jellyfin / jellyfin-androidtv

Android TV Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
2.83k stars 481 forks source link

5.1 passthrough issues with libvlc #786

Closed daniel1v closed 3 years ago

daniel1v commented 3 years ago

Describe the bug On my Android TV the 5.1 audio passthrough does not work with libvlc, instesd only stereo is output. When selecting exoplayer, 5.1 passthrough works without issues.

Also with kodi app it works perfectly.

To Reproduce Set libvlc as player in the options and play a mkv video with 5.1 ac3 sound.

Expected behavior 5.1 Sound should be passend through, not stereo.

bqv commented 3 years ago

Not entirely sure on the specific file encodings, but I vastly see the reverse with yesterday's nightly. Almost no files play audio with exoplayer, but so far I've had luck with libvlc. Sony Bravia 4K TV.

kinghat commented 3 years ago

i can only get consistent playback with libvlc. if i use exoplayer some videos wont play or wont play sound.

ZachMayry commented 3 years ago

I'm noticing something similar. Not sure about ac3 but definitely with DTS. My receiver reports 2.1 PCM sound when the movie had DTS 5.1. When I play using VLC as an external player I noticed that passthrough was not enabled by default. Once I enabled it, I started to get DTS sound.

Here is the line where the option is set. I'm not sure if you can do it via the command line. https://code.videolan.org/videolan/vlc-android/-/blob/master/application/resources/src/main/java/org/videolan/resources/VLCOptions.kt#L155

A user option to turn that on in Jellyfin for Android TV would be nice.

svemonix commented 3 years ago

If I'm not mistaken, the situation is the following: The libVLC implementation in Jellyfin does not have a passthrough setting => Depending on HW capabilities, it will result either on a multichannel PCM output or Stereo PCM. The VLC app has a passthrough option which works more or less.

So HW that can't output multichannel PCM (i.e. many Android TV devices or TVs) simply won't be able to have multichannel audio with libVLC currently.

koying commented 3 years ago

The libVLC implementation in Jellyfin does not have a passthrough setting

Yes it does. https://github.com/jellyfin/jellyfin-androidtv/blob/e5c39429ae511326216dbeacc96cab984d2e0a8c/app/src/main/java/org/jellyfin/androidtv/ui/playback/VideoManager.java#L428 enables it.

libVLC is the same as used by the Android VLC player, so should work as well.

Same issue, btw ;)

svemonix commented 3 years ago

Well I meant a setting to activate or not passthrough in the GUI.

If it is supposed to be active by default with the current stable version then something is clearly wrong as I just get stereo with libvlc. I can get passthrough to work directly in the VLC app though.

Anyway, for me passthrough on/off is not good enough because it typically assumes anything is supported which is not necessarily the case. The Kodi refined passthrough settings are the way to go.

koying commented 3 years ago

Found the culprits:

https://github.com/jellyfin/jellyfin-androidtv/blob/e5c39429ae511326216dbeacc96cab984d2e0a8c/app/src/main/java/org/jellyfin/androidtv/ui/playback/VideoManager.java#L427

and

https://github.com/jellyfin/jellyfin-androidtv/blob/e5c39429ae511326216dbeacc96cab984d2e0a8c/app/src/main/java/org/jellyfin/androidtv/ui/playback/VideoManager.java#L427

The vlc javadoc mention "Calling this method will disable the encoding detection", and that interferes with passthrough, apparently. Commenting those lines makes passthrough work with vlc

miberecz commented 3 years ago

I can see its fixed with #891 but when it will be released? Or how do I get some kind of nightly build of this?

daniel1v commented 2 years ago

@thornbill you have closed this issue long time ago. For me, the issue still persists, also in the current beta versions.

Could you please reopen the issue so that I do not have to create a new one?

Thank you.

nielsvanvelzen commented 2 years ago

The issue templates have changed, so does our code. Please create a new iasue and reference this one.