Plex playing DTS 24/44.1 files at 96kHz in Passthrough

Plex on Windows 10… Player Version 1.84.1.4069-ff740b6d

Output via MB HDMI to Pioneer AVR. AVR is set to “Auto-Surround” where normally, when it detects any of the support formats, will automatically decode bitstream.

It seems that when I play a 24/96 DTS file - it works fine… AVR sees DTS, (shows on display) decodes properly. When I play 24/44.1 - AVR still sees DTS but somehow it is always 24/96 PCM… and this results in an immediately noticeable pitch and speed change.

I’ve been mucking about all afternoon and cannot seem to solve this. All this used to be so easy in WMC…

Ideas anyone?

More info…

Interestingly, I was able to play a 24bit/44.1kHz stereo FLAC (Lossless mode) file without the sample rate issues. (Correct speed/pitch).

So this seems to be an issue with doing a DTS passthrough. It is NOT exactly passthrough.

BTW: If I open those files in Foobar2000: no problems… golden.

Can someone here explain what is going on with DTS playback on Plex with the Windows player?

Passthrough of 44.1khz DTS and Dolby Digital (AC3) content is “broken”. This is an issue with mpv, not Plex.

Ac3/DTS is transmitted as 2ch@48Khz bit stream.

I assume, that 44.1khz content should be streamed as 2ch@44.1khz bit stream. This is only an assumption, I have not tested this. If it’s the case it would need a smarter logic in mpv.

=> mpv/audio/decode/ad_spdif.c at master · mpv-player/mpv · GitHub

I’m sorry, but what does this have to do with MPV? I have never used MPV and it is not on my system.

So your conclusions are just not accurate. BTW: I have had this working on WMP and WMC before I started with Plex; and that was well after 2019.

Today, I can still play those exact files through Windows Media Player and I get the correct pitch/speed. Pretty sure other players work fine too.

Unless I am missing something, IMHO is a Plex (Windows) problem.

Plex for Windows (like Plex HTPC) is using mpv as a playback engine. Have a look at the log. :wink:

Jan 04, 2024 17:56:11.755 [13240] INFO - Starting Plex version: 1.84.1.4069-ff740b6d
Jan 04, 2024 17:56:11.755 [13240] INFO - Running on: Windows 10 Version 2009 [10.0.22631] x86_64
Jan 04, 2024 17:56:11.755 [13240] INFO - Happy Plexing!
Jan 04, 2024 17:56:11.755 [12868] INFO - [OpenGL] Selected angle renderer.
Jan 04, 2024 17:56:11.755 [12868] INFO - [OpenGL] Default surface format version: 2.0
Jan 04, 2024 17:56:11.755 [12868] INFO - [OpenGL] Selecting surface format version: 3.0; profile: 1
Jan 04, 2024 17:56:11.944 [12868] INFO - [OpenGL] Testing surface format version: 3.0
Jan 04, 2024 17:56:11.944 [12868] INFO - [OpenGL] Setting default surface format
Jan 04, 2024 17:56:11.944 [12868] WARN - [OpenGL] Warning: Setting a new default format with a different version or profile after the global shared context is created may cause issues with context sharing.
Jan 04, 2024 17:56:11.945 [12868] INFO - [Settings] Web inspector port 0
--------
Jan 04, 2024 17:56:12.061 [1472] DEBUG - [MPVEngine/mpv] cplayer: mpv 0.34.0-UNKNOWN Copyright © 2000-2022 mpv/MPlayer/mplayer2 projects
Jan 04, 2024 17:56:12.061 [1472] DEBUG - [MPVEngine/mpv] cplayer:  built on Tue Sep 19 12:47:27 UTC 2023
Jan 04, 2024 17:56:12.061 [1472] DEBUG - [MPVEngine/mpv] cplayer: FFmpeg library versions:
Jan 04, 2024 17:56:12.061 [1472] DEBUG - [MPVEngine/mpv] cplayer:    libavutil       57.24.101
Jan 04, 2024 17:56:12.061 [1472] DEBUG - [MPVEngine/mpv] cplayer:    libavcodec      59.25.100
Jan 04, 2024 17:56:12.061 [1472] DEBUG - [MPVEngine/mpv] cplayer:    libavformat     59.20.101
Jan 04, 2024 17:56:12.061 [1472] DEBUG - [MPVEngine/mpv] cplayer:    libswscale      6.6.100
Jan 04, 2024 17:56:12.061 [1472] DEBUG - [MPVEngine/mpv] cplayer:    libavfilter     8.29.100
Jan 04, 2024 17:56:12.061 [1472] DEBUG - [MPVEngine/mpv] cplayer:    libswresample   4.6.100
Jan 04, 2024 17:56:12.061 [1472] DEBUG - [MPVEngine/mpv] cplayer: FFmpeg version: a31c019-4614

The other players like WMP/WMC use a different passthrough logic so that explains why they work.

So my conclusion remains accurate, the problem is MPV-related.

Wow, wow, wow.

I stand corrected.

So Plex uses some crap open-source playback engine that has had a broken (Fs) playback since 2019?

And - I PAID for this crap?

I’m relatively new to Plex - but how do folks around here put up with this???

I wouldn´t be that harsh about mpv. mpv is a very capable video renderer, that outperforms almost all competitors. (yes, also madvr in some areas) The audio side of things is good but could see some love… Anyway, I´m very happy with the decision Plex made back when they introduced these desktop players, way better than starting from scratch and creating a new playback engine. (I´m sure they would have made a good one, but that is a very demanding task…)

Playback of DTS/AC3 44.1khz passthrough content was never working in mpv, so the issue has been there since the beginning. Nobody noticed due to the lack of much 44.1khz dts/ac3 content and the fact that not many devs are using a setup where they can test audio passthrough… I only have two 44.1khz ac3 files on my server and both have been created (wrongly) by me… I have never seen anyone really using such content in the wild.

When it’s a mpv issue, we head over to github and make some noise about the problem there… When it’s big enough of an issue they fix it… Now comes the nice part. When it’s fixed, we don´t need to wait until Plex publishes a new update. We can simply change the mpv.dll in the install folder ourselves. Isn´t that nice? With a proprietary playback engine, this wouldn´t be possible.

So for your problem, you have the option to head over to GitHub and make some noise, recode your files to 48khz, or disable passthrough. Not ideal… I know…

Being honest here, if we had to make our own playback engine, the desktop apps wouldn’t exist. At best they would use an HTML5 player but doing that makes one question “what’s the point of making an app when you can just use a browser?”

I actually have some 44.1kHz AC3 files … somewhere. I was fiddling with them back in the days when I worked on the A52 audio component on Mac. Doing passthrough with these is tricky and as pointed out they are quite rare.

1 Like

I am sorry to disagree; but neither of you have made ANY case on why Plex has a proper audio player. I get that you might be vested in it… but you cannot use adjectives like “very capable” with a straight face here… and if you are, then you are barking up the wrong tree.

If you have an audio engine that cannot play audio without the gross distortion of playing them at the wrong speed and pitch, then you have a crap audio engine; and IMHO, its that simple.

…and I’m certainly not giving anyone a “pat on the head” for playing mp3’s - or FLAC files.

Anyway - thanks for the Plex education; I’ll shut-up now… not really more I can say. Harsh? PLEX has no business using the word “audiophile” or “professional” on their web-site.

If you are still interested in trying a potential fix… Have a look here => 44100Hz DTS incorrectly played at 48000Hz when using passthrough results in sped up audio · Issue #12078 · mpv-player/mpv · GitHub. I just created a build with a potential fix. The link to the build can be found there or here => build-clang-ad_spdif_v3.zip - Google Drive

I also noticed that ac3 44.1khz should work… Interesting, I definitely need to try that one as well!

Just opened a PR to fix this issue:

##Edit:
Has just been merged

Just curious: why would it be OK - in a passthrough mode - to change 24/96kHz content to 24/48kHz?

Well, to be honest, because DTS says so. What you have to keep in mind is the fact that the audio is not downconverted to a pcm stream or something and then bit streamed to the AVR. No - that’s not how it works. The code inside mpv/ffmpeg repackages (without altering the actual audio data) the DTS 5.1 48khz or DTS 24/96 frames to a 2ch@48khz and actually a 16bit bitstream that can be bitstreamed as 1 and 0 in a specific way to the AVR. So no, this is not an audio quality downgrade - its a repackaging so it can be transferred over HDMI (or whatever…)

The linked fix now only correctly “slices” the DTS 44.1khz data into small packages (that rely on a 44.1khz output mode) that the avr can understand. I hope the explanation makes sense to you.

Has this been released for Plex yet?

Nope, the manual mpv.dll swap is still needed, but thats very simple to do…

Well… I tried. There are no instructions so I simply renamed the old DL by adding the word OLD… added the new one to the directory and then restarted the machine.

That did not work: playback was still pitched.

The real question, is why Plex has not integrated the update, tested it with their beta team and made a general release?

Instructions can be found here =>

They are for Plex HTPC but it’s the same on Plex for Desktop…

Please try again. The fix works on my end. Yesterday I fully tested it on my end. With the unpatched mpv my AVR would not even play any sound with 44.1khz dts content… The patched one works perfectly.

There are problems with those instructions. Aside from getting the path incorrect, I downloaded this latest item:

mpv-dev-x86_64-v3-20240218-git-bd5b80b.7z

Based on the page link and the instructions to “be sure to grab a version that contains x86_64”

There is no mpv-2.dll in the extraction.

In the linked 7z archive you will find a file called libmpv-2.dll.

Gab this file and copy it to the install folder of Plex for Desktop.

Now rename the mpv-2.dll originally found in the install folder to something like mpv-2.dll.old. Now rename the libmpv-2.dll to mpv-2.dll and start Plex for Desktop. Now you are ready to go.

Thank-you for those instructions. That did the job. I tested a number of files that used to play at the wrong pitch; and they all seem fine. I’ll do more testing in the next few days…

Thank-you Mitzschs!