Looks like there is bug in Android code for BLOCKING OFFLOAD mode causing a 
crash when offload output is closed.

void AudioFlinger::OffloadThread::threadLoop_exit()
{
    if (mFlushPending || mHwPaused) {
        // If a flush is pending or track was paused, just discard buffered 
data
        flushHw_l();
    } else {
        mMixerStatus = MIXER_DRAIN_ALL;
        threadLoop_drain();
    }
    mCallbackThread->exit(); *// For BLOCKING mode mCallbackThread is NULL*
    PlaybackThread::threadLoop_exit();
}

On Tuesday, November 5, 2013 8:59:00 AM UTC-8, Eric Laurent wrote:
>
> The pause, resume, drain and flush APIs are only called by audioflinger 
> for offloaded output streams.
> There is no need to implement them for other HALs.
>
> Your understanding on switching to/from offload mode is correct.
>
>
>
> On Monday, November 4, 2013 11:54:51 AM UTC-8, Uday Gupta wrote:
>>
>> Hi Glenn,
>>
>> Thanks for the reply. I have couple of more questions.
>>
>> In my understanding, there is build in support for switching from HW 
>> codec to SW codec for different use cases like
>>
>> 1. If the effects are turned ON but the effects are not offloaded.
>> 2. If the device switches to a device not supported by the offloaded 
>> codec output.
>>
>> Thanks
>> Uday
>>
>> On Monday, November 4, 2013 11:35:59 AM UTC-8, Glenn Kasten wrote:
>>>
>>> After syncing AOSP branch android-4.4_r1, look at these projects and 
>>> files:
>>>   hardware/libhardware/include/hardware/audio*.h
>>>   hardware/qcom/audio/
>>>   device/lge/hammerhead/audio*.conf
>>> Do a git log on these, and look especially at CLs with the words 
>>> "offload" or "tunnel".
>>> I think the new APIs are intended for the offload stream only.
>>>
>>> On Saturday, November 2, 2013 1:29:49 PM UTC-7, Uday Gupta wrote:
>>>>
>>>> Hi,
>>>>
>>>> Is there an example of sample code and audio_policy.xml for 
>>>> supporting Audio Codec Offload support in Kitkat.
>>>>
>>>> Also can the newly added API's for audio_stream_out like pause, resume 
>>>> drain and flush be used by other HALS like primary or deep buffer.
>>>>
>>>> Thanks.
>>>>
>>>

-- 
-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

--- 
You received this message because you are subscribed to the Google Groups 
"android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-porting+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to