Linux

September 8th, 2010 Leave a comment Go to comments

The GNU/Linux module (prototype) is a combination of a Video4Linux2 device driver, and an executable app that will transfer the stream from the phone to the driver.

It’s assumed you are somewhat familiar with the system. Text in blue should be executed in the Terminal. Also please keep in mind other posts on the blog are Windows oriented.

Install

1. You must first remove any old versions of the client you have. Scroll down to the “Removal” section below.

2. Download (for DroidCam v4.0+, DroidCamX v4.0+):
32-bit (850abe9f28b3e91dee520e8d4b40c1dc), or
64-bit (7e4e4d1255f2956e69488d237d34948c).

3. Extract everything to the desktop or another folder. Make sure there are no spaces in the path.

4. Open up Terminal, cd ~/Desktop/droidcam-?? (or ~/whatever). A simple bash script is included that will automate the installation process.

Simply run sudo ./install 320 240 to install the client. sudo needed to register the device driver. 320 and 240 are optional, this is the output resolution for the webcam. Replace them with one of 320 240, 480 360, 640 480, or 960 720. You can change this anytime, so it’s best to make sure 320×240 works first.

The installer creates a settings directory as /home/`logname`/.droidcam. If you’re running as root, make sure you move it to your standard users home directory.

If no errors are displayed, you can ensure the device is installed with lsmod.

5. Open up a V4L2 compatible program (VLC player, Skype, Cheese, etc) and you should see DroidCam listed as a video device.

6. Start droidcam via the Terminal, or create a launcher if you’re using gnome. You can also try droidcam-cli -h.

7. Check the connection post on how to connect. If all goes well, you should see the output in the chat application, and you’re done! Remember to delete the install folder from step 3.

A note about USB connections: The latest version of the client will try to invoke ‘adb’ automatically, provided the executable is found via the $PATH environment variable (ie. export PATH=$PATH:/path/to/adb).
The following commands are automatically executed:
adb start-server
adb devices # Look in output for a connected device
adb forward tcp:$port tcp:$port # $port = specified port on the client

Interested in the source code? Great.

Update webcam resolution

You may change the webcam output resolution as follows:

1. Close any programs using the droidcam webcam. Unload the device driver: sudo rmmod v4l2loopback-dc

2. Re-load it as follows: sudo insmod /lib/modules/`uname -r`/kernel/drivers/media/video/v4l2loopback-dc.ko width=WIDTH height=HEIGHT (Where WIDTH and HEIGHT are numbers).
Recommended resolutions: 320×240, 480×360, 640×480, 960×720 or 1280×720.

3. Edit the first line of the text file ~/.droidcam/settings so the frames are resized properly (specify the same resolution as in 2). Restart the client to reload the settings.

4. Test the webcam with whatever programs you wish. You can keep changing the resolution.

5. Edit the text file /etc/modules so the webcam gets reloaded with the new resolution after reboot.

Removal

To remove the DroidCam client (or existing old version):

Close any running programs. Open the command line.
run `sudo ~/.droidcam/uninstall` which does the following:

– Unload the V4L driver: sudo rmmod v4l2loopback-dc.
– Delete the driver file and the client executable:
sudo rm -f /usr/bin/droidcam /usr/bin/droidcam-cli
sudo rm -f /lib/modules/`uname -r`/kernel/drivers/media/video/v4l2loopback-dc.ko

– Get rid of droidcam and ‘videodev’ in /etc/modules

Finally, Delete ~/.droidcam/ folder

  1. dev47
    February 10th, 2015 at 17:00 | #1

    might be because adb is running as sudo – although it should have dropped privileges.
    try doing `sudo adb kill-server’ then use the droidcam client (which will try starting adb)

  2. johno
    February 15th, 2015 at 14:01 | #2

    Hi,

    i tried to install it on Linux Mint 17.1 64Bit. But it faild:

    — INSTALL: Webcam parameters: ‘640’ and ‘480’
    — INSTALL: Home directory: /home/john/.droidcam
    — INSTALL: Building v4l2loopback-dc.ko
    make -C /lib/modules/`uname -r`/build M=`pwd`
    make[1]: Betrete Verzeichnis ‘/usr/src/linux-headers-3.16.0-28-generic’
    Building modules, stage 2.
    MODPOST 1 modules
    make[1]: Verlasse Verzeichnis ‘/usr/src/linux-headers-3.16.0-28-generic’
    — INSTALL: Moving driver and executable to system folders..
    — INSTALL: Registering webcam device
    insmod: ERROR: could not insert module /lib/modules/3.16.0-28-generic/kernel/drivers/media/video/v4l2loopback-dc.ko: Invalid parameters

    Any ideas?

    Thank’s a lot!
    Best regards, Johno

    • dev47
      February 16th, 2015 at 09:41 | #3

      Hello,
      hmm, not sure whats going on. Right after the error, open /var/log/syslog and look at the bottom – there might be some clues.

  3. February 16th, 2015 at 00:19 | #4

    hi,
    I’m trying to install on Linux Lite the distribution is Ubuntu 12.04.5 LTS
    I created folder on Desktop named “droidcam”
    i extracted everything to that folder.
    Here is my terminal output:

    todd@todd-Evo-N800v:~$ cd /home/todd/Desktop/droidcam
    todd@todd-Evo-N800v:~/Desktop/droidcam$ sudo ./install 320 240
    [sudo] password for todd:
    logname: no login name
    todd@todd-Evo-N800v:~/Desktop/droidcam$

    I tried it as root also but same thing.
    Why am I getting “logname: no login name” ??

    Please help, i used with windows and love your app!!
    Thank you
    T. Gardner

    • dev47
      February 16th, 2015 at 09:37 | #5

      The installer tries to run the command ‘logname’.
      Try entering that command into the terminal – if it comes back with ‘no login name’, I’d do a quick search on why that would happen.

  4. johno
    February 16th, 2015 at 17:19 | #6

    @dev47
    hm, thanks for you response! Ok, i tried it to install it with root:

    I7 droidcam # ./install
    — INSTALL: Webcam parameters: ‘640’ and ‘480’
    — INSTALL: Home directory: /home/john/.droidcam
    — INSTALL: Building v4l2loopback-dc.ko
    make -C /lib/modules/`uname -r`/build M=`pwd`
    make[1]: Betrete Verzeichnis ‘/usr/src/linux-headers-3.16.0-28-generic’
    Building modules, stage 2.
    MODPOST 1 modules
    make[1]: Verlasse Verzeichnis ‘/usr/src/linux-headers-3.16.0-28-generic’
    — INSTALL: Moving driver and executable to system folders..
    — INSTALL: Registering webcam device
    insmod: ERROR: could not insert module /lib/modules/3.16.0-28-generic/kernel/drivers/media/video/v4l2loopback-dc.ko: Invalid parameters
    I7 droidcam #

    Now the output from: “tail -f -n 0 /var/log/syslog”
    Feb 17 02:15:39 I7 kernel: [485734.055299] v4l2loopback_dc: disagrees about version of symbol video_ioctl2
    Feb 17 02:15:39 I7 kernel: [485734.055303] v4l2loopback_dc: Unknown symbol video_ioctl2 (err -22)
    Feb 17 02:15:39 I7 kernel: [485734.055329] v4l2loopback_dc: disagrees about version of symbol video_devdata
    Feb 17 02:15:39 I7 kernel: [485734.055330] v4l2loopback_dc: Unknown symbol video_devdata (err -22)
    Feb 17 02:15:39 I7 kernel: [485734.055345] v4l2loopback_dc: disagrees about version of symbol video_unregister_device
    Feb 17 02:15:39 I7 kernel: [485734.055347] v4l2loopback_dc: Unknown symbol video_unregister_device (err -22)
    Feb 17 02:15:39 I7 kernel: [485734.055359] v4l2loopback_dc: disagrees about version of symbol video_device_alloc
    Feb 17 02:15:39 I7 kernel: [485734.055360] v4l2loopback_dc: Unknown symbol video_device_alloc (err -22)
    Feb 17 02:15:39 I7 kernel: [485734.055374] v4l2loopback_dc: disagrees about version of symbol v4l2_device_register
    Feb 17 02:15:39 I7 kernel: [485734.055375] v4l2loopback_dc: Unknown symbol v4l2_device_register (err -22)
    Feb 17 02:15:39 I7 kernel: [485734.055392] v4l2loopback_dc: disagrees about version of symbol __video_register_device
    Feb 17 02:15:39 I7 kernel: [485734.055393] v4l2loopback_dc: Unknown symbol __video_register_device (err -22)
    Feb 17 02:15:39 I7 kernel: [485734.055403] v4l2loopback_dc: disagrees about version of symbol v4l2_device_unregister
    Feb 17 02:15:39 I7 kernel: [485734.055404] v4l2loopback_dc: Unknown symbol v4l2_device_unregister (err -22)
    Feb 17 02:15:39 I7 kernel: [485734.055413] v4l2loopback_dc: disagrees about version of symbol video_device_release
    Feb 17 02:15:39 I7 kernel: [485734.055415] v4l2loopback_dc: Unknown symbol video_device_release (err -22)
    Feb 17 02:15:54 I7 console-kit-daemon[1975]: GLib-CRITICAL: Source ID 1219 was not found when attempting to remove it

    And at last your command: `sudo adb kill-server’:
    john@I7 ~/Dokumente/droidcam $ sudo adb kill-server
    sudo: adb: command not found

    Thank you for your support! :-)
    Best regards, john

    • dev47
      February 17th, 2015 at 17:44 | #7

      Hi,
      It seems you might be missing some video4linux2 libs. You should ensure you have the correct linux-headers installed:
      sudo apt-get install linux-headers-`uname -r`
      sudo depmod -a

      Then run a ‘make clean` under droidcam/v4l2loopback before trying the install script again.

  5. Jinghis
    February 19th, 2015 at 05:41 | #8

    Hello!

    I tried to install the client, but I bumped to this problem. The terminal showed me this:

    [root@Gizi-Arch droidcam]# ./install 320 240
    [snip]
    make[1]: Leaving directory ‘/usr/lib/modules/3.18.6-1-ARCH/build’
    Makefile:4: recipe for target ‘all’ failed
    make: *** [all] Error 2
    — INSTALL: v4l2loopback-dc.ko not built.. Failure

    Can someone tell me, what did I missed out, or what is the answer for that, because I don’t have a clue :/?

  6. March 9th, 2015 at 04:43 | #10

    How can I use 1280×920 from an ace2 using ubuntu 14.10?

    I installed the client with “./install 960 720″ but I got this as resolution in vlc. It was also kind of blurry, it seems even format 1 is too low quality, sililar to format 2. I don’t really know why I bought it lol. But that’s another story…

    Anyway, I edited the settings file to make it 1280-720 from 960-720 but then vlc would give me a greenish capture composited of 4(?) videos with garbage. Unusable.

    I then uninstalled it, rebooted and tried to install it with “./install 1280 720″ but that failed with the message Parameters too low: ‘1280’ and ‘720’

    What do I do? I don’t understand

    Also, why is the quality of format 1 worse than my crappy, cheap webcam? Any chance of improvement?

    • dev47
      March 9th, 2015 at 17:40 | #11

      Format 1 uses very little CPU but is pinned to 400×300 (the tradeoff is much more network usage).
      To get to higher resolutions, the frames need to be compressed – this is where Format 2 comes in (its basically JPEG).
      Another thing that could get in the way is which resolutions your phone provides to apps for video recording. A lot of them will limit the selection. DroidCam picks the closest one available given the webcam resolution on computer.

Comment pages
1 6 7 8 12
captcha