1

I'm trying to turn my phone webcam into a "fake webcam" for my raspberry pi 400, but I get an error:

Anas@raspberrypi:~/Downloads/server/v4l2loopback $ make
Building v4l2-loopback driver...
make -C /lib/modules/`uname -r`/build M=/home/Anas/Downloads/server/v4l2loopback modules
make[1]: *** /lib/modules/5.10.17-v7l+/build: No such file or directory.  Stop.
make: *** [Makefile:46: v4l2loopback.ko] Error 2
Anas@raspberrypi:~/Downloads/server/v4l2loopback $

Please help with this.

Peregrino69
  • 2,337
  • 1
  • 15
  • 22
  • is running a configuration script necessary? If it is, did you run it already? – eftshift0 Oct 06 '21 at 21:19
  • sorry sir im a noobie can you explain to me what that is and if possible send me a link to it @eftshift0 – Anas Kattan Khayta Oct 06 '21 at 22:18
  • Anas, every project is different and the way to build it is also different. It might be the case that there is a configuration script that will take care of setting up the details to your own environment. I just checked in https://github.com/umlaeute/v4l2loopback and it only asks to run `make` so no pre-configuration is required. Just running make. Do you have the kernel headers installed? – eftshift0 Oct 06 '21 at 22:24
  • By the way, just reading https://github.com/umlaeute/v4l2loopback#dependencies – eftshift0 Oct 06 '21 at 22:25
  • yes i have the headers installed but the error i showed is what happened when i did `make` – Anas Kattan Khayta Oct 06 '21 at 23:01

2 Answers2

0

You might need to build the kernel once. What do you see when you have a ls -la /lib/modules/5.10.17-v7l+/?

You might follow these instructions here, as they need the same for their camera modules: https://www.arducam.com/docs/cameras-for-raspberry-pi/pivariety/how-to-access-and-program-the-pivariety-camera-using-command-line-python-opencv-and-gstreamer/#22-create-a-virtual-video-node-access-by-python

TL;DR:

cd ~
sudo apt install git bc bison flex libssl-dev python2
sudo wget https://raw.githubusercontent.com/RPi-Distro/rpi-source/master/rpi-source -O /usr/local/bin/rpi-source && sudo chmod +x /usr/local/bin/rpi-source && /usr/local/bin/rpi-source -q --tag-update
mkdir $(uname -r)
rpi-source -d $(uname -r)

Before you configure v4l2loopback

0

I had the same issue and installing the kernel headers solved it for me

sudo apt install raspberrypi-kernel-headers
Termi
  • 101