Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MediaCodecAudioRender always wins over FfmpegAudioRenderer #2269

Closed
stari4ek opened this issue Dec 28, 2016 · 7 comments
Closed

MediaCodecAudioRender always wins over FfmpegAudioRenderer #2269

stari4ek opened this issue Dec 28, 2016 · 7 comments
Labels

Comments

@stari4ek
Copy link

stari4ek commented Dec 28, 2016

  • dev-v2, 163a3a7
  • demo player with extensions
  • ffmpeg with mp3 decoder
  • MPEG-TS stream with audio/mpeg-L2
  • nvidia shield

NVidia shield:

D/MediaCodecInfo: NoSupport [channelCount.support, 2, supported 1] [OMX.Nvidia.mp2.decoder, audio/mpeg-L2] [foster, SHIELD Android TV, NVIDIA, 23]
D/MediaCodecInfo: NoSupport [channelCount.support, 2, supported 1] [OMX.Nvidia.mp2.decoder, audio/mpeg-L2] [foster, SHIELD Android TV, NVIDIA, 23]
D/EventLogger: Tracks [
D/EventLogger:   Renderer:0 [
D/EventLogger:     Group:0, adaptive_supported=N/A [
D/EventLogger:       [X] Track:0, id=null, mimeType=video/avc, res=1920x1080, supported=YES
D/EventLogger:     ]
D/EventLogger:   ]
D/EventLogger:   Renderer:2 [
D/EventLogger:     Group:0, adaptive_supported=N/A [
D/EventLogger:       [X] Track:0, id=null, mimeType=audio/mpeg-L2, channels=2, sample_rate=48000, supported=NO_EXCEEDS_CAPABILITIES
D/EventLogger:     ]
D/EventLogger:   ]
D/EventLogger:   Renderer:6 [
D/EventLogger:     Group:0, adaptive_supported=N/A [
D/EventLogger:       [ ] Track:0, id=null, mimeType=application/cea-608, supported=YES
D/EventLogger:     ]
D/EventLogger:   ]
D/EventLogger: ]

device decoder declares that it supports 1 channel only (btw, Philips, QM16XE_U, QM163E with OMX.MTK.AUDIO.DECODER.DSPMP1 does the same)

Please check RendererCapabilities.supportsFormat:
MediaCodecAudioRender returns ADAPTIVE_NOT_SEAMLESS | formatSupport while FfmpegAudioRenderer returns just formatSupport.

It means that FORMAT_EXCEEDS_CAPABILITIES wins over FORMAT_HANDLED which looks wrong

@stari4ek
Copy link
Author

stari4ek commented Dec 28, 2016

BTW, is it expected that decoders:

  • OMX.Nvidia.mp2.decoder (nvidia shield)
  • OMX.MTK.AUDIO.DECODER.DSPMP1 (philips)

returns MediaCodecInfo.getMaxInputChannelCount() == 1?

No issues with audio playback on NVidia shield.

Should I create separate issue for it?

@kiall
Copy link
Contributor

kiall commented Dec 30, 2016

By default, exoplayer will prefer to use native rather than extension renderers.

You can pass a extensionRendererMode paramater to ExoPlayerFactory.newSimpleInstance() with a value of SimpleExoPlayer.EXTENSION_RENDERER_MODE_PREFER to have ExoPlayer prefer the extension..

@stari4ek
Copy link
Author

By default, exoplayer will prefer to use native rather than extension renderers.

This is expected behavior if both renderers are supported equally. For example both FORMAT_HANDLED or both FORMAT_EXCEEDS_CAPABILITIES

But in described situation we compare "fully supported" vs "lacking proper support" where "lacking proper support" wins

@ojw28
Copy link
Contributor

ojw28 commented Jan 2, 2017

I think there's a one line bug (we're forgetting to mask the value here) that causes this. We'll push a fix shortly. Thanks!

@ojw28 ojw28 added the bug label Jan 2, 2017
@stari4ek
Copy link
Author

stari4ek commented Jan 2, 2017

@ojw28 , thank you

What about MediaCodecInfo.getMaxInputChannelCount() == 1 from nvidia/mediatek MediaCodec? is it expected behavior?

@ojw28
Copy link
Contributor

ojw28 commented Jan 2, 2017

I doubt it, particularly if you're seeing it work successfully with more channels. I suggest you report the issue directly to nVidia.

@stari4ek
Copy link
Author

stari4ek commented Jan 2, 2017

With Nvidia it works with 2 channels pretty well.
But for Philips (with OMX.MTK.AUDIO.DECODER.DSPMP1) doesn't - stalled video. ffmpeg solves the issue

ojw28 added a commit that referenced this issue Jan 4, 2017
Issue: #2269

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143433012
@ojw28 ojw28 closed this as completed Jan 4, 2017
@google google locked and limited conversation to collaborators Jun 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants