(I hope posting an answer to own question is not against TOS here, I made it because I discovered the solution while writing this post, and extensive googling didn't help, so I hope I can help some people looking for solution.)
Problem: Google chrome / chromium doesn't open v4l2loopback virtual camera device (won't access it) and report "No camera available", even if it is listed and selected in settings page sometimes.
Observed cause of problem: (noticed when using OBS Cam Studio) Google chrome / chromium WILL NOT access (open) virtual camera device if it finds real camera device being in use (busy).
Solution (short version):
ls /dev/video*
, connect it, and try ls /dev/video*
again to see which devices appeared (in my case it's /dev/video0
and /dev/video1
) - in most cases it will be /dev/video0
sudo chmod 000 /dev/video0
sudo chmod 000 /dev/video1
(use the device names that you discovered your physical webcam is)
sudo chmod 660 /dev/video0
sudo chmod 660 /dev/video1
Solution (long version): Description, step by step, how to make OBS Cam Studio virtual output be visible in google chrome/chromium.
sudo modprobe -r v4l2loopback
(you need to stop any virual camera feed and stop application that uses virtual cam, otherwise you will get modprobe: FATAL: Module v4l2loopback is in use.
error)
sudo modprobe v4l2loopback devices=1 video_nr=21 exclusive_caps=1 card_label="Virtual Webcam"
(this command will create one loopback device with name /dev/video21
and name (caption) "Virtual Webcam")
simpler version of the command, that really matters:
sudo modprobe v4l2loopback exclusive_caps=1
sudo chmod 000 /dev/video0
sudo chmod 000 /dev/video1
(device names may be different in your case and there may be just one of them) (if you have no sudo access and your camera is pluggable you can just unplug it)
sudo chmod 660 /dev/video0
sudo chmod 660 /dev/video1
(in case you unplugged the webcam plug it back and (possibly) reopen it in your program)
I hope it helps as I struggled for a long time with no effect to make google chrome open virtual webcam in OBS Cam Studio.
Edited: Found working solution that is based on similar principle, it's here: https://www.scs.stanford.edu/~dm/blog/hide-webcam.html It hides physical webcam from the list of visible webcams, so you need to enter the path to it manually or in the config settings of the program.