"no signal" for HDR content when Plex HTPC launched via bat file

Plex HTPC version: 1.45.1.3942-6fc4ceab

I need to change resolution when I launch Plex HTPC, and then again when I exit it.

So I thought I just write a little batch file:

D:\tools\set_2160p60.exe
START /W "" "C:\Program Files\Plex\Plex HTPC\Plex HTPC.exe"
D:\tools\set_1080p120.exe

This basically works great… that is as long as I play SDR content.
When I play an HDR movie or tv show then I get “no signal” on my TV.

This only happens when I launch Plex HTPC.exe via a bat, ps1, ahk or Launchbox. Plex HTPC (or mpv) really does not like that.

Log is flooded with this:

Aug 15, 2023 10:46:35.055 [13520] DEBUG - [MPVEngine/mpv] ffmpeg/video: hevc: Skipping NAL unit 63

Plex HTPC.log (952.3 KB)

There is one odd workaround:

  1. start Plex HTPC via .bat
  2. change video quality to “normal (Angle)”
  3. start playback of an HDR movie
  4. Plex HTPC crashes
  5. start Plex HTPC via .bat
  6. change video quality to “normal”
  7. play a HDR movie
  8. works just fine!
  9. exit Plex HTPC
  10. start Plex HTPC via .bat
  11. now you again get “no signal” when playing HDR content

Usually a no-signal on the TV means it is outputting a mode that the TV does not support.

Perhaps your odd workaround is really just not setting the resolution and refresh rate (randr) back and so the second launch doesn’t perform a switch when launching the app? Maybe a delay before launching might be prudent to stabilize things before the app is actually started?

What if you change the randr manually, launch the app manually, and then attempt to play HDR content? What if you change randr manually, launch via the bat? You can see where I’m going here.

Okay, so this is a little bit complex. :sweat_smile:

The issue is not related to launching Plex HTPC via script, by using the script to first set the resolution to 2160p60 it only uncovered the following issue.

Configuration:

Plex HTPC:

  • refresh rate switching = on
  • resolution switching = off
  • HDR switching = on

Steps to Reproduce:

  1. toggle HDR off (WIN + ALT + B)
  2. set resolution in windows to 3840x2160@60Hz (2160p60)
  3. launch Plex HTPC
  4. play a HDR video with 23.976FPS

Result:

  • Audio plays
  • Onkyo TX-SR393 reports 2160p23
  • HDR was not switched on
  • Samsung QE65Q9FNA gives me “no signal”
  1. stop playback
  2. display is changed back to 2160p60
  3. toggle HDR on with WIN+ALT+B
  4. play the same HDR video

Result:

  • Video & Audio plays (HDR is on as it was toggled on already)
  • Onkyo TX-SR393 reports 2160p23
  1. stop playback
  2. display is changed back to 2160p60
  3. toggle HDR off with WIN+ALT+B
  4. disable refresh rate switching in Plex HTPC
  5. play the same HDR video

Result:

  • Video & Audio plays
  • Onkyo TX-SR393 reports 2160p60 (stays at 60Hz b/c RR switching is now disabled)
  • HDR was switched on

Plex HTPC.log (2.1 MB)

So when I start Plex HTPC with the system at:

  • 2160p60
  • HDR off

Then I have a problem if I play a video which requires Plex HTPC to both switch HDR on and change the refresh rate.

I already tried to set the delay to 10 seconds, which sadly did not help.

This issue does not occur when I run the system at 1080p - which is why I did not run into it previously.

System:
GeForce RTX 3090
Onkyo TX-SR393
Samsung QE65Q9FNA

So the HDR switching in Windows is a public but undocumented API (it is present in the headers and the structures/functions have public names but it’s not to be found in any documentation). Perhaps these kinds of issues are why? It seems like your TV is having issues negotiating the signal when the refresh rate and HDR are both changed (and I say the TV because your AVR seems to have figured it out).

Since you are using an NVIDIA GPU, you may want to try switching to Vulkan and turning on the HDR Metadata Passthrough setting. Vulkan can be turned on via adding gpu-context=winvk to the mpv.conf. When using Vulkan and HDR Metadata Passthrough, NVIDIA GPUs switch the output to HDR themselves in the driver outside of Windows switching. Maybe this would help your situation.

Thank you for the suggestion! :slight_smile:

Exactly!
Only when the videofile requires Plex HTPC to change both the refresh rate and toggle HDR on, the “no signal” occurs.

Since changing just the resolution or just switching HDR on works, this would suggest that a delay between these 2 steps could prevent the problem, or? :thinking:

Like a “HDR change delay” setting similar to the “refresh rate change delay” setting that is already there. :slight_smile:

I have done that now, sadly it did not help.
I checked in the logs, and seems like Vulkan was used, so I guess I did change mpv.conf correctly.
Plex HTPC.log (999.4 KB)

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