OBS Virtual Camera Failed to start streaming on '/dev/video2' (Invalid argument)

rebelduck

New Member
Hello,
I've been using OBS Virtual Camera with v4l2loopback for a while now, but a few days ago it started failing.
I have uploaded the log here: https://obsproject.com/logs/FXY9iWZZJqakGT6t

It seems to not be able to use the device that is created by OBS through v4l2loopback as output device.

things I've tried:
- Re-create the v4l2loopback device
- Remove OBS profiles and settings
- Remove OBS completely
- Fresh distro install (EndavourOS and Garuda)
- Change encoding.

Streaming and recording works fine.

v4l2 lists the following devices:

╰─❯ v4l2-ctl --list-devices OBS Virtual Camera (platform:v4l2loopback-000): /dev/video2 HD Pro Webcam C920 (usb-0000:02:00.0-2.4.2): /dev/video0 /dev/video1 /dev/media0


The virtual camera output through v4l2loopback works fine through other programs (I tried webcamoid, which worked fine)
 

rebelduck

New Member
thank you for linking this. I guess I'll wait for the bug fix to make it into a release.
(rolling back packages is a pain on arch :/ )
 

jensenr30

New Member
thank you for linking this. I guess I'll wait for the bug fix to make it into a release.
(rolling back packages is a pain on arch :/ )
Bash:
# select version 0.13.2-1 for both of these:
sudo downgrade v4l2loopback-dkms
sudo downgrade v4l2loopback-utils

#refresh the module (or you could just reboot and skip these two commands)
sudo rmmod -f v4l2loopback
sudo modprobe v4l2loopback

The above commands worked for me.
 

rebelduck

New Member
Bash:
# select version 0.13.2-1 for both of these:
sudo downgrade v4l2loopback-dkms
sudo downgrade v4l2loopback-utils

#refresh the module (or you could just reboot and skip these two commands)
sudo rmmod -f v4l2loopback
sudo modprobe v4l2loopback

The above commands worked for me.


Oh perfect, that worked for me too.
thank you!
 

jufra

New Member
I have the exact same problem, also on arch (Cachy OS), I downgraded the v4l2loopback packages, but the error is still there. The moment I start the virtual camera, I get the dreaded error message (Starting the output failed. Please check the log for details.Note: If you are using the NVENC or AMD encoders, make sure your video drivers are up to date.) and the log as below.
I have two machines running cachy, both are doing the exact same thing

What else can i do?

Code:
info: [pipewire] source selected, setting up screencast
info: [pipewire] Server version: 1.4.1
info: [pipewire] Library version: 1.4.1
info: [pipewire] Header version: 1.4.1
info: [pipewire] Created stream 0x5b4b9c7d6050
info: [pipewire] Stream 0x5b4b9c7d6050 state: "connecting" (error: none)
info: [pipewire] Playing stream 0x5b4b9c7d6050
info: [pipewire] Stream 0x5b4b9c7d6050 state: "paused" (error: none)
info: [pipewire] Negotiated format:
info: [pipewire]     Format: 12 (Spa:Enum:VideoFormat:BGRA)
info: [pipewire]     Modifier: 0x0
info: [pipewire]     Size: 2560x1440
info: [pipewire]     Framerate: 0/1
info: [pipewire] Negotiated format:
info: [pipewire]     Format: 12 (Spa:Enum:VideoFormat:BGRA)
info: [pipewire]     Modifier: 0x20000001876bb03
info: [pipewire]     Size: 2560x1440
info: [pipewire]     Framerate: 0/1
info: [pipewire] Stream 0x5b4b9c7d6050 state: "streaming" (error: none)
error: Failed to start streaming on '/dev/video2' (Invalid argument)
warning: Failed to start virtual camera
 

jufra

New Member
I have the exact same problem, also on arch (Cachy OS), I downgraded the v4l2loopback packages, but the error is still there. The moment I start the virtual camera, I get the dreaded error message (Starting the output failed. Please check the log for details.Note: If you are using the NVENC or AMD encoders, make sure your video drivers are up to date.) and the log as below.
I have two machines running cachy, both are doing the exact same thing

What else can i do?

Code:
info: [pipewire] source selected, setting up screencast
info: [pipewire] Server version: 1.4.1
info: [pipewire] Library version: 1.4.1
info: [pipewire] Header version: 1.4.1
info: [pipewire] Created stream 0x5b4b9c7d6050
info: [pipewire] Stream 0x5b4b9c7d6050 state: "connecting" (error: none)
info: [pipewire] Playing stream 0x5b4b9c7d6050
info: [pipewire] Stream 0x5b4b9c7d6050 state: "paused" (error: none)
info: [pipewire] Negotiated format:
info: [pipewire]     Format: 12 (Spa:Enum:VideoFormat:BGRA)
info: [pipewire]     Modifier: 0x0
info: [pipewire]     Size: 2560x1440
info: [pipewire]     Framerate: 0/1
info: [pipewire] Negotiated format:
info: [pipewire]     Format: 12 (Spa:Enum:VideoFormat:BGRA)
info: [pipewire]     Modifier: 0x20000001876bb03
info: [pipewire]     Size: 2560x1440
info: [pipewire]     Framerate: 0/1
info: [pipewire] Stream 0x5b4b9c7d6050 state: "streaming" (error: none)
error: Failed to start streaming on '/dev/video2' (Invalid argument)
warning: Failed to start virtual camera
Fixed it. Turns out I was running Kernel 6.14, once I downgraded to 6.13.8 it worked....
 

leohearts

New Member
It will be officially fixed on the next 31.1 release.
> RytoEX added this to the OBS Studio 31.1 milestone Apr 24, 2025 last week

for anyone who can't wait nor downgrade v4l , you could patch/usr/lib64/obs-plugins/linux-v4l2.so as github diff shows, with ida or ghidra.
Search string 'Failed to start streaming', find it's xref, and patch the parent `js loc_xxxx` command to the other route , or just nop this command.

If you don't know how, here's a patched version working on my computer:
 

Attachments

  • linux-v4l2.zip
    20.2 KB · Views: 253

elegrantt

New Member
Bash:
# select version 0.13.2-1 for both of these:
sudo downgrade v4l2loopback-dkms
sudo downgrade v4l2loopback-utils

#refresh the module (or you could just reboot and skip these two commands)
sudo rmmod -f v4l2loopback
sudo modprobe v4l2loopback

The above commands worked for me.
Is there any way to do something like this on Linux Mint? This worked fine on Arch for me, but downgrade doesn't exist on Ubuntu.
 

stephematician

New Member
Is there any way to do something like this on Linux Mint? This worked fine on Arch for me, but downgrade doesn't exist on Ubuntu.
If an older version of loopback was installed; it might still be in the cache on your system, in which case you can use:

Bash:
sudo apt remove v4l2loopback-dkms
sudo apt install v4l2loopback-dkms=0.13.2

or similar, followed by an rmmod (and modprobe) command similar to that posted above.

Otherwise, you can always remove the package, and build from source (I appreciate that this is _not_ a user-friendly option!)
 

fsworld009

New Member
While waiting for 31.1 release, if anyone is using flatpak OBS and could not downgrade v4l2loopback (for me, I'm on Bazzite which is based on Fedora Silverblue and v4l2loopback-0.14 is part of base image, so I couldn't downgrade):

I've built OBS from current master (commit ID bdebea3d858deeccf1900fe8272d1f40bb9501e3), which included the fix commit, and extracted linux-v4l2.so from the build and put it into flatpak OBS, and confirmed virtual camera is working now.

Uploading the file here in case anyone having trouble building OBS.

The path for the so file is /var/lib/flatpak/app/com.obsproject.Studio/x86_64/stable/active/files/lib/obs-plugins/linux-v4l2.so
Need administrator permission to write into that folder, and I would recommend backing up the original file just in case it doesn't work for you.
 

Attachments

  • linux-v4l2_obsstudio_flatpak_31.0.3.zip
    75.7 KB · Views: 208

serqetry

New Member
It will be officially fixed on the next 31.1 release.
> RytoEX added this to the OBS Studio 31.1 milestone Apr 24, 2025 last week

for anyone who can't wait nor downgrade v4l , you could patch/usr/lib64/obs-plugins/linux-v4l2.so as github diff shows, with ida or ghidra.
Search string 'Failed to start streaming', find it's xref, and patch the parent `js loc_xxxx` command to the other route , or just nop this command.

If you don't know how, here's a patched version working on my computer:
I tried using this .so file and the virtual cam button completely disappeared from OBS. Using OBS 31.0.3 and v4l2loopback-dkms 0.15.0-1. Unfortunately I am unable to downgrade... but this .so didn't save me.
 

stephematician

New Member
I tried using this .so file and the virtual cam button completely disappeared from OBS. Using OBS 31.0.3 and v4l2loopback-dkms 0.15.0-1. Unfortunately I am unable to downgrade... but this .so didn't save me.
You could build OBS, it's not actually that difficult!
 
Top