-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Client tries to direct play FLAC 2.1 audio track, which results in no audio output #146
Comments
same problem on the C1 FLAC 2.0 works this also happens when using DLNA direct play, so it must be an LG issue? |
I suspect I ran into the same issue, tried playing video with FLAC 2.1 and got no sound whatsoever. |
its an weird, no idea why 2.0 works but not 2.1 |
I'm seeing the same problem om my C3. Perhaps we should consider FLAC to be broken on webOS so that it gets transcoded? Would that be done in this repo or in jellyfin-web? |
I would prefer it if FLAC stereo audio could continue to be played back without transcoding, because that does work reliably and is a popular format for music as well (almost all of which is stereo). If it isn't feasible to distinguish between stereo FLAC and >2 channel FLAC audio streams, then it's probably better to just transcode it in general. opus audio streams are also affected by this issue in my experience. I don't think that was mentioned yet. |
I've just been doing some investigating, and it seems very inconsistent. I can't get FLAC > 2 channels to work properly at all, but even if I transcode it to something else it doesn't seem to want to play properly. Even AAC 5.1 files aren't playing properly if they are in an external file and need to be muxed in. Due to this I think there might actually be something else going on than just FLAC being broken with more than 2 channels. I've got some Opus 5.1 videos that play fine if the files are muxed in, but not if they are in a separate file, and others where they don't play properly even if muxed in. The code for determining if a format is supported or not doesn't seem to be able to take the number of channels into account, so without refactoring quite a bit, it doesn't seem possible to distinguish them for transcoding. It might be worth mentioning that I'm using jellyfin 10.8.13, not the latest nightly, so maybe (hopefully) some of this has already been resolved. |
I have the same problem with FLAC 5.1/7.1. Audio is very quiet missing the center channels. My receiver is connected through ARC (not eARC) which I think only supports 5.1 sound through (E)AC3. Certainly not PCM 5.1. According to jellyfin audio is direct play so not sure how my LG GX handles it. I assume it transcodes before passing it through ARC, and somehow ignores channels >2. A solution would be to force transcode to dolby digital. I'm not sure at all, but I think AAC 5.1 is handled OK by LG webos and is direct played, so this is also an option, but i would have to check this. Edit: tested with the stable jellyfin docker image (10.8.x), maybe 10.9 solves it? |
10.9 doesn't solve it. I'm very confused as to what exactly is going wrong here, as if I play the exact same audio file as music from JF, it does play with the correct number of channels, when it doesn't as part of a video. I've also got an example of AAC and Dolby Digital not playing correctly, so I don't think it's necessarily entirely due to codec. I'm a bit stumped as to how to go about fixing this. The first step would be to find out exactly when the issue occurs, as that isn't known yet. Does anyone know of a way to generate test audio files with different codecs and channel configurations? Then we could test them alongside different video codecs and container formats to see exactly when it does wrong. From there we might be able to deduce what the exact issue is, and (hopefully) fix it within Jellyfin. Otherwise it might be down to LG to fix. |
For the sake of completeness and to determine a common root cause. I encountered the problem with a FLAC 7.1 track. I'm pretty sure I had it with FLAC 5.1 too but I can't confirm. Media info: I have the bug that the audio tracks are out of order (fixed in 10.9 I think). The media info displays information about the selected track (e.g., track 2), but the other track is played (e.g., track 1). When I turn off the receiver then the TV also outputs quiet audio for the FLAC track, so I assume we can rule out ARC. Although the receiver is still connected, it shouldn't have any impact. The problem remains the same when I enable "Prefer fMP4-HLS Media Container". I did want to modify src/scripts/browserDeviceProfile.js in jellyfin-webos and disable flac for web0s (line 128), but I'm using the jellyfin docker image which has a compiled version of Jellyfin-web. Anyone know if I can just drop a single modified file into /jellyfin/jellyfin-web/src/scripts/browserDeviceProfile.js in the container to override it, or do I need to compile everything from scratch with npm install, ... (and mount the jellyfin-web folder)? |
After some experimenting, it seems flac >2.0 is just not supported by webos. flac is only mentioned for 2 channels on: I fiddled around with jellyfin-web and managed to disable flac support. It now transcodes automatically to aac which works perfectly. Of course, ideally transcoding should only happen for flac >2.0 (and as flac 2.0 is popular for music). As a sidenote, I also suspected ARC as that should only support < 1 Mbps for audio (flac is between 800kpbs to 1.8 Mbps), but manually transcoded AAC@1.2Mbps still seems to work (or LG does its own transcoding before pushing it over the ARC). |
@ilmc888 did you have to edit the web client itself or was it some kind of configuration option you could pass to force transcoding? |
I modified the jellyfin-web folder (part of the jellyfin server). In src/scripts/browserDeviceProfile.js
seems to work. Then compile and mount the dist/ folder inside the jellyfin container. I also saw the following lines:
Not sure where options.disableVideoAudioCodecs comes from, but perhaps you can define it in config.json in the root web folder. I don't know javascript, but adding something like: |
It comes from here (needs to be added as you wrote): jellyfin-webos/frontend/js/webOS.js Lines 76 to 82 in 5c7cbdf
At the same time, audio codec can be granularly disabled for |
Question. You can get some samples from https://github.com/sfiera/flac-test-files Or you can test this by extracting audio track from the video file. Then place it in the library which handle audio files: |
Yes, FLAC 5.1 does work as music. |
Isn't that strange? LG webos then supports FLAC 5.1, except if it is in a video container? I will see if I can test FLAC 5.1 music later (I can try both the given tracks as well as extracting from the video container to rule out any issues with the audio track). |
It is indeed very strange. That's part of why I think that FLAC isn't the root cause of this issue. The other reason is that I've got some other video files with other, non-FLAC, formats that have the same issue. I can send the examples in private if you would like them for experimentation. |
Unfortunately, I can not confirm normal playback as a music file (Music library) on my setup (ARC). I get the same behavior as before. For surround51.flac I only get the "Front left" and "Front right" messages (no center, LFE, and back channels). My receiver also indicates a stereo signal. The same is true for the flac extracted from the video container. With AAC transcoding I do get the full 6 channels. In that case,I also see that my receiver gets a Dolby digital plus signal so I'm fairly sure webos transcodes the AAC track to EAC3, but apparently fails to do so properly for FLAC 5.1. Given that, transcoding to (E)AC3 instead of AAC might make sense for ARC setups to avoid double transcode and loss of detail. Extra, I did see the surround51.flac file was encoded as 5.1(side) using sox. I converted it to standard 5.1 using ffmpeg and also tested the audio track of the video in 5.1 and 5.1(side) but with the same results. ffmpeg -i file for two test files of about 7 I tested:
Edit, worth mentioning that I switched to jellyfin 10.9 (well, master) a couple of days ago. |
@FintasticMan Could you please re-test |
@dmitrylyzo Interestingly, for that file I can only hear Front Left and Front Right. Other 5.1 FLAC files however do play all channels correctly when played as music. Some info that might be useful: my Sonos app shows that the files that do play correctly are Dolby MAT 5.1, and For further testing, it might be easier to chat on Matrix or Discord (I'm @FintasticMan:matrix.org on Matrix and @FintasticMan on Discord) |
Could it be that in the case of Dolby MAT 5.1 it is Dolby Atmos (?) encoded in FLAC? So FLAC is just a container. What does ffprobe say?
Maybe. It's more persistent (documented) here. 🤷 |
ffprobe only mentions that it's FLAC. It is in a Matroska (mka) container. I extracted it from a video affected by this issue. So when it is played in a video container, it only plays 2 channels (Sonos shows PCM 2.0), but when extracted, muxed into an audio container and played as music, it plays all channels (Sonos shows Dolby MAT 5.1). |
@dmitrylyzo I've just muxed the surround51.flac into an mka container, and now it does play all the channels! |
Could you paste the output of ffprobe (or ffmpeg -i file.mka) of the file that isn't working? |
The same file, in an mka container, that does play all the channels:
It seems so far like any FLAC file can be made to play all channels by muxing it into an mka container. This only works for music though, I haven't tried remuxing my video with FLAC audio yet into different containers. |
What a weird behavior. 😅 For now, we've blocked FLAC with >2 channels in video. |
Funnily enough, I can confirm :) I remuxed surround51.flac using
In the Music library of Jellyfin, surround51.flac only outputs stereo (left and right front). surround51.mka gives me all channels and my Denon receiver indicates dolby digital. I assume it takes a different processing path in LG webos (where mka is still seen as video by webos?). I'm using the v10.9.z branch (with the changes of #5452 included). |
Putting it into a video doesn't work. Here's the ffprobe info
|
I've also tried muxing it into an mp4 container, and that for some reason doesn't play any audio at all?? Details
Created using
|
You are mixing streams with different duration in one container. Is that a problem for jellyfin or webos? You could specify -t 12s to make video and audio equal? |
OK, seems jellyfin is transcoding the surround51.mka to aac. That's why it works. Surround51.flac is direct played. |
That is quite an important observation! I'm sorry for not noticing that myself 😅 I've just tested with jellyfin/jellyfin-web#5452, and while it almost seems to work with videos, the OS seems to be downmixing it to 2 channels... and discarding the subwoofer channel. The Sonos app shows PCM 2.0 and the rear left and rear right channels are definitely not playing from the rear speakers. |
I also created a couple of videos based on surround51.flac and just a black screen for video: Keeping the surround:
For both, audio is transcoded to aac and plays perfectly. Downmixing to stereo:
The whole file is direct played and I can hear all channel shoutouts, but obviously it is played as stereo so, e.g., the back channels are played by the front speakers. This wasn't tested yet for the PR, but so video with 2.0 FLAC is processed correctly. I think this is all according to expectation and solves the problem for me, but happy to test some things for others (otherwise this can be closed). Note, the difference between surround51.flac (not ok) and surround51.mka (ok) is probably because jellyfin takes different transcoding paths for music vs video? Where mka/mkv/matroska are all seen as a video container regardless of the streams it contains, and also ignoring the fact both files are played as Music in jellyfin (no transcode for music files as is for the plain flac, aac transcoding for video files as is for the flac embedded in mka). Just making some assumptions here. |
Are you sure the first one works correctly? Running the exact same command gives me the issue I described above (no subwoofer audio and downmixed to 2.0). |
The mkv one? Yes, that does work correctly as well as the mp4 one. The audio is transcoded to aac because of the patch of @dmitrylyzo . Are you running without the patch? You can download the files from wetransfer if you want to test: I used Ubuntu's ffmpeg (not ffmpeg-jellyfin): |
I am using the latest version of jellyfin-web, with the patch, so it is transcoding to AAC. Testing with your files shows the same as my testing. |
I tested some of those Dolby 5.1.2 atmos test files (E-AC3), I have no idea how to check if my Denon receiver still gets an atmos signal. I do get all channels (but I only have a 5.1 setup). On the other hand, I finally figured out that I can get more info (signal / audio format) in the web interface of Denon. AAC 5.1 audio is received as Dolby digital 5.1, so LG webos indeed transcode it. This of course rises the question whether we should directly transcode to (E-)AC3 (instead of AAC) on the jellyfin side to avoid an extra webos transcode. In that case, the client should detect ARC and set an enabledARC / enabledEARC variable? |
I've been redirected here from the Jellyfin chatroom, seems like I have an LG webOS related audio issue too. My setup: I noticed recently that .mkv videos with Dolby Vision (DV/HDR10) will result in remuxing and I’m able to see the “Dolby Vision” badge appearing on the LG tv, which is a very welcomed improvement. However, it seems like this potentially introduced quite a few audio issues whenever it remux .mkv DV media:
I have tested non-DV media files with the exact same setup and the audio level sounds normal, with the audio format displaying correctly on the soundbar. Here's an example with mediainfo:When playing this media, the Mediainfo of the media file:
and the playback info that's shown on TV:
TLDR; I suspect the recent update that remuxes Dolby Vision mkv files has somewhat negatively affected the audio portion, reducing it to just Stereo somehow. |
On my LG CX9 (WebOS 5.4), the Jellyfin (1.1.0) app will fail to playback audio with any file that contains a 2.1 (or any >2.0) FLAC track. FLAC Stereo works just fine with the same files (
5.1 too, as far as I rememberI have tested this and 5.1 FLAC will only play some channels, while center is silent).I have tested this behavior with all audio output types,
except HDMI ARCafter further testing, even HDMI eARC set to passthrough audio is affected. Even the internal speakers show the same issue. Playing the same files via USB-stick yields identical results, so it's probably safe to assume that any FLAC audio track with more than two channels is buggy on at least some WebOS LG TVs.I've found other people describing similar issues with LG TVs and FLAC playback with certain channel configurations. I assume an exception would need to be added for these, unless someone knows if LG is planning on adding playback capability for them.
The text was updated successfully, but these errors were encountered: