-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Make VirtualCam work with Flatpak #4552
Make VirtualCam work with Flatpak #4552
Conversation
It is not possible to run host system executables like modinfo, pkexec, and modprobe inside a Flatpak sandbox. However, Flatpak provides a way to run command on the host system: the flatpak-spawn executable. flatpak-spawn is a tiny helper that, when executed with the '--host' parameter, talks to the org.freedesktop.Flatpak D-Bus interface to run and retrieve the return value of the executable. This provides OBS Studio a way to escape this sandbox limitation without opening large holes in the sandbox. Make v4l2's implementation of VirtualCam run system commands using flatpak-spawn when inside a Flatpak sandbox. The detection of the sandbox is done by checking the existence of the /.flatpak-info file, which is created by Flatpak itself, and only exists inside the sandbox. If OBS Studio is not running inside a Flatpak sandbox, run the exact same command it used to run before this commit. Add the permission to talk to the org.freedesktop.Flatpak D-Bus interface to the Flatpak manifest, so we can run flatpak-spawn with the '--host' parameter. Notice that the same constraints apply with and without Flatpak: the host system needs to have the v4l2loopback kernel module available for the v4l2 implementation of VirtualCam to work.
EZ Clap |
@GeorgesStavracas I am trying to get the virtual camera working on OBS 29 flatpak version using Xorg, I have
I am asked for authentication when trying to start the virtual camera: and after entering it I don't seem to have any virtual camera, it used to be picked up in Signal Messenger (ages ago, sorry I don't remember which version of OBS), but now it is not. The I looked in the OBS logs and there seems no mention of it. Could this be a sandboxing problem? Could you advise me how to find the problem and find out if it is a bug? Thanks! |
the same with fedora 37 and flatpak. |
I found the error by running OBS on the terminal, it was:
I solved the problem by turning off secure boot in my BIOS, it seems a crazy fix, but it is explained here: https://discussion.fedoraproject.org/t/modprobe-error-could-not-insert-v4l2loopback-key-was-rejected-by-service/62084/7 Now it works perfectly. I am on AlmaLinux 9.1 using:
|
Description
It is not possible to run host system executables like modinfo, pkexec, and modprobe inside a Flatpak sandbox. However, Flatpak provides a way to run command on the host system: the flatpak-spawn executable.
flatpak-spawn is a tiny helper that, when executed with the '--host' parameter, talks to the org.freedesktop.Flatpak D-Bus interface to run and retrieve the return value of the executable. This provides OBS Studio a way to escape this sandbox limitation without opening large holes in the sandbox.
Make v4l2's implementation of VirtualCam run system commands using flatpak-spawn when inside a Flatpak sandbox. The detection of the sandbox is done by checking the existence of the /.flatpak-info file, which is created by Flatpak itself, and only exists inside the sandbox. If OBS Studio is not running inside a Flatpak sandbox, run the exact same command it used to run before this commit.
Add the permission to talk to the org.freedesktop.Flatpak D-Bus interface to the Flatpak manifest, so we can run flatpak-spawn with the '--host' parameter.
Notice that the same constraints apply with and without Flatpak: the host system needs to have the v4l2loopback kernel module available for the v4l2 implementation of VirtualCam to work.
Motivation and Context
VirtualCam is an important feature, and making it work properly with Flatpak will impact many (dozens of thousands, according to Flathub) users. It also gets us closer to complete feature-parity between Flatpak and host system OBS Studio.
How Has This Been Tested?
v4l2loopback
installed on your host systemTypes of changes
Checklist: