4

I want to use my phone camera as a webcam in my computer with Ubuntu. I read that DroidCam is the easiest way...

So, I tried following the official script: https://www.dev47apps.com/droidcam/linuxx/

cd /tmp/
wget https://files.dev47apps.net/linux/droidcam_latest.zip
echo "fb7d7fa80a8e47a98868941939104636 droidcam_latest.zip" | md5sum -c --
# OK?
unzip droidcam_latest.zip -d droidcam && cd droidcam
sudo ./install

However, the video device is not installed, nothing found if I check this:

lsmod | grep v4l2loopback_dc

My terminal is asking for the path of the public key but I left it empty as suggested:

$ sudo ./install
Webcam parameters: '640' and '480'
Building v4l2loopback-dc.ko
make: Entering directory '/tmp/droidcam/v4l2loopback'
make -C /lib/modules/5.4.0-33-generic/build M=/tmp/droidcam/v4l2loopback modules
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-33-generic'
  CC [M]  /tmp/droidcam/v4l2loopback/v4l2loopback-dc.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC [M]  /tmp/droidcam/v4l2loopback/v4l2loopback-dc.mod.o
  LD [M]  /tmp/droidcam/v4l2loopback/v4l2loopback-dc.ko
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-33-generic'
make: Leaving directory '/tmp/droidcam/v4l2loopback'
Secure Boot is enabled, attempting to sign the driver
please specify signing key location (or leave empty to sign manually later)
You can Google 'secure boot' for your distro

Enter the path of the public key: 
Enter the path of the private key: 
Adding uninstall script
Moving driver and executable to system folders
+ cp v4l2loopback/v4l2loopback-dc.ko /lib/modules/5.4.0-33-generic/kernel/drivers/media/video/
+ cp droidcam /usr/bin/
+ cp droidcam-cli /usr/bin/
+ set +x
Registering webcam device
insmod: ERROR: could not insert module /lib/modules/5.4.0-33-generic/kernel/drivers/media/video/v4l2loopback-dc.ko: Operation not permitted
warning: insmod failed
Running depmod
make: Entering directory '/tmp/droidcam/v4l2loopback'
make -C /lib/modules/5.4.0-33-generic/build M=/tmp/droidcam/v4l2loopback clean
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-33-generic'
  CLEAN   /tmp/droidcam/v4l2loopback/Module.symvers
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-33-generic'
make: Leaving directory '/tmp/droidcam/v4l2loopback'
Done

If I run DroidCam in my phone and then in Ubuntu... the following message popups in Ubuntu:

Droidcam video device not found (/dev/video[0-9]). Did it install correctly? If you had a kernel update, you may need to re-install.

How can I Secure Boot Module Signing in Ubuntu 20.04? Could the issue be related with this? Any idea or alternative solution to Droidcam would be really appreciate it : )

Johnny Johnny
  • 211
  • 3
  • 6
  • Maybe you need to disable secure boot from your BIOS firmware settings? – Akib Azmain Turja Jun 02 '20 at 11:50
  • 1
    thank u so much @Akib but that's dangerous, isn't it? do you know an alternative? – Johnny Johnny Jun 02 '20 at 12:36
  • 1
    No that's not dangerous (if know what you are doing). Secure Boot just secures the boot process by checking the signature of bootloader, linux kernel etc which are the part of the boot process. If signature isn't matched, boot process is canceled. The signature usually don't mismatch. They mismatch only when your PC is infected by malware, which won't happen if you don't misuse root privilege and install untrusted software. – Akib Azmain Turja Jun 02 '20 at 13:16
  • Did disabling secure boot work? – Shihab Khan Jul 31 '20 at 15:48

1 Answers1

1

This did it for me:

sudo apt-get install linux-generic
sudo apt-get install v4l2loopback-dkms
sudo modprobe v4l2loopback

Got the solution from here modprobe v4l2loopback fails on Ubuntu

During the install of v4l2loopback-dkms I had to do the 'Enroll MOK' process (it guided me automatically).

After this I uninstalled and reinstalled Droidcam and the webcam was registered with no error

Carlos MSF
  • 111
  • 2
  • does not work for installation of droidcam – sjatkins Mar 11 '21 at 22:52
  • 1
    @sjatkins What version are you using? This worked for me in Ubuntu 20.04 focal (x86-64). The only problem is that I have to repeat the process every time there's a kernel update. – Carlos MSF Mar 15 '21 at 22:42