antonioginer / switchres

Modeline generation engine for emulation
49 stars 12 forks source link

how to use switchres / groovymame in Xwayland ? #78

Closed Saroumane closed 3 years ago

Saroumane commented 3 years ago

Hello,

I'm aware that switchres requires X11, so this is more a question (or feature request ?) I have found no equivalent of switchres for Wayland, but Wayland is using X11 session (Xwayland) to launch X11 apps. So maybe there is a way to use switchres in Xwayland (for groovymame) ?

Thanks !

substring commented 3 years ago

Hi!

There is not RandR equivalent in Wayland to my knowledge as, according to what I've read in the past, Wayland developpers consider that a user shouldn't change the resolution. So you'd better forget about GM in Wayland, we didn't even try to port switchres to Wayland, knowing it wouldn't work.

Saroumane commented 3 years ago

Yes, I know this about Wayland, but I was referring Xwayland (which is X inside wayland, for apps that are not Wayland-native, if I'm not mistaken)

(Oops missclick)

In fact, it seems that Valve's gamescope manage to do it : https://github.com/Plagman/gamescope

You can spoof a virtual screen with a desired resolution and refresh rate as the only thing the game sees, and control/resize the output as needed.

// Upscale a 720p game to 1440p with integer scaling gamescope -w 1280 -h 720 -W 2560 -H 1440 -n

I'm not sure it implements Modelines insertion (so maybe we still have to pre-inject them with an edid.bin file), but it seems to allow switching !

(I'm no dev, I can't really help, sorry...)

substring commented 3 years ago

switchres is all about exact modelines, not just resolutions that are read from EDID. We need a librandr equivalent in wayland, which doesn't exist to my knowledge.

gamescope relies on existing resolutions and just sets them, in no way it computes new resolutions (ith the few minutes I spent to understand the code). It's based on KMS/DRM, and KMS/DRM doesn't support custom resolutions, this was removed in kernel 4.10-rc3 as it was "unused and not working" according to the dev.