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

Switchres on Steam Deck #97

Open
LichLord91 opened this issue Nov 15, 2022 · 3 comments
Open

Switchres on Steam Deck #97

LichLord91 opened this issue Nov 15, 2022 · 3 comments

Comments

@LichLord91
Copy link

LichLord91 commented Nov 15, 2022

Hello!

I'm trying to get switchres and 15khz output from Steam Deck. I've actually successfully patched the Steam Deck's kernel with the following repo https://github.com/D0023R/linux_kernel_15khz . Steam Deck is on 5.13 kernel atm if that helps.

Anyway I compiled the swithres repo here and tried to just test it on the built in screen and once with a external lcd screen in KMS/DRM gamescope mode (while in the normal Steam Deck UI game mode) (with non 15khz outputs) but looks like I'm having issues , I've added the debug logging below including the drm card devices. eDP is the laptop where DP is the external adapter.

I understand that the steam deck's custom APU may not work here but wanted to see if it could haha. let me know if I'm on the right direction or not even close.

(Steam deck uses Xwayland for the gamescope session)

image

image

xwayland while connected to external monitor through DP-1

image

xwayland while connected to internal monitor through eDP-1

image

@substring
Copy link
Collaborator

Hi,
The logs say it didn't find a X session, so it went the DRM way. But it couldn't find an existing DRM master to hijack, nor set itself as DRM master, so it failed.

So among various things that come to my mind :

  • you may have not compiled the kernel with the KMS user modes patch, D00zer added it recently in the 6.0 branch -> 05_linux_switchres_kms_drm_modesetting.patch. The other patches in that kernel version are worth, really, even more on a AMD APU
  • X support wasn't compiled in switchres (you should have the information when building). You'd need to install a few packages, I don't know if Steam has them, nor if Steams uses the default Arch repos
  • we do not support wayland (that's for sure, and we may never will) since wayland mind on switching resolution is more or less "why would the user change resolution ?" unless it changed
  • knowing Wayland is built on top of DRM, we'd need further investigation to find the DRM backend doesn't work with wayland.
  • try in a terminal session, not from the desktop so you have good old DRM once you have patched the kernel with the fore mentionned patch. We're doing our best to help emulators integrate switchres so modeswitching is absolutely transparent to them

To tell you the truth, I personnaly switched to wayland a few weeks ago only because I was having heavy tearing in X after upgrading my daily Ubuntu desktop to 22.04 + BIOS update.

Pinging @D0023R if he has free time and wanna investigate further on that.

@LichLord91
Copy link
Author

Hey Substring! Thanks for the reply. Just to let you know I'm very new to all this retro gaming tech and been researching quite a bit haha so if i missed some obvious things that's probably why.

you may have not compiled the kernel with the KMS user modes patch, D00zer added it recently in the 6.0 branch -> 05_linux_switchres_kms_drm_modesetting.patch. The other patches in that kernel version are worth, really, even more on a AMD APU

Ahh okay wasn't sure if the 6.0 patches would apply to 5.13, rebuilding the kernel now with those patches as well.

X support wasn't compiled in switchres

Ahh haha, tbh I wasn't sure how to compile the repo i just ran make with no arguments and thought it worked <<. (first time using switchres and not the best compiler/package maker XD) Any tips to compile this correctly? Did I miss some guide? (is there a PKGBUILD out there somewhere << :) )

try in a terminal session, not from the desktop so you have good old DRM once you have patched the kernel with the fore mentionned patch. We're doing our best to help emulators integrate switchres so modeswitching is absolutely transparent to them

So I actually ran these commands via ssh on terminal remotely. I add export DISPLAY=0.0 to interact with the display session. If that method is flawed lmk I'll see if i can get a konsole session running in the Steam Deck Game Mode.

Also just to clarify I was just trying to change the resolution on the screen not via any emulator (though I know switch res is used in emulators via a library)

Just to tell you my use case I plan to use emulation on the deck and use a Sony PVM-20m2mdu (which does 240p/480i only @ 15khz obviously with 600 lines).

The following is what got me to this point.

15khz patch
http://forum.arcadecontrols.com/index.php/topic,159804.0.html

Groovymame
http://forum.arcadecontrols.com/index.php/topic,164449.0.html

(wealth of info even beyond batocera)
https://wiki.batocera.org/batocera-and-crt

(some switchres edid emulation info)
http://forum.arcadecontrols.com/index.php/topic,140215.msg1447520.html#msg1447520

P.S. Found your thread/gitlab on making a GroovyMame Live CD based on Arch Linux so its funny you're commented here cause I was going to reach out to eventually as you know Steam Deck runs of Arch Linux too XD

@substring
Copy link
Collaborator

Ok, things are crystal clear in my mind but sounds like I should explain myself better ;)

The first thing you need is a kernel patched with the patches from the 6.0 folder. Except maybe some amdgpu specific parts, anything else should apply more or less fine on a 5.13 kernel. The KMS patch is top mandatory at this point, really

situation word on Wayland: we've never investigated for Wayland modeswitching for many different reasons, one of them being that at that moment, KMS modeswitching wasn't as mature as today.

X support in switchres/wayland: you're on your own on that point, since I have no idea if this would work. I bet not. To build X support you need libxrandr, Steam may not provide it or at least, not its pkgconfig + header file. But I guess we shouldn't need it

When I say terminal session, I mean with no X/wayland running, just pure tty and no X/Wayland process even running in background.

A word on some testing protocol: we like to build the grid with make grid then test switchres with it like switchres 320 240 60 -s -l grid.

I suggest you hop on the GroovyArcade discord, might be easier for helping you

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

No branches or pull requests

2 participants