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

When the screen is locked, Selkies will have no video output #174

Open
5 tasks done
Resulte opened this issue Jan 24, 2025 · 11 comments
Open
5 tasks done

When the screen is locked, Selkies will have no video output #174

Resulte opened this issue Jan 24, 2025 · 11 comments
Labels
question Further information is requested

Comments

@Resulte
Copy link

Resulte commented Jan 24, 2025

Is your enhancement request related to a problem? Please describe.
When the screen is locked, Selkies will have no video output:

Image
At this time, I am unable to perform any operations through Selkies.

Describe the solution you'd like
I want to be able to use Selkies even when the screen is locked, including unlocking the screen by Selkies.
Have any ideas to solve this problem?

  • I confirm that this issue is relevant to the scope of this project. If you know that upstream projects are the cause of this problem, please raise the issue there.
  • I confirm that I have read other open and closed issues and that duplicates do not exist.
  • I confirm that I have described the solution as well as the problem in detail, and if possible, explained how to solve the problem.
  • I confirm that no portion of this issue contains credentials or other private information, and it is my own responsibility to protect my privacy.
  • I confirm that the authors of this issue does not willfully breach or infringe legal regulations, in any and all global law, regarding trademarks, trade names, logos, patents, or any and all other forms of external intellectual property, as well as adhering to software license terms of open-source and proprietary software projects.
@Resulte Resulte added the enhancement New feature or request label Jan 24, 2025
@PMohanJ
Copy link
Member

PMohanJ commented Jan 24, 2025

Based on what you explained, I assume that you're basically accessing an existing desktop with Selkies.
Screen lock and unlock falls under OS level configurations; I highly doubt we'd support such, because Selkies is more focused on running desktops in containerised environments. @ehfd correct me here.

Nonetheless, it's nice feature to have. I guess Sunshine support this.

@ehfd
Copy link
Member

ehfd commented Jan 25, 2025

I have no information on the desktop environment and OS, etc. First need those things. Otherwise, I don't see a good reason why it can't work with X11.

@Resulte
Copy link
Author

Resulte commented Jan 25, 2025

I have no information on the desktop environment and OS, etc. First need those things. Otherwise, I don't see a good reason why it can't work with X11.我没有关于桌面环境和操作系统等信息。首先需要这些。否则,我看不出为什么它不能与 X11 兼容。

OS version: ubuntu 22.04
Desktop environment: x11 + gnome.
In my test, Selkies can run normally in this environment, but when I lock the screen, Selkies will not have any video output and cannot perform any operations.

@ehfd
Copy link
Member

ehfd commented Jan 25, 2025

Thank you for the information.

First, make sure that you are running selkies-gstreamer as root. This is required in order to communicate with the session manager.

Then, I suggest (less likely to be the culprit):

Option "HardDPMS" "False"

Under the Device or Screen section in /etc/X11/xorg.conf.

References:
https://virtualgl.org/Documentation/HeadlessNV
https://download.nvidia.com/XFree86/Linux-x86_64/550.144.03/README/xconfigoptions.html

Please confirm whether either of this works, and do not close this issue in any case. Documentation is required.

@ehfd ehfd added question Further information is requested and removed enhancement New feature or request labels Jan 27, 2025
@ehfd
Copy link
Member

ehfd commented Jan 29, 2025

@Resulte Any further issues or feedback?

@Resulte
Copy link
Author

Resulte commented Jan 29, 2025

@Resulte Any further issues or feedback?任何进一步的问题或反馈?

Sorry for the delayed response.

Firstly, I make sure to run selkies-gstreamer as root, but it didn’t help.

Then, following your suggestion, I tried modifying the xorg.conf configuration (and rebooted the system to ensure the changes took effect), but that didn’t work either. After manually locking the screen, there was still no video output.

In my opinion, when the screen is locked, the system will switch to another session, but selkies-gstreamer remains in the original session. As a result, selkies-gstreamer cannot capture the original screen. However, once the screen is unlocked, selkies-gstreamer can resume capturing the screen as normal.

@ehfd
Copy link
Member

ehfd commented Jan 29, 2025

It might be that your login session (gdm, lightdm, etc.) is running on Wayland.

@Resulte
Copy link
Author

Resulte commented Jan 29, 2025

It might be that your login session (gdm, lightdm, etc.) is running on Wayland.可能您的登录会话(gdm、lightdm 等)正在运行在 Wayland 上。

I can sure that my login session is running on X11, not Wayland.

@ehfd
Copy link
Member

ehfd commented Jan 29, 2025

My suggestion is to use DISPLAY= to the ID of your login session (it might not be the same), combined with sudo. I remember that working for me before.
If using gdm, it is possible that it uses Wayland despite the actual desktop being on X11. Double check the WaylandEnable=false setting on /etc/gdm/custom.conf.

@Resulte
Copy link
Author

Resulte commented Jan 29, 2025

Actually, I am using LightDM, and I have already modified the relevant configuration to ensure Wayland is not used.
I specify the DISPLAY environment variable with the following command:

sudo DISPLAY=:0 ./selkies-gstreamer/selkies-gstreamer-run --addr=0.0.0.0 --port=8080 --enable_https=false --https_cert=/etc/ssl/certs/ssl-cert-snakeoil.pem --https_key=/etc/ssl/private/ssl-cert-snakeoil.key --basic_auth_user=user --basic_auth_password=mypassword --encoder=nvh264enc --enable_resize=false

However, there is still no video output when the screen is locked.

In my testing environment, I executed the command ps aux | grep Xorg and found that when the screen is locked, two DISPLAY instances appear, including :0 and :1. DISPLAY=:1 seems to correspond to the login screen. So, I suspect that the DISPLAY ID changes when the screen is locked, which causes Selkies to stop outputting video.

@ehfd
Copy link
Member

ehfd commented Jan 29, 2025

There is not much that can be reliably done here, then... Disabling the screen lock during using Selkies is an alternative.

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

No branches or pull requests

3 participants