Daemon icon indicating copy to clipboard operation
Daemon copied to clipboard

Some systems don't support 640×480 resolution so we can't use that as a fallback in all cases

Open illwieckz opened this issue 9 months ago • 3 comments

When the engine fails to run on the configured resolution, it falls back on 640×480.

But here on some Lenovo Thinkpad X1 carbon laptop (4th gen), that resolution isn't supported:

[28360.179490] i915 0000:00:02.0: [drm] User-defined mode not supported: "640x480": 60 23875 640 656 720 800 480 481 484 497 0x20 0x6

In fact the last time it tried to use that resolution the while display server crashed. Having the display server crashing is likely a bug in some underlying software like a driver bug, but the game can't run anyway.

So, when the configured resolution is not renderable, we may first fallback to the lowest resolution from the list of known resolution if the currently configured one is not part of it, then only try 640×480 is last resort.

illwieckz avatar Feb 25 '25 08:02 illwieckz

Could we change the fallback to be: start in 640x480 and in windowed mode? Would that solve this problem?

cu-kai avatar Feb 25 '25 12:02 cu-kai

Yes we can, it would work I guess.

illwieckz avatar Feb 25 '25 12:02 illwieckz

In fact 640x480 in windowed mode is the fallback: https://github.com/DaemonEngine/Daemon/blob/96f06112cc28ff0561bc41c39b42758a71a637d3/src/engine/sys/sdl_glimp.cpp#L2770 (The false second argument means not fullscreen). Though it is not tried if the first attempt was 640x480 (via r_mode 3) and full screen.

This might not work correctly when the originally requested config was fullscreen though, because it tries making a window in windowed mode, but does not update the r_fullscreen cvar. So probably the code that checks for r_fullscreen modifications will immediately try to put it back in full-screen mode.

slipher avatar Mar 08 '25 07:03 slipher