Closed illeatmyhat closed 3 years ago
Seems like 5.1 audio isn't properly downmixing to Stereo
Seems like 5.1 audio isn't properly downmixing to Stereo
It's both multi-channel and two-channel audio. I have several items in my library that have two audio tracks encoded with Opus, 6 channel and 2 channel. They are both heavily scrambled on my Roku Ultra.
ok. I just tested 2ch Opus on my system and it plays fine. I wonder what's up with your system
I've uploaded a couple of sample OPUS files here (about 8Mb each, one 6 channel and one stereo) that I've validated both work on my Roku with App v 1.4.5.
Could you try downloading these files and testing them on your Roku just to confirm if both, one or none sound garbled please?
I downloaded the samples, and the stereo file plays fine, but the 5.1 is junky audio. But mine continue to be junk for both. Maybe it has something to do with how I used Handbrake to encode the Opus stereo track. I set it to "Dolby Pro Logic II" instead of regular stereo. I'll try one encoded as strictly stereo.
OK thanks for that. Something for me to have a look at.
Do you have an 5.1 sound system connected, or is the actual output stereo?
I have an Ultra, with HDMI audio set to (DD+,DTS) to reduce audio transcoding, and connected to an LG TV, so just stereo.
I did have a shower thought last night about it being something related to not downmixing 5.1 to stereo properly, and this isn't specific to this issue, but ...
Since what audio can be direct played is somewhat determined by what audio capabilities are reported by the device the Roku is connected to, it would be kind of cool if the Roku client could look at the audio device, look at the available audio streams, and if the content contains both a surround and a stereo stream, automatically use the one that is most appropriate, with the user having the ability to override it. So if the Roku is connected to something that can only deal with stereo, the client automatically uses the stereo stream.
This is where we query the roku device asking if it can support opus. It should propeely downmix 5.1 to stereo on the roku itself. I can play 5.1 audio (i havent tested the 5.1 opus sample provided yet) on my stereo only tv and it comes out fine. Have you isolated this issue to the jellyfin app specifically?
I just went and checked with my Plex client, and it also sounds horrible using the Opus 5.1 stream.
I set it to "Dolby Pro Logic II" instead of regular stereo.
This might be the issue but I'm not sure. I'd have to dig into the encoding requirements of the opus spec
I can play 5.1 audio (i havent tested the 5.1 opus sample provided yet) on my stereo only tv and it comes out fine.
Did you encode your Opus 5.1 in Handbrake? It may be that OP and I used it, and it has something to do with Handbrake's settings for FFMpeg for encoding Opus.
i want to say it was 5.1 aac. it hadnt been for this issue specifically. once I'm home i can test the sample that @neilsb provided. I dont really mess with Handbrake, I use FFmpeg directly haha
i want to say it was 5.1 aac. it hadnt been for this issue specifically.
Oh, yeah. I can play 5.1 in other codecs just fine, as well. It's just Opus that's an issue. I'm going to say its either how FFmpeg encodes, Handbrake encodes, or the Roku handles it, but probably not inherent to the JF client.
can you pull the exact ffmpeg command that handbrake uses or provide a sample? I'd like to check it out. if not, the output of ffmpeg -i file might be enough
I pulled this out of Kodi's video sample library, and crunched it through Handbrake real quick. I transcoded it from VC-1 with TrueHD 5.1 to VP9 with 3 audio tracks, Opus 5.1 at 640k, Opus using the Dolby Pro Logic II setting at 160k, and then just straight stereo, also at 160k. All audio streams are a mess on my Roku/LG setup.
Is it transcoding? or is it Direct Playing?
The server dashboard shows it as Direct Playing for all three audio streams.
So a little more testing shows that even when a stereo output source is connected, the Roku is telling Jellyfin it supports 6 channel Open (and AAC amongst others). So the interference is almost certainly to do with the Roku device downmixing to Stereo. I don't have 5.1 decoder to test if it handles 5.1 OPUS correctly if it's not performing downmixing.
The same behaviour is seen with aac as well, but Roku seems to downmix that fine.
The suggestion about the Roku looking at the detected (or manually set) output settings and defaulting to the best stream is an interesting idea, and makes sense. Might be worth raising a separate issue for this as it would be a nice to have, whereas sorting Audio not working is more of a priority. Wouldn't want the idea getting lost when this issue is closed.
ow. that hurt. I got the same results. All 3 audio clips from your sample were bad. Neils' 2ch was good and the 6ch failed to properly downmix but it wasn't nearly as bad as your samples. You could at least hear Neils' audio whereas with yours it sounded like a complete encoding failure.
Only difference I see is TAG:language=eng
which I doubt would cause the issue. I'll look to see how else I can analyze the differences.
I found this open ticket for opus in mkv.
I am having problems with the Roku app (not the web client however) and OPUS as well. I get no audio from two TVs with Rokus on them when the audio format is OPUS. The video stream is transcoded, but the audio stream is copied (from logs). If I change the audio stream to something else (FLAC for instance) with ffmpeg ahead of time, it works just fine.
if you test exo in Android, you will probably get the same results. i think the issue is upstream of jellyfin
I just tried a new encode of VP9/Opus 5.1 on my Roku (OS 10.0.0 b4209) with JF 1.4.b8 and while it plays fine in the JMP on the desktop and the Android client (2.3.3), it is still just noise on the Roku, the same as a year ago. Just to provide an update.
When playing an .MKV file with a 720p HEVC video stream, and a "Jpn OPUS 5.1 Default" audio stream, the audio is heavily scrambled. Mostly, only loud static noise can be heard. The natural sound from the audio stream can be barely heard, though also scrambled.
Works fine on the web version of Jellyfin. Probably a transcoding error. May be related to #231