Skip to content

Linux: Stopping Virtual Camera Requires v4l2loopback Restart to Restart Virtual Camera #12506

Open

Description

@hcgernhardtiii

Operating System Info

Ubuntu 24.04

Other OS

No response

OBS Studio Version

31.1.2

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/QzOiXzO43puQU00c

OBS Studio Crash Log URL

No response

Expected Behavior

After stopping the virtual camera, it should restart without issue.

Current Behavior

The virtual camera fails to start, showing the following error:

Image

Steps to Reproduce

  1. Start the virtual camera after a fresh boot with v4l2loopback up and running.
  2. Stop the virtual camera.
  3. Start it again.
    ...

Anything else we should know?

This started for me with 31.1.0.

As shown in the logs, after stopping v4l2loopback, /dev/video has the following:

crw-rw----+ 1 root video 81, 1 Aug 14 06:01 /dev/video0
crw-rw----+ 1 root video 81, 2 Aug 14 06:01 /dev/video1
crw-rw----+ 1 root video 81, 0 Aug 14 18:43 /dev/video10

modprobe --remove v4l2loopback results in /dev/video10 going away.
modprobe v4l2loopback (reloading it) brings /dev/video10 back.

Let me know if there's any other information (such as the output of lsmod or the kernel module configuration for v4l2loopback) you may need.

Thanks so much!

Activity

  1. stephematician commented on Aug 15, 2025

    @stephematician
    Contributor

    What version of v4l2loopback are you using, e.g. as reported by modinfo v4l2loopback.

    I think you mean that it started with 31.1.2; because I don't think 31.1.0 would include the "attempting to reset output capability" shown in the log.

  2. stephematician commented on Aug 15, 2025

    @stephematician
    Contributor

    @cmosetick - you reported a similar problem but I never saw any further details (I suggested trying the OBS forum)

    Given that two people have reported this, I am wondering if there's something that has been missed in #11906 (in spite of best efforts to test).

  3. stephematician commented on Aug 15, 2025

    @stephematician
    Contributor

    Alternatively; there could be a new problem.

    I noticed that when I was last Recording: I wasn't able to close and re-open my webcam (not the Virtual Camera); something that I don't think has happened before.

  4. hcgernhardtiii commented on Aug 15, 2025

    @hcgernhardtiii
    Author

    Output from modinfo v4l2loopback:

    filename:       /lib/modules/6.8.0-65-lowlatency/kernel/v4l2loopback/v4l2loopback.ko.zst
    license:        GPL
    author:         Vasily Levin, IOhannes m zmoelnig <[email protected]>,Stefan Diewald,Anton Novikovet al.
    description:    V4L2 loopback video device
    srcversion:     BA0C71A8222B3B2583C4AFA
    depends:        videodev
    retpoline:      Y
    name:           v4l2loopback
    vermagic:       6.8.0-65-lowlatency SMP preempt mod_unload modversions 
    sig_id:         PKCS#7
    signer:         Build time autogenerated kernel key
    sig_key:        62:05:4C:A6:3F:FC:0F:F1:F4:28:08:25:12:51:8E:0D:38:7A:72:B6
    sig_hashalgo:   sha512
    signature:      1B:7B:A2:E9:A6:51:98:3E:71:08:2C:EC:CC:AA:8D:06:98:B0:AB:DA:
    		7D:98:1F:E5:BF:8A:FA:FA:CD:01:B6:BA:FC:E7:9A:2A:16:E7:00:21:
    		3C:50:3C:A1:74:77:2F:CD:EC:E6:B9:0D:88:58:90:79:64:7B:BB:55:
    		11:4A:89:7C:94:40:71:CB:23:18:36:5D:E7:EC:D2:DC:0D:3C:EC:D6:
    		5C:41:B2:C3:07:0E:CC:58:43:67:DB:05:6E:4A:FB:B3:3A:6A:64:5A:
    		55:C7:13:9B:53:61:F3:9A:A0:09:33:47:AE:D2:BD:CD:91:72:C8:A0:
    		2A:75:82:B5:EA:5D:87:36:E9:20:66:E6:79:B4:E4:11:C4:D4:DC:94:
    		26:33:58:49:F2:63:59:B0:CF:6F:67:7D:E2:CD:9D:CE:0B:76:0F:98:
    		E5:6F:89:0F:F1:9A:7C:CF:86:A3:59:F1:2A:8D:97:2E:5C:92:8A:45:
    		69:D4:48:3C:0A:69:7A:4D:3F:9F:CE:D6:72:06:E5:A3:5D:25:37:B5:
    		83:4B:9F:A5:78:B2:8F:9F:96:7D:91:F3:C6:29:F5:97:44:51:1E:63:
    		2E:4C:B8:19:0A:79:25:2E:D0:EE:2A:C9:14:0E:2B:CD:FA:29:80:26:
    		92:23:C8:0A:C8:CD:28:21:69:47:92:71:BB:18:1D:CA:05:51:BF:B4:
    		9D:18:5A:A1:A7:95:EA:DB:0D:6D:0E:8C:76:96:F1:5B:31:96:FC:7B:
    		C3:4D:B3:52:B8:E9:9F:F9:A1:C8:AF:2C:27:05:DB:AF:BD:E7:35:4C:
    		E9:33:8E:AF:1C:7C:20:AD:8A:75:41:AE:0E:F5:DD:42:A6:09:A4:14:
    		43:12:A3:AF:B2:6D:58:24:EB:E7:F4:D8:EE:3E:2A:42:B5:AE:9D:C5:
    		83:B4:BF:63:BB:E1:7A:AD:64:CC:9A:6B:66:4D:8E:E8:13:8F:9B:47:
    		9B:DB:03:61:EB:4A:46:87:EC:41:86:C7:F9:D9:1C:A8:BC:18:44:C3:
    		45:60:AF:AD:59:A2:32:CE:E0:97:E0:16:F9:FA:BC:F7:49:9B:FE:63:
    		44:AB:97:EC:F4:E8:08:42:F4:38:7E:12:E3:0B:AE:15:91:94:20:C2:
    		85:A3:81:CB:88:40:D7:FA:F5:D7:5D:32:09:F6:73:13:11:AA:AE:96:
    		32:A3:07:90:B1:97:35:04:CC:FD:67:BF:29:12:88:A6:F1:C7:D1:7C:
    		28:43:3E:5C:EB:E8:05:0B:11:75:A2:8A:46:2E:59:FC:A3:92:FF:6C:
    		FE:9E:86:84:1B:77:87:E8:63:20:CA:CF:EE:F1:AA:28:21:5C:8E:75:
    		49:05:37:5F:D7:DF:4C:DF:06:73:ED:19
    parm:           debug:debugging level (higher values == more verbose) (int)
    parm:           max_buffers:how many buffers should be allocated (int)
    parm:           max_openers:how many users can open loopback device (int)
    parm:           devices:how many devices should be created (int)
    parm:           video_nr:video device numbers (-1=auto, 0=/dev/video0, etc.) (array of int)
    parm:           card_label:card labels for every device (array of charp)
    parm:           exclusive_caps:whether to announce OUTPUT/CAPTURE capabilities exclusively or not (array of bool)
    parm:           max_width:maximum frame width (int)
    parm:           max_height:maximum frame height (int)
    

    I just performed an apt update && apt full-upgrade, so this should be the most recent version from the repos.

  5. stephematician commented on Aug 16, 2025

    @stephematician
    Contributor

    If this means you're using the usual Ubuntu 24.04 v4l2loopback-dkms package, then you've probably got version 0.12.7.

    I can reproduce the behaviour provided I don't open the Virtual Camera in another application. A (horrible) workaround is:

    1. Start the virtual camera.
    2. Open it with ffplay or something.
    3. Stop the virtual camera.
    4. Close ffplay.

    You can now start and stop the virtual camera as often as you like.

    This is still (basically) a problem with v4l2loopback which OBS has tried to work around for some time. Newer versions of the loopback module don't exhibit this behaviour; but OBS had a non-compliant work-around - so we had to try a new work-around in OBS. But corner cases seem to keep popping up :/

    I'll have a quick look today to see if there's a way to clean this corner case up.

    A better workaround, btw, is to use a newer version of the loopback module. There's nothing really stopping you from downloading the .deb package of 0.15.0 from here: https://packages.debian.org/trixie/all/v4l2loopback-dkms and installing it with gdebi or apt.

  6. hcgernhardtiii commented on Aug 16, 2025

    @hcgernhardtiii
    Author

    @stephematician Yep, looks like I'm using 0.12.7-2ubuntu5 if I'm parsing the output from apt list correctly.

    I can reproduce the behaviour provided I don't open the Virtual Camera in another application. A (horrible) workaround is:

    1. Start the virtual camera.
    2. Open it with ffplay or something.
    3. Stop the virtual camera.
    4. Close ffplay.

    That didn't work for me—I had the same error condition with the virtual camera when I tried to restart it after closing ffplay. The thing that's been working continuously is to remove and reload the v4l2loopback module.

    A better workaround, btw, is to use a newer version of the loopback module. There's nothing really stopping you from downloading the .deb package of 0.15.0 from here: https://packages.debian.org/trixie/all/v4l2loopback-dkms and installing it with gdebi or apt.

    The updated version appears to be working. It was a bit of a slog for me to actually find the .deb files. For those who might look at this later, I found them at https://ftp.debian.org/debian/pool/main/v/v4l2loopback/

    Given that upgrading v4l2loopback solves the issue, and it's fairly painless, shall we consider this resolved?

  7. stephematician commented on Aug 17, 2025

    @stephematician
    Contributor

    Yeah; sorry, I could have linked to the packaged files. Otherwise, the .deb can be built from the source package as follows:

    1. Download the .dsc, the v4l2loopback_0.15.0.orig.tar.gz and v4l2loopback_0.15.0-2.debian.tar.xz from the link I provided into a folder, say ~/debian/loopback.
    2. Go to ~/debian/loopback in a terminal, and extract the files into a folder v4l2loopback-0.15.2 via:
      dpkg-source -x v4l2loopback_0.15.0-2.dsc
      
    3. Then cd v4l2loopback-0.15.0 and build the debian files which will be placed back in ~/debian/loopback:
      debuild -us -uc
      
      NOTE: this is an unsigned build.
    4. Go back and use dpkg or apt or gdebi to install the .deb.

    Details are provided in the maintainers guide, but it's way more detail than most need.

    Anyway; I wouldn't close this issue because in theory (I believe) Ubuntu 24.04 is a target platform for OBS; so if we can fix it up so that it works with the loopback module provided for 24.04, then we should. I've got a proposed fix already: #12510

  8. yllekz commented on Dec 22, 2025

    @yllekz

    I have run into this on a consistent basis with the Flatpak OBS for a few months now.

    The consistent fix is to run this:
    sudo modprobe -r v4l2loopback; sudo modprobe v4l2loopback

    But that's super annoying to do. I don't seem to have this issue in any other app, just OBS.

  9. notyourbiz commented on Dec 23, 2025

    @notyourbiz

    hey there, i'm having the exact same problems here...

    running OBS-.Studio 32.0.4 (Flatpak) on Linux Mint 22 Wilma Cinnamon

  10. lizzi193 commented on Dec 25, 2025

    @lizzi193

    I can confirm the issue with flatpak Version on Linux Mint 22 Cinnamon.

    The consistent fix is to run this:
    sudo modprobe -r v4l2loopback; sudo modprobe v4l2loopback
    But that's super annoying to do.

    End users without technical skills will not be able to make it work.

  11. stephematician commented on Dec 25, 2025

    @stephematician
    Contributor

    In case this has been missed, there is a proposed fix already #12510

    Just waiting for it to get merged.

  12. dephekt commented on Dec 27, 2025

    @dephekt

    Yeah; sorry, I could have linked to the packaged files. Otherwise, the .deb can be built from the source package as follows:

    I wanted to mention a slightly alternative approach, I think it is more canonical based on the upstream readme but like most nerd things it's an opinionated take and debatable. My thinking was if I'm managing the package out-of-band from apt then I should probably remove the apt packages and lean into the notion I have to manage this myself.

    1. Remove the apt packages: sudo apt remove v4l2loopback-dkms v4l2loopback-utils
    2. Mark dkms as manually installed: sudo apt install dkms
      • Prevents dkms being auto-removed later if v4l2loopback was the only package needing it
    3. Download the latest source and extract to the system source tree :
    curl -L https://github.com/umlaeute/v4l2loopback/archive/v0.15.3.tar.gz | tar xvz -C /usr/src
    
    1. Build and install using DKMS:
    sudo dkms add -m v4l2loopback -v 0.15.3
    sudo dkms build -m v4l2loopback -v 0.15.3
    sudo dkms install -m v4l2loopback -v 0.15.3
    
    1. Install the latest v4l2loopback-ctl:
    cd /usr/src/v4l2loopback-0.15.3/utils
    sudo bash -c "make && make install"
    

    To update the module in the future, just repeat steps 3, 4, and 5 using the new release tag (e.g. 0.15.4 or 0.16.1).

    Looking forward to your proposed MR getting merged, thanks for your effort ❤️

  13. yllekz commented on Dec 27, 2025

    @yllekz

    I can confirm the issue with flatpak Version on Linux Mint 22 Cinnamon.

    The consistent fix is to run this:
    sudo modprobe -r v4l2loopback; sudo modprobe v4l2loopback
    But that's super annoying to do.

    End users without technical skills will not be able to make it work.

    I'm very aware of that. If it wasn't clear, my in-between-the-lines statement is that while the workaround works, it's not viable for regular users (heck, even if you're tech savvy this is a very annoying fix because it requires opening Terminal + running a command that requires sudo)

  14. philb61 commented on Jan 22, 2026

    @philb61

    Is this fix ever going to get merged in? I'm presently using v4l2loopback-dkms:

    v4l2loopback-dkms/now 0.15.2-1 all [installed,local]
    Source for the v4l2loopback driver (DKMS)

    on Ubuntu 24.04, and it still happens.

  15. NeatNit commented on Apr 23, 2026

    @NeatNit

    Leaving a note here for anyone unlucky enough to have to deal with this but lucky enough to find this post.

    TL;DR: this is the .deb to install: https://packages.debian.org/forky/all/v4l2loopback-dkms/download just pick any of the mirrors and continue despite no https. Verify the download afterwards using the SHA256 checksum at the bottom of the page. On Mint, I could just double-click the .deb and a GUI opened to install it. Hope it's as easy on other distros. Done.

    More details: This plan sounded good to me, but failed:

    A better workaround, btw, is to use a newer version of the loopback module. There's nothing really stopping you from downloading the .deb package of 0.15.0 from here: https://packages.debian.org/trixie/all/v4l2loopback-dkms and installing it with gdebi or apt.

    It failed to install (Linux Mint 22.3 Xfce) because of this bug which was fixed in v4l2loopback-v0.15.1. The package on stable Debian is still 0.15.0-2, and doesn't have the fix. Luckily, the next version of Debian has a more updated version 0.15.3-1 https://packages.debian.org/forky/all/v4l2loopback-dkms and this seemed to install fine. That's it... I think. OBS can start and stop the virtual camera as many times as needed. Apps like Discord, Signal and Zoom appear to see the camera.

    Now, the next issue might affect only me and probably has nothing to do with OBS, but I just cannot get Firefox specifically to see the camera picture. It detects that the camera exists, but it just can't show it in the preview and websites trying to use the camera get a blank image. I haven't looked into this issue yet, and frankly I ran out of patience for this. But still I would like to know if anyone else is having this exact problem.

  16. philb61 commented on Apr 23, 2026

    @philb61

    Now, the next issue might affect only me and probably has nothing to do with OBS, but I just cannot get Firefox specifically to see the camera picture. It detects that the camera exists, but it just can't show it in the preview and websites trying to use the camera get a blank image. I haven't looked into this issue yet, and frankly I ran out of patience for this. But still I would like to know if anyone else is having this exact problem.

    I'm not having this problem. Just tested with a Google Meet link. Hopefully, you can find a resolution quickly.

  17. NeatNit commented on Apr 24, 2026

    @NeatNit

    I'm not having this problem. Just tested with a Google Meet link. Hopefully, you can find a resolution quickly.

    Thanks for the data point!

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions