You are not logged in.

#1 2025-04-16 04:59:34

u2hq9y
Member
Registered: 2025-04-16
Posts: 1

OBS Studio Virtual Camera: Failed to start streaming on '/dev/video2'

OBS Version: 31.0.3
Kernel Version: 6.14.2-arch1-1
v4l2loopback-utils Version: 0.14.0-1
vulkan-radeon Version: 25.0.3-1

> v4l2-ctl --list-devices
OBS Virtual Camera (platform:v4l2loopback-000):
	/dev/video2

Laptop Camera: Laptop Camera (usb-0000:c4:00.4-1):
	/dev/video0
	/dev/video1
	/dev/media0

When I click "Start Virtual Camera" on OBS Studio I get the "Failed to start virtual camera" error. Checking the logs, I see "Failed to start streaming on '/dev/video2' (Invalid argument)." I tried downgrading to 0.13.2-1.

> sudo downgrade v4l2loopback-dkms
> sudo downgrade v4l2loopback-utils
> sudo rmmod -f v4l2loopback
> sudo modprobe v4l2loopback

I could start the Virtual Camera, but Google Meet and other conferencing software could not detect my virtual camera anymore. also some other programs need v4l2 so I can no longer keep it in the downgraded state. Are there any fixes other than waiting for OBS to correct their code?

Offline

#2 2025-05-03 15:27:11

imjustahuman
Member
Registered: 2024-06-12
Posts: 9

Re: OBS Studio Virtual Camera: Failed to start streaming on '/dev/video2'

I am also having the same problem and the same error in obs logs, did you find a solution to this?

Offline

#3 2025-05-03 15:29:05

imjustahuman
Member
Registered: 2024-06-12
Posts: 9

Re: OBS Studio Virtual Camera: Failed to start streaming on '/dev/video2'

I am also having the same problem and the same error in obs logs, did you find a solution to this?

Offline

#4 2025-06-02 18:34:47

sudomateo
Member
Registered: 2025-06-02
Posts: 3

Re: OBS Studio Virtual Camera: Failed to start streaming on '/dev/video2'

I also ran into the same issue with the following software versions.

> pacman -Q linux obs-studio v4l2loopback-dkms v4l2loopback-utils vulkan-radeon
linux 6.14.9.arch1-1
obs-studio 31.0.3-2
v4l2loopback-dkms 0.14.0-1
v4l2loopback-utils 0.14.0-1
vulkan-radeon 1:25.1.1-2

I downgraded the v4l2loopback-dkms and v4l2loopback-utils packages using the following commands.

sudo pacman -U https://archive.archlinux.org/packages/v/v4l2loopback-dkms/v4l2loopback-dkms-0.13.2-1-any.pkg.tar.zst
sudo pacman -U https://archive.archlinux.org/packages/v/v4l2loopback-dkms/v4l2loopback-utils-0.13.2-1-any.pkg.tar.zst

Then I rebooted and was able to successfully use OBS virtual camera. Here are the final list of versions I used.

> pacman -Q linux obs-studio v4l2loopback-dkms v4l2loopback-utils vulkan-radeon
linux 6.14.9.arch1-1
obs-studio 31.0.3-2
v4l2loopback-dkms 0.13.2-1
v4l2loopback-utils 0.13.2-1
vulkan-radeon 1:25.1.1-2

Offline

#5 2025-06-07 03:56:41

sudomateo
Member
Registered: 2025-06-02
Posts: 3

Re: OBS Studio Virtual Camera: Failed to start streaming on '/dev/video2'

Same issue with version 0.15.0. I tested and then downgraded again to get OBS virtual camera to work.

Offline

#6 2025-06-16 17:06:18

sudomateo
Member
Registered: 2025-06-02
Posts: 3

Re: OBS Studio Virtual Camera: Failed to start streaming on '/dev/video2'

If you're trying to keep the 0.13.2 version working on Arch kernel 6.15.2-arch1-1 then you'll need the following patch.

diff --git a/var/lib/dkms/v4l2loopback/0.13.2/source/v4l2loopback.c b/var/lib/dkms/v4l2loopback/0.13.2/source/v4l2loopback.c
index 25cb1be..5166e64 100644
--- a/var/lib/dkms/v4l2loopback/0.13.2/source/v4l2loopback.c
+++ b/var/lib/dkms/v4l2loopback/0.13.2/source/v4l2loopback.c
@@ -1682,8 +1682,8 @@ static int vidioc_querybuf(struct file *file, void *fh, struct v4l2_buffer *b)
 static void buffer_written(struct v4l2_loopback_device *dev,
                           struct v4l2l_buffer *buf)
 {
-       del_timer_sync(&dev->sustain_timer);
-       del_timer_sync(&dev->timeout_timer);
+       timer_delete_sync(&dev->sustain_timer);
+       timer_delete_sync(&dev->timeout_timer);

        spin_lock_bh(&dev->list_lock);
        list_move_tail(&buf->list_head, &dev->outbufs_list);
@@ -2255,8 +2255,8 @@ static int v4l2_loopback_close(struct file *file)

        atomic_dec(&dev->open_count);
        if (dev->open_count.counter == 0) {
-               del_timer_sync(&dev->sustain_timer);
-               del_timer_sync(&dev->timeout_timer);
+               timer_delete_sync(&dev->sustain_timer);
+               timer_delete_sync(&dev->timeout_timer);
        }
        try_free_buffers(dev);

Then you can rebuild the module.

sudo dkms install --no-depmod v4l2loopback/0.13.2 -k 6.15.2-arch1-1

Last edited by sudomateo (2025-06-16 17:06:43)

Offline

#7 Today 02:06:26

live4thamuzik
Member
Registered: 2024-02-27
Posts: 67

Re: OBS Studio Virtual Camera: Failed to start streaming on '/dev/video2'

sudomateo wrote:

If you're trying to keep the 0.13.2 version working on Arch kernel 6.15.2-arch1-1 then you'll need the following patch.

Thanks for this! Patching did fix this issue for me. Here's what I did.

sudo rmmod -f v4l2loopback        // force unload module
sudo pacman -Rns v4l2loopback-dkms v4l2loopback-utils   //remove packages
mkdir v4l2_patch       // make new directory for building 
cd v4l2_patch            // change to new directory
nvim PKGBUILD       // I already downloaded the PKGBUILD file from source below, copied it to the v4l2_patch folder and appiled the patch here

Patched PKGBUILD file based on source: https://gitlab.archlinux.org/archlinux/ … _type=tags

# Maintainer: Bruno Pagani <archange@archlinux.org>

pkgbase=v4l2loopback
pkgname=(v4l2loopback-dkms v4l2loopback-utils)
pkgver=0.13.2
pkgrel=1
pkgdesc="v4l2-loopback device"
arch=(any)
url="https://github.com/umlaeute/v4l2loopback"
license=(GPL2)
makedepends=(help2man)
source=(${url}/archive/v${pkgver}/${pkgbase}-${pkgver}.tar.gz)
# The sha256sum for v4l2loopback-0.13.2.tar.gz from github.com/umlaeute/v4l2loopback
sha256sums=('1e57e1e382d7451aa2a88d63cc9f146eab1f425b90e76104d4c3d73127e34771')

prepare() {
  cd "${pkgbase}-${pkgver}"

  # PATCH START: Fix 'del_timer_sync' usage on newer kernels (6.8+)
  # Addresses: 'implicit declaration of function ‘del_timer_sync’' error from earlier attempts.
  # Replacing del_timer_sync with timer_delete_sync which is its replacement.
  echo "Applying patch for timer functions (del_timer_sync to timer_delete_sync)..."
  sed -i 's/del_timer_sync/timer_delete_sync/g' v4l2loopback.c
  # Ensure the necessary header <linux/timer.h> is included for new kernel APIs.
  echo "Adding #include <linux/timer.h>..."
  sed -i '1s/^/#include <linux\/timer.h>\n/' v4l2loopback.c
  # PATCH END
}

package_v4l2loopback-dkms() {
  pkgdesc+=" – module sources"
  depends=(dkms)
  provides=(V4L2LOOPBACK-MODULE)
  cd ${pkgbase}-${pkgver} # This is handled by prepare() and the overall makepkg process
  install -Dm644 v4l2loopback.h v4l2loopback.c v4l2loopback_formats.h dkms.conf Kbuild Makefile -t "${pkgdir}"/usr/src/${pkgbase}-${pkgver}/
}

package_v4l2loopback-utils() {
  pkgdesc+=" – utilities only"
  depends=(V4L2LOOPBACK-MODULE)
  cd ${pkgbase}-${pkgver} # This is handled by prepare() and the overall makepkg process
  make DESTDIR="${pkgdir}" PREFIX="/usr" install-utils install-man
  install -Dm644 COPYING -t "${pkgdir}"/usr/share/licenses/${pkgbase}
}
makepkg -s     // build patched v4l2loopback-utils & v4l2loopback-dkms 
sudo pacman -U v4l2loopback-dkms-0.13.2-1-any.pkg.tar.zst v4l2loopback-utils-0.13.2-1-any.pkg.tar.zst   // install newly built pkgs
sudo modprobe v4l2loopback   // loaded module

virtual cam is working in OBS again and discord is detecting it! big_smile

Offline

Board footer

Powered by FluxBB