Skip to content

Virtual Camera will start one time and will not restart until reboot #4808

Closed

Description

@bmn001

Operating System Info

Ubuntu 21.04

Other OS

No response

OBS Studio Version

27.0.0

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/Cy96Hu3XHeD7c-Zb

OBS Studio Crash Log URL

No response

Expected Behavior

I should be able to toggle Virtual Camera on and off.

Current Behavior

I'm able to start and stop Virtual Camera one time. After that, it will not start again until my next reboot. Each click on the "Start Virtual Camera" button inserts a single line of text into the log:
04:00:54 PM.094: Failed to start virtual camera

Steps to Reproduce

  1. Reboot
  2. Launch OBS
  3. Click "Start Virtual Camera"
  4. Click "Stop Virtual Camera"
  5. Click "Start Virtual Camera". The button text remains the same ("Start Virtual Camera") and the VC is never started.

Anything else we should know?

This began happening immediately after an OS upgrade from Ubuntu 20.10 to 21.04. Things worked fine in Ubuntu 20.10 using the same version of OBS (27.0.0).

The attached log shows me launching OBS immediately after a reboot.
I click to start the virtual camera.
I enter my sudo pw.
I click to stop the virtual camera.
So far so good.
I click to start the virtual camera - three times - and all three times result in failure and an error message in the log: "Failed to start virtual camera."

The output of v4l2-ctl --list-devices immediately after reboot:

UVC Camera (046d:0821) (usb-0000:00:14.0-8.4):
	/dev/video4
	/dev/video5

Integrated_Webcam_HD: Integrate (usb-0000:00:14.0-9):
	/dev/video0
	/dev/video1
	/dev/video2
	/dev/video3

The output of v4l2-ctl --list-devices after I've tried and failed to get the Virtual Camera to start:

OBS Virtual Camera (platform:v4l2loopback-000):
    /dev/video6

UVC Camera (046d:0821) (usb-0000:00:14.0-8.4):
    /dev/video4
    /dev/video5

Integrated_Webcam_HD: Integrate (usb-0000:00:14.0-9):
    /dev/video0
    /dev/video1
    /dev/video2
    /dev/video3

This is on a Dell XPS 13 laptop, model 9300. If it matters, I'm not using the integrated webcam, I'm using Logitech C910 USB cam.

Activity

  1. bmn001 commented on Jun 4, 2021

    @bmn001
    Author

    If I quit OBS, then remove the modprobe rule with:
    sudo modprobe -r v4l2loopback
    I'm able to restart OBS and launch the Virtual Camera successfully (without rebooting) - but again, only one time.

  2. troyhitch commented on Jun 4, 2021

    @troyhitch

    Hi, for what it's worth, I'm experiencing the exact same thing having updated to 21.04 earlier today. I have been able to reliably restart the VC after a reboot. And I've been able to successfully restart it after killing OBS and running sudo modprobe -r v4l2loopback per above and have been able to do it more than once.

  3. ajrabassa commented on Jun 10, 2021

    @ajrabassa

    Reporting the same issue, with the exact modprobe solution. Problem started after upgrade from Ubuntu 20.10 to Ubuntu 21.04.

    System info:
    OS: Ubuntu 21.04
    Apt package: obs-studio/hirsute,hirsute,now 27.0.0-0obsproject1~hirsute amd64
    Version: OBS Studio 27.0.0 (64 bit)

  4. bmn001 commented on Jun 12, 2021

    @bmn001
    Author

    OBS 27.0.1 came out today and the issue is still there.

  5. added
    platform/linux
    on Jun 25, 2021
  6. jbrains commented on Jul 2, 2021

    @jbrains

    I have the same problem on Pop!_OS 21.04 and the workaround of sudo modprobe -r v4l2loopback works as well for me as the others have described.

    I built from source just now (commit 16a49eb) and the problem persists.

    I also went back to build 26.1 from source (commit 38ad3ba) and the problem persists there.

    I wish I had more to offer.

  7. WebrangerC commented on Aug 11, 2021

    @WebrangerC

    Same issue with 21.04 and OBS 27.0.1

  8. pmichaud commented on Aug 21, 2021

    @pmichaud

    [Edit after post: Swapped "OUTPUT" and "CAPTURE" to correctly identify the capabilities. --Pm]

    On my system, the problem appears to be related to the "exclusive_caps=1" option of the v4l2loopback module.

    If I remove "exclusive_caps=1" from whatever is creating the virtual camera device, then obs is able to start / stop / restart the virtual camera with no difficulty, both within a single obs-studio invocation and across multiple invocations.

    Unfortunately, removing "exclusive_caps=1" means that the v4l2loopback output device is no longer accessible by Chrome and some other programs. The version of Zoom that I have still works -- it finds the virtual device just fine -- but Chrome no longer finds it.


    If I understand correctly, exclusive_caps=1 tells v4loopback to start the virtual device in "OUTPUT" capabilities (so that programs such as Chrome won't find it), then switch to "CAPTURE only" capabilities once something like obs starts sending data to the virtual device. However, when the data stream stops, the virtual device remains in "CAPTURE only" mode and I think this prevents OBS from either finding or re-opening the device on second and subsequent attempts. The only reliable solution is to restart the virtual device altogether, either via a reboot or a rmmod/modprobe of the device as mentioned by others above.

    Ideally I think the virtual device should reset itself to advertising OUTPUT capabilities when it no longer has an active input data stream -- but that would be a fix to v4l2loopback instead of obs. Alternatively, obs should find/open the device for streaming even if it's not currently advertising OUTPUT capabilities.

    Hope this helps point the way to a solution.

    Pm

  9. pmichaud commented on Aug 21, 2021

    @pmichaud

    To follow-up a bit on my previous post: If I set up the loopback device without "exclusive_caps=1", then "v4l2-ctl -d /dev/video0 --all" gives me the following output:

    pmichaud@kiwi:~$ sudo v4l2-ctl -d /dev/video0 --all
    Driver Info:
    	Driver name      : v4l2 loopback
    	Card type        : Dummy video device (0x0000)
    	Bus info         : platform:v4l2loopback-000
    	Driver version   : 5.11.22
    	Capabilities     : 0x85200003
    		Video Capture
    		Video Output
    		Read/Write
    		Streaming
    		Extended Pix Format
    		Device Capabilities
    	Device Caps      : 0x05200003
    		Video Capture
    		Video Output
    		Read/Write
    		Streaming
    		Extended Pix Format
    Priority: 2
    

    This part of the output remains the same no matter how many times "Start Virtual Camera" and "Stop Virtual Camera" are selected. Zoom recognizes the virtual loopback device just fine, but Chrome does not find it.

    If I add "exclusive_caps=1" when loading the virtual device via modprobe, the device initially appears as follows:

    pmichaud@kiwi:~$ sudo v4l2-ctl -d /dev/video0 --all
    Driver Info:
    	Driver name      : v4l2 loopback
    	Card type        : Dummy video device (0x0000)
    	Bus info         : platform:v4l2loopback-000
    	Driver version   : 5.11.22
    	Capabilities     : 0x85200002
    		Video Output
    		Read/Write
    		Streaming
    		Extended Pix Format
    		Device Capabilities
    	Device Caps      : 0x05200002
    		Video Output
    		Read/Write
    		Streaming
    		Extended Pix Format
    Priority: 2
    

    Once I hit "Start Virtual Camera" in OBS, the device settings change to:

    pmichaud@kiwi:~$ sudo v4l2-ctl -d /dev/video0 --all
    Driver Info:
    	Driver name      : v4l2 loopback
    	Card type        : Dummy video device (0x0000)
    	Bus info         : platform:v4l2loopback-000
    	Driver version   : 5.11.22
    	Capabilities     : 0x85200001
    		Video Capture
    		Read/Write
    		Streaming
    		Extended Pix Format
    		Device Capabilities
    	Device Caps      : 0x05200001
    		Video Capture
    		Read/Write
    		Streaming
    		Extended Pix Format
    Priority: 2
    

    Stopping the Virtual Camera in OBS (or exiting OBS) results in:

    pmichaud@kiwi:~$ sudo v4l2-ctl -d /dev/video0 --all
    Driver Info:
    	Driver name      : v4l2 loopback
    	Card type        : Dummy video device (0x0000)
    	Bus info         : platform:v4l2loopback-000
    	Driver version   : 5.11.22
    	Capabilities     : 0x85200000
    		Read/Write
    		Streaming
    		Extended Pix Format
    		Device Capabilities
    	Device Caps      : 0x05200000
    		Read/Write
    		Streaming
    		Extended Pix Format
    Priority: 2
    

    Note that the video device no longer advertises either output or capture capabilities. As a result, OBS won't or can't re-open the device to restart the loopback video stream.

    So this looks to me like something that needs to be fixed within v4l2loopback.

    Pm

  10. WebrangerC commented on Sep 10, 2021

    @WebrangerC

    @pmichaud THANK YOU.
    I haven't duplicated/verified the exclusive_caps BUT using modprobe to re-initialize:

    • sudo modprobe -r v4l2loopback
    • sudo modprobe v4l2loopback
      works well for Zoom, even if Zoom has been started and I wanted to switch to using OBS.
  11. prasket commented on Oct 1, 2021

    @prasket

    I was having this issue as well using POP_OS and 27.1.0 but the modprobe was my hotfix. I just one of my machine using Debian Stable and I just built OBS 27.1.1 and the start/stop of the virtual camera appears to be working just fine.

  12. bmn001 commented on Oct 5, 2021

    @bmn001
    Author

    Just tested OBS 27.1.3 and it looks like the issue is still there.

  13. cmcqueen commented on Oct 5, 2021

    @cmcqueen

    Just tested OBS 27.1.3 and it looks like the issue is still there.

    It looks to be a bug in the v4l2loopback kernel driver. The issue isn't really in OBS, of any version.

  14. bmn001 commented on Oct 6, 2021

    @bmn001
    Author

    Right you are. Looks like a v4l2loopback bug referencing this one has been filed. v4l2loopback/v4l2loopback#442

  15. bmn001 commented on Oct 6, 2021

    @bmn001
    Author

    I found a fix for now.

    The version of v4l2loopback included with Ubuntu 20.04 is apparently no good. You've got to manually install the latest version.

    Download the latest .deb from https://packages.ubuntu.com/groovy/all/v4l2loopback-dkms/download

    Install it:
    sudo dpkg -i v4l2loopback-dkms_0.12.5-1_all.deb

    This will replace v4l2loopback version 0.12.5-1ubuntu1 with 0.12.5-1. I guess this is technically a downgrade, according to the dpkg output...

    After that, Virtual Camera will work as expected. You can toggle it on and off to your heart's content.

    So here's the weird thing - doing an apt upgrade after this point will reverse what you've done and put you back on 0.12.5-1ubuntu1, however Virtual Camera will continue to work properly. EDIT- This only lasted until a reboot. I had to roll back again.

  16. 62 remaining items

  17. added a commit that references this issue on Oct 26, 2022
    e078a20
  18. added a commit that references this issue on Oct 27, 2022
    5a68d49
  19. stephematician commented on Jan 31, 2025

    @stephematician
    Contributor

    The fix that was added, fca624e, is very non-compliant with the V4L2 UAPI. The STREAMON that OBS uses will (and should) fail; see the expected return codes from the V4L2 UAPI 7.55. ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF:

    EINVAL
    The buffer type is not supported, or no buffers have been allocated (memory mapping) or enqueued (output) yet.

    I am in the process of hardening v4l2-loopback's compliance with the V4L2 UAPI - and this will return the EINVAL - breaking this fix. Currently, the PR is in draft: v4l2loopback/v4l2loopback#611 - so there is plenty of time to consider a new fix, as it takes time for everything to downstream.

    Luckily, the fix should be simple: remove the STREAMON and STREAMOFF when v4l2loopback version is greater than 0.13.2 (might have to get the version from modinfo v4l2loopback --field=version somehow).

  20. kkartaltepe commented on Jan 31, 2025

    @kkartaltepe
    Collaborator

    PRs are welcome, but you should probably make v4l2loopback report its version via the v4l2 api since modinfo is not going to be available on all platforms or even correct since users can update the on disk modules without restarting or reloading.

  21. stephematician commented on Jan 31, 2025

    @stephematician
    Contributor

    PRs are welcome, but you should probably make v4l2loopback report its version via the v4l2 api since modinfo is not going to be available on all platforms or even correct since users can update the on disk modules without restarting or reloading.

    I'm not aware of a mechanism within the V4L2 API for reporting module version information - and I'm not an OBS expert so I can't say much about which platforms you support that do have v4l2loopback but don't have modinfo (or kmod). The best I can think of is a kludge via VIDIOC_G_CTRL with one control for each of the version numbers; but that's not what controls are meant for.

    I'll put up a PR and then the discussion can be moved there.

  22. kkartaltepe commented on Feb 1, 2025

    @kkartaltepe
    Collaborator

    We only have two supported platforms, flatpak and ubuntu. You can take your guess at which one i'm referring to. Though as a kernel module developer id assume you were aware of the issues folks run into with managing installed and running kernel versions and modules and how tricky it can be.

    Last I used v4l2-info it provided a very convenient location for drivers to report their version information. Perhaps you can use that instead of a kludge.

    v4l2-ctl --info -d /dev/video0
    Driver Info:
    	Driver name      : uvcvideo
    	Card type        : HD Pro Webcam C920
    	Bus info         : usb-0000:c4:00.3-2.2
    	Driver version   : 6.12.4
    
  23. stephematician commented on Feb 1, 2025

    @stephematician
    Contributor

    Though as a kernel module developer...

    I wish I was! Thanks for the help. I had another thought about using sysfs to report the version, that way the user doesn't need v4l-utils, but perhaps your approach is easier to implement. I'll get back to this once the v4l2-loopback PR is close.

  24. cmosetick commented on Aug 7, 2025

    @cmosetick

    This issue has returned.
    Can we get it re-opened @kkartaltepe @stephematician ?

    Flatpak OBS version 31.1.2

    I've found this on 2 different machines with different Linux Kernel versions:
    5.15
    6.8

    Only way to resolve without a full reboot is:

    sudo modprobe -r v4l2loopback

    Analysis

    On system boot you get:

    ls -la /dev | grep -i video  
    crw-rw----   1 root video    29,     0 Aug  7 14:15 fb0
    crw-rw----+  1 root video   234,     0 Aug  7 14:15 media0
    crw-rw----+  1 root video   234,     1 Aug  7 14:15 media1
    crw-rw----+  1 root video    81,     0 Aug  7 14:15 video0
    crw-rw----+  1 root video    81,     1 Aug  7 14:15 video1
    crw-rw----+  1 root video    81,     2 Aug  7 14:15 video2
    crw-rw----+  1 root video    81,     3 Aug  7 14:15 video3
    

    Launch the virtual camera in v31.1.2 and then you get a /dev/video4

    ls -la /dev | grep -i video 
    crw-rw----   1 root video    29,     0 Aug  7 14:15 fb0
    crw-rw----+  1 root video   234,     0 Aug  7 14:15 media0
    crw-rw----+  1 root video   234,     1 Aug  7 14:15 media1
    crw-rw----+  1 root video    81,     0 Aug  7 14:15 video0
    crw-rw----+  1 root video    81,     1 Aug  7 14:15 video1
    crw-rw----+  1 root video    81,     2 Aug  7 14:15 video2
    crw-rw----+  1 root video    81,     3 Aug  7 14:15 video3
    crw-rw----+  1 root video    81,     4 Aug  7 14:42 video4
    

    If you stop the virtual camera now, the next time that you launch it via OBS, you will get errors:

    info: NV12 texture support enabled
    info: P010 texture support not available
    info: Attempting to reset output capability of '/dev/video0'
    info: Attempting to reset output capability of '/dev/video1'
    info: Attempting to reset output capability of '/dev/video2'
    info: Attempting to reset output capability of '/dev/video3'
    info: Attempting to reset output capability of '/dev/video4'
    warning: Failed to start virtual camera
    

    Fix without a full reboot

    sudo modprobe -r v4l2loopback

    This command will remove /dev/video4

    And now the virtual camera will start again without a full reboot.

    Note that simply doing a sudo rm /dev/video4 will not resolve.

    The module reload seems required and should be resolved.

  25. stephematician commented on Aug 8, 2025

    @stephematician
    Contributor

    @cmosetick I would try the forums for support (I'm checking there as often as I can) as this may not be an issue with OBS and there's a lot of detail about your system and use case is missing (NOTE: the kernel version is almost irrelevant, because v4l2loopback is an out-of-tree module).

    Also NOTE: The command rm /dev/video4 is definitely not a solution, and I would advise against anyone using an rm command on any contents of the /dev folder unless they have a really specific reason for doing so.

  26. jbrains commented on Aug 8, 2025

    @jbrains

    FWIW, I experienced this problem before, but I don't experience it now. Here is what I can repeatably do:

    1. remove module v4l2loopback.
    2. start OBS Studio, Flatpak, 31.1.2
    3. press "Start Virtual Camera". This loads v4l2loopback and I see a new video device in /dev.
    4. press "Stop Virtual Camera". The Virtual Camera video device remains listed in /dev.
    5. press "Start Virtual Camera". Nothing goes wrong and the Virtual Camera device works in Zoom. There are no OBS Studio log messages that indicate a failure.

    My kernel is 6.12.10.

    I hope this information helps somehow. I second @stephematician 's suggestion to move this into the forum. Post a link here to the thread when you do.

  27. Atom02 commented on Aug 28, 2025

    @Atom02

    ye it is comming back and the only "work around" is to run sudo modprobe -r v4l2loopback everytime i want to start virtual camera

  28. mrbarletta commented on Apr 1, 2026

    @mrbarletta

    Its happening in Ubuntu 24.04 with version 32.1.0

    info: Kernel Version: Linux 6.17.0-19-generic
    info: Distribution: "KDE neon" "24.04"
    info: Desktop Environment: KDE (KDE)
    info: Session Type: wayland
    info: Current Date/Time: 2026-04-01
    
  29. zDEFz commented on Apr 3, 2026

    @zDEFz

    Its happening in Ubuntu 24.04 with version 32.1.0

    info: Kernel Version: Linux 6.17.0-19-generic
    info: Distribution: "KDE neon" "24.04"
    info: Desktop Environment: KDE (KDE)
    info: Session Type: wayland
    info: Current Date/Time: 2026-04-01
    

    Yea, you can absolutely fix it manually.
    Not sure why this issue is closed

  30. stephematician commented on Apr 3, 2026

    @stephematician
    Contributor

    @zDEFz it's closed because it was closed - there's a new issue because it's failing for a different reason now, see: #12506. Generally speaking it's because some distributions are still using older v4l2loopback. @mrbarletta - if you can install a newer version of v4l2loopback, that would likely resolve the issue.

  31. added a commit that references this issue on Aug 22, 2026
    25639c3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/dependencyplatform/linux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions