AC3 audio decoding

Post Reply
BenV
Posts: 5
Joined: Mon Nov 18, 2019 3:20 am
languages_spoken: english
ODROIDs: N2
Has thanked: 1 time
Been thanked: 1 time
Contact:

AC3 audio decoding

Unread post by BenV » Tue Dec 03, 2019 7:42 am

I can see in media_codecs.xml that there is MediaCodec support for AC3 via OMX.amlogic.audio.decoder.ac3. However, when I try to use this codec to decode via the MediaCodec API I get buffers that contain all zeroes. The same content plays fine if I pass the AC3 audio through to my receiver. I've tried with both the stock 32-bit odroid ROM, as well as LineageOS 16. The test file I'm using is located at https://alcorn.com/wp-content/downloads ... est_HD.mpg. I don't see anything obvious in the logs, although they are pretty verbose so maybe I'm missing something. Is the OMX.amlogic.audio.decoder.ac3 component actually known to work properly on the N2? Is there something obvious I'm missing? Hoping someone can point me in the right direction. Thanks!

User avatar
rooted
Posts: 6899
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 270 times
Been thanked: 64 times
Contact:

Re: AC3 audio decoding

Unread post by rooted » Tue Dec 03, 2019 4:55 pm

What are you using to play the file?

Sav
Posts: 52
Joined: Mon Sep 02, 2019 2:33 am
languages_spoken: english
ODROIDs: odroid-n2
Has thanked: 18 times
Been thanked: 1 time
Contact:

Re: AC3 audio decoding

Unread post by Sav » Tue Dec 03, 2019 7:03 pm

BenV wrote:
Tue Dec 03, 2019 7:42 am
I can see in media_codecs.xml that there is MediaCodec support for AC3 via OMX.amlogic.audio.decoder.ac3. However, when I try to use this codec to decode via the MediaCodec API I get buffers that contain all zeroes. The same content plays fine if I pass the AC3 audio through to my receiver. I've tried with both the stock 32-bit odroid ROM, as well as LineageOS 16. The test file I'm using is located at https://alcorn.com/wp-content/downloads ... est_HD.mpg. I don't see anything obvious in the logs, although they are pretty verbose so maybe I'm missing something. Is the OMX.amlogic.audio.decoder.ac3 component actually known to work properly on the N2? Is there something obvious I'm missing? Hoping someone can point me in the right direction. Thanks!
Strange. I'm able to play ac3 files with VLC and kodi under android.
They work just fine with the preset settings and with audio passtrough

BenV
Posts: 5
Joined: Mon Nov 18, 2019 3:20 am
languages_spoken: english
ODROIDs: N2
Has thanked: 1 time
Been thanked: 1 time
Contact:

Re: AC3 audio decoding

Unread post by BenV » Tue Dec 03, 2019 11:02 pm

rooted wrote:
Tue Dec 03, 2019 4:55 pm
What are you using to play the file?
I am using Google's ExoPlayer demo application (https://github.com/google/ExoPlayer/tre ... demos/main), which uses the standard Android MediaCodec API. I am simply adding that example AC3 mpg file to the media.exolist.json file to test.

I believe VLC/Kodi work because they use either FFmpeg or a different software decoder. Using the ExoPlayer FFmpeg extension is also an option for me, but I was mostly just curious as to why the Amlogic decoder appears to be available but just does not work properly. It is a bit of a problem because unless I remove it from media_codecs.xml it will be the preferred decoder for AC3. It does not generate any errors or exceptions, but the buffers it creates while decoding are filled with zeroes. I tried to dig into the source code to see if I could figure out where things to wrong, but the actual decoding appears to be happening in libOmxAudio.so that I don't have source for. I'm going to try to add some more logging to ACodec.cpp today and see if I can find any other clues. Thanks!

Edit: The overall reason for looking into this is I am trying to get a USB TV tuner to work with my AndroidTV build via Live Channels on the N2. The video works fine after some kernel tweaks, but the AC3 audio from the ATSC channels does not play unless I can pass it through an AC3 capable receiver/sound bar.

Sav
Posts: 52
Joined: Mon Sep 02, 2019 2:33 am
languages_spoken: english
ODROIDs: odroid-n2
Has thanked: 18 times
Been thanked: 1 time
Contact:

Re: AC3 audio decoding

Unread post by Sav » Tue Dec 03, 2019 11:57 pm

BenV wrote:
Tue Dec 03, 2019 11:02 pm
rooted wrote:
Tue Dec 03, 2019 4:55 pm
What are you using to play the file?
I am using Google's ExoPlayer demo application (https://github.com/google/ExoPlayer/tre ... demos/main), which uses the standard Android MediaCodec API. I am simply adding that example AC3 mpg file to the media.exolist.json file to test.

I believe VLC/Kodi work because they use either FFmpeg or a different software decoder. Using the ExoPlayer FFmpeg extension is also an option for me, but I was mostly just curious as to why the Amlogic decoder appears to be available but just does not work properly. It is a bit of a problem because unless I remove it from media_codecs.xml it will be the preferred decoder for AC3. It does not generate any errors or exceptions, but the buffers it creates while decoding are filled with zeroes. I tried to dig into the source code to see if I could figure out where things to wrong, but the actual decoding appears to be happening in libOmxAudio.so that I don't have source for. I'm going to try to add some more logging to ACodec.cpp today and see if I can find any other clues. Thanks!

Edit: The overall reason for looking into this is I am trying to get a USB TV tuner to work with my AndroidTV build via Live Channels on the N2. The video works fine after some kernel tweaks, but the AC3 audio from the ATSC channels does not play unless I can pass it through an AC3 capable receiver/sound bar.
You can try tvheadend server (preinstalled in voodik 's lineage os rom) and kodi with pvr addon, or vlc.
These users thanked the author Sav for the post:
BenV (Wed Dec 04, 2019 4:12 am)

Post Reply

Return to “Android”

Who is online

Users browsing this forum: voodik and 0 guests