-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Comments
The log pasted says that the audio format is not supported on this device
A quick search shows that the Xiaomi Mi 10T does not support playing Dolby Atmos. |
But I can use MediaPlayer to play it, so it's not that the device doesn't support it. |
Can you please share the following:
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. |
The email has been sent. |
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. |
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. |
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. |
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. |
ExoPlayer Demo.txt |
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、Our video and hardware are custom made, using 26 speaker outputs |
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. |
One thing to note though, although I didn't modify DefaultAudioSink in my tests it was able to play, but the logs were displayed |
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. |
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 To avoid confusion, can I ask you to do the following:
[Edit] |
Yes, This is logged from the Car device |
Thank you for the logs, can you also share a git patch of your change? |
I think there may be some confusion here. Change DefaultAudioSink.txt says |
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 |
If only change the Util. GetAudioTrackChannelConfig , it will also says supported=NO_UNSUPPORTED_TYP |
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
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
We pushed a commit that changes |
I have updated the latest code of the dev-v2 branch, it can play, but the log shows supported=NO_UNSUPPORTED_TYP |
I find this puzzling. This log line from log.txt
says that the the device does not have an Atmos decoder ( 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 ( 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:
Thanks. |
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)
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)
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! |
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. |
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: ]
The text was updated successfully, but these errors were encountered: