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

(Stremio Android TV) Wrong channel order for OPUS 5.1 / 7.1 audio tracks #613

Closed
johnmolina opened this issue Nov 27, 2023 · 5 comments
Closed

Comments

@johnmolina
Copy link

Describe the bug
There is a bug in Android that causes a wrong channel order for OPUS 5.1 or 7.1 multichannel audio playback in ExoPlayer with Android platform decoders.

Its very obvious once you know about it because it switches the center channel with the right channel, so all the dialogue now comes from the right instead of the center. The LFE channel also switches places with one of the side/back surround channels.

This also affects devices with just two speakers because the down-mix to stereo uses the same wrong channel order.

Check out this thread for more info: google/ExoPlayer#8396

It seems the only way to fix this bug is:

  • Google fixes the bug in Android itself <- lol
    or
  • Apps have to use ExoPlayer extensions like ffmpeg to decode OPUS multichannel audio

For Stremio it seems that the Android Mobile version already uses an ExoPlayer extension for OPUS since it is not affected by this bug. But the Android TV version is affected by this bug.

I hope Stremio Android TV can switch to an ExoPlayer extension like ffmpeg with libopus decode for OPUS multichannel audio so the channels play back correctly.

To Reproduce
Steps to reproduce the behavior:

  1. Install Stremio Android TV on any Android device.
  2. Try to playback a file with OPUS 5.1 or 7.1 audio tracks.
  3. Channel order is wrong, audio channels are switched around. All dialogue is played back from the right speaker instead of center.

Expected behavior
Stremio Android TV should play back OPUS multichannel audio with the correct channel order like Stremio Android Mobile version.

Screenshots
N/A

Smartphone (please complete the following information):

  • Devices: Amazon Fire Stick 4K Max (1st GEN), Samsung Galaxy S23, Samsung Galaxy Tab S9
  • OS: Android 10-13
  • App: Stremio TV 1.6.4 ARM / ARM64
  • Player: Integrated ExoPlayer

Additional context
N/A

@TRtomasz
Copy link
Member

if you disable hardware accelerated decoding exo will use ffmpeg to decode sound.

@johnmolina
Copy link
Author

@TRtomasz Your comment is not really helpful.

Yes, using ExoPlayer without hardware acceleration or switching to libVLC in Stremio AndroidTV will result in the correct channel order for multichannel OPUS audio since both options no longer use the bugged Android platform OPUS audio decoders.

BUT both options are unable to properly play back 4K AV1 and 4K AV1 HDR video. Some other video formats struggle as well and you only get a video slideshow or a black screen.

Most of the files that use OPUS multichannel audio also use advanced video codecs like HEVC or AV1.

This bug can only be fixed without affecting video decoding with an override to use ffmpeg for multichannel OPUS audio tracks while keeping hardware acceleration for the video tracks in ExoPlayer.

Btw i assumed in my Issue that Stremio Android Mobile is not affected because it already uses ExoPlayer + ffmpeg extension. It seems this is wrong and the real reason is that it uses libVLC.

@TRtomasz
Copy link
Member

I dont think we will focus on making a workaround since this is is not very popular audio format. IT should get fixed in exo, you can switch player to LibVlc on your TV in stremio settings.

@johnmolina
Copy link
Author

@TRtomasz There will be a fix for this bug in the next Media3 / ExoPlayer bugfix and minor release. Please update Stremio Android TV when this becomes available.

google/ExoPlayer#8396 (comment)

androidx/media@b1541b0

@johnmolina
Copy link
Author

@TRtomasz A fix for this bug has been released with Androidx Media3 1.2.1. I hope you can update Stremio AndroidTV.

https://github.com/androidx/media/blob/release/RELEASENOTES.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants