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

Does ExoPlayer can support Dolby ATMOS video playback? #10701

Closed
zyfeng413 opened this issue Oct 19, 2022 · 26 comments
Closed

Does ExoPlayer can support Dolby ATMOS video playback? #10701

zyfeng413 opened this issue Oct 19, 2022 · 26 comments

Comments

@zyfeng413
Copy link

I need to play a Dolby video in my project, but the playback fails.
ExoPlayer Version:v2.18.0
Environment: Xiaomi Mi 10T
logcat:
EventLogger: tracks [eventTime=0.36, mediaPos=0.00, window=0, period=0
EventLogger: group
EventLogger: [
EventLogger: [X] Track:0, id=1, mimeType=video/avc, codecs=avc1.640032, res=2400x1200, fps=25.0, supported=YES
EventLogger: ]
EventLogger: group
EventLogger: [
EventLogger: [ ] Track:0, id=2, mimeType=audio/eac3-joc, channels=6, sample_rate=48000, language=und, supported=NO_UNSUPPORTED_TYPE
EventLogger: ]
EventLogger: ]

@zyfeng413 zyfeng413 changed the title Does ExoPlayer can support Dolby ATMOS video play? Does ExoPlayer can support Dolby ATMOS video playback? Oct 19, 2022
@christosts
Copy link
Contributor

The log pasted says that the audio format is not supported on this device

EventLogger: [ ] Track:0, id=2, mimeType=audio/eac3-joc, channels=6, sample_rate=48000, language=und, supported=NO_UNSUPPORTED_TYPE

A quick search shows that the Xiaomi Mi 10T does not support playing Dolby Atmos.

@zyfeng413
Copy link
Author

But I can use MediaPlayer to play it, so it's not that the device doesn't support it.

@christosts christosts reopened this Oct 20, 2022
@christosts
Copy link
Contributor

Can you please share the following:

  • a link to the media you're playing for us to inspect it
  • a bug report obtained from the device after that media is played by MediaPlayer.

If you're unable to share those publicly, please send them to dev.exoplayer@gmail.com subject "Issue #10701". Please also update this issue to indicate you've done this.

@zyfeng413
Copy link
Author

The email has been sent.

@christosts
Copy link
Contributor

I have received your email, thank you. I see that you have linked this issue with RenderHeads/UnityPlugin-AVProVideo#1302 in the AVProVideo project.

In the top of the current issue you mention that your device is Xiaomi Mi 10T. However on the AVProVideo issue you mention a different device, Car machine SO. Also, on the AVProVideo issue you posted code snippets with changes inside ExoPlayer (comment) that would solve the problem.

I would like to clarify for which device we should provide assistance in this issue.

@zyfeng413
Copy link
Author

The device that really needs to be solved is Car machine SO, the system is Android10, but I can't provide this device. Besides, they can also reappear on Xiaomi Mi 10T, but I'm not sure if it's for the same reason.

@christosts
Copy link
Contributor

By the data provided in the two issues, the reasons can be unrelated.

On the Xiaomi Mi 10T, the audio is clearly reported as NO_UNSUPPORTED_TYPE and ExoPlayer does not even attempt to play it. However, the code snippet that's shared in the AVProVideo issue touches code that is executed after ExoPlayer has started playing the specific track. Therefore, I assume the track is considered supported on the Car SOC. The specific code is executed after the audio decoder outputs the decoded audio. Your suggested change shows that the decoded audio is 12 channels, which is somewhat unexpected . What I've seen is that before Android 12L, Dolby Atmos decoders were outputting stereo audio (2 channels). After Android 12L, the Atmos decoder may output 6, 8 or 12 channels based on how the codec is configured. Our information is based on code contributions directly from Dolby, please see #10322 and the comment thread on the commit.

The above is a hypothesis, and to be able to help you more, please run the demo app on the affected device and obtain a bug-report after your error happens, and share it with us.

@Ste-RH
Copy link

Ste-RH commented Nov 1, 2022

Hi. Just thought I would jump in to hopefully clear up a few points.

The Xiaomi Mi 10T is my device I was investigating the initially reported issue with in AVPro Video. So it should be disregarded due to, as you rightly say, it appears unsupported.

AVPro Video should be completely disregarded as the OP is saying their Dolby based audio stream is not working as they expect in the ExoPlayer demo. If any, the important post in the AVPro Video issue thread is this one...as they suggest that those changes to the ExoPlayer codebase fixes their playback of the audio stream.

Sorry for the confusion by linking the AVPro Video issue to this one - it was simply for full exposure of the issue to AVPro Video users.

@zyfeng413
Copy link
Author

ExoPlayer Demo.txt
ExoPlayer Demo with custom changes.txt
Sorry for replying you so late. This is a log that cannot be played without modification, and another log that can be played with modification

@christosts
Copy link
Contributor

Thank you for the logs - they confirm my hypothesis, the decoder is outputting 12-channel PCM audio, which ExoPlayer does not expect from a pre-Android 12L device. I don't see a way of overriding this check, e.g. by changing some configuration or overriding a method. Here are some options as I can think of:

  1. On existing pre-Android 12L devices with Dolby Atmos, the decoder outputs less than 12 channels. For example, I've observed that on mobile devices the decoder downmixes to stereo. It sounds that you're working on bespoke hardware. Is there a way to configure the number of channels output by the decoder, e.g., up to 8? Do you really need 12 channels? How many speakers are you outputting on?

  2. You modify ExoPlayer sources directly yourself as you've done. That's not great of course as you won't be able to update easily.

  3. We can relax ExoPlayer's assumptions to allow 12ch playback on pre-Android 12L devices. That will take some time until it's included in a future release. Note: I think we only need to change Util.getAudioTrackChannelConfig() but in your changes snippet, you also modified DefaultAudioSink. Is the change inDefaultAudioSink really needed?

@zyfeng413
Copy link
Author

1、Our video and hardware are custom made, using 26 speaker outputs
2、I may not be able to change it directly because we are using the Exoplayer API of the AVPro plugin and they have internally changed the package name of the exoplayer
3、Maybe you don't have to change DefaultAudioSink

@christosts
Copy link
Contributor

Alright, we can change Util.getAudioTrackChannelConfig() to allow 12 channels without OS version check, however this means that you'll need to wait until the change is released and the AVPro plugin updates to that version of ExoPlayer.

@zyfeng413
Copy link
Author

One thing to note though, although I didn't modify DefaultAudioSink in my tests it was able to play, but the logs were displayed
tracks [eventTime=3.22, mediaPos=0.00, window=0, period=0
group [
[X] Track:0, id=1, mimeType=video/avc, codecs=avc1.640032, res=2400x1200, fps=25.0, supported=YES
]
group [
[ ] Track:0, id=2, mimeType=audio/eac3-joc, channels=6, sample_rate=48000, language=und, supported=NO_UNSUPPORTED_TYPE
]
]

@Ste-RH
Copy link

Ste-RH commented Nov 11, 2022

Alright, we can change Util.getAudioTrackChannelConfig() to allow 12 channels without OS version check, however this means that you'll need to wait until the change is released and the AVPro plugin updates to that version of ExoPlayer.

I can apply changes to the ExoPlayer we build for AVPro. Just let me know the details when the changes are committed. Then going forward they will be part of the ExoPlayer releases so in our product as standard.

@christosts
Copy link
Contributor

christosts commented Nov 11, 2022

One thing to note though, although I didn't modify DefaultAudioSink in my tests it was able to play, but the logs were displayed tracks [eventTime=3.22, mediaPos=0.00, window=0, period=0 group [ [X] Track:0, id=1, mimeType=video/avc, codecs=avc1.640032, res=2400x1200, fps=25.0, supported=YES ] group [ [ ] Track:0, id=2, mimeType=audio/eac3-joc, channels=6, sample_rate=48000, language=und, supported=NO_UNSUPPORTED_TYPE ] ]

Are you sure this is correct? This is logged from the Car device and not the Xiaomi device, right? If the stream is unsupported, the demo app would not have played audio at all in this case. And, the changes in DefaultAudioSink are irrespective of whether the Atmos track is supported.

To avoid confusion, can I ask you to do the following:

  • share a patch of your changes on Util.getAudioTrackChannelConfig() on which the Atmos is reported as supported=NO_UNSUPPORTED_TYPE

  • share a patch of your changes on Util.getAudioTrackChannelConfig() and DefaultAudioSink for which the Atmos stream is reported as SUPPORTED

[Edit]
How is it that the Atmos decoder outputs 12ch out of a 6ch encoded stream?

@zyfeng413
Copy link
Author

@christosts
Copy link
Contributor

Thank you for the logs, can you also share a git patch of your change?

@zyfeng413
Copy link
Author

Exoplayer Change.zip

@christosts
Copy link
Contributor

I think there may be some confusion here. Change DefaultAudioSink.txt says supported=NO_UNSUPPORTED_TYPE, whereas Change DefaultAudioSink and Util.getAudioTrackChannelConfig.txt says supported=YES. What's needed is the change Util.getAudioTrackChannelConfig() and not DefaultAudioSink

@zyfeng413
Copy link
Author

2022-11-15 10:54:20.327 28425-28425/com.google.android.exoplayer2.demo W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@928ce62
2022-11-15 10:54:20.401 28425-28425/com.google.android.exoplayer2.demo E/exoplayer2.dem: Invalid ID 0x00000000.
2022-11-15 10:54:20.451 28425-28425/com.google.android.exoplayer2.demo E/exoplayer2.dem: Invalid ID 0x00000000.
2022-11-15 10:54:20.460 28425-28425/com.google.android.exoplayer2.demo I/chatty: uid=10105(com.google.android.exoplayer2.demo) identical 5 lines
2022-11-15 10:54:20.463 28425-28425/com.google.android.exoplayer2.demo E/exoplayer2.dem: Invalid ID 0x00000000.
2022-11-15 10:54:20.466 28425-28425/com.google.android.exoplayer2.demo E/exoplayer2.dem: Invalid ID 0x00000000.
2022-11-15 10:54:20.482 28425-28425/com.google.android.exoplayer2.demo I/chatty: uid=10105(com.google.android.exoplayer2.demo) identical 4 lines
2022-11-15 10:54:20.485 28425-28425/com.google.android.exoplayer2.demo E/exoplayer2.dem: Invalid ID 0x00000000.
2022-11-15 10:54:20.490 28425-28425/com.google.android.exoplayer2.demo E/exoplayer2.dem: Invalid ID 0x00000000.
2022-11-15 10:54:20.504 28425-28425/com.google.android.exoplayer2.demo I/chatty: uid=10105(com.google.android.exoplayer2.demo) identical 2 lines
2022-11-15 10:54:20.512 28425-28425/com.google.android.exoplayer2.demo E/exoplayer2.dem: Invalid ID 0x00000000.
2022-11-15 10:54:20.526 28425-28425/com.google.android.exoplayer2.demo E/exoplayer2.dem: Invalid ID 0x00000000.
2022-11-15 10:54:20.527 28425-28425/com.google.android.exoplayer2.demo I/chatty: uid=10105(com.google.android.exoplayer2.demo) identical 2 lines
2022-11-15 10:54:20.527 28425-28425/com.google.android.exoplayer2.demo E/exoplayer2.dem: Invalid ID 0x00000000.
2022-11-15 10:54:20.540 28425-28425/com.google.android.exoplayer2.demo E/exoplayer2.dem: Invalid ID 0x00000000.
2022-11-15 10:54:20.541 28425-28425/com.google.android.exoplayer2.demo E/exoplayer2.dem: Invalid ID 0x00000000.
2022-11-15 10:54:20.556 28425-28425/com.google.android.exoplayer2.demo E/exoplayer2.dem: Invalid ID 0x00000000.
2022-11-15 10:54:20.557 28425-28425/com.google.android.exoplayer2.demo I/chatty: uid=10105(com.google.android.exoplayer2.demo) identical 2 lines
2022-11-15 10:54:20.558 28425-28425/com.google.android.exoplayer2.demo E/exoplayer2.dem: Invalid ID 0x00000000.
2022-11-15 10:54:20.561 28425-28425/com.google.android.exoplayer2.demo E/exoplayer2.dem: Invalid ID 0x00000000.
2022-11-15 10:54:20.564 28425-28425/com.google.android.exoplayer2.demo I/chatty: uid=10105(com.google.android.exoplayer2.demo) identical 5 lines
2022-11-15 10:54:20.565 28425-28425/com.google.android.exoplayer2.demo E/exoplayer2.dem: Invalid ID 0x00000000.
2022-11-15 10:54:20.652 28425-28425/com.google.android.exoplayer2.demo I/ExoPlayerImpl: Init 94d718e [ExoPlayerLib/2.18.0] [au8155_xp, E38, XiaoPeng, 29]
2022-11-15 10:54:20.670 28425-28425/com.google.android.exoplayer2.demo D/AudioSystem: get_audio_policy_service
2022-11-15 10:54:20.670 28425-28425/com.google.android.exoplayer2.demo D/AudioSystem: get_audio_policy_service() ap registerClient 11
2022-11-15 10:54:20.671 28425-28425/com.google.android.exoplayer2.demo D/AudioSystem: get_audio_policy_service() ap registerClient 22
2022-11-15 10:54:20.671 28425-28425/com.google.android.exoplayer2.demo D/AudioSystem: get_audio_policy_service() ap registerClient 33
2022-11-15 10:54:20.671 28425-28425/com.google.android.exoplayer2.demo D/AudioSystem: get_audio_policy_service() ap registerClient 44
2022-11-15 10:54:20.726 28425-28425/com.google.android.exoplayer2.demo D/AudioSystem: get_audio_flinger
2022-11-15 10:54:20.727 28425-28425/com.google.android.exoplayer2.demo D/AudioSystem: get_audio_flinger() af registerClient 11
2022-11-15 10:54:20.727 28425-28425/com.google.android.exoplayer2.demo D/AudioSystem: get_audio_flinger() af registerClient 22
2022-11-15 10:54:20.727 28425-28425/com.google.android.exoplayer2.demo D/AudioSystem: get_audio_flinger() af registerClient 33
2022-11-15 10:54:20.743 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: playWhenReady [eventTime=0.00, mediaPos=0.00, window=0, true, USER_REQUEST]
2022-11-15 10:54:20.751 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: timeline [eventTime=0.01, mediaPos=0.00, window=0, periodCount=1, windowCount=1, reason=PLAYLIST_CHANGED
2022-11-15 10:54:20.752 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: period [?]
2022-11-15 10:54:20.752 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: window [?, seekable=false, dynamic=true]
2022-11-15 10:54:20.752 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: ]
2022-11-15 10:54:20.752 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: mediaItem [eventTime=0.01, mediaPos=0.00, window=0, reason=PLAYLIST_CHANGED]
2022-11-15 10:54:20.756 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: state [eventTime=0.01, mediaPos=0.00, window=0, BUFFERING]
2022-11-15 10:54:20.770 28425-28425/com.google.android.exoplayer2.demo I/xpWindowManager: getOverrideLayoutParams lp={(-1,-1)(fillxfill) ty=10 fmt=TRANSLUCENT
fl=LAYOUT_IN_SCREEN LAYOUT_INSET_DECOR SPLIT_TOUCH DRAWS_SYSTEM_BAR_BACKGROUNDS
pfl=FORCE_DRAW_STATUS_BAR_BACKGROUND
sharedId=0
isAlert=false} sharedId=0
2022-11-15 10:54:20.779 28425-28425/com.google.android.exoplayer2.demo I/xpWindowManager: getOverrideLayoutParams global lp={(0,0)(fillxfill) sim={forwardNavigation} ty=10 fmt=TRANSLUCENT
fl=LAYOUT_IN_SCREEN LAYOUT_INSET_DECOR SPLIT_TOUCH DRAWS_SYSTEM_BAR_BACKGROUNDS
pfl=FORCE_DRAW_STATUS_BAR_BACKGROUND
sharedId=0
isAlert=false}
2022-11-15 10:54:20.798 28425-28472/com.google.android.exoplayer2.demo D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2022-11-15 10:54:20.840 28425-28425/com.google.android.exoplayer2.demo D/ViewRootImpl: updateViewConfiguration config.uiMode=83 configuration.uiMode=83
2022-11-15 10:54:20.850 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: surfaceSize [eventTime=0.11, mediaPos=0.00, window=0, 1700, 956]
2022-11-15 10:54:20.870 28425-28425/com.google.android.exoplayer2.demo V/KeyEvent: Reset: android.view.KeyEvent$DispatcherState@527314e
2022-11-15 10:54:20.880 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: loading [eventTime=0.14, mediaPos=0.00, window=0, period=0, true]
2022-11-15 10:54:20.883 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: timeline [eventTime=0.14, mediaPos=0.00, window=0, period=0, periodCount=1, windowCount=1, reason=SOURCE_UPDATE
2022-11-15 10:54:20.883 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: period [?]
2022-11-15 10:54:20.883 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: window [?, seekable=false, dynamic=false]
2022-11-15 10:54:20.883 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: ]
2022-11-15 10:54:20.912 28425-28425/com.google.android.exoplayer2.demo D/ViewRootImpl: updateViewConfiguration config.uiMode=83 configuration.uiMode=83
2022-11-15 10:54:20.924 28425-28425/com.google.android.exoplayer2.demo V/KeyEvent: Reset: android.view.KeyEvent$DispatcherState@f752187
2022-11-15 10:54:20.926 28425-28425/com.google.android.exoplayer2.demo V/InputMethodManager: onWindowFocus: null softInputMode=STATE_UNSPECIFIED|ADJUST_PAN|IS_FORWARD_NAVIGATION first=true flags=#81810180
2022-11-15 10:54:21.115 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: timeline [eventTime=0.37, mediaPos=0.00, window=0, period=0, periodCount=1, windowCount=1, reason=SOURCE_UPDATE
2022-11-15 10:54:21.115 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: period [232.45]
2022-11-15 10:54:21.115 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: window [232.45, seekable=true, dynamic=false]
2022-11-15 10:54:21.115 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: ]
2022-11-15 10:54:21.175 28425-28470/com.google.android.exoplayer2.demo W/VideoCapabilities: Unrecognized profile/level 0/3 for video/mpeg2
2022-11-15 10:54:21.176 28425-28470/com.google.android.exoplayer2.demo W/VideoCapabilities: Unrecognized profile/level 0/3 for video/mpeg2
2022-11-15 10:54:21.177 28425-28470/com.google.android.exoplayer2.demo W/VideoCapabilities: Unsupported mime video/x-ms-wmv
2022-11-15 10:54:21.222 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: videoEnabled [eventTime=0.48, mediaPos=0.00, window=0, period=0]
2022-11-15 10:54:21.226 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: tracks [eventTime=0.48, mediaPos=0.00, window=0, period=0
2022-11-15 10:54:21.226 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: group [
2022-11-15 10:54:21.226 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: [X] Track:0, id=1, mimeType=video/avc, codecs=avc1.640032, res=2400x1200, fps=25.0, supported=YES
2022-11-15 10:54:21.227 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: ]
2022-11-15 10:54:21.227 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: group [
2022-11-15 10:54:21.227 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: [ ] Track:0, id=2, mimeType=audio/eac3-joc, channels=6, sample_rate=48000, language=und, supported=NO_UNSUPPORTED_TYPE
2022-11-15 10:54:21.227 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: ]
2022-11-15 10:54:21.227 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: ]
2022-11-15 10:54:21.229 28425-28480/com.google.android.exoplayer2.demo I/OMXClient: IOmx service obtained
2022-11-15 10:54:21.242 28425-28425/com.google.android.exoplayer2.demo E/exoplayer2.dem: Invalid ID 0x00000000.
2022-11-15 10:54:21.248 28425-28479/com.google.android.exoplayer2.demo D/SurfaceUtils: connecting to surface 0x75b0f0c010, reason connectToSurface
2022-11-15 10:54:21.251 28425-28479/com.google.android.exoplayer2.demo I/MediaCodec: [OMX.qcom.video.decoder.avc] setting surface generation to 29107201
2022-11-15 10:54:21.251 28425-28479/com.google.android.exoplayer2.demo D/SurfaceUtils: disconnecting from surface 0x75b0f0c010, reason connectToSurface(reconnect)
2022-11-15 10:54:21.252 28425-28479/com.google.android.exoplayer2.demo D/SurfaceUtils: connecting to surface 0x75b0f0c010, reason connectToSurface(reconnect)
2022-11-15 10:54:21.256 28425-28480/com.google.android.exoplayer2.demo I/ExtendedACodec: setupVideoDecoder()
2022-11-15 10:54:21.262 28425-28480/com.google.android.exoplayer2.demo I/ExtendedACodec: Decoder will be in frame by frame mode
2022-11-15 10:54:21.276 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: downstreamFormat [eventTime=0.53, mediaPos=0.00, window=0, period=0, id=1, mimeType=video/avc, codecs=avc1.640032, res=2400x1200, fps=25.0]
2022-11-15 10:54:21.285 28425-28425/com.google.android.exoplayer2.demo I/xpWindowManager: getOverrideLayoutParams global lp={(0,24)(wrapxwrap) gr=BOTTOM CENTER ty=TOAST fmt=TRANSLUCENT wanim=0x1030004
fl=NOT_FOCUSABLE NOT_TOUCHABLE KEEP_SCREEN_ON SPLIT_TOUCH
sharedId=0
isAlert=false}
2022-11-15 10:54:21.332 28425-28480/com.google.android.exoplayer2.demo D/SurfaceUtils: set up nativeWindow 0x75b0f0c010 for 2400x1200, color 0x7fa30c06, rotation 0, usage 0x20002900
2022-11-15 10:54:21.332 28425-28425/com.google.android.exoplayer2.demo D/ViewRootImpl: updateViewConfiguration config.uiMode=83 configuration.uiMode=83
2022-11-15 10:54:21.360 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: videoDecoderInitialized [eventTime=0.62, mediaPos=0.00, window=0, period=0, OMX.qcom.video.decoder.avc]
2022-11-15 10:54:21.362 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: videoInputFormat [eventTime=0.62, mediaPos=0.00, window=0, period=0, id=1, mimeType=video/avc, codecs=avc1.640032, res=2400x1200, fps=25.0]
2022-11-15 10:54:21.403 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: videoSize [eventTime=0.66, mediaPos=0.00, window=0, period=0, 2400, 1200]
2022-11-15 10:54:21.409 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: renderedFirstFrame [eventTime=0.67, mediaPos=0.00, window=0, period=0, Surface(name=null)/@0x3c41b03]
2022-11-15 10:54:21.419 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: surfaceSize [eventTime=0.68, mediaPos=0.00, window=0, period=0, 1700, 850]
2022-11-15 10:54:23.562 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: state [eventTime=2.82, mediaPos=0.00, window=0, period=0, READY]
2022-11-15 10:54:23.569 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: isPlaying [eventTime=2.83, mediaPos=0.01, window=0, period=0, true]
2022-11-15 10:54:25.281 28425-28425/com.google.android.exoplayer2.demo V/InputMethodManager: onViewDetachedFromWindow: view=com.xiaopeng.widget.ThemeTextView{570f8b9 V.ED..... ........ 24,15-421,34 #102000b android:id/message},focus=false,windowFocus=false,autofillUiShowing=false,window=android.view.ViewRootImpl$W@4f874fe,displayId=0,temporaryDetach=false mServedView=null
2022-11-15 10:54:25.283 28425-28425/com.google.android.exoplayer2.demo V/InputMethodManager: onViewDetachedFromWindow: view=com.xiaopeng.widget.ThemeLinearLayout{be3645f V.E...... ......ID 0,0-445,49},focus=false,windowFocus=false,autofillUiShowing=false,window=android.view.ViewRootImpl$W@4f874fe,displayId=0,temporaryDetach=false mServedView=null
2022-11-15 10:54:29.867 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: state [eventTime=9.12, mediaPos=6.30, window=0, period=0, BUFFERING]
2022-11-15 10:54:29.876 28425-28425/com.google.android.exoplayer2.demo D/EventLogger: isPlaying [eventTime=9.13, mediaPos=6.31, window=0, period=0, false]

@zyfeng413
Copy link
Author

If only change the Util. GetAudioTrackChannelConfig , it will also says supported=NO_UNSUPPORTED_TYP

microkatz pushed a commit that referenced this issue Nov 16, 2022
Util.getAudioTrackChannelConfig() maps a channel count to a
channel mask that is passed to AudioTrack. The method expected that
playback of 8-channel audio is possible from Android 5.1 and playback of
12-channel audio is only possible from Android 12L. However, there is no
restriction on the upper number of channels that can be passed to the
AudioTrack. #10701 is an example where the audio decoder
outputs 12 channels on an Android 10.

This change removes the restrictions for 8 and 12 channels. Note, we still
do not support playback of arbitrary number of channels as it would require
further changes to DefaultAudioSink.

#minor-release

Issue: #10701
PiperOrigin-RevId: 488659831
microkatz pushed a commit to androidx/media that referenced this issue Nov 16, 2022
Util.getAudioTrackChannelConfig() maps a channel count to a
channel mask that is passed to AudioTrack. The method expected that
playback of 8-channel audio is possible from Android 5.1 and playback of
12-channel audio is only possible from Android 12L. However, there is no
restriction on the upper number of channels that can be passed to the
AudioTrack. google/ExoPlayer#10701 is an example where the audio decoder
outputs 12 channels on an Android 10.

This change removes the restrictions for 8 and 12 channels. Note, we still
do not support playback of arbitrary number of channels as it would require
further changes to DefaultAudioSink.

#minor-release

Issue: google/ExoPlayer#10701
PiperOrigin-RevId: 488659831
@christosts
Copy link
Contributor

We pushed a commit that changes Util.getAudioTrackChannelConfig(). It's available on the dev-v2 branch. The commit is already linked on this issue. Will you be able to checkout the dev-v2 branch and try the demo app with your content?

@zyfeng413
Copy link
Author

zyfeng413 commented Nov 17, 2022

I have updated the latest code of the dev-v2 branch, it can play, but the log shows supported=NO_UNSUPPORTED_TYP
log.txt

@christosts
Copy link
Contributor

I find this puzzling. This log line from log.txt

[ ] Track:0, id=2, mimeType=audio/eac3-joc, channels=6, sample_rate=48000, language=und, supported=NO_UNSUPPORTED_TYPE

says that the the device does not have an Atmos decoder (NO_UNSUPPORTED_TYPE), hence the audio track is not selected for playback (an X is missing in []). There should be no audio playback when this log is printed. In addition, in log.txt there are no logs for the audioDecoderInitialized and audioInputFormat events which would indicate audio playback was set up.

I looked again at all the attached logs, ExoPlayer Demo.txt and ExoPlayer Demo with custom changes.txt were obtained with ExoPlayer 2.18.0 and the Atmos track appears supported (supported=YES). Whereas, the logs where the track appears unsupported are printed with 2.18.1.

In the event there is a bug in 2.18.1, and since your device is custom and I cannot reproduce locally, I kindly ask for some debugging assistance:

  • First, can you verify you using the demo app obtained from the dev-v2 branch without any other modifications to the ExoPlayer source code, besides modifying media.exolist.json?
  • Second, can you please attach a debugger and see what MediaCodecAudioRenderer.supportsFormat() returns when the player asks for the Atmos support? Note, when you play the file, the method MediaCodecAudioRenderer.supportsFormat() will be called a few times for both the video and audio track. For the video track, the method will quickly return C.FORMAT_UNSUPPORTED_TYPE here. Please ignore those invocations. We are interested in the invocations where the Format argument is audio, i.e. Format.sampleMimeType should be audio/eac3-joc. Can you tell us what value is returned by the method and at what line exactly?
  • Third, if MediaCodecAudioRenderer.supportsFormat() returns C.FORMAT_UNSUPPORTED_SUBTYPE here, can you inspect what DefaultAudioSink. getFormatSupport() returns and at which line exactly?

Thanks.

microkatz pushed a commit to androidx/media that referenced this issue Nov 22, 2022
Util.getAudioTrackChannelConfig() maps a channel count to a
channel mask that is passed to AudioTrack. The method expected that
playback of 8-channel audio is possible from Android 5.1 and playback of
12-channel audio is only possible from Android 12L. However, there is no
restriction on the upper number of channels that can be passed to the
AudioTrack. google/ExoPlayer#10701 is an example where the audio decoder
outputs 12 channels on an Android 10.

This change removes the restrictions for 8 and 12 channels. Note, we still
do not support playback of arbitrary number of channels as it would require
further changes to DefaultAudioSink.

#minor-release

Issue: google/ExoPlayer#10701
PiperOrigin-RevId: 488659831
(cherry picked from commit 491b136)
microkatz pushed a commit that referenced this issue Nov 22, 2022
Util.getAudioTrackChannelConfig() maps a channel count to a
channel mask that is passed to AudioTrack. The method expected that
playback of 8-channel audio is possible from Android 5.1 and playback of
12-channel audio is only possible from Android 12L. However, there is no
restriction on the upper number of channels that can be passed to the
AudioTrack. #10701 is an example where the audio decoder
outputs 12 channels on an Android 10.

This change removes the restrictions for 8 and 12 channels. Note, we still
do not support playback of arbitrary number of channels as it would require
further changes to DefaultAudioSink.

#minor-release

Issue: #10701
PiperOrigin-RevId: 488659831
(cherry picked from commit 1b24e6f)
@google-oss-bot
Copy link
Collaborator

Hey @zyfeng413. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link
Collaborator

Since there haven't been any recent updates here, I am going to close this issue.

@zyfeng413 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@google google locked and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants