Droidcam Installation Error on Ubuntu 18.04

I've been trying to install Droidcam on my Ubuntu 18.04 and I've encountered an error I can't solve:

root@homelab:/tmp/droidcam-64bit#  sudo ./install
Webcam parameters: '640' and '480'
Building v4l2loopback-dc.ko
make: Entering directory '/tmp/droidcam-64bit/v4l2loopback'
make -C /lib/modules/`uname -r`/build M=`pwd`
make[1]: Entering directory '/usr/src/linux-headers-4.18.0-15-generic'
Makefile:970: "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel"
  CC [M]  /tmp/droidcam-64bit/v4l2loopback/v4l2loopback-dc.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/droidcam-64bit/v4l2loopback/v4l2loopback-dc.mod.o
  LD [M]  /tmp/droidcam-64bit/v4l2loopback/v4l2loopback-dc.ko
make[1]: Leaving directory '/usr/src/linux-headers-4.18.0-15-generic'
make: Leaving directory '/tmp/droidcam-64bit/v4l2loopback'
Moving driver and executable to system folders
Registering webcam device
insmod: ERROR: could not insert module /lib/modules/4.18.0-15-generic/kernel/drivers/media/video/v4l2loopback-dc.ko: Unknown symbol in module

Since my microphone doesn't work I am mainly using Droidcam to emulate a mic on my linux machine using my phone. I don't need the webcam capabillities either, so if I could just create a fake device I'd be happy. I just need to stream my audio through my phone to my linux machine. If I try to open Droidcam right now, I'm getting the following error: Device not found (/dev/video[0-9]). Did you install it?

Your help would be much appreciated :) Also, here's the tutorial I followed to install Droidcam (it's the official website).


Solution 1:

I faced similar problem but in a bit different scenario. I was running already installed Droidcam on Ubuntu and saw this error. It was caused due to a lost video device which happened after kernel update.

So that, I uninstalled Droidcam-

sudo /opt/droidcam-uninstall

Then reinstalled it following this procedure.

The problem was solved afterwards.

Solution 2:

I had the same problem and found the solution here:

https://stackoverflow.com/questions/34800731/module-not-found-when-i-do-a-modprobe

Running this:

sudo depmod -ae
sudo modprobe v4l2loopback_dc
droidcam

It is working for me.

Solution 3:

Just tried to use droid cam and hit same bugs. What got me going was to first install standard loopback camera from apt.

sudo apt install v4l2loopback-utils

doing install prompt for the MOK password. Then reboot and get another prompt about MOK password. Don't skip the password.

After that, I did the droid cam instructions again from the link above and the module was no more error.

I had usb debuggin on the old alcatel phone and I can find it in cheese program camera list. Here is the firs picture.

first picture using droid cam shows askubuntu post.

Now need to see about the resolution. onlye seeing 640x480 in the list of cheese settings.

install/update script


#!/bin/bash

# original command line option getter filename: commandLine.sh
# thanks to author: @theBuzzyCoder

showHelp() {
# `cat << EOF` This means that cat should stop reading when EOF is
# detected
cat << EOF  
Usage: ./droidcam.sh [-hbir -x N -y N]
Get a new droid cam if needed and change resolution if desired.

-h, -help,          --help              Display help

-b, -build,         --build             Download and rebuild droidcam

-i, -install,       --install           Install droidcam kernel modules

-r, -resolution,    --resolution        Set new resolution

-x, -xres,          --xres [N]          Pixel width resolution

-y, -yres,          --yres [N]          Pixel height resolution
EOF
# EOF is found above and hence cat command stops reading. 
# This is equivalent to echo but much neater when printing out.
}

if [[ ! $@ =~ ^\-.+ ]]
then
    echo
    echo Needs argugments
    echo
    showHelp
    exit 0
fi

export build=0
export installit=0
export resolution=0
export XRES=1920
export YRES=1080

# $@ is all command line parameters passed to the script.
# -o is for short options like -v
# -l is for long options with double dash like --version
# the comma separates different long options
# -a is for long options with single dash like -version
options=$(getopt -l "help,build,install,resolution,xpixels:,ypixels:" -o "hbirx:y:" -a -- "$@")

# set --:
# If no arguments follow this option, then the positional parameters are unset. Otherwise, the positional parameters 
# are set to the arguments, even if some of them begin with a ‘-’.
eval set -- "$options"

while true
do
case $1 in
-h|--help) 
    showHelp
    exit 0
    ;;
-b|--build) 
    export build=1
    echo BUILD=$build
    ;;
-i|--install)
    export installit=1
    ;;
-r|--resolution)
    export resolution=1
    ;;
-x|--xres)
    shift
    export XRES=$1
    ;;
-y|--yres)
    shift
    export YRES=$1
    ;;
--)
    shift
    break;;
esac
shift
done

# run the build when there is a kernel update

if [ $build -gt 0 ]; then
    cd /tmp/
    wget https://files.dev47apps.net/linux/droidcam_latest.zip
    unzip droidcam_latest.zip -d droidcam
    cd droidcam && sudo ./install-client
    sudo ./install-video
fi

# doing installation or change resolution

if [ $installit -gt 0 ] || [ $resolution -gt 0 ]; then
    sudo rmmod v4l2loopback_dc
    sudo insmod /lib/modules/`uname -r`/kernel/drivers/media/video/v4l2loopback-dc.ko width=$XRES height=$YRES
fi

Solution 4:

I have solved this problem just now, and if you have a Secure Boot enabled you might wanna uninstall the droidcam first then run this command

sudo update-secureboot-policy --enroll-key

then reboot you should see the Mok Manager then proceed to enroll key and sign it and continue booting up then re-install the droidcam