3 ms·
How does this work on a technical level? Does it framebuffer grab the current session and inject input events?
by ChocolateGod 2mo ago
How does this work on a technical level?
Does it framebuffer grab the current session and inject input events?
- hparadiz 2mo agoYea I need to know this before I even consider something like this. I'm guessing it's a daemon that runs as root in the background.
- jchw 2mo agoUsually the way to be able to even get the login screen is to use DRM/KMS based capture and use uinput for device emulation. It doesn't strictly need root but it does need privileges a user wouldn't have, like access to the DRM card nodes and uinput device. Sunshine does it this way. It entirely sidesteps the problem of X vs Wayland, although this does mean the unattended physical seat can be physically taken over while you are remote.
- codedokode 2mo agoAs I remember, generic DRM interface allows only writing to a framebuffer and not reading from someone's else framebuffer. Do they use some vendor-specific APIs?
- jchw 2mo agoNot that I'm aware of. I'm on my phone right now but any KMS driver that supports KMS and dma-bufs should work. The basic idea is to enumerate the CRTCs to get the relevant framebuffer plane resources and then use dma-buf exports to pass them to an encoder. Reality can be a bit more complex due to the existence of overlay planes but that's the idea. https://github.com/LizardByte/Sunshine/blob/master/src/platform/linux/kmsgrab.cpp https://github.com/LizardByte/Sunshine/blob/master/src/platf...