Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 685f0e36 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

Fix offload tracks playback

Translation between audio_offload_info_t and AudioOffloadInfo
was missing a field. This was causing compressed tracks to play
using 'deep_buffer' mode instead of 'offload'.

Changing output stream async callback methods to 'oneway',
since they don't require anything from the callee.

Change-Id: I27fe7fb715e421f102db21a10d34e1dc3134cf01
Test: play MP3 file with Play Music, check audioflinger dump
parent 163e9d68
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -23,15 +23,15 @@ interface IStreamOutCallback {
    /*
     * Non blocking write completed.
     */
    onWriteReady();
    oneway onWriteReady();

    /*
     * Drain completed.
     */
    onDrainReady();
    oneway onDrainReady();

    /*
     * Stream hit an error.
     */
    onError();
    oneway onError();
};
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */

#define LOG_TAG "StreamOutHAL"
//#define LOG_NDEBUG 0

#include <hardware/audio.h>
#include <android/log.h>
+2 −0
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@ void HidlUtils::audioOffloadInfoFromHal(
        const audio_offload_info_t& halOffload, AudioOffloadInfo* offload) {
    offload->sampleRateHz = halOffload.sample_rate;
    offload->channelMask = AudioChannelMask(halOffload.channel_mask);
    offload->format = AudioFormat(halOffload.format);
    offload->streamType = AudioStreamType(halOffload.stream_type);
    offload->bitRatePerSecond = halOffload.bit_rate;
    offload->durationMicroseconds = halOffload.duration_us;
@@ -109,6 +110,7 @@ void HidlUtils::audioOffloadInfoToHal(
    *halOffload = AUDIO_INFO_INITIALIZER;
    halOffload->sample_rate = offload.sampleRateHz;
    halOffload->channel_mask = static_cast<audio_channel_mask_t>(offload.channelMask);
    halOffload->format = static_cast<audio_format_t>(offload.format);
    halOffload->stream_type = static_cast<audio_stream_type_t>(offload.streamType);
    halOffload->bit_rate = offload.bitRatePerSecond;
    halOffload->duration_us = offload.durationMicroseconds;