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

Adding a session for Pegasus-FE #1122

Closed
Lokito23 opened this issue Jun 22, 2024 · 10 comments
Closed

Adding a session for Pegasus-FE #1122

Lokito23 opened this issue Jun 22, 2024 · 10 comments
Labels

Comments

@Lokito23
Copy link

Lokito23 commented Jun 22, 2024

Description

It would be interesting if Pegasus on Linux had a Batocera/Lakka/SteamOS like session, in order to use it as a main frontend.

Blocking issue

The following issue however, does not allow for this, or would make it clunky to use: #442

Granted, I know that this issue is more on Valve's side than yours...

I have also ran into problems trying to open Steam games (Steam launches visually), but that is beyond the scope of this issue, and I will open another issue to report it (#1123).

Concepts

You might be able to use gamescope-session-plus in order to create said session, but it has problems with the -e or --steam property, since said properties are known for not allowing clients not considered a steam game to render.

Another option would be to use kiosk window managers, like cage, which allow you to run a single, fullscreen app, and does not suffer from the issue that gamescope-session-plus has.

A problem with cage might be setting up WiFi though, since Pegasus (by default), does not give the menus to configure it (and I am not sure if it is even possible).

Finishing thoughts

While opening Pegasus on fullscreen with another desktop on start-up would also work, I feel like that solution isn't as clean as if a session existed, as it does not require to wait for a full desktop/WM to load.
It also allows to use Pegasus as a Frontend for controller-first computers (like the Steam Deck, or TV Boxes).

@mmatyas
Copy link
Owner

mmatyas commented Jun 22, 2024

Hi! Could you describe what is a "Batocera/Lakka/SteamOS like session"? Do you mean using Pegasus without a window manager? On the Raspberry Pi 4, Pegasus directly uses KMS, so this is probably possible on other platforms too. It also depends mainly on the Qt backend, so if you can build Qt for your use case, then Pegasus too should work on top of it.

@Lokito23
Copy link
Author

Lokito23 commented Jun 22, 2024

Could you describe what is a "Batocera/Lakka/SteamOS like session"?

What I meant there was a session where the frontend is the main GUI of it (like gamepadUI/Big Picture from Steam)

On the Raspberry Pi 4, Pegasus directly uses KMS, so this is probably possible on other platforms too.

I was unaware of this, not sure if it is in Linux though, would have to check, could you tell me how it is done in Raspberry Pi 4? Should be a similar process.

@mmatyas
Copy link
Owner

mmatyas commented Jun 22, 2024

Sure, for RPi4, Qt is built with the EGLFS backend, which handles the lack of window manager. However, because Pegasus have to close and reopen its own window, a workaround patch is also applied to connect/disconnect from the screen.

Basically if there are any graphics requirement, you'll have to start making Qt work there, then you can continue with Pegasus, which might just work out of the box.

@Lokito23
Copy link
Author

Lokito23 commented Jun 22, 2024

It does work, but with a caveat.

I'm using a laptop, the moment I opened Pegasus with EGLFS it disabled the keyboard.

Not sure what happened there, I'll try connecting an external keyboard.

EDIT: Not even with an external keyboard, nor reconnecting said keyboard gave control back, weird.

@Lokito23
Copy link
Author

Lokito23 commented Jun 22, 2024

Not even using SDDM to load it, the keyboard still didn't work.

I used the following command: pegasus-fe --platform eglfs

EDIT: I forgot to clarify, it doesn't disable the keyboard for Pegasus, it disables the keyboard, period. Had to restart the laptop each time I tested something with it.

@Lokito23
Copy link
Author

Lokito23 commented Jun 22, 2024

Upon further investigation, I have found that the root cause of the keyboard problem is the permissions of /dev/input/event, since it's necessary for input in QT to work.

Seems like running it like root is a fix, but I doubt that is a good solution...

However, since I have now seen that it is possible, I don't see much reason to maintain this issue open. As such, I'm closing it.

EDIT: Just found out that my user is not in the input group, that should fix the problems I had.

EDIT 2: I can confirm that the problem was the user not being in input, that fixed it.

@Lokito23
Copy link
Author

As for the implementation, it shouldn't be that different to the one used in RPi4, since they also use Linux.

@Lokito23
Copy link
Author

Update: I have tried to apply the RPi4 patch, but it keeps giving me libdl errors, so that happened.

I can't seem to find a way to fix it, yet.

@mmatyas
Copy link
Owner

mmatyas commented Jun 22, 2024

Try the following qmake build parameter: QMAKE_LIBS_LIBDL=-ldl

@Lokito23
Copy link
Author

Lokito23 commented Jun 22, 2024

It compiled, but I tested with a steam game, it didn't find the session.

Log: lastrun.log

That isn't all, will add a photo of the output of the command: steamlog

EDIT: Seems like Steam is throwing it's logs to the console directly, so I'll have to send a photo.

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

No branches or pull requests

2 participants