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
Comments
Seconding this. |
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. |
streetpea/chiaki4deck#93 |
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. |
It's the only thing holding back the Steam Deck for me at this point... hope you can figure it out! |
Not sure if you accept bounties or sponsorships for features but I'd happily pay to have this prioritized. |
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: |
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. |
…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
Happy to test this right now! Let me know what if any logs i can provide. |
This comment was marked as resolved.
This comment was marked as resolved.
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. |
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. |
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. |
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. |
So here are some logs ( I noticed there is |
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 |
I can confirm latest build is working with Sunshine on Windows to host
|
Thank you for your work on this! It looks like Appveyor has hit its download quota:
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 |
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) |
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: Here's what it's like with HDR enabled: 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. |
I tried capping it lower but it made no difference to performance. |
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. |
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. |
With a 3080 and windows 10, I can stream hdr with no jitter or connection
issues. Might be your setup.
…On Thu, Mar 28, 2024, 1:19 PM Pär Strindevall ***@***.***> wrote:
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. Client is a ChimeraOS PC with a Ryzen
8700G.
moonlight.log
<https://gist.githubusercontent.com/parski/27b78d13874705cd44dd5f37d6cc8f1a/raw/0214366c2ce41b13e2ac789b31b6891d5cf629ee/gistfile1.txt>
—
Reply to this email directly, view it on GitHub
<#1117 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANOCNB7WKPTL3RZYTPAHVRLY2Q7IVAVCNFSM6AAAAAA7N3FBA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRVG4ZTEOJZGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Is 2160p at 120 fps in HDR working in gamescope for you? |
On my steamdeck, through steam which uses gamescope, my host is set to
2560 x 1440 @120 HDR and the client is set to 1920 x 1080 @60 hdr on. I have no
issues with stuttering. I even have HAGS on and modded DLSS Frame
Generation.
On my Linux desktop, using gamescope whether it's the native rpm or the App
Image, setting gamescope to 2560 x 1440 @120, HDR off, I can stream. If I set
--hdr-itm and set the max nit values, I can even tone map the hdr image
coming through.
What I can't do is --hdr-enable and --hdr-debug-force-output/support
because I'll get a vulkan swap chain error about a missing vulkan extension
for the hdr10+pq signal coming through. Something is not converting that
signal to something my Intel gpu can handle. In mpv I can specify the color
space for the output and it'll convert the dv signal nicely.
The appimage I get from this thread is the only one where gamescope will
allow me to tick the hdr box in moonlight, the rpm won't.
Using gamescope and Intel gpu, I'll see black frames every few seconds when
I'm streaming. The choppiness is also more noticeable along with visible
compression artifacts and banding.
Without gamescope and the native rpm, it's buttery smooth @120, no
compression artifacts, slight banding.
Of course, native moonlight can't tone map hdr nor will gamescope allow
moonlight to check the hdr box.
I'm guessing it's something to do with EGLS and Vulkan back ends, but I
don't know how to build moonlight with one or the other.
On Fri, Mar 29, 2024, 1:10 PM Pär Strindevall ***@***.***> wrote:
|
I should also note I've changed sunshine settings frok their default for
higher quality. I think I'm using either p6 or p7 and a full resolution
double pass as well as some other bandwidth related settings.
I can stream ***@***.*** over wifi with the client at 75 mpbs bitrate on the
desktop and 50mpbs on the steamdeck.
…On Fri, Mar 29, 2024, 1:10 PM Pär Strindevall ***@***.***> wrote:
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?
—
Reply to this email directly, view it on GitHub
<#1117 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANOCNB3KQ6AYH3GINQALGU3Y2WG6DAVCNFSM6AAAAAA7N3FBA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRXGUYDKMZVGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I think that hardware and setup is different enough to deserve its own thread. Hope you find a solution! |
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. |
Now that kwin_wayland has HDR support would it be possible to look at adding this to work sans needing to proxy via gamescope? |
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) |
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. |
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. |
for me, using AV1 testing with Dead Space Remake, the raised black is still there comparing to my qd-oled monitor. |
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. |
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 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!
|
@dylanfrankcom Same brand here, so I went and test with inside and ori and both are ink black while playing on deck. |
cannot test. appveyor reached its download limit |
@systox, here is a mirror of build 2420: https://pixeldrain.com/u/gqgGALkC SHA-256: 6b74af08df55bcdc6f54b14ad0dc5f0ea99cf561ffc8faa657e2767be908904e Moonlight-r2420-x86_64.AppImage |
Can confirm @dylanfrankcom fix works. Now I get true blacks. Tested on 512gb Steamdeck OLED while using H265 at all brightness levels. Thanks! |
Setup: 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. |
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! |
I can't seem to use this AppImage. The executable exits immediately upon launch. What I did to execute it:
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. |
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 |
This worked, thank you! |
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 :)
The text was updated successfully, but these errors were encountered: