Steam-Headless / docker-steam-headless

A Headless Steam Docker image supporting NVIDIA GPU and accessible via Web UI
GNU General Public License v2.0
734 stars 80 forks source link

Allow multiple registered custom resolutions for the virtual display #77

Open declanvong opened 10 months ago

declanvong commented 10 months ago

Is your feature request related to a problem?

No response

What is your feature request?

Currently, you can override the display resolution + refresh rate via the DISPLAY_SIZEW + DISPLAY_SIZEH + DISPLAY_REFRESH env variables. However, I'd like to connect from multiple devices that have different resolutions, and therefore would like to register more than one custom resolution into xrandr so that Moonlight can request those resolution changes upon connecting.

I'm happy to try and hack this in myself and raise a PR if you're happy with that, but just might be faster for you to do it since you're obviously way more familiar with the current scripts + how you'd like it done 😄

Are there any workarounds?

~Dump the required nvidia-xconfig calls into the "startup" scripts to ~/init.d. But that only solves it for me and I can imagine that if you have a hosted headless gaming server, it might not just be me that wants to access it from more than one device which may have differing resolutions.~

edit: actually, I thought that would work, but tried doing this manually as well and didn't seem to work. current workaround is to just change the env vars each time manually and then reboot the container. or perhaps run two steam-headless instances with different configurations.

Additional Context

No response

declanvong commented 10 months ago

I think this would probably mean changing the current env vars into a more structured list instead, e.g. DISPLAY_MODES=1920x1200:60 for single, and comma separated like DISPLAY_MODES=1920x1200:60,2176x1812:120.

Then parsing that appropriately and calling cvt / nvidia-xconfig for each one here: https://github.com/Steam-Headless/docker-steam-headless/blob/d2b4d2cae792a6446de1e0a88fc2d7ab1631354f/overlay/etc/cont-init.d/70-configure_xorg.sh#L45

?

survivor182ca commented 10 months ago

Pull request is there alteady but it takes forever to get merge...... : https://github.com/Steam-Headless/docker-steam-headless/pull/62