jellyfin / Swiftfin

Native Jellyfin Client for iOS and tvOS
Mozilla Public License 2.0
2.62k stars 285 forks source link

Multi Channel Audio through Standard Video Player does not work #723

Open turtle12 opened 1 year ago

turtle12 commented 1 year ago

Describe the bug

So far I could not get surround sound to work at all with the standard video player. I tried various 5.1 audio files with different codecs like Dolby Digital, AAC and so on and surround sound did not work for any of them. My sounhd system actually reports a multi ch pcm input passed through from my TV but all the sound is coming from the front left and right channels it seems.

When I switch to the experimental native player I get really good surround sound support that also plays correctly on my sound system, even dolby atmos via DD+.

Application version

1.0.1

Where did you install the app from?

App Store

Device information

Apple TV 4K 2022 (A2843)

OS version

tvOS 16.3.3

Jellyfin server version

10.8.9

J0riz commented 1 year ago

This issue seems to be the same as: https://github.com/jellyfin/Swiftfin/issues/663

The same issue with audio channels also exists in VLC app on Apple TV. So the cause seems to be an issue in libVLC.

With this audio file the left channel plays at left front speaker, left surround also plays on left front speaker. all the other channels go through center speaker:

I can't yet find a related issue at libVLC bug tracker. However comments in this issue seems to have some similarities:

With the Experimental Native player in Jellyfin plays all 5.1 audio channels at my amp work correctly. However than my screen stays black which makes the Experimental Native Player unusable.

I hope someone can find the exact cause within Jellyfin and/or libVLC.

mattyeark commented 1 year ago

It appears this isn't a libVLC issue, or at least an issue within libVLC. I used these audio test files, and proceeded to test them with the VLC app on the Apple TV. They played fine (I have a 5.1 sound system), the side channels played on the side speakers, which is the correct behavior. On Swiftfin, they play on the front left and right speakers. So, somehow Swiftfin is misusing libVLC? To be noted: even though the side channels get "squashed" into the front channels, the audio signal that the Apple TV sends to my amp is a 5.1 one... the side channels' audio is just nonexistent.

J0riz commented 1 year ago

@mattyeark That is interesting. I also don't have the issue anymore with VLC on my Apple TV with this file: https://www2.iis.fraunhofer.de/AAC/ChID-BLITS-EBU-Narration.mp4 So it seems that it is fixed in VLC and newer versions of libVLC. I'm currently using VLC 3.4.5 (522) to test this. So it seemed to be fixed between VLC 3.4.0 and 3.4.5. So I had the issue before with both VLC and Swiftfin. Now only still with Swiftfin.

So it looks like building a new version of Swiftfin with a newer version of libVLC would resolve the issue. 🙂

@LePips Can a release be build of Swiftfin with a newer libVLC? Than it is quick to confirm this resolves the problem.

J0riz commented 7 months ago

As stated in #1016 if you build Swiftfin for AppleTV with VLCKit 3.6.0b11 the audio issues are gone. 😄 However in current main branch there are still a lot of interface issues.

@LePips can VLCKit 3.6.0b11 be included in future official builds of Swiftfin?

ShyViolets commented 6 months ago

As stated in #1016 if you build Swiftfin for AppleTV with VLCKit 3.6.0b11 the audio issues are gone. 😄 However in current main branch there are still a lot of interface issues.

@LePips can VLCKit 3.6.0b11 be included in future official builds of Swiftfin?

Just wanted to ask if this happened? I still have subtitle and audio issues and don’t know how to personally build/fix it for myself.

LePips commented 6 months ago

I apologize that I haven't responded to this issue. I'll have to think about what to do about this since I will be moving to mpv soon and don't intend to keep using VLCKit. Sadly, tvOS on main is in an un-shippable state and is actually quite annoying to work on. I think that it would be possible to just create a small release from the commit-way-back-then with the new version of VLCKit, however I don't want to deal with people creating issues thinking that a lot of work was done on that release, not really understanding what that release is for.

ShyViolets commented 6 months ago

I apologize that I haven't responded to this issue. I'll have to think about what to do about this since I will be moving to mpv soon and don't intend to keep using VLCKit. Sadly, tvOS on main is in an un-shippable state and is actually quite annoying to work on. I think that it would be possible to just create a small release from the commit-way-back-then with the new version of VLCKit, however I don't want to deal with people creating issues thinking that a lot of work was done on that release, not really understanding what that release is for.

Thank you :) I appreciate the work you’ve done and do with Swiftfin. I don’t mind being patient while you figure things out - I just wanted to be sure you were aware of the issue since it’s been around for a bit. Just knowing it’s on your mind is good for me.

LePips commented 5 months ago

Since I've just taken a look at this, 3.6.0 was released by VLCKit however they haven't provided packaged framework for it just yet. I have pinged in their development channels for it and iOS should receive that update on TestFlight afterwards.

J0riz commented 5 months ago

Great. If a TestFlight tvOS version is available I will help testing 👍

maxer9500 commented 1 month ago

Any update on this?