Random HTPC Audio Glitch/Dropout

Server Version#: 1.32.8.7639
Player Version#: Plex HTPC for Windows 1.54.0.4072-cf4808cc

I recently moved from a Mac Mini running HTPC to a windows system running HTPC. Two reasons, first the mini couldn’t keep up with higher bit-rate videos and second because windows has better audio pass-through codec support.

The new system video-wise works great, it is a beast and can handle direct play of 400mbps 4k files smoothly. My problem comes with random audio glitching. The best way to describe it is as a sub-second skip/silence. This isn’t like a 0dbfs signal spike, it’s not loud, just quite noticeable. I’ve been trying to better characterize it but the random nature makes it hard to reliably reproduce, especially with the same audio content playing. Sometimes it’s just silent other times it seems like there’s a little snap sound that goes with it.

Near as I can tell it only happens with video files. I don’t play many audio files on this system but the listening I’ve done hasn’t produced the issue. File bitrate doesn’t seem to matter, it happens on 4K UHD BR rips (no remux etc) files with high end modern audio codecs and it also happens on DVD rips with plain stereo audio.

I’m running HTPC plain vanilla, no special MPV configs. Audio is set to exclusive, HDMI, 7.1, and all the formats are checked. That said, when I changed the device kind to basic and auto channels the issue was still present.

I’ve been using plex for ages now but haven’t ever really had to troubleshoot anything like this so any pointers on logs to look at or things to try would be appreciated.

Thanks!

Does it happen on specific codecs? TrueHD / AC3? Does it also happen with PCM?
What Hardware do you have?

Can you please share your Plex HTPC logs?

I’ve experienced it with the following audio codecs:
eac3 640Kbs/5.1
dca 5.2Mbps/7.1 (DTS-HD)
truehd 7.1
aac 448Kbps/5.1
ac3 192kbps stereo

I did find one file I have that has a mp3 encoded soundtrack. That one also glitched but it was more of a buzzy sound than all the others.

Hardware is a Ryzen 3700x and a Nvidia RTX 4070 Super GPU, 8G ram. Everything is direct play.

I’ve attached a log. In this log HTPC was launched, a video file was played. Immediately after the audio glitch is heard the player is paused. Then HTPC is cleanly shut down.

Plex HTPC.log (188.4 KB)

Perhaps noteworthy on another log there were the entries:

Feb 06, 2024 09:23:37.667 [4624] WARN - [MPVEngine/mpv] cplayer: Audio device underrun detected.
Feb 06, 2024 09:23:37.668 [4624] DEBUG - [MPVEngine/mpv] cplayer: restarting audio after underrun
Feb 06, 2024 09:23:48.474 [4988] INFO - Debug info:
File:
  URL: https://10-0-1-10.53a12e46cf094fe28005d7281705c297.plex.direct:32400/library/parts/62030/1705934705/file.mkv?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx&X-Plex-Product=Plex%20HTPC%20for%20Windows&X-Plex-Platform=windows&X-Plex-Platform-Version=10.0.19042&X-Plex-Model=Gecko&X-Plex-Device=&X-Plex-Device-Name=Plex-HTPC&X-Plex-Device-Vendor=Plex&X-Plex-Device-Screen-Resolution=1280x720&X-Plex-Drm=widevine%3Avideo&X-Plex-Version=1.54.0.4072-cf4808cc&X-Plex-Client-Identifier=UUID_Masked&X-Plex-Language=en&X-Plex-Features=external-media%2Cindirect-media&X-Plex-Session-Id=3a44284c-b4cf-495c-aaef-9f996598e31b&Accept=application%2Fjson&Accept-Language=en&X-Plex-Playback-Session-Id=026eec1b-95da-44bf-8289-98ed1105ce5d&X-Plex-Playback-Id=723a8b8b-9770-4283-be10-88118c13233d
  Container: mkv
  Native seeking: yes

Video:
  Codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10)
  Size: 1920x1080
  Duration: 3143.01
  FPS (container): 23.98
  FPS (filters): 23.98
  Aspect: 1.78
  Bitrate: 10,103,269
  Display FPS: 60.00
  Hardware Decoding: d3d11va (d3d11va)

Audio: 
  Codec: spdif_eac3 (libavformat/spdifenc audio pass-through decoder)
  Bitrate: 640,000
  Channels: passthrough (eac3) -> passthrough (eac3)
  Output driver: wasapi

Cache:
  Total Used (B): 183,200,112
  Forward Used (B): 157,331,920
  Forward Available (B): 157,286,400
  Backward Available (B): 52,428,800
  Speed (bytes per second): 1,308,455

Misc: 
  Seekable: true
  Partially seekable: false
  Paused for cache: false
  Buffering state: 100
  Frame drop count: 6
  Time: 30.03 / 3143.01 (0.96%)
  State: playing 

This is playing the same file as in the attached log. I thought when I saw this that for sure the issue must be the underrun listed. However, upon multiple attempts to re-create this error I didn’t get it again despite multiple audio glitches happening. Based on that I don’t think the underrun is a reliable explanation for the problem I’m encountering.

Thanks!

One possible reason:

This discrepancy in frame rate must be compensated somehow.

A common method is to wait until the drift is equal to about 1 frame. and then this frame is either dropped or jumped ahead.
This of course does also affect the audio, otherwise it would drift out of sync over time.

If your screen is not a “computer monitor” but rather a TV device, consider activating “Refresh Rate Switching”. This will cause the connected display to use the exact same refresh rate as the video file. So workarounds like the above described to keep the sync are not necessary anymore.

True but mpv (found in Plex HTPC) with its default config does not touch the audio, the drift is compensated by dropping video frames. The audio is untouched.

My explanation lies in your GPU. The RTX 4070 Super is a very very new card and has not seen many drivers.

This would explain why the issue is present but without log entries. When we would have a coincidence with the “clinical findings” (e.g. the dropouts) and a printed log output, we could say it’s likely not the hardware. The underrun message may also guide us in the direction of a buggy driver. (audio device not fast enough to process the audio → driver issue…)

Could you please test playback with Plex HTPC with passthrough disabled? Then we will get a multichannel PCM output, when it also drops out audio frames, its very likely a driver issue. (I assume it will drop audio frames, as you are also seeing issues with AAC audio - which can not be bit streamed to the AVR - its transferred as PCM)

I did a similar setup with an old GPU (a Nvidia GT710) last year and experienced the same issue. Because the GPU wasn’t powerful enough for the video rendering and a general lack of time I put the project aside and didn’t dig into it further. Based on that experience I’m skeptical that it’s due to the newness of the GPU.

I disabled all the passthrough options and confirmed that it was putting out a PCM stream with my audio processor. I still get glitches but it’s more of a digital stutter/hiccup now rather than a slience.

It could also be an issue down the chain then. Have you tested different cables? A different HDMI port on your AVR? A different AVR or directly to the TV? Any adapters in the chain?

I´ve been using an RTX 3050 without problems for over a year now…

I had an Nvidia RTX 3050 with this issue, random audio dropouts, I reported it as a faulty card but Nvidia were unable to help with a fix.

I have since swapped the card for an Intel ARC A380, and had no issues at all since then, that’s been 8 months now.

I’ve had audio dropouts with NVIDIA cards before and in my case it didn’t matter whether I was using audio passthrough or having the computer decode to PCM. However, it did seem to matter the video that was displayed. I could most reliably reproduce it with a video file that had periodic black screen with some white text (intro credits). In my case, changing the power control in the NVIDIA settings resolved it: HTPC Tips and Tricks - #5 by gbooker02

Hopefully this will help you as well.

Hey all, just an update, I’ve managed to reduce the occurrence of the problem so that it’s less annoying but I haven’t resolved it all together. I did test with just MPV to remove all possible plex related issues and the problem is still present. I’ve tested the rest of the signal chain and that’s all working fine so the issue isn’t there. At this point I may just need to try a different GPU to see if that makes a difference.

Thanks for all the time spent trying to assist!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.