Open saifrahmed opened 4 years ago
I'm running into the same issue on Mint 19.3:
Traceback (most recent call last):
File "webtest.py", line 11, in <module>
camera = pyfakewebcam.FakeWebcam('/dev/video20', 640, 480)
File "/usr/local/lib/python3.6/dist-packages/pyfakewebcam-0.1.0-py3.6.egg/pyfakewebcam/pyfakewebcam.py", line 56, in __init__
fcntl.ioctl(self._video_device, _v4l2.VIDIOC_S_FMT, self._settings)
OSError: [Errno 22] Invalid argument
its seems Proposed solution was to install the kernel module from github instead of using the officially distributed v4l2-loopback package from Ubuntu 18.04
That seems to fix it, thanks!
Ubuntu 18.04 Linux 5.3.0-46-generic
sudo modprobe -r v4l2loopback sudo apt remove v4l2loopback-dkms
sudo apt-get install linux-generic sudo apt install dkms
https://github.com/umlaeute/v4l2loopback.git cd v4l2loopback make
sudo cp -R . /usr/src/v4l2loopback-1.1 sudo dkms add -m v4l2loopback -v 1.1 sudo dkms build -m v4l2loopback -v 1.1 sudo dkms install -m v4l2loopback -v 1.1 sudo reboot
Do you happen to know if these steps are relevant for Ubuntu 20.04? Thanks!
Using video2 instead of video1 worked for me. (Ubuntu 20.04)
I have the same problem with Ubuntu 21.04. (I have already tried all mentioned fixes). Any ideas?
I have the same problem with Ubuntu 21.04. (I have already tried all mentioned fixes). Any ideas?
Do sudo modprobe -r v4l2loopback
see the output of ls /dev/video*
In your modprobe command choose a virtual device number that is not already present.
In my case I used modprobe v4l2loopback devices=1 exclusive_caps=1 video_nr=7 card_label="v4l2loopback"
With 7
being an id that was not existing prior to activating v4l2loopback.
@JanSurft Thanks a lot! Now it works! I think the explicit phrase of the video ID did the trick.
sudo modprobe -r v4l2loopback
sudo modprobe v4l2loopback devices=1 exclusive_caps=1 video_nr=7 card_label="v4l2loopback"
ls /dev/video*
@JanSurft Thanks a lot! Now it works! I think the explicit phrase of the video ID did the trick.
sudo modprobe -r v4l2loopback sudo modprobe v4l2loopback devices=1 exclusive_caps=1 video_nr=7 card_label="v4l2loopback" ls /dev/video*
For me, it was /dev/video20
. Why does that happen, and can I set the number manually to 2?
Dear @jremmons - Firstly thanks for this project, this is exactly what I was looking for!
I tried running the project (both pip installed and via local pulls (both tagged release and master branch) but keep getting and "OSError: [Errno 22] Invalid argument" on the fcntl.ioctl call.
I tried using both webcams w/o success. I also did a
ls /dev | grep video
and tried the different devices w/o success.Suspecting an issue with the settings object _v4l2.v4l2_format() I also tried to strip that down w/o success. I'm running on Ubuntu 18 with all the required dependency installs. Any suggestions on possible ways to debug this?