Jump to content

Emby Theater/mpv trouble with TrueHD


fadingphoenix

Recommended Posts

fadingphoenix

I am having trouble with losing audio signal in Emby Theater when trying to passthrough Dolby TrueHD audio. It kind of took me a while to notice this since my blu-ray/uhd library, at least seems to be, overwhelmingly DTS, which surprises me.

The problem is really weird, it's both erratic and consistent. I first noticed it with Raya and the Last Dragon; at about 19-20 minutes in, when she's in the river and the picture cuts back to her face the audio would just drop and wouldn't recover. Eventually enough skipping forward and back or stopping and restarting could get it again, but then it would drop again intermittently. Without fail though, it always drops at that same point with her in the water.

So, I thought at first it was a problem with that movie rip, but trying to fix that didn't seem to help and I just figured maybe something was wrong with the disc that was getting screwed up in the rip, but MakeMKV wasn't throwing any errors or seeming to have any trouble with it. Next I tried the file in mpc-hc and it played fine, so then I started testing different settings in Emby. I tried changing the video output, hardware acceleration, enabling/disabling display rate switching, OpenGL, Interpolation, speaker layout, and exclusive mode. Nothing helped. Disabling audio passthrough would work fine, but isn't exactly helpful. Stats for Nerds seems to say that audio is still playing after its been lost, just...my avr isn't getting or accepting anything. I kind of pushed it aside and forced myself not to worry about it.

Then one day I put Enchanted on in the background, or at least that was my intent, but immediately it didn't play any audio; so naturally that then became my focus instead of anything else I was doing. As soon as I would start enchanted, my avr would flicker a brief detection of a signal on its display and then it would be gone. Left playing it will never recover the signal itself, again if I fight with it and skip forward and back and enough till I eventually get lucky the signal can get recovered; if I recall it dropped again in another scene a bit later though and I dropped it at the time. I KNEW that  movie played fine years ago though, and now I was just frustrated.

The third encounter was with the movie Brave, where the audio would drop immediately after the Pixar logo finished. With this one though if I get the signal reestablished the rest of the movie played perfectly fine, receiver reading TrueHD and all. Now I was paranoid and wondering if my computer, server, or emby (or all three 🤯) were in some conspiracy against Disney films.

Somewhat sillily, I don't remember what film made me have an epiphany of what was actually connecting them, but eventually it dawned on me each film I gradually had a an issue with was Dolby TrueHD. "BUT", I thought, "surely some of these other films I've played were surely TrueHD and none of them showed a problem." And that was indeed true, some movies with TrueHD will seem to play absolutely fine, beginning to end, without any issue. The catch, there's always a catch, is that I can't skip forward or back or pause in them. If I do the audio will almost positively be lost and become a real pain to get back. So, then I just started testing films that way, and without fail each film I tested with TrueHD would lose signal while DTS-HD MA and regular dts/dolby would play perfectly fine.

At this point I uninstalled and reinstalled Emby Theater to no avail (* but it might actually have brought with it another possibly related problem). I installed Emby Theater on a laptop and hooked it up to the receiver and it has the exact same problem. Still, MPC-HC and VLC will passthrough TrueHD without issue so it doesn't seem to be an issue with my computer or receiver. Today I downloaded mpv separately and tried that...same problem...but again, I KNEW this problem wasn't there in the past, so I started downloading older versions of mpv. I tried 35.1, 35.0, 34.0, 33.0 32.0, and 30.0. TrueHD playback started working fine for me again at v32.0, any of the more recent versions listed have the issue described.

I'm not sure what might have changed between those versions to cause this issue. Has anyone else ever experienced any of this? I'm guessing passthrough TrueHD isn't THAT niche of a scenario, but I can't find any accounts like this. At the same time though I can reproduce it on multiple machines, so unless it's specifically something like my avr doesn't like mpv or mpv doesn't like my avr...I dunno. I'm at a loss. Is this something that can be looked into on Emby's end? I figure I'll probably look into where to post for help with mpv specifically too, but that probably won't be today.

* Also, after reinstalling Emby Theater, it seems like Emby doesn't reestablish a windows audio connection after exiting or finishing movies. This seems to be true for any passthrough audio. So, even if I have the navigation sound effects enabled in Emby, and I exit a playing movie, there will just be no audio whatsoever in Emby. It seems luck of the draw if playing a film in Emby will establish an audio connect after this, sometimes it will sometimes it won't. Exiting to windows and playing any audio will establish a connection after a small delay. I haven't really looked into this particular aspect of the issue more, maybe something else  is going on causing a problem, but it did seem like the same behavior was happening on the laptop when I installed Emby on it, and it definitely wasn't happening before reinstalling.

 

TL:DR
Movies with TrueHD will either lose audio connection with my avr at specific points in certain movies or by skipping foward/back or pausing in any movies. DTS-HD MA and regular dts/dolby plays fine. MPC-HC and VLC passthrough TrueHD without any issue.. MPV v32.0 does passthrough TrueHD fine, more recent versions do not.

Edited by fadingphoenix
Link to comment
Share on other sites

generiq

I can't test this, but it sounds like an old issue. It could be related to the gpu driver and buffer underrun. 

Link to comment
Share on other sites

  • 2 months later...
scottpro

A while back I was having pops, clicks and dropouts with TrueHD passthrough audio.  As a quick fix I turn off passthrough/bitstreaming for TrueHD and let the mpv player decode the audio as 7.1 PCM.  I felt like I was losing out on the object-based meta data being passed along to my processor for the 7.1.4 format.  I did a little research and found this patch to mpv which fixes this problem.  It's the latest mpv build, 0.36.0, with TrueHD fixes.

Here is the thread that explains the problem/fix. Post #951
https://www.avsforum.com/threads/unofficial-mpv-player-support-thread.3274072/page-48#post-62744444

Here is the link to the download mpv.exe player and mpv-2.dll version 0.36.0 with the fix.  Scroll past the previous builds until you find the "build-11.08.2023"
https://forums.plex.tv/t/dolby-truehd-passthrough-modified-mpv-build/802742/149

I used this build which has the "mpv.exe" and "mpv-2.dll".  Google Drive file, -v3 build.
"build-11.08.2023-ntruehd+commits-overlay-mod.zip"

Just unzip the build, open this folder "mpv-dev-x86_64-v3-20230812-git-76e929c", copy the "mpv-2.dll" to your "AppData\Roaming\Emby-Theater\system\electronapp\libmpv\x64" folder and rename it to "mpv-1.dll" (you will have to rename the old one first).

I used "Toy Story 4" as my test movie because it had some serious audio issues at 00:02:32.  This build fixed it.  In fact, this build fixed all the movies that had TrueHD audio issues.

Make sure you have this option enabled.
"audio-exclusive=yes" (mpv.config) or "Enable exclusive audio mode" in the ET Audio GUI.


Enjoy.

Edited by scottpro
  • Like 1
  • Thanks 2
Link to comment
Share on other sites

  • 4 weeks later...
AdamPhillips

Scottpro you are a champion, thank you so much for sorting this out.

TrueHD passthru had never really worked properly for me, very low frequency sounds were weirdly clipped (especially noticeable on overhead speakers), and sound would frequently cutout altogether for maybe a tenth of a second which was incredibly annoying. Other sound formats were not affected.

Anyway I followed your instructions and voila it is now fixed, no more micro dropouts and overhead explosions now sound great.

Thanks again.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...