Linux

The GNU/Linux client is a combination of an executable app that connects to the phone, and Video4Linux and ALSA loopback drivers.

It’s assumed you are familiar with the system and how to use the Terminal. Please keep in mind other posts on the website are Windows oriented.

Install

Note: Only standard 64-bit binaries are provided. You’ll need to compile the client from source if you are running a 32-bit or ARM based system.

If droidcam is already installed, make sure it’s not open.
Download and install latest client:
cd /tmp/
wget -O droidcam_latest.zip https://files.dev47apps.net/linux/droidcam_2.1.3.zip
# sha1sum: 2646edd5ad2cfb046c9c695fa6d564d33be0f38b
unzip droidcam_latest.zip -d droidcam
cd droidcam && sudo ./install-client

Note: Latest versions of Debian, Ubuntu, Fedora have removed libappindicator, which is needed for the system tray icon.

On Ubuntu 21, use sudo apt install libappindicator3-1.
On Fedora 33, use sudo dnf install libappindicator-gtk3
For Debian Bullseye, get:
https://files.dev47apps.net/linux/libindicator3-7_0.5.0-4_amd64.deb
https://files.dev47apps.net/linux/libappindicator3-1_0.4.92-7_amd64.deb

Video

You can use the standard v4l2loopback-dkms module (available on most systems), or the DroidCam version v4l2loopback-dc.

With v4l2loopback-dc you’ll see “DroidCam” in the list of webcams, have Skype+Chrome support without needing exclusive_caps=1, and the install scripts will setup the module to auto-load on system boot.

To compile and install v4l2loopback-dc,

1. Get these packages: linux-headers-`uname -r` gcc make.

For example: sudo apt install linux-headers-`uname -r` gcc make

2. Run sudo ./install-video

The install-video script will try to auto-sign the drivers if you have secure boot enabled. If signing fails, you will be prompted to manually take care of signing the driver. Find and follow 'Secure Boot Module Signing' instructions for your distro.

If all goes well, you can ensure the video device is loaded via lsmod (you should see v4l2loopback_dc in the output).

Skype, Zoom, OBS Studio, etc. should now list DroidCam as a video device (you may also see it listed as a raw /dev/video device). Note: OBS Studio users should check out DroidCam OBS as an alternative.

Sound (optional)

DroidCam can use the Linux ALSA Loopback sound card for audio. Caution: there are many quirks with audio on different Linux systems. It is recommended you use droidcam for video only, and use a regular microphone for audio input.

Run sudo ./install-sound to load the Loopback sound card. See Extra Notes below for additional audio related information.

Run

Start droidcam client from the Gnome launcher menu or via the Terminal. There is also a cli client, droidcam-cli, that you can use.

If the main client does not open, please check the libappindicator notes under the Install section above.

Extra Notes

Video rotation:
You can achieve portrait video by inverting the webcam. See the HD Mode section below.

Android USB connections:

(a) Turn on “USB Debugging” on your phone. Its located in the system Settings, under Developer Options.
On most phones the Developer Options screen is hidden by default. To unlock it, open the phones Settings, go to About Phone and search for Build number. Tap Build Number seven times to unlock Developer options. Once unlocked, search for USB Debugging and turn it On.

(b) Ensure adb is installed. The client app will try to invoke adb automatically to setup the DroidCam connection.
Debian-based Linux users can do: sudo apt-get install adb
Fedora/SUSE-based Linux users can do: sudo yum install android-tools

If you have multiple devices, you can specify which one to connect to using ANDROID_SERIAL environment variable. Use adb devices to list available devices and serials, then env ANDROID_SERIAL=XYZ droidcam-cli adb 4747.

iOS USB Connections:
The client will try to communicate with usbmuxd to detect and connect to your iOS device. Make sure usbmuxd is installed and running.

Sound support:
To use the mic in PulseAudio you can either run
pacmd load-module module-alsa-source source_properties=device.description=DroidCam device=hw:Loopback,1,0 (you may need to adjust the last number; on some systems you need to do this after launching the droidcam client. ), or by editing /etc/pulse/default.pa as described here.

If the Loopback card takes over your line out, you can set the default PulseAudio sink as shown here.

With Pipewire, open pavucontrol, Configuration tab. There are probably multiple devices called “Built-in Audio”, one of them is droidcam. Choose the profile Pro Audio, go to the Input Devices tab and check which meter reacts to the phone’s audio input (eg. Built-in Audio Pro 1), this is the desired audio input device.
Inside pavucontrol you can now set this device as default input or choose it as the input device for individual apps etc.

HD Mode – Change webcam resolution

If you are using the regular v4l2loopback module, close the droidcam client and any programs using v4l2loopback. Update the size parameter in ~/.config/droidcam using one of the sizes from step 2 below.

For DroidCam v4l2loopback-dc, you can change the webcam resolution as follows:

1. Close any programs using the droidcam webcam. Unload the driver:
sudo rmmod v4l2loopback_dc

2. Re-load it with new options (WIDTH and HEIGHT are numbers). :
sudo insmod /lib/modules/`uname -r`/kernel/drivers/media/video/v4l2loopback-dc.ko width=WIDTH height=HEIGHT

Standard sizes (Width x Height): 640×480, 960×720, 1280×720 (720p), 1920×1080 (1080p).
Note: MS Teams and Skype on Linux support only up to 1280×720 input.

3. Re-open the droidcam client and test it out.

4. Edit the text file /etc/modprobe.d/droidcam.conf with the new options to make the change permanent.

It’s also possible to invert the video size (eg. 480×640, width=480 height=640), which will make the webcam vertical and rotate the video 90º. Not all programs may load the webcam with inverted parameters (eg. Discord does not) but many do (eg. Zoom and OBS).

Note: if the new options are not being loaded on boot, you may need to update your initramfs:
Ubuntu: sudo update-initramfs -u
OpenSUSE: sudo dracut -f --regenerate-all

Removal

Close any running programs to make sure droidcam is not in use and run sudo /opt/droidcam-uninstall.