Code Monkey home page Code Monkey logo

droidcam's Introduction

Linux

Download and Install

You can download and install the latest release from the official website at https://www.dev47apps.com/droidcam/linux/, along with instructions on how to update the webcam resolution and other info.

Releases are also available here on GitHub at https://github.com/dev47apps/droidcam/releases

Raspberry-PI instructions can be found here: https://github.com/dev47apps/droidcam/wiki/Raspberry-PI

Building

Install the dependencies

Debian/ubuntu:
libavutil-dev libswscale-dev libasound2-dev libspeex-dev libusbmuxd-dev libplist-dev libturbojpeg0-dev

# Only needed for GUI client
libgtk-3-dev libappindicator3-dev


Fedora:
libavutil-free-devel libswscale-free-devel alsa-lib-devel speex-devel libusbmuxd-devel libplist-devel turbojpeg-devel

# Only needed for GUI client
gtk3-devel libappindicator-gtk3-devel

Run make, or make droidcam-cli if you skipped installing GTK+, to build the droidcam binaries.

To install, run sudo ./install-client

Note: Some distros are removing libappindicator in their latest versions (Ubuntu 21+, Fedora 33+, Debian Bullseye+), used for system tray icon. The new dependency (Ubuntu) is libayatana-appindicator3-dev

You can specify the indicator libary to make like so: APPINDICATOR=ayatana-appindicator3-0.1 make droidcam

V4L2 Loopback (Webcam driver)

DroidCam has its own version of v4l2loopback, v4l2loopback-dc, which makes the app a little more user-friendly. DroidCam works with the standard v4l2loopback module, so installing v4l2loopback-dc is optional.

The standard v4l2loopback module is already available on most distros as v4l2loopback-dkms. See v4l2loopback usage examples.

The main differences with v4l2loopback-dc are that:

  • You’ll see "DroidCam" in the list of webcams.
  • It works with Skype+Chrome without the need for exclusive_caps=1.
  • The install scripts will configure v4l2loopback-dc to auto-load after reboot.

To use v4l2loopback-dc, make sure you have these dependencies installed

linux-headers-`uname -r` gcc make

then run sudo ./install-video to build the module and install it.

Debian/Ubuntu and RHEL (Fedora/SUSE) based distros: If your system supports DKMS, you can instead use sudo ./install-dkms.

(note: you may need the deb-helper package)

Sound

DroidCam can use the Linux ALSA Loopback sound card for audio. There are many differences and quirks with audio on different Linux systems. It’s recommended you use a regular microphone and keep droidcam for video only.

Run sudo ./install-sound to load the Linux ALSA Loopback sound card which the Droidcam client will use for audio input.

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

If the Loopback card takes over your line out, you can set the default PulseAudio sink as shown here: https://askubuntu.com/a/14083

To use DroidCam with Pipewire (Source)

  • Open pavucontrol, Configuration tab
  • There's probably multiple devices called "Built-in Audio", one of them is droidcam. Try with the bottom device maybe.
  • Choose the profile Pro Audio
  • Go to the Input Devices tab
  • Check which VU 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.

FreeBSD

Initial considerations

Please make sure that you add your user to the webcamd group after the installation of the dependencies, this can be done by running doas pw groupmod webcamd -m $USER

You will also want to enable webcamd and the cuse module to load at boot for that you'll need to modify /etc/rc.conf and /boot/loader.conf with:

webcamd_enable="YES"

and

cuse_load="YES"

respectively.

Getting all the necessary dependencies

Run doas pkg install gmake gcc pkgconf libjpeg-turbo usbmuxd libusbmuxd alsa-lib v4l_compat speex ffmpeg webcamd libappindicator

Building and Installing

Run gmake, or gmake droidcam-cli if you wish to only build the command line version of droidcam.

To install, run doas ./install-client

Running

You'll need to run doas webcamd -B -c v4l2loopback before launching droidcam

droidcam's People

Contributors

aramg avatar arifd avatar bernardogo avatar dlobatog avatar doamatto avatar eazel7 avatar ericonr avatar etherealthedev avatar igormorgado avatar invidian avatar johschilleremnify avatar kenohassler avatar lbriais avatar ls-fcefyn avatar okready avatar parranoh avatar recolic avatar royge avatar skbeh avatar stefanbruens avatar suhr avatar timrichardson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

droidcam's Issues

A question about the forward proxy NGINX patch

Hi Aram,

Sorry for using this issue to contact you - following your advice https://gist.github.com/aramg/4540f0f8cfb8922e89bd#gistcomment-1959333.

Could you please advise me on the status of that patch? Is it now a part of OpenResty release? If I download OpenResty, will I get this patch installed? You wrote in your blog: "his new code has gone out to production just recently". So is it part of OpenResty or do you apply the patch during your internal build process?

Thanks a lot for the great blog and the patch!

Vadim

altered webcam resolution is non-permament

steps to reproduce

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

  2. Re-load it with new resolution:
    sudo insmod /lib/modules/uname -r/kernel/drivers/media/video/v4l2loopback-dc.ko width=1280 height=720

  3. Restart the droidcam client: Works with 720p resolution.

  4. Edit the text file /etc/modprobe.d/droidcam.conf with the new options to make the change stick:
    options v4l2loopback_dc width=1280 height=720

  5. reboot

actual behaviour

Despite the droidcam.conf entries, the resolution falls back to 640 x 480.

expected behaviour

The changes in resolution should be permanent.

version number
DroidCamX 6.7.3
latest Linux client from https://www.dev47apps.com/files/linux/droidcam_latest.zip (downloaded on 04/01/20)

operating systems
mobile: Android 9
desktop: openSUSE Leap 15.1 w/ KDE and kernel 5.3.8

Compiling error

Hi, any idea what is wrong? Using Debian 10 amd64.

gcc -Wall -no-pie -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast src/droidcam-cli.c src/connection.c src/decoder.c        -I/opt/libjpeg-turbo/include /opt/libjpeg-turbo/lib`getconf LONG_BIT`/libturbojpeg.a `pkg-config --libs --cflags libswscale libavutil` -lm -o droidcam-cli
In file included from src/decoder.c:30:
src/decoder.c: In function ‘decode_next_frame’:
src/decoder.c:265:61: warning: implicit declaration of function ‘tjGetErrorCode’; did you mean ‘tjGetErrorStr’? [-Wimplicit-function-declaration]
             errprint("tjDecompressHeader3() failure: %d\n", tjGetErrorCode(jpg_decoder.tj));
                                                             ^~~~~~~~~~~~~~
src/common.h:36:39: note: in definition of macro ‘errprint’
 #define errprint(...) fprintf(stderr, __VA_ARGS__)
                                       ^~~~~~~~~~~
src/decoder.c:266:30: warning: implicit declaration of function ‘tjGetErrorStr2’; did you mean ‘tjGetErrorStr’? [-Wimplicit-function-declaration]
             errprint("%s\n", tjGetErrorStr2(jpg_decoder.tj));
                              ^~~~~~~~~~~~~~
src/common.h:36:39: note: in definition of macro ‘errprint’
 #define errprint(...) fprintf(stderr, __VA_ARGS__)
                                       ^~~~~~~~~~~
src/decoder.c:266:22: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘int’ [-Wformat=]
             errprint("%s\n", tjGetErrorStr2(jpg_decoder.tj));
                      ^~~~~~  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/common.h:36:39: note: in definition of macro ‘errprint’
 #define errprint(...) fprintf(stderr, __VA_ARGS__)
                                       ^~~~~~~~~~~
/usr/bin/ld: /tmp/cc8QcTGP.o: in function `decode_next_frame':
decoder.c:(.text+0x891): undefined reference to `tjGetErrorCode'
/usr/bin/ld: decoder.c:(.text+0x8c2): undefined reference to `tjGetErrorStr2'
/usr/bin/ld: decoder.c:(.text+0xa18): undefined reference to `tjGetErrorCode'
collect2: error: ld returned 1 exit status
make: *** [Makefile:30: droidcam-cli] Error 1

Installing on Fedora 22

get error message after sudo sh install on Fedora 22, all dependencies, excluding
libavutil-dev
libswscale-dev, installed
...
Moving driver and executable to system folders
cp: cannot stat «droidcam»: No such file

Sound(MIC) support

I started playing with the application for Linux and made some minor improvements. Also I have managed to start streaming of sound using some reverse engineering and part of the code you commented out. I was wondering if you can give me some hint about the encoding use to stream the audio so I can try to enable also microphone input forwarding.

Bad UI Rendering on 4K screen with scaling more 100%

The UI is not rendered correctly on a 4K screen having a scale of 200% as shown in the screenshot below.

Imgur

My initial investigation pointed me to the explicit setting of widget sizes with absolute values using the gtk_widget_set_size_request(...) function.

Client GUI freezes when clicking "Connect" on Fedora 32

I compiled the client without problems on Fedora 32, but when I click "Connect" the program freezes completely until it says:

Connect failed, please try again.
Check IP and Port.
Check network connection.

droidcam-cli instead works perfectly fine.

Rotated image by default

Hi,

I am using droidcam in Ubuntu x86_64 with 5.3.0-45-generic kernel. I am able to rotate the image using WebClient, but from a webcam app like cheese/teams/skype the image appears flipped, but the driver only has height and width as module params. If I put it in a landscape mode it works fine, but only in portrait the issue appears, tried the pre-compiled sources and directly compiling from this repo.

Any help is appreciated?

[Workaround] Droidcam blank picture on Discord

Hi!

Currently, at least on my two machines, droidcam does not produce a picture when used through Discord.

I'm noting down the workaround I ended up using, in hopes that it might help figure out the issue:

  1. Install v4l2loopback for your kernel (you'll now have both v4l2loopback and v4l2loopback-dc).
  2. Install ffmpeg if it's missing
  3. Restart
  4. Ensure that droidcam works in VLC, for instance.
  5. Run sudo modprobe v4l2loopback video_nr=9 card_label="DroidCam Repeat"
  6. Run ffmpeg -re -i /dev/video0 -f v4l2 /dev/video9
    Replace video0 with your droidcam device. VLC will easily show you which one it is.
  7. Change Discord to using the "DroidCam Repeat" device. It now works!

[android] White Balance Menu

The menu for adjusting the white balance presents the options in a random way. Would it not be better to list options based on an increase of temperature?

Also it may also improve usability to have the Kelvin value displayed in brackets: e.g. "Incandescent (2400 K)"

On packaging this application

This application could be packaged and published in various linux package repositories (for example, nixpkgs). But there are several issues that complicate this:

  • The lack of versions. Package maintenance relies on them
  • A non-standard license. It is strongly advised to use one of OSI approved licenses
  • Ad-hoc paths in makefiles (for example, the path to libjpeg_turbo). A better idea is allowing specifying them with environment or make variables.
  • The repository structure. Having Makefile in the root it preferable and v4l2loopback-dc should be a separate repo

I extracted v4l2loopback-dc into a separate repo and wrote a package for it. Then I installed it and run DroidCam with #47 fix. It worked fine.

To build DroidCam I patched Makefile as with:

diff --git a/linux/Makefile b/linux/Makefile
index 6995c18..28d94a0 100644
--- a/linux/Makefile
+++ b/linux/Makefile
@@ -9,7 +9,7 @@
 CC    = -no-pie
 GTK   = `pkg-config --libs --cflags gtk+-2.0` `pkg-config --libs x11`
 LIBS  = `pkg-config --libs --cflags libswscale libavutil`
-JPEG  = -I/opt/libjpeg-turbo/include /opt/libjpeg-turbo/lib`getconf LONG_BIT`/libturbojpeg.a
+JPEG  = -I"${LIBJPEG_DEV}/include" "${LIBJPEG_OUT}/lib/libturbojpeg.a"
 SRC      = src/connection.c src/decoder.c
 NO_WARN  = -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast

And used the following nix-shell environment:

with import <nixpkgs> {};

let
  libjpeg = libjpeg_turbo.override { enableStatic = true; };
in
  stdenv.mkDerivation rec {
    name = "droidcam";
    buildInputs = [
      gnome2.gtk ffmpeg libjpeg
    ];
    nativeBuildInputs = [ pkgconfig ];

    LIBJPEG_DEV = libjpeg.dev;
    LIBJPEG_OUT = libjpeg.out;
  }

If you fix the packaging related issues I would be glad to properly package the app and create a PR to nixpkgs.

Error attempting to install droidcam on Fedora

Hello, I tried installing droidcam on my Fedora 32 computer and got the following error upon running the install script. I installed all dependencies: linux header files, libspeex, libspeexdsp, libjpeg-turbo, libavutil-dev and libswscale.

Webcam parameters: '640' and '480'
Building v4l2loopback-dc.ko
make: Entering directory '/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback'
make -C /lib/modules/`uname -r`/build M=`pwd`
make[1]: Entering directory '/usr/src/kernels/5.6.0-0.rc7.git0.2.fc32.x86_64'
  CC [M]  /home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.o
/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.c:38:41: warning: ‘struct timeval’ declared inside parameter list will not be visible outside of this definition or declaration
   38 | static inline void get_timestamp(struct timeval *tv) {
      |                                         ^~~~~~~
/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.c: In function ‘get_timestamp’:
/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.c:41:7: error: invalid use of undefined type ‘struct timeval’
   41 |     tv->tv_sec = (time_t)ts.tv_sec;
      |       ^~
/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.c:41:19: error: ‘time_t’ undeclared (first use in this function); did you mean ‘ktime_t’?
   41 |     tv->tv_sec = (time_t)ts.tv_sec;
      |                   ^~~~~~
      |                   ktime_t
/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.c:41:19: note: each undeclared identifier is reported only once for each function it appears in
/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.c:41:26: error: expected ‘;’ before ‘ts’
   41 |     tv->tv_sec = (time_t)ts.tv_sec;
      |                          ^~
      |                          ;
/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.c:42:7: error: invalid use of undefined type ‘struct timeval’
   42 |     tv->tv_usec = (suseconds_t)(ts.tv_nsec / NSEC_PER_USEC);
      |       ^~
/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.c: In function ‘vidioc_qbuf’:
/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.c:1541:19: error: passing argument 1 of ‘get_timestamp’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 1541 |     get_timestamp(&b->buffer.timestamp);
      |                   ^~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   struct __kernel_v4l2_timeval *
/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.c:38:50: note: expected ‘struct timeval *’ but argument is of type ‘struct __kernel_v4l2_timeval *’
   38 | static inline void get_timestamp(struct timeval *tv) {
      |                                  ~~~~~~~~~~~~~~~~^~
/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.c: In function ‘v4l2_loopback_write’:
/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.c:1989:17: error: passing argument 1 of ‘get_timestamp’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 1989 |   get_timestamp(&b->timestamp);
      |                 ^~~~~~~~~~~~~
      |                 |
      |                 struct __kernel_v4l2_timeval *
/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.c:38:50: note: expected ‘struct timeval *’ but argument is of type ‘struct __kernel_v4l2_timeval *’
   38 | static inline void get_timestamp(struct timeval *tv) {
      |                                  ~~~~~~~~~~~~~~~~^~
/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.c: In function ‘init_buffers’:
/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.c:2093:19: error: passing argument 1 of ‘get_timestamp’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 2093 |     get_timestamp(&b->timestamp);
      |                   ^~~~~~~~~~~~~
      |                   |
      |                   struct __kernel_v4l2_timeval *
/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.c:38:50: note: expected ‘struct timeval *’ but argument is of type ‘struct __kernel_v4l2_timeval *’
   38 | static inline void get_timestamp(struct timeval *tv) {
      |                                  ~~~~~~~~~~~~~~~~^~
/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.c: At top level:
/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.c:2448:1: fatal error: opening dependency file /home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/.v4l2loopback-dc.o.d: Permission denied
 2448 | }
      | ^
cc1: some warnings being treated as errors
compilation terminated.
make[2]: *** [scripts/Makefile.build:268: /home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback/v4l2loopback-dc.o] Error 1
make[1]: *** [Makefile:1683: /home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback] Error 2
make[1]: Leaving directory '/usr/src/kernels/5.6.0-0.rc7.git0.2.fc32.x86_64'
make: *** [Makefile:4: all] Error 2
make: Leaving directory '/home/matheus/Downloads/droidcam/droidcam-64bit/v4l2loopback'

Use v4l2loopback upstream kernel module

Packaging/architecture questions here:

  • Why does droidcam require it's own kernel module? From security point of view, this seems suspicious, that application brings it's own kernel module.
  • Why upstream https://github.com/umlaeute/v4l2loopback couldn't be used? I think this would simplify the maintenance work, as well as packaging, as v4l2loopback is already available for several distros (e.g. Arch, Ubuntu). Are there some specific changes done to this module, which e.g. has been rejected by upstream?

Linux Desktop client droidcam-v4l2-x64 does not connect with DroidCam 6.3 Android App

With the latest update of DroidCam 6.3 on my phone. I'm no longer being able to connect with my Linux client droidcam-v4l2-x64
The desktop client raises error:

MSG_ERROR("Connection reset!\nDroidCam is probably busy with another client");

although the android app says: "Desktop client is outdated"
which in my opinion is the correct statement.

*** buffer overflow detected ***: ./droidcam terminated

Backtrace:

#0  0x00007ffff6e4c15a in raise () from /nix/store/bwzra330vib0ik4d3l8rq6gp6y2ah1fr-glibc-2.30/lib/libc.so.6
#1  0x00007ffff6e36548 in abort () from /nix/store/bwzra330vib0ik4d3l8rq6gp6y2ah1fr-glibc-2.30/lib/libc.so.6
#2  0x00007ffff6e8d748 in __libc_message () from /nix/store/bwzra330vib0ik4d3l8rq6gp6y2ah1fr-glibc-2.30/lib/libc.so.6
#3  0x00007ffff6f1afed in __fortify_fail_abort () from /nix/store/bwzra330vib0ik4d3l8rq6gp6y2ah1fr-glibc-2.30/lib/libc.so.6
#4  0x00007ffff6f1b021 in __fortify_fail () from /nix/store/bwzra330vib0ik4d3l8rq6gp6y2ah1fr-glibc-2.30/lib/libc.so.6
#5  0x00007ffff6f19a70 in __chk_fail () from /nix/store/bwzra330vib0ik4d3l8rq6gp6y2ah1fr-glibc-2.30/lib/libc.so.6
#6  0x00007ffff6e86569 in _IO_str_chk_overflow () from /nix/store/bwzra330vib0ik4d3l8rq6gp6y2ah1fr-glibc-2.30/lib/libc.so.6
#7  0x00007ffff6e919e1 in _IO_default_xsputn () from /nix/store/bwzra330vib0ik4d3l8rq6gp6y2ah1fr-glibc-2.30/lib/libc.so.6
#8  0x00007ffff6e7a19c in __vfprintf_internal () from /nix/store/bwzra330vib0ik4d3l8rq6gp6y2ah1fr-glibc-2.30/lib/libc.so.6
#9  0x00007ffff6e865fe in __vsprintf_internal () from /nix/store/bwzra330vib0ik4d3l8rq6gp6y2ah1fr-glibc-2.30/lib/libc.so.6
#10 0x00007ffff6f195f9 in __sprintf_chk () from /nix/store/bwzra330vib0ik4d3l8rq6gp6y2ah1fr-glibc-2.30/lib/libc.so.6
#11 0x0000000000405404 in find_droidcam_v4l ()
#12 0x00000000004055c5 in decoder_init ()
#13 0x00000000004040ff in main ()

OS: NixOS (linux)

config setting for connection mode (wifi/lan, wifi server, usb)

would you mind a pr to configure the selected connection mode for the linux client? I am using USB and would like to avoid having to select this each time. Especially my kids who started using it while doing school vc's often forget this.
Also do you mind adding ~/.config/droidcam to the search-path for the config and making it the default (that'd be inline with where configs should be stored).
Finally, did you consider using https://developer.gnome.org/glib/stable/glib-Key-value-file-parser.html to have the settings in ini format?

Module does not build against 5.6

Linux 5.6 introduces a new proc_ops for doing procfs operations. This has broken many modules. I'm working on a patch for droidcam, should create a PR shortly.

FEDORA 31 x86-64 : Could not install => insmod : could not insert module

Hello guys,

I am trying to install DroidCam on my fedora, but i couldn't. I tried modprobe etc.. but it always failing can you help me ?

There is my error :

➜ droidcam-64bit git:(master) ✗ sudo ./install
Webcam parameters: '640' and '480'
Building v4l2loopback-dc.ko
make: Entering directory '/home/srajendran/droidcam-64bit/v4l2loopback'
make -C /lib/modules/`uname -r`/build M=`pwd`
make[1]: Entering directory '/usr/src/kernels/5.5.15-200.fc31.x86_64'
  Building modules, stage 2.
  MODPOST 1 modules
make[1]: Leaving directory '/usr/src/kernels/5.5.15-200.fc31.x86_64'
make: Leaving directory '/home/srajendran/droidcam-64bit/v4l2loopback'
Moving driver and executable to system folders
Registering webcam device
insmod: ERROR: could not insert module /lib/modules/5.5.15-200.fc31.x86_64/kernel/drivers/media/video/v4l2loopback-dc.ko: Operation not permitted
➜  droidcam-64bit git:(master) ✗ sudo modprobe v4l2loopback-dc
modprobe: ERROR: could not insert 'v4l2loopback_dc': Operation not permitted

I you have any ideas, it will be very usefull.

Thank you in advance

SOUND SUPPORT BETA

Hello!

Sound support has been added to the Linux client, I am looking for some volunteers to test everything out.

Steps:

  1. Load the Alsa Loopback driver: sudo modprobe snd_aloop.

You should see it listed as a sound card when you type aplay -l

card 1: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  ...
card 1: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  ...

To have snd_aloop load after you reboot, add it to /etc/modules-load.d:
sudo bash -c "grep snd_aloop /etc/modules-load.d/droidcam.conf 2>/dev/null || echo snd_aloop >> /etc/modules-load.d/droidcam.conf"

  1. Download the droidcam client binaries with sound support:

https://dev47apps.com/files/linux/droidcam_sound_beta.zip

  1. Extract and run the new client, droidcam or droidcam-cli.

Both will try to find the Loopback sound card and open one of the substreams.
They will print/show which sound device you should use to get the output.

# ./droidcam-cli 192.168.0.12 4747 -a
Device /dev/video0 is 'Droidcam'
Opened /dev/video0, fd:3
Client v1.1
Video: /dev/video0
Audio: hw:1,1,0
...
  1. Connect to the phone app, you should see a "Audio Connected" toast on the phone.

  2. Open for example VLC Player, press Ctrl+C to open a capture device and open the droidcam audio and video devices. eg. /dev/video1 and hw:1,1,0.
    Start playing VLC, you should get both sound and picture. If you dont hear anything check the "Audio Device" option in the VLC file menu on top, make sure its set to your speakers.

Version tags

For packaging, it would be convenient to have version tags on github.

DroidCamX not working but DroidCam is on Ubuntu 18.04 (subsampling error).

While the DroidCam works through USB-A smoothly, I tried it with DroidCamX to improve the quality, but it's not working. I get this message: Error: Unexpected video image stream subsampling in my terminal every other second. It seems I can't change the resolution despite following the instructions (doesn't do anything even if I edit the config file).

I've looked into the code to understand why I get this error, but it's not obvious to me why it does so.

Currently using this on a Ubuntu 18.04 machine with a Pixel 3 in adb mode.

Do you need more info to help me out?

Best,

Build failure if path has space

If path has space, for example /home/some user/droidcam, build fails in v4l2loopback step.

Tried to fix it but without success, something is wrong with this:

all:
    make -C /lib/modules/`uname -r`/build M=`pwd`

Adding quotes does not help and I couldn't discover what does M argument stands for.

make error

uname -a                                                                                                                                                                                                                                                          
Linux localhost.localdomain 4.4.8-300.fc23.x86_64 #1 SMP Wed Apr 20 16:59:27 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

$ make                                                                                                                                                                                                                                                               
gcc -Wall  src/connection.c src/decoder.c src/droidcam.c -lgthread-2.0 -l:/usr/lib64/libswscale.so -l:/usr/lib/libavutil.a -l:/opt/libjpeg-turbo/lib`getconf LONG_BIT`/libturbojpeg.a `pkg-config --libs --cflags gtk+-2.0` -lm -o droidcam
src/decoder.c: In function ‘decoder_share_frame’:
src/decoder.c:594:36: warning: passing argument 2 of ‘sws_scale’ from incompatible pointer type [-Wincompatible-pointer-types]
         sws_scale(jpg_decoder.swc, srcSlice, srcStride, 0, jpg_decoder.m_height, dstSlice, dstStride);
                                    ^
In file included from src/decoder.c:30:0:
/usr/include/ffmpeg/libswscale/swscale.h:229:5: note: expected ‘const uint8_t * const* {aka const unsigned char * const*}’ but argument is of type ‘uint8_t ** {aka unsigned char **}’
 int sws_scale(struct SwsContext *c, const uint8_t *const srcSlice[],
     ^
src/droidcam.c: In function ‘VideoThreadProc’:
src/droidcam.c:184:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  SOCKET videoSocket = (SOCKET) args;
                       ^
src/droidcam.c: In function ‘accel_callback’:
src/droidcam.c:288:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   thread_cmd = (int) user_data;
                ^
src/droidcam.c: In function ‘the_callback’:
src/droidcam.c:296:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  int cb = (int) extra;
           ^
src/droidcam.c:343:5: warning: ‘g_thread_create’ is deprecated: Use 'g_thread_new' instead [-Wdeprecated-declarations]
     hVideoThread = g_thread_create(VideoThreadProc, (void*)s, TRUE, NULL);
     ^
In file included from /usr/include/glib-2.0/glib.h:107:0,
                 from /usr/include/glib-2.0/gobject/gbinding.h:28,
                 from /usr/include/glib-2.0/glib-object.h:23,
                 from /usr/include/glib-2.0/gio/gioenums.h:28,
                 from /usr/include/glib-2.0/gio/giotypes.h:28,
                 from /usr/include/glib-2.0/gio/gio.h:26,
                 from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
                 from /usr/include/gtk-2.0/gdk/gdk.h:32,
                 from /usr/include/gtk-2.0/gtk/gtk.h:32,
                 from src/droidcam.c:16:
/usr/include/glib-2.0/glib/deprecated/gthread.h:104:10: note: declared here
 GThread *g_thread_create       (GThreadFunc       func,
          ^
src/droidcam.c:343:53: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     hVideoThread = g_thread_create(VideoThreadProc, (void*)s, TRUE, NULL);
                                                     ^
src/droidcam.c: In function ‘main’:
src/droidcam.c:412:2: warning: ‘g_thread_init’ is deprecated [-Wdeprecated-declarations]
  g_thread_init(NULL);
  ^
In file included from /usr/include/glib-2.0/glib.h:107:0,
                 from /usr/include/glib-2.0/gobject/gbinding.h:28,
                 from /usr/include/glib-2.0/glib-object.h:23,
                 from /usr/include/glib-2.0/gio/gioenums.h:28,
                 from /usr/include/glib-2.0/gio/giotypes.h:28,
                 from /usr/include/glib-2.0/gio/gio.h:26,
                 from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
                 from /usr/include/gtk-2.0/gdk/gdk.h:32,
                 from /usr/include/gtk-2.0/gtk/gtk.h:32,
                 from src/droidcam.c:16:
/usr/include/glib-2.0/glib/deprecated/gthread.h:265:10: note: declared here
 void     g_thread_init                   (gpointer vtable);
          ^
src/droidcam.c:424:2: warning: ‘gdk_pixbuf_new_from_inline’ is deprecated [-Wdeprecated-declarations]
  gtk_window_set_icon(GTK_WINDOW(window), gdk_pixbuf_new_from_inline(-1, icon_inline, FALSE, NULL));
  ^
In file included from /usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf.h:33:0,
                 from /usr/include/gtk-2.0/gdk/gdkpixbuf.h:37,
                 from /usr/include/gtk-2.0/gdk/gdkcairo.h:28,
                 from /usr/include/gtk-2.0/gdk/gdk.h:33,
                 from /usr/include/gtk-2.0/gtk/gtk.h:32,
                 from src/droidcam.c:16:
/usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-core.h:314:12: note: declared here
 GdkPixbuf* gdk_pixbuf_new_from_inline (gint          data_length,
            ^
/usr/bin/ld: cannot find -l:/usr/lib64/libswscale.so
/usr/bin/ld: cannot find -l:/usr/lib/libavutil.a
/usr/bin/ld: cannot find -l:/opt/libjpeg-turbo/lib64/libturbojpeg.a
collect2: error: ld returned 1 exit status
Makefile:16: recipe for target 'all' failed
make: *** [all] Error 1
[1]    21818 exit 2

[patches] build breakages, warnings

Hello,

Thanks for sharing your code, extremely interesting.

FYI, I forked your repository on Framagit (https://framagit.org/ericb/droidcam). My main goal is to understand how I can connect my own application (see https://framagit.org/ericb/miniDart) to smartphones. If you are interested, using ffmpeg, the devel version of miniDart (not publicaly available yet) can display rtsp flew, and more. I simply had no clue on about connect to smartphone, thus, I'm learning what you did :-)

Not sure it's important, but I'm using Linux on Intel x86_64 (mint 18.3) + ffmpeg 4.0.1. Trying to build, I found some build issues, and fixed some warnings. If you are interested, I can provide you patches, and you can have a look at the links below. If you are not, please close this issue :-)

For further information, see:

HTH

-- ericb

droidcam-cli usb connection

Not sure if I'm missing something, but there doesn't seem to be an option to connect to droidcam via usb using droidcam-cli on linux. Everything works fine from the GUI, but I want to run droidcam on a system without X.

setup USB connection via gui client crashes during connection

Hi,
the connection is working via wifi already, but it crashes during usb connection via the gui-client.

  1. It asks me for my (android) passcode.
  2. The client on X then crashes like so:
droidcam: XlibInt.c:238: _XPrivSyncFunction: Assertion `dpy->synchandler == _XPrivSyncFunction' failed.
[1]    306304 abort (core dumped)  droidcam

I'm on fedora 31 with X

I then tried it via the cli like so droidcam-cli 127.0.0.1 4747
That works without crashes.

compile failed on Fedora 27 64bits

when I run Make here are the result:

gcc -Wall src/connection.c src/decoder.c src/droidcam.c -lgthread-2.0 -l:/usr/l ib/libswscale.a -l:/usr/lib/libavutil.a -l:/opt/libjpeg-turbo/libgetconf LONG_ BIT/libturbojpeg.a pkg-config --libs --cflags gtk+-2.0 -lm -o droidcam
src/decoder.c: In function ‘decoder_prepare_video’:
src/decoder.c:321:60: error: ‘PIX_FMT_YUV420P’ undeclared (first use in this fun ction); did you mean ‘AV_PIX_FMT_YUV420P’?
jpg_decoder.m_width, jpg_decoder.m_height, PIX_FMT_YUV420P, /* src /
^~~~~~~~~~~~~~~
AV_PIX_FMT_YUV420P
src/decoder.c:321:60: note: each undeclared identifier is reported only once for each function it appears in
src/decoder.c: In function ‘decoder_share_frame’:
src/decoder.c:592:36: warning: passing argument 2 of ‘sws_scale’ from incompatib le pointer type [-Wincompatible-pointer-types]
sws_scale(jpg_decoder.swc, srcSlice, srcStride, 0, jpg_decoder.m_height , dstSlice, dstStride);
^~~~~~~~
In file included from src/decoder.c:28:0:
/usr/local/include/libswscale/swscale.h:217:5: note: expected ‘const uint8_t * c onst
{aka const unsigned char * const*}’ but argument is of type ‘uint8_t ** {a ka unsigned char **}’
int sws_scale(struct SwsContext c, const uint8_t const srcSlice[],
^~~~~~~~~
src/droidcam.c: In function ‘VideoThreadProc’:
src/droidcam.c:184:23: warning: cast from pointer to integer of different size -Wpointer-to-int-cast]
SOCKET videoSocket = (SOCKET) args;
^
src/droidcam.c: In function ‘accel_callback’:
src/droidcam.c:288:16: warning: cast from pointer to integer of different size -Wpointer-to-int-cast]
thread_cmd = (int) user_data;
^
src/droidcam.c: In function ‘the_callback’:
src/droidcam.c:296:11: warning: cast from pointer to integer of different size -Wpointer-to-int-cast]
int cb = (int) extra;
^
src/droidcam.c:343:5: warning: ‘g_thread_create’ is deprecated: Use 'g_thread_ne w' instead [-Wdeprecated-declarations]
hVideoThread = g_thread_create(VideoThreadProc, (void
)s, TRUE, NULL);
^~~~~~~~~~~~
In file included from /usr/include/glib-2.0/glib.h:108:0,
from /usr/include/glib-2.0/gobject/gbinding.h:28,
from /usr/include/glib-2.0/glib-object.h:23,
from /usr/include/glib-2.0/gio/gioenums.h:28,
from /usr/include/glib-2.0/gio/giotypes.h:28,
from /usr/include/glib-2.0/gio/gio.h:26,
from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
from /usr/include/gtk-2.0/gdk/gdk.h:32,
from /usr/include/gtk-2.0/gtk/gtk.h:32,
from src/droidcam.c:16:
/usr/include/glib-2.0/glib/deprecated/gthread.h:104:10: note: declared here
GThread g_thread_create (GThreadFunc func,
^~~~~~~~~~~~~~~
src/droidcam.c:343:53: warning: cast to pointer from integer of different size -Wint-to-pointer-cast]
hVideoThread = g_thread_create(VideoThreadProc, (void
)s, TRUE, NULL);
^
src/droidcam.c: In function ‘main’:
src/droidcam.c:412:2: warning: ‘g_thread_init’ is deprecated [-Wdeprecated-decla rations]
g_thread_init(NULL);
^~~~~~~~~~~~~
In file included from /usr/include/glib-2.0/glib.h:108:0,
from /usr/include/glib-2.0/gobject/gbinding.h:28,
from /usr/include/glib-2.0/glib-object.h:23,
from /usr/include/glib-2.0/gio/gioenums.h:28,
from /usr/include/glib-2.0/gio/giotypes.h:28,
from /usr/include/glib-2.0/gio/gio.h:26,
from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
from /usr/include/gtk-2.0/gdk/gdk.h:32,
from /usr/include/gtk-2.0/gtk/gtk.h:32,
from src/droidcam.c:16:
/usr/include/glib-2.0/glib/deprecated/gthread.h:265:10: note: declared here
void g_thread_init (gpointer vtable);
^~~~~~~~~~~~~
src/droidcam.c:424:2: warning: ‘gdk_pixbuf_new_from_inline’ is deprecated [-Wdep recated-declarations]
gtk_window_set_icon(GTK_WINDOW(window), gdk_pixbuf_new_from_inline(-1, icon_in line, FALSE, NULL));
^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf.h:34:0,
from /usr/include/gtk-2.0/gdk/gdkpixbuf.h:37,
from /usr/include/gtk-2.0/gdk/gdkcairo.h:28,
from /usr/include/gtk-2.0/gdk/gdk.h:33,
from /usr/include/gtk-2.0/gtk/gtk.h:32,
from src/droidcam.c:16:
/usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-core.h:362:12: note: declared here
GdkPixbuf
gdk_pixbuf_new_from_inline (gint data_length,
^~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:15: all] Error 1

Any idea?
thanks

Does not detect the microphone

I have installed the app for Linux in Ubuntu 18.04 and in KDE neon. Neither of the two distros detects the mobile's microphone.

I have tried it with two phones, a BQ Aquaris U Plus and a Huawei P20 Lite.

The problem is, surely, from the application for Linux, because I have tested it on Windows 10 and with either of the two phones the microphone works perfectly.

Could you help me

Thank you.

Protocols?

Hi,
what protcols droidcam uses?
thanks

Will not compile on Linux 4.15

Droidcam will not compile on Linux 4.15 as the included v4l2loopback module does not use the new kernal timer API.


$ ./install
make -C /lib/modules/`uname -r`/build M=`pwd`
make[1]: Entering directory '/usr/lib/modules/4.15.2-1-vfio/build'
CC [M] /tmp/makepkg/droidcam/src/droidcam/v4l2loopback/v4l2loopback-dc.o
/tmp/makepkg/droidcam/src/droidcam/v4l2loopback/v4l2loopback-dc.c: In function ‘v4l2_loopback_init’:
/tmp/makepkg/droidcam/src/droidcam/v4l2loopback/v4l2loopback-dc.c:2229:3: error: implicit declaration of function ‘setup_timer’; did you mean ‘setup_irq’? [-Werror=implicit-function-declaration]
setup_timer(&dev->sustain_timer, sustain_timer_clb, nr);
^~~~~~~~~~~
setup_irq
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:323: /tmp/makepkg/droidcam/src/droidcam/v4l2loopback/v4l2loopback-dc.o] Error 1
make[1]: *** [Makefile:1508: module/tmp/makepkg/droidcam/src/droidcam/v4l2loopback] Error 2
make[1]: Leaving directory '/usr/lib/modules/4.15.2-1-vfio/build'
make: *** [Makefile:4: all] Error 2

Migrate to GTK3

It would be cool to have a bit more modern dependencies and update from gtk-2.0 to gtk-3.0. I'm working on it right now and it shouldn't be too difficult.

Fedora 32 x64 Compiling problem

The included Makefile can't find libswscale headers in Fedora 32.
Adding --cflags also to the Makefile line:

LIBS  = `pkg-config --libs --cflags libswscale libavutil`

Fixes the issue.

Raspberry PI

Seems not supports Raspberry PI.

root@lx-desktop:/tmp/droidcam-32bit# sudo ./install
Webcam parameters: '640' and '480'
Building v4l2loopback-dc.ko
make: Entering directory '/tmp/droidcam-32bit/v4l2loopback'
make -C /lib/modules/uname -r/build M=pwd
make[1]: Entering directory '/tmp/droidcam-32bit/v4l2loopback'
make[1]: *** /lib/modules/4.4.38-v7+/build: No such file or directory. Stop.
make[1]: Leaving directory '/tmp/droidcam-32bit/v4l2loopback'
Makefile:4: recipe for target 'all' failed
make: *** [all] Error 2
make: Leaving directory '/tmp/droidcam-32bit/v4l2loopback'

Big delays between Android and iPhone

Hi
First, I wanna say thank you for this amazing module, I was testing it and works great in Linux Mint 19.3 Tricia. However, I got some serious delays streaming when I tried it from an iPhone 5s (if compares with the Mi A3 I tried first). I'm not using that old iPhone since the Android is my main phone, and being honest, I'm sure many people could use their old iPhones like this one to get them a new use as webcam :P

I wanted to report an issue for the iPhone app, but, there is not a repository for that, so I'm doing it here.

My first thought was about a possible issue with the module, so I tried it the web (IP:PORT/video), then this was clear that the problem was in the iPhone side. There is a very long delay (around 1s ~ 2s) in iPhone.

You can see the problem in this video https://youtu.be/VxOCsLvO2_4
Android was close to realtime, but iPhone was very out of place lol

I think there are some reasons why this would be happening:

  1. wifi issues?: maybe iPhone 5s antenna is bad, idk, I got that phone from someone but I have never used it for enough time.
  2. slow compression?: of course the phone is doing that work, but Idk if CPU just do not can with the process.
  3. big source?: Thinking how improve the performance, idk if the image size that the app is using as source is just too big (since main record resolution in that phone is 1080p, idk if that could affect the amount of data to resize->compress).

For 1 and 2, the issue is the iPhone (gg old iPhones). but 3 is something that only the iOS developer could know.

I apologize for make this report here, I hope the iOS dev can know about this.

Thanks!

"Wifi Server Mode" causes crash

Android app connects to it - but nothing happens - black screen - and after like half minute it just segfaults.
Unfortunately backtrace is very incomplete for some strange reason… I installed all debug symbols, and even recompiled droidcam client with -ggdb3 to include debug symbols but this is all I get:

 $ gdb ./droidcam 
GNU gdb (GDB) Fedora 8.3.50.20190824-30.fc31
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./droidcam...
(gdb) r
Starting program: /home/morsik/Projects/third-party/droidcam/linux/droidcam 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
Device: Integrated_Webcam_HD: Integrate
Device: Integrated_Webcam_HD: Integrate
Device: Droidcam
Found driver: /dev/video2 (fd:5)
[New Thread 0x7fffe915a700 (LWP 55804)]
waiting on port 4747..got socket 7

Thread 2 "droidcam" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe915a700 (LWP 55804)]
0x00007ffff7079b28 in __libc_recv (fd=<optimized out>, buf=<optimized out>, len=<optimized out>, flags=<optimized out>) at ../sysdeps/unix/sysv/linux/recv.c:28
28	  return SYSCALL_CANCEL (recvfrom, fd, buf, len, flags, NULL, NULL);
(gdb) bt
#0  0x00007ffff7079b28 in __libc_recv (fd=<optimized out>, buf=<optimized out>, len=<optimized out>, flags=<optimized out>) at ../sysdeps/unix/sysv/linux/recv.c:28
#1  0x0ddfab275ee1bffe in  ()
#2  0xb13ee4e0b2e6e24b in  ()
#3  0xe9076547554f822a in  ()
#4  0x36be04d5bf57afc0 in  ()
#5  0xea86bc0d352677b1 in  ()
#6  0x34fc8357fa3907a3 in  ()
#7  0x0bb65fa8b98e3abd in  ()
#8  0xee1ccec0b9931c49 in  ()
#9  0xd0a9c3d3794dfd3d in  ()
#10 0x38eb941d1bfe36a9 in  ()
#11 0xff17f8dedc528456 in  ()
#12 0x91334942da4f1300 in  ()
#13 0xbec67fee3ed96e04 in  ()
#14 0x3c41351d9a9dd4cb in  ()
#15 0xff390e4ef781bc48 in  ()
#16 0x4ad900ffe22b3d00 in  ()
#17 0xfd56ee52bdc5cf78 in  ()
#18 0xd92a19d793e016dc in  ()
#19 0x774f11ef0beb2bfd in  ()
#20 0xc30a8fc60643d8ad in  ()
#21 0xedf5be9e03e4c170 in  ()
#22 0xa6d2be6a1822b6f0 in  ()
#23 0x95444c2d7ce231d6 in  ()
#24 0xeff76c9200ff7b2a in  ()
#25 0x466926026d9b5908 in  ()
#26 0x3d7e7c9f9c5c181b in  ()
#27 0x033fe92dbe8befea in  ()
#28 0x31a6d733be6a1d3e in  ()
#29 0x3cb85197b11a3ee9 in  ()
#30 0xc7acbe08318c656e in  ()
#31 0x54f0ce0a98f7070a in  ()
#32 0x10921acf46a54b52 in  ()
#33 0x055fe9eb01e0e477 in  ()
#34 0x1f7833b57fc1c17f in  ()
#35 0x22d7e917fe86afe0 in  ()
#36 0x11492d754a14df2b in  ()
#37 0x470f2b11b97016f9 in  ()
#38 0xf363a25fc1fa6e94 in  ()
#39 0xeebd536934bc382a in  ()
#40 0xad2b17867ceed69e in  ()
#41 0xa3356b6d952aa985 in  ()
#42 0x37da00ff697f333f in  ()
#43 0xc68f78373ea6fd5a in  ()
#44 0x8f17c44b6de6f49a in  ()
#45 0x2e91e8145212e072 in  ()
#46 0xbca2e8515420227a in  ()
#47 0x0d5ecf6ef2ed1bee in  ()
#48 0xf77a3d39dcbdb850 in  ()
#49 0xf51e3ce76be3d2a2 in  ()
#50 0xc7adb5260ab9afcc in  ()
#51 0xd23f00ffc1bd2c97 in  ()
#52 0x5185762ebfc481a7 in  ()
#53 0x7768e499ac793d8e in  ()
#54 0xea9657f3f871f01c in  ()
#55 0x001841f97765523b in  ()
#56 0x97769be45ea435e7 in  ()
#57 0x8740492e99dba68b in  ()
#58 0x57c4f78a9a733a2a in  ()
#59 0x771b60df259b205e in  ()
#60 0x33eb1221b3da6137 in  ()
#61 0x747fea3e4e0cf779 in  ()
#62 0x74a0905348abad76 in  ()
#63 0xc06c4310a42e4def in  ()
#64 0x30914e5f51719264 in  ()
#65 0x52d4539b8adb9300 in  ()
#66 0x54ad1f7b0b426406 in  ()
#67 0xdf13f3934c921682 in  ()
#68 0x096944b03bc5f9b7 in  ()
#69 0x965a00ff3ea9977f in  ()
#70 0xa615c6d0e9ec9f3b in  ()
#71 0xb3d4fa3f90116024 in  ()
#72 0xa7f5cf6d85942dce in  ()
#73 0xe99bb9cdc88c4158 in  ()
#74 0xd99f8b3d6adaa6de in  ()
#75 0xf4863926d7db64cb in  ()
#76 0x7bfd18c36fcf483d in  ()
#77 0xc693246eb461abd5 in  ()
#78 0x13e2a2923e153930 in  ()
#79 0x306e11cd3737ec6c in  ()
#80 0xaaf4b83e80439ffe in  ()
#81 0x1fe44170430e47e2 in  ()
#82 0x4fb2097611f24263 in  ()
#83 0xaab38d3dded96aa5 in  ()
#84 0xfcf4449fc3551e92 in  ()
#85 0xbf9846d67b4c3f78 in  ()
#86 0x00c0666619239969 in  ()
#87 0x6fee424d02ec6a70 in  ()
#88 0xe2c68883c3253922 in  ()
#89 0xe7314ee1c71938a3 in  ()
#90 0x8da526ca5cd4b17c in  ()
#91 0x6fadb5d2a7d71bee in  ()
#92 0xbdb90618c7fc1af1 in  ()
#93 0x55f032321ca504ed in  ()
#94 0x80fa85f52afd2087 in  ()
#95 0xa0353814756020d9 in  ()
#96 0x0dc316a11a4c9d79 in  ()
#97 0x149e75c5f36f0fdc in  ()
#98 0xbc06cf790794bcd6 in  ()
#99 0x3a1d86cfece7edcf in  ()
#100 0x19921cb6bef0de0a in  ()
#101 0x342935835ebf0378 in  ()
#102 0xf6df12fc2fe8c7c2 in  ()
#103 0x7b3a8dc7bfb33fc0 in  ()
#104 0xa967b1d4c1fee6d9 in  ()
#105 0xce01cbc8853987c6 in  ()
#106 0x3577dcce7118904a in  ()
#107 0x1e2fbcd0b56074fb in  ()
#108 0x78a90c6d6fcea6ab in  ()
#109 0x218b651badaeac8e in  ()
#110 0xfc1523e7fbc0101c in  ()
#111 0x46dea7efc41b78c5 in  ()
#112 0xb45ff160e41072ea in  ()
#113 0x2dbe49db7f47f01f in  ()
#114 0xcf33ade6e19b1f7c in  ()
#115 0x65333296bc90e8a9 in  ()
#116 0x43caaf5ffe70dd9e in  ()
#117 0x515d81812a039e63 in  ()
#118 0x5f77d555ab7beaa6 in  ()
#119 0xadb969dc1a3f0ff0 in  ()
#120 0xb7f5b1dfa74fded6 in  ()
#121 0xeace06f145243dc5 in  ()
#122 0xff4badd56e2d0236 in  ()
#123 0x8c10f88f908fb500 in  ()
#124 0xf0ddfe565ff8a2d7 in  ()
#125 0x1f1788e6e1d99de5 in  ()
#126 0x57f891033f8c7edd in  ()
#127 0x1455f823feca6b9f in  ()
#128 0x1c6ec21974db47a8 in  ()
#129 0xbfba864d3f700a95 in  ()
#130 0x9f48f7e9de9a7a86 in  ()
#131 0x25bb1e886a9fccea in  ()
#132 0xf00a3f2e4600ff1b in  ()
#133 0xe33efde2acd349a5 in  ()
#134 0x1dad506a8dd729e8 in  ()
#135 0xd9ff9ffa8300ff9a in  ()
#136 0x0000000000000000 in  ()

This is VERY strange…

Autofocus lock

I use DroidCam to stream my Wii, and I would like an autofocus lock so the gameplay is not disrupted by focusing when it is not necessary.

Audio only mode

i tried the latest version with sound support and it worked fantastic but if i don't wanna my phone's camera and only microphone i have to keep it on and it drains battery for no reason
an audio only mode would be fantastic

Fail to link client

After some modifications to the makefile (see my answer to #4), the client sources compile on Fedora 20, but fail to link with the error:

decoder.o: In function `decode_next_frame':
decoder.c:(.text+0xaa5): undefined reference to `jpeg_mem_src_tj'
collect2: error: ld returned 1 exit status

the jpeg_mem_src_tj function is declared in decoder.c but defined nowhere, is there anything missing?

The kernel module compiles and works, the binary clients from dev47apps.com work as well.

screen capture and droidcam (feature?)

I wonder if it would be possible to add the screen capture rather than the webcam on windows/macos/android/IOS?
amrag, I would be ready to contribute some $$$ if it's possible thanks

insmod: ERROR: could not insert module /lib/modules/5.3.0-42-generic/kernel/drivers/media/video/v4l2loopback-dc.ko: Operation not permitted

Hi,

I am trying to install the linux client by following instructions from: https://www.dev47apps.com/droidcam/linuxx/

I made sure the dependencies are installed by doing:

sudo apt-get install gcc make linux-headers-`uname -r`

When executing the install script, it fails when trying to insert the compiled module
insmod: ERROR: could not insert module /lib/modules/5.3.0-42-generic/kernel/drivers/media/video/v4l2loopback-dc.ko: Operation not permitted

Here's some extra info:

$ uname -a
Linux hostname 5.3.0-42-generic #34~18.04.1-Ubuntu SMP Fri Feb 28 13:42:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

$ gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I also tried installing gcc-4.9, but got the same error

$ 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-5.3.0-42-generic'
  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-5.3.0-42-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/5.3.0-42-generic/kernel/drivers/media/video/v4l2loopback-dc.ko: Operation not permitted

$ gcc --version
gcc (Ubuntu 4.9.3-13ubuntu2) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Any clues about this?

Use shared version of libjpeg-turbo

To resolve some issues mentioned in #49, perhaps it would make sense to use shared version of libjpeg-turbo, instead of statically linked one. Many distros have a package for it and from my tests on Arch Linux, everything works fine.

The following patch is sufficient to switch to use the shared one:

From 7796485f7fd696f9e6b78b77eee65fc142be16f0 Mon Sep 17 00:00:00 2001
From: Mateusz Gozdek <[email protected]>
Date: Thu, 28 May 2020 09:32:03 +0200
Subject: [PATCH] Use shared version of libjpeg-turbo

Signed-off-by: Mateusz Gozdek <[email protected]>
---
 linux/Makefile | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git linux/Makefile linux/Makefile
index 0072361..9ccf019 100644
--- linux/Makefile
+++ linux/Makefile
@@ -6,15 +6,11 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 # Use at your own risk. See README file for more details.

-JPEG_DIR ?= /opt/libjpeg-turbo
-JPEG_INCLUDE ?= $(JPEG_DIR)/include
-JPEG_LIB ?= $(JPEG_DIR)/lib`getconf LONG_BIT`
-
 CC    = -no-pie
 GTK   = `pkg-config --libs --cflags gtk+-2.0` `pkg-config --libs x11`
 LIBAV = `pkg-config --libs --cflags libswscale libavutil`
 LIBS  =  -lspeex -lasound -lpthread -lm
-JPEG  = -I$(JPEG_INCLUDE) $(JPEG_LIB)/libturbojpeg.a
+JPEG  = `pkg-config --libs --cflags libturbojpeg`
 SRC      = src/connection.c src/settings.c src/decoder*.c src/av.c src/adb.c
 NO_WARN  = -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast

--
2.26.2

Module not loaded

Hello, everything works fine and I'm trying to uninstall. I'm in right directory and in terminal ./uninstall
it says

rmmod: ERROR: Module v4l2loopback_dc is not currently loaded
done

insmod error on deepin

Hello!
I try to install droidcam on my Deepin 15.9.3. This is debian-based distro. On my phone i use current latest version of DroidCam (6.7.4)
All gone fine except last step when insmod failed.

At first i check system reqs:

user@localhost:~/droidcam-64bit$ uname -r
4.15.0-29deepin-generic
user@localhost:~/droidcam-64bit$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 7.3.0-19' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.3.0 (Debian 7.3.0-19) 

Then i did all by instruction from official site:

user@localhost:~$ sudo apt-get install linux-headers-`uname -r`
[sudo] пароль для user: 
Чтение списков пакетов… Готово
Построение дерева зависимостей       
Чтение информации о состоянии… Готово
Уже установлен пакет linux-headers-4.15.0-29deepin-generic самой новой версии (4.15.0-29deepin.31).
linux-headers-4.15.0-29deepin-generic помечен как установленный вручную.
Обновлено 0 пакетов, установлено 0 новых пакетов, для удаления отмечено 0 пакетов, и 0 пакетов не обновлено.
user@localhost:~$ bits=`getconf LONG_BIT`
user@localhost:~$ wget https://www.dev47apps.com/files/600/droidcam-${bits}bit.tar.bz2
--2019-04-26 20:32:55--  https://www.dev47apps.com/files/600/droidcam-64bit.tar.bz2
Распознаётся www.dev47apps.com (www.dev47apps.com)… 198.252.107.38
Подключение к www.dev47apps.com (www.dev47apps.com)|198.252.107.38|:443... соединение установлено.
HTTP-запрос отправлен. Ожидание ответа… 200 OK
Длина: 435901 (426K) [application/x-bzip]
Сохранение в: «droidcam-64bit.tar.bz2»

droidcam-64bit.tar.bz2                                      100%[==========================================================================================================================================>] 425,68K   348KB/s    за 1,2s    

2019-04-26 20:32:58 (348 KB/s) - «droidcam-64bit.tar.bz2» сохранён [435901/435901]

user@localhost:~$ tar xjf droidcam-${bits}bit.tar.bz2
user@localhost:~$ cd droidcam-${bits}bit/
user@localhost:~/droidcam-64bit$ sudo ./install
Webcam parameters: '640' and '480'
Building v4l2loopback-dc.ko
make: вход в каталог «/home/user/droidcam-64bit/v4l2loopback»
make -C /lib/modules/`uname -r`/build M=`pwd`
make[1]: вход в каталог «/usr/src/linux-headers-4.15.0-29deepin-generic»
  CC [M]  /home/user/droidcam-64bit/v4l2loopback/v4l2loopback-dc.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/user/droidcam-64bit/v4l2loopback/v4l2loopback-dc.mod.o
  LD [M]  /home/user/droidcam-64bit/v4l2loopback/v4l2loopback-dc.ko
make[1]: выход из каталога «/usr/src/linux-headers-4.15.0-29deepin-generic»
make: выход из каталога «/home/user/droidcam-64bit/v4l2loopback»
Moving driver and executable to system folders
Registering webcam device
insmod: ERROR: could not insert module /lib/modules/4.15.0-29deepin-generic/kernel/drivers/media/video/v4l2loopback-dc.ko: Unknown symbol in module

What can i do to avoid this error?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.