Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDR support for the Steam Deck #1117

Open
alon-z opened this issue Nov 16, 2023 · 472 comments
Open

HDR support for the Steam Deck #1117

alon-z opened this issue Nov 16, 2023 · 472 comments
Labels
enhancement New feature or request

Comments

@alon-z
Copy link

alon-z commented Nov 16, 2023

Is your feature request related to a problem? Please describe.
Users cannot enable the HDR option on the Steam Deck (Linux client) when connected to an external display that supports HDR.

Describe the solution you'd like
Being able to enable HDR setting in moonlight and see HDR content when streaming

Describe alternatives you've considered
Possible to use other clients for HDR (couldn't find one that supports HDR 4K 60hz)

Additional context
I have seen something about ffmpeg 6.1 that was released that enables HDR on vulkan? (I think)
I would love to help coding (golang knowledge) but I have 0 idea on where to start here.

Thank you :)

@Kabraxist
Copy link

Kabraxist commented Nov 17, 2023

Seconding this.
New Steam Deck OLEDs have builtin HDR support for its new display, but in the meantime Valve enabled HDR for first generation devices as well when connected to an external display that supports HDR. It seems to work well except Moonlight on Linux doesn't allow toggling the "HDR mode".

@cgutman
Copy link
Member

cgutman commented Nov 20, 2023

On Linux, HDR is only currently supported when streaming outside of a desktop environment (where Moonlight can take full control over the display hardware to configure HDR). In theory, it should be possible to support HDR using our existing EGL+GLES renderer, but I think Gamescope only supports HDR via Vulkan.

In any case, I am working on a Vulkan renderer that will support HDR on Linux from within Gamescope.

@cgutman cgutman added the enhancement New feature or request label Nov 20, 2023
@kaitolucifer
Copy link

streetpea/chiaki4deck#93
I think this could help.

@Jordan-Ch
Copy link

I use moonlight regularly to stream from my PC to my Nvidia Shield, often with HDR.

Recently grabbed an OLED Steam Deck hoping to stream with HDR to the Steam Deck. Is this currently not possible?

HDR option on the Linux build seems to be greyed out.

@eliw00d
Copy link

eliw00d commented Nov 28, 2023

I use moonlight regularly to stream from my PC to my Nvidia Shield, often with HDR.

Recently grabbed an OLED Steam Deck hoping to stream with HDR to the Steam Deck. Is this currently not possible?

HDR option on the Linux build seems to be greyed out.

Both the LCD and OLED Steam Decks now support HDR to external displays. Only the OLED supports it on its own display. However, the support for external displays is limited to games run on the Steam Decks themselves. Streaming apps like Moonlight need to add support for HDR separately. I hope that helps.

@HA55EHH
Copy link

HA55EHH commented Nov 29, 2023

It's the only thing holding back the Steam Deck for me at this point... hope you can figure it out!

@david-pili
Copy link

Not sure if you accept bounties or sponsorships for features but I'd happily pay to have this prioritized.

@arshiatn
Copy link

arshiatn commented Dec 5, 2023

On Linux, HDR is only currently supported when streaming outside of a desktop environment (where Moonlight can take full control over the display hardware to configure HDR). In theory, it should be possible to support HDR using our existing EGL+GLES renderer, but I think Gamescope only supports HDR via Vulkan.

In any case, I am working on a Vulkan renderer that will support HDR on Linux from within Gamescope.

Guys from chiaki4deck got the HDR working and are debugging. I have tested it and it works great. I don't know how they made HDR work but you can check it out:

streetpea/chiaki4deck#104

@ritmototal
Copy link

Also dying for HDR remoteplay on the steam deck so I can drop the nvidia shield and its horrible controls with moonlight due to its limited control configuration support. If the steam deck could do HDR remote play then it can be the ultimate TV Docked and Portable experience paired with a gaming PC.

cgutman added a commit that referenced this issue Dec 13, 2023
…ing support

Vulkan H.264/HEVC video decoding isn't supported with Fedora's Mesa binaries due to
patent issues, so only the VAAPI/DRM-PRIME import path was tested locally with ANV.

HDR video is getting tonemapped to my SDR monitor reasonably, so HDR output probably
works with GameScope but I haven't confirmed yet.

See #1117
@zachrd
Copy link

zachrd commented Dec 13, 2023

Happy to test this right now! Let me know what if any logs i can provide.

@zachrd

This comment was marked as resolved.

@cgutman
Copy link
Member

cgutman commented Dec 13, 2023

Yep, that's expected if you're using the AppImage build from CI. It doesn't have the required libraries yet for Vulkan. I'm working on that now.

@cgutman
Copy link
Member

cgutman commented Dec 14, 2023

You can try this AppImage - https://ci.appveyor.com/project/cgutman/moonlight-qt/builds/48754905/job/7r54vi0b48f1b6n1/artifacts

You'll need to make sure you run it from within the regular Steam Deck UI rather than the desktop mode since it requires Gamescope for HDR.

There are still known issues with the Vulkan renderer but I think it should work for testing.

@TheBacon00
Copy link

You can try this AppImage - https://ci.appveyor.com/project/cgutman/moonlight-qt/builds/48754905/job/7r54vi0b48f1b6n1/artifacts

You'll need to make sure you run it from within the regular Steam Deck UI rather than the desktop mode since it requires Gamescope for HDR.

There are still known issues with the Vulkan renderer but I think it should work for testing.

I actually just tried this build on my Steam Deck (from the "Game Mode" UI by adding the AppImage as a non-Steam game), HDR option is still greyed out. Do I need to set an env var or something to enable the new Vulkan renderer?

@zachrd
Copy link

zachrd commented Dec 14, 2023

You can try this AppImage - https://ci.appveyor.com/project/cgutman/moonlight-qt/builds/48754905/job/7r54vi0b48f1b6n1/artifacts
You'll need to make sure you run it from within the regular Steam Deck UI rather than the desktop mode since it requires Gamescope for HDR.
There are still known issues with the Vulkan renderer but I think it should work for testing.

I actually just tried this build on my Steam Deck (from the "Game Mode" UI by adding the AppImage as a non-Steam game), HDR option is still greyed out. Do I need to set an env var or something to enable the new Vulkan renderer?

Going to test the JSON here: FrogTheFrog

@FrogTheFrog posted this on the Discord the other day.

@FrogTheFrog
Copy link
Contributor

You can try this AppImage - https://ci.appveyor.com/project/cgutman/moonlight-qt/builds/48754905/job/7r54vi0b48f1b6n1/artifacts

You'll need to make sure you run it from within the regular Steam Deck UI rather than the desktop mode since it requires Gamescope for HDR.

There are still known issues with the Vulkan renderer but I think it should work for testing.

I have tested AppImage (and my flatpak build), both with no luck.

I will generate some logs from AppImage in gamemode and add them here.

@arshiatn
Copy link

arshiatn commented Dec 14, 2023

You can try this AppImage - https://ci.appveyor.com/project/cgutman/moonlight-qt/builds/48754905/job/7r54vi0b48f1b6n1/artifacts
You'll need to make sure you run it from within the regular Steam Deck UI rather than the desktop mode since it requires Gamescope for HDR.
There are still known issues with the Vulkan renderer but I think it should work for testing.

I actually just tried this build on my Steam Deck (from the "Game Mode" UI by adding the AppImage as a non-Steam game), HDR option is still greyed out. Do I need to set an env var or something to enable the new Vulkan renderer?

Same. I just added Applmage to Steam after making it executable and HDR (Experimental) is grayed out. I thought that I may have to connect to my PC first then change the options and it is still grayed out. I tried out every combination of Display Mode X Video Decoder X Video Codec and HDR is still grayed out. Restarting the steam deck didn't do anything either.

Using Windows 11 with a LG C2 OLED and (HDR on before connecting to my PC).

I have no idea how to generate logs for you but it seems like that @FrogTheFrog is going to generate his logs.

@FrogTheFrog
Copy link
Contributor

FrogTheFrog commented Dec 14, 2023

So here are some logs (PLVK_LOG_LEVEL=5, for debug logs) for SteamDeck running from gamemode:
with_prefer_vulkan.log
with_prefer_vulkan_and_force_vaapi.log
without_prefer_vulkan.log

I noticed there is SDL Error (0): pl_map_avframe_ex() failed, but have no idea what this means :/

@matte-schwartz
Copy link

matte-schwartz commented Dec 15, 2023

This latest AppImage is a winner! Very impressive work, devs. System details:
Nobara Linux, Kernel 6.6.7-200, Steam Deck OLED. Added the AppImage as a non-Steam game, switched to game mode and HDR was available as an option within Moonlight’s settings.

IMG_0385
IMG_0386

@johnyz333
Copy link

This latest AppImage is a winner! Very impressive work, devs. System details: Nobara Linux, Kernel 6.6.7-200, Steam Deck OLED. Added the AppImage as a non-Steam game, switched to game mode and HDR was available as an option within Moonlight’s settings.

IMG_0385 IMG_0386

Hmmm… HDR is grayed out on my end…

@matte-schwartz
Copy link

This latest AppImage is a winner! Very impressive work, devs. System details: Nobara Linux, Kernel 6.6.7-200, Steam Deck OLED. Added the AppImage as a non-Steam game, switched to game mode and HDR was available as an option within Moonlight’s settings.
IMG_0385 IMG_0386

Hmmm… HDR is grayed out on my end…

Even on the build from an hour ago? The previous ones I tried hadn’t worked but this worked OOTB for me… happy to dump logs if it would be useful
IMG_0391

@johnyz333
Copy link

This latest AppImage is a winner! Very impressive work, devs. System details: Nobara Linux, Kernel 6.6.7-200, Steam Deck OLED. Added the AppImage as a non-Steam game, switched to game mode and HDR was available as an option within Moonlight’s settings.
IMG_0385 IMG_0386

Hmmm… HDR is grayed out on my end…

Even on the build from an hour ago? The previous ones I tried hadn’t worked but this worked OOTB for me… happy to dump logs if it would be useful IMG_0391

Can you link the build please…

@cgutman
Copy link
Member

cgutman commented Dec 15, 2023

Here's a link to the working AppImage build with HDR support: https://ci.appveyor.com/project/cgutman/moonlight-qt/builds/48762923/job/8ciibh342qicq980/artifacts

@chipgw
Copy link

chipgw commented Dec 15, 2023

I can confirm latest build is working with Sunshine on Windows to host
if you aren't getting it working here are some things to try:

  • what remains of the NVidia driver host did not work for me; upon starting a stream Moonlight would say the PC can't encode AV1 or H265 in HDR (my 30-series GPU can't encode AV1 at all, so that one at least makes total sense)
  • you need HDR turned on for the display you're streaming from in Windows display settings on the host machine; which yeah if Windows isn't outputting HDR then there's no HDR to stream.

@dylanfrankcom
Copy link
Contributor

Thank you for your work on this! It looks like Appveyor has hit its download quota:

{"message":"Artifacts download limit (1024 MB/day) exceeded."}

Is there a mirror available?

@matte-schwartz
Copy link

Thank you for your work on this! It looks like Appveyor has hit its download quota:

{"message":"Artifacts download limit (1024 MB/day) exceeded."}

Is there a mirror available?

I anticipated this happening and uploaded a mirror here: https://pixeldrain.com/u/1zMvXLqi @ cgutman please feel free to delete if this is not okay

@Moredread
Copy link

I've tried the Appveyor AppImage on my OLED Steamdeck with a Nvidia 2080TI and Sunshine on my PC.

I can select HDR in Moonlight, but starting the stream produces a black screen.

When manually changing the codec to HVEC (AV1 encoding isn't supported by the graphics card) I get a warning "This PC's GPU doesn't support HEVC Main 10 decoding for HDR streaming" and the stream is shown in SDR (i.e. washed out colors and no HDR indicator in the brightness settings)

@parski
Copy link

parski commented Mar 25, 2024

Been following this issue for a while and anticipating the feature. Gave it a shot today for the first time using the AppImage from @FrogTheFrog. I should mention that I'm running ChimeraOS, not SteamOS. I'm running the Moonlight from the controller based UI using gamescope, not the desktop. I have HDR enabled and working using gamescope. However, I'm seeing some issues:

I'm streaming at 120 Hz in 2160p with the bandwidth capped at 150 Mbps but when I enable HDR I get a "rendering frame rate" of 60 fps as opposed to 120 fps when it's disabled. I also get a jitter of constant 50% dropped frames (it flickered to just under that just when I took the photo but it's pretty much locked at 50% when I've been testing this). Not sure why this is happening. Also, the image is not a 60 fps experience. It's a stuttery mess, really. Anyone else get issues like this?

Here's what it looks like with HDR disabled with this AppImage or the latest stable build:

Screenshot 2024-03-25 at 16 21 40

Here's what it's like with HDR enabled:

Screenshot 2024-03-25 at 16 21 33

However, the HDR looks phenomenal. It just runs like crap.

@systox
Copy link

systox commented Mar 25, 2024

Been following this issue for a while and anticipating the feature. Gave it a shot today for the first time using the AppImage from @FrogTheFrog. I should mention that I'm running ChimeraOS, not SteamOS. I'm running the Moonlight from the controller based UI using gamescope, not the desktop. I have HDR enabled and working using gamescope. However, I'm seeing some issues:

I'm streaming at 120 Hz in 2160p with the bandwidth capped at 150 Mbps but when I enable HDR I get a "rendering frame rate" of 60 fps as opposed to 120 fps when it's disabled. I also get a jitter of constant 50% dropped frames (it flickered to just under that just when I took the photo but it's pretty much locked at 50% when I've been testing this). Not sure why this is happening. Also, the image is not a 60 fps experience. It's a stuttery mess, really. Anyone else get issues like this?

Here's what it looks like with HDR disabled with this AppImage or the latest stable build:

Screenshot 2024-03-25 at 16 21 40 Here's what it's like with HDR enabled: Screenshot 2024-03-25 at 16 21 33 However, the HDR looks phenomenal. It just runs like crap.

Out of curiosity, how’s the performance with HDR if you cap it to something low like 40 mbps? Just to test.

@parski
Copy link

parski commented Mar 25, 2024

I tried capping it lower but it made no difference to performance.

@parski
Copy link

parski commented Mar 28, 2024

I did some more testing just now. I've tried setting the resolution lower, 1080p and 720p. I've limited the bandwidth cap at various levels (~100/80/40/20) down to around 10 Mbps at these resolutions. I've tried capping the frame rate at 120 and at 60. It all works as expected until I activate HDR. Then the client will start exhibiting the previously described behavior. Namely: performance will tank. At 120 fps the statistics overlay will report a rendered frame rate of 60 and a frame drop due to jitter of 50%. Capping the frame rate to 60 will report a frame drop of 0% but the output is very clearly not 60 fps. This is regardless of resolution and bandwidth cap. Deactivating HDR fixes everything immediately.

@parski
Copy link

parski commented Mar 28, 2024

Here's a log of running 2160p at 120 fps with a bandwidth cap of 150 Mbps with HDR enabled. The session is exhibiting the issues described above. Host is a Windows 11 PC with a 4090 running Sunshine. Client is a ChimeraOS PC with a Ryzen 8700G.

moonlight.log

@Erfboom
Copy link

Erfboom commented Mar 28, 2024 via email

@parski
Copy link

parski commented Mar 29, 2024

With a 3080 and windows 10, I can stream hdr with no jitter or connection issues. Might be your setup.

Is 2160p at 120 fps in HDR working in gamescope for you?

@Erfboom
Copy link

Erfboom commented Mar 29, 2024 via email

@Erfboom
Copy link

Erfboom commented Mar 29, 2024 via email

@systox
Copy link

systox commented Mar 29, 2024

I think that hardware and setup is different enough to deserve its own thread. Hope you find a solution!

@RyVee
Copy link

RyVee commented Mar 29, 2024

Sunshine seems to be a factor in the stuttering. I was forced to switch to it with the new Nvidia App beta. I didn't have any issues with the HDR client on Native Gamestream. Meanwhile Sunshine even on the release client has WAY more issues.

@aenertia
Copy link

aenertia commented Apr 4, 2024

Now that kwin_wayland has HDR support would it be possible to look at adding this to work sans needing to proxy via gamescope?

@systox
Copy link

systox commented Apr 14, 2024

Just wondering, did anyone ever stumble on a solution for the raised black levels when using HDR?

Saw the CRU comments above but not sure if this applies to those of us using VDD. (https://github.com/itsmikethetech/Virtual-Display-Driver)

@dylanfrankcom
Copy link
Contributor

dylanfrankcom commented Apr 19, 2024

It would awesome to get an update or more insight on this issue. I don't believe the Reshade workaround is really viable as it appears to me that it absolutely crushes the image, unless there is some calibration I haven't done properly.

Just to recap, enabling the HDR toggle within Moonlight causes elevated black levels on the Steam Deck OLED. The elevated black levels are present when the host is in SDR or HDR mode, specifically when using the HEVC Main 10 codec. Not sure if this happens with AV1 and apparently BOE panels may not be affected, but I have my doubts about that.

I don't have any knowledge in the area but I wonder if this might be an issue with HEVC Main 10 hardware decoding within either Vulkan or Gamescope or if it is really just some metadata mismatch somewhere.

I believe the following should theoretically fix the problem but does not:

//plvk.cpp

// libplacebo assumes a minimum luminance value of 0 means the actual value was unknown.
// Since we assume the host values are correct, we use the PL_COLOR_HDR_BLACK constant to
// indicate infinite contrast.
//
// NB: We also have to check that the AVFrame actually had metadata in the first place,
// because libplacebo may infer metadata if the frame didn't have any.
if (av_frame_get_side_data(frame, AV_FRAME_DATA_MASTERING_DISPLAY_METADATA) && !mappedFrame->color.hdr.min_luma) {
    mappedFrame->color.hdr.min_luma = PL_COLOR_HDR_BLACK;
}

I wonder if @EndlesslyFlowering could chime in with their thoughts since they seemed to have some great insights here back in December as well as a similar issue in MPV.

@systox
Copy link

systox commented Apr 19, 2024

It would awesome to get an update or more insight on this issue. I don't believe the Reshade workaround is really viable as it appears to me that it absolutely crushes the image, unless there is some calibration I haven't done properly.

Just to recap, enabling the HDR toggle within Moonlight causes elevated black levels on the Steam Deck OLED. The elevated black levels are present when the host is in SDR or HDR mode, specifically when using the HEVC Main 10 codec. Not sure if this happens with AV1 and apparently BOE panels may not be affected, but I have my doubts about that.

I don't have any knowledge in the area but I wonder if this might be an issue with HEVC Main 10 hardware decoding within either Vulkan or Gamescope or if it is really just some metadata mismatch somewhere.

I believe the following should theoretically fix the problem but does not:

//plvk.cpp

// libplacebo assumes a minimum luminance value of 0 means the actual value was unknown.
// Since we assume the host values are correct, we use the PL_COLOR_HDR_BLACK constant to
// indicate infinite contrast.
//
// NB: We also have to check that the AVFrame actually had metadata in the first place,
// because libplacebo may infer metadata if the frame didn't have any.
if (av_frame_get_side_data(frame, AV_FRAME_DATA_MASTERING_DISPLAY_METADATA) && !mappedFrame->color.hdr.min_luma) {
    mappedFrame->color.hdr.min_luma = PL_COLOR_HDR_BLACK;
}

I wonder if @EndlesslyFlowering could chime in with their thoughts since they seemed to have some great insights here back in December as well as a similar issue in MPV.

Can confirm, I use the AV1 protocol the majority of the time and it happens there too.

@dylanfrankcom
Copy link
Contributor

dylanfrankcom commented Apr 28, 2024

I think I was able to fix the elevated black level issue if anyone wants to give it a shot. Can someone who uses AV1 test it out and report back?

The AppImage on AppVeyor is available here.

@Tikaroz
Copy link

Tikaroz commented Apr 28, 2024

for me, using AV1 testing with Dead Space Remake, the raised black is still there comparing to my qd-oled monitor.
For example when I'm in dark area with light source behind me I wouldn't be able to see anything down the hallway on the monitor but, on SD OLED the light source from behind give out foggy white aura if I can call it that, so I can make out details on the wall where I shouldn't.
If I just test with black picture it does seem black so idk if it's just while gaming.
I tried to take pics for comparison but it doesn't show it well sorry for that.

@arshiatn
Copy link

arshiatn commented Apr 28, 2024

I think I was able to fix the elevated black level issue if anyone wants to give it a shot. Can someone who uses AV1 test it out and report back?

The AppImage on AppVeyor is available here.

I tested it with highest bitrate possible (150mbps) on 1920x1200 while using an ethernet connection. I am on stable 3.5.19 and it works great. While looking at a black picture, it doesn't look gray anymore. I tried out 2410 or something from last december, newest one and yours. Only yours show the black picture as black. The rest got elevated black level. (On AV1 and H265)

To Tikaroz, I think the problem should be a mix of compression artifacts and "mura".

Edit: small note: last time I did a HDR calibration on my own pc while streaming it to my Steam Deck, it was this January. I am pretty sure, highlights would clip at around 930-950 so I had the settings at 0 950 950. Right now, in all 3 versions, I stated above, it clips at around 900nits. So I have 0 900 900 in windows HDR calibration. It doesn't really matter but I wanted to mention it. It could be Steam's HDR fix or Idk Sunshine maybe.

@dylanfrankcom
Copy link
Contributor

dylanfrankcom commented Apr 28, 2024

Good to know! Thanks for the quick feedback!

@Tikaroz, unfortunately, I don't have Dead Space to test this area specifically. I've been relying on a mix of the boot screen of Ori and the Will of The Whisps and the Vesa DisplayHDRTest application. I don't think I am able to see any raised black levels when playing Ori and the game seems to display pretty much the same as running natively on the deck. As @arshiatn mentioned, I too believe this could be a combination of compression artifacts and mura. I also have a QD-OLED display, the Alienware AW3423DWF, and I don't believe it and the Steam Deck would be directly comparable since they have different panels and coatings. I believe the best comparison would be to run a game natively on the deck and then compare to the same game running via Moonlight.

To add on to what @arshiatn had mentioned, I've calibrated my display through Windows HDR Calibration to 0, 1000, 1000 with native saturation (I'm not sure how to discern if something is clipping or not). In CRU, the HDR Static Metadata of my dummy plug HDMI adapter is set to Max Luminance 103, Max frame-avg 103, and Min Luminance to blank. In Nvidia Control Panel's Change resolution panel; Desktop Color Depth: Highest, Output color depth: 10 bpc, Output color format: RGB, Output Dynamic Range: Full. I did test with limited set here and was still able to receive true black via Moonlight.

I have made a build of Moonlight that removes the setting of PL_COLOR_HDR_BLACK as noted in my comment above.

Here's an explanation of that value:

// This defines the default black point assumed for "infinite contrast" HDR
// displays. This is not exactly 0.0 because a value of 0.0 is interpreted
// as "unknown / missing metadata" inside struct pl_hdr_metadata, and also
// to avoid numerical issues in a variety of tone mapping functions.
// Essentially, a black level below this number is functionally meaningless
// inside libplacebo, and will be clamped to this value regardless.
//
// The value used here (1e-6) is about one 13-bit PQ step above absolute zero,
// which is a small fraction of the human JND at this brightness level, and also
// about 3 bits above the floating point machine epsilon.
#define PL_COLOR_HDR_BLACK 1e-6f

I don't see any difference with this removed but maybe you will!

I've published the build on PixelDrain so we don't have to wait for AppVeyor. Feel free to give it a try and report back! I'm not really a fan of having builds on random hosting sites floating around so I will probably remove the link after you try. Everyone else should grab the build from AppVeyor.

@Tikaroz
Copy link

Tikaroz commented Apr 28, 2024

@dylanfrankcom Same brand here, so I went and test with inside and ori and both are ink black while playing on deck.
I think both of you are right on the spot about artifact, the black image is ink black like on the monitor.
Great build!

@systox
Copy link

systox commented Apr 28, 2024

cannot test. appveyor reached its download limit

@dylanfrankcom
Copy link
Contributor

dylanfrankcom commented Apr 28, 2024

@systox, here is a mirror of build 2420: https://pixeldrain.com/u/gqgGALkC

SHA-256: 6b74af08df55bcdc6f54b14ad0dc5f0ea99cf561ffc8faa657e2767be908904e Moonlight-r2420-x86_64.AppImage

@azafrob
Copy link

azafrob commented Apr 29, 2024

Can confirm @dylanfrankcom fix works. Now I get true blacks. Tested on 512gb Steamdeck OLED while using H265 at all brightness levels. Thanks!

@systox
Copy link

systox commented Apr 29, 2024

@systox, here is a mirror of build 2420: https://pixeldrain.com/u/gqgGALkC

SHA-256: 6b74af08df55bcdc6f54b14ad0dc5f0ea99cf561ffc8faa657e2767be908904e Moonlight-r2420-x86_64.AppImage

Setup:
Windows 11, rtx 4090, stock sunlight settings, AV1, HDR enabled, and same old HDR configuration on windows tailored to the steam deck oled screen.

I did not extensively test for unintended side effects but dylanfrankcom's patch seems to address the lifted blacks I was experiencing before. True black now actually appears to turn off the pixels on the steamdeck oled display.

I think this might unmask what might be an extremely subtle artifact associated with black on an oled screen. I'll try to capture an example for posterity. Either way, this was a net positive. Thank you.

Update I’ve attached a photo of the oled artifact for funsies. Might help prevent confusion in the future. Again, I don’t think this relates to moonlight.

To generate the image I had to use a 10 second exposure on an iphone. that’s how imperceptible it is Irl. The image shows a persistent smear across the screen in and around a previous path of the mouse cursor. The mouse is off screen and the image should be uniformly black (ignore green lights, that’s a photo capture issue). No cursor motion occurred directly before or during the long photo exposure.

IMG_0600

@JustPlainGarak
Copy link

Good to know! Thanks for the quick feedback!

@Tikaroz, unfortunately, I don't have Dead Space to test this area specifically. I've been relying on a mix of the boot screen of Ori and the Will of The Whisps and the Vesa DisplayHDRTest application. I don't think I am able to see any raised black levels when playing Ori and the game seems to display pretty much the same as running natively on the deck. As @arshiatn mentioned, I too believe this could be a combination of compression artifacts and mura. I also have a QD-OLED display, the Alienware AW3423DWF, and I don't believe it and the Steam Deck would be directly comparable since they have different panels and coatings. I believe the best comparison would be to run a game natively on the deck and then compare to the same game running via Moonlight.

To add on to what @arshiatn had mentioned, I've calibrated my display through Windows HDR Calibration to 0, 1000, 1000 with native saturation (I'm not sure how to discern if something is clipping or not). In CRU, the HDR Static Metadata of my dummy plug HDMI adapter is set to Max Luminance 103, Max frame-avg 103, and Min Luminance to blank. In Nvidia Control Panel's Change resolution panel; Desktop Color Depth: Highest, Output color depth: 10 bpc, Output color format: RGB, Output Dynamic Range: Full. I did test with limited set here and was still able to receive true black via Moonlight.

I have made a build of Moonlight that removes the setting of PL_COLOR_HDR_BLACK as noted in my comment above.

Here's an explanation of that value:

// This defines the default black point assumed for "infinite contrast" HDR
// displays. This is not exactly 0.0 because a value of 0.0 is interpreted
// as "unknown / missing metadata" inside struct pl_hdr_metadata, and also
// to avoid numerical issues in a variety of tone mapping functions.
// Essentially, a black level below this number is functionally meaningless
// inside libplacebo, and will be clamped to this value regardless.
//
// The value used here (1e-6) is about one 13-bit PQ step above absolute zero,
// which is a small fraction of the human JND at this brightness level, and also
// about 3 bits above the floating point machine epsilon.
#define PL_COLOR_HDR_BLACK 1e-6f

I don't see any difference with this removed but maybe you will!

I've published the build on PixelDrain so we don't have to wait for AppVeyor. Feel free to give it a try and report back! I'm not really a fan of having builds on random hosting sites floating around so I will probably remove the link after you try. Everyone else should grab the build from AppVeyor.

This build works flawlessly on both my Deck OLED and my Bazzite HTPC streaming from my host PC with a 7900 XTX, tested from Fedora 40 and Win 11. AV1 and HEVC both worked as well. Looking good!

@kbdick24
Copy link

kbdick24 commented May 6, 2024

I think I was able to fix the elevated black level issue if anyone wants to give it a shot. Can someone who uses AV1 test it out and report back?

The AppImage on AppVeyor is available here.

I can't seem to use this AppImage. The executable exits immediately upon launch.

What I did to execute it:

  1. Downloaded the file in desktop mode
  2. Went to Steam and used "add non-steam app", browsing to and selecting the downloaded file.
  3. Switched to game mode
  4. Attempted to execute the added app.

Any idea what might be going wrong here? The previous version did not work either, but the first version posted in this thread did (and still does), though it no longer works with HDR.

@HORSE-PASTE
Copy link

I think I was able to fix the elevated black level issue if anyone wants to give it a shot. Can someone who uses AV1 test it out and report back?
The AppImage on AppVeyor is available here.

I can't seem to use this AppImage. The executable exits immediately upon launch.

What I did to execute it:

  1. Downloaded the file in desktop mode
  2. Went to Steam and used "add non-steam app", browsing to and selecting the downloaded file.
  3. Switched to game mode
  4. Attempted to execute the added app.

Any idea what might be going wrong here? The previous version did not work either, but the first version posted in this thread did (and still does), though it no longer works with HDR.

Make sure you right click the file and make it executable.

@EliSantana1
Copy link

I think I was able to fix the elevated black level issue if anyone wants to give it a shot. Can someone who uses AV1 test it out and report back?
The AppImage on AppVeyor is available here.

I can't seem to use this AppImage. The executable exits immediately upon launch.

What I did to execute it:

1. Downloaded the file in desktop mode

2. Went to Steam and used "add non-steam app", browsing to and selecting the downloaded file.

3. Switched to game mode

4. Attempted to execute the added app.

Any idea what might be going wrong here? The previous version did not work either, but the first version posted in this thread did (and still does), though it no longer works with HDR.

Run the Appimage by itself from the Applications folder directly first while in Desktop mode. After that it will open from Steam in gaming mode

@kbdick24
Copy link

kbdick24 commented May 6, 2024

I think I was able to fix the elevated black level issue if anyone wants to give it a shot. Can someone who uses AV1 test it out and report back?
The AppImage on AppVeyor is available here.

I can't seem to use this AppImage. The executable exits immediately upon launch.
What I did to execute it:

  1. Downloaded the file in desktop mode
  2. Went to Steam and used "add non-steam app", browsing to and selecting the downloaded file.
  3. Switched to game mode
  4. Attempted to execute the added app.

Any idea what might be going wrong here? The previous version did not work either, but the first version posted in this thread did (and still does), though it no longer works with HDR.

Make sure you right click the file and make it executable.

This worked, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests