New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 791900 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

MediaCodecAudioDecoder can not play HE-AAC encoded file.

Reported by cwhong...@gmail.com, Dec 5 2017

Issue description

Steps to reproduce the problem:
1. Go https://www2.iis.fraunhofer.de/AAC/multichannel.html
2. Play any AAC-HE stream

What is the expected behavior?
Play well

What went wrong?
Can't play.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version:   Channel: n/a
OS Version: All
Flash Version: 

Hi all.

I tried play he-aac stream on this page(https://www2.iis.fraunhofer.de/AAC/multichannel.html), but failed to decode when I use MCAD.
Of course I modified default_renderer_factory.cc to create external decoder(i.e., MojoAudioDecoder -> MCAD finally) to make web engine to use MediaCodec and do not create FFmpegDecoder. I know you guys use MCAD for only EME but I have to use MediaCodec always, not FFmpeg, for some reason.

I've been digging this problem and I think I found the wrong csd(codec specific code) is sent to MediaCodec in configuration.
In ConfigureMediaFormatForAudio() kCodecAAC case in media_codec_bridge_impl.cc,
...
      csd[0] = profile << 3 | frequency_index >> 1;
      csd[1] = (frequency_index & 0x01) << 7 | channel_config << 3;
...
that part always make the current stream AAC-LC stream even if stream is HE-AAC profiled stream. 
I think this mistake come from this patch(https://chromiumcodereview.appspot.com/16114009). It introduces some code for extracting information from extra data in packet(or frame?). The code copied from aac.cc that parses base frequency, channel config, extension freq and sort of things. But it was wrong because information was cut.

I'll upload patch that remove code that modifying information wrong and just pass-through the extra_data as is to MediaCodec.

Other uestions:
1. How can I test EME on mobile device?
2. Is there any EME contents encoded in various codec profiles (like he-aac he-aac-v2)? Are there test cases in chromium?
 
Cc: sandeepkumars@chromium.org
Labels: Needs-triage-Mobile Needs-Feedback Triaged-Mobile
Tested the issue in Android and could not reproduce the issue. Able to play the audio.

Steps Followed:
1. Launched Chrome Browser.
2. https://www2.iis.fraunhofer.de/AAC/multichannel.html
3. Able to play the audio.

Chrome versions tested:
62.0.3202.84, 65.0.3285.0

OS
Android 8.1.0, 7.0.0

Android Devices
8.1.0 Pixel XL Build/OPM1.171019.007, 7.0.0; SM-J710F Build/NRD90M

@cwhong893: Could you please help us with the chrome version, OS and details of your device for further triaging of the issue.

Thanks!!
Owner: xhw...@chromium.org
Assigning to xhwhang@ for triage as it seems that the reporter is using MojoAudioDecoder. I'm not sure if this is something we ought to support though.
Cc: dalecur...@chromium.org
cwhong893: Thanks for looking into this! It seems the root issue is in the demuxer side, not in MCAD then. If you can upload a CL for review it'll be appreciated!

To test this, feel free to add a test case in https://cs.chromium.org/chromium/src/media/filters/audio_decoder_unittest.cc

You don't need MojoAudioDecoder or EME to do this test.

Actually I saw a he-aac test there using MCAD, can you help check why we don't see issues in that test?
https://cs.chromium.org/chromium/src/media/filters/audio_decoder_unittest.cc?rcl=f4e2e65212a72810646656c41e68b359c426fa0d&l=441

For your follow up questions, you can test EME on https://shaka-player-demo.appspot.com/demo. We don't have detailed EME test with different codecs, because decryption and decoding are mostly independent.
Status: Assigned (was: Unconfirmed)
Thank you guys for helping me clarification.

@xhwang: Nice test case! Thanks. I'll debug based on test case you told me.

I thought demuxer is right and media_codec_bridge_impl.cc is wrong, because when I just pass-through extra_data(that from demuxer) on ConfigureMediaFormatForAudio() to the Java_MediaCodecBridge_setCodecSpecificData() then playing he-aac stream is played well. Yeah, it was naive test but hint for us.

I'll investigate more, but actually I'm not codec expert guy thus I need some more time and your helping. Thank you.

Sign in to add a comment