Software AAC codec stuck using Codec2 interface / Setting pipeline threshold

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Software AAC codec stuck using Codec2 interface / Setting pipeline threshold

NimeshChanchani
Hi All,

My player application is using media codec NDK API's to  decode (H.264 video and AAC audio). 

After I pause for about 3.3 s , the software AAC decoder using Codec2 plugin errors out.
with the following message:
W/CCodec: previous call to queue exceeded timeout
E/MediaCodec: Codec reported err 0x80000000, actionCode 0, while in state 6

If I use OMX plugin instead , I don't get this error.

similar issue was faced by exoplayer team earlier:
 https://github.com/google/ExoPlayer/issues/7551

current state of NDK application decoding/rendering threads is:

decoder thread ( no more input buffers to dequeue)
renererthread ( not dequeueing output buffer)

on investigation i found that :
there is a Watchdog timer that is started whenever CCodec executes a command.  
and this releases the codec if a particular frame spends more than threshold time (3.3s ) in the pipeline AND the no. of frames in the pipeline is Greater than the threshold (2 frames) . 
This threshold is derived from adding up (inputDelay+OutputDelay+pipelineDelay)

Now, when we pause:

In error case:

We constantly have 3 frames in the pipeline(PipelineWatcher logs enabled) , which is above threshold. So after 3.3 s codec is released by framework assuming that pipeline is stuck.

in OK case:

We constantly have 2 frames in the pipeline , and on pausing it remains 2 , hence the framework assumes we are not stuck.

On investigation looks like 

threshold values are part of codec configuration. in our case we have recd. 2:

CCodecConfig: c2::u32 output.delay.value = 2 
CCodecConfig: c2::u32 input.delay.value = 0

My questions are following:
1. My understanding is that  input/output and pipeline delay values are NOT part of Codec specific data of AAC and are CCodec configuration . Is this correct?
2. Who configures these values ( ? MediaCodec) 
3. What are the guidelines for setting   input/output and pipeline delay and how to decide what value to set?
4. if we want to change pipeline delay values where do we make the change?

Thanks&Regards
Nimesh

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/fee1c450-22c9-4933-8998-2075d7a98f23n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Software AAC codec stuck using Codec2 interface / Setting pipeline threshold

Glenn Kasten
Please consider filing a bug here, with test case:
https://source.android.com/setup/contribute/report-bugs

On Wednesday, February 24, 2021 at 8:47:01 AM UTC-8 NimeshChanchani wrote:
Hi All,

My player application is using media codec NDK API's to  decode (H.264 video and AAC audio). 

After I pause for about 3.3 s , the software AAC decoder using Codec2 plugin errors out.
with the following message:
W/CCodec: previous call to queue exceeded timeout
E/MediaCodec: Codec reported err 0x80000000, actionCode 0, while in state 6

If I use OMX plugin instead , I don't get this error.

similar issue was faced by exoplayer team earlier:

current state of NDK application decoding/rendering threads is:

decoder thread ( no more input buffers to dequeue)
renererthread ( not dequeueing output buffer)

on investigation i found that :
there is a Watchdog timer that is started whenever CCodec executes a command.  
and this releases the codec if a particular frame spends more than threshold time (3.3s ) in the pipeline AND the no. of frames in the pipeline is Greater than the threshold (2 frames) . 
This threshold is derived from adding up (inputDelay+OutputDelay+pipelineDelay)

Now, when we pause:

In error case:

We constantly have 3 frames in the pipeline(PipelineWatcher logs enabled) , which is above threshold. So after 3.3 s codec is released by framework assuming that pipeline is stuck.

in OK case:

We constantly have 2 frames in the pipeline , and on pausing it remains 2 , hence the framework assumes we are not stuck.

On investigation looks like 

threshold values are part of codec configuration. in our case we have recd. 2:

CCodecConfig: c2::u32 output.delay.value = 2 
CCodecConfig: c2::u32 input.delay.value = 0

My questions are following:
1. My understanding is that  input/output and pipeline delay values are NOT part of Codec specific data of AAC and are CCodec configuration . Is this correct?
2. Who configures these values ( ? MediaCodec) 
3. What are the guidelines for setting   input/output and pipeline delay and how to decide what value to set?
4. if we want to change pipeline delay values where do we make the change?

Thanks&Regards
Nimesh

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/2248fde5-c7c0-40d0-b102-aa6af6c60590n%40googlegroups.com.