pi-apps icon indicating copy to clipboard operation
pi-apps copied to clipboard

DroidCam

Open open-sorcerer64 opened this issue 4 years ago • 33 comments

DroidCam on Raspberry Pi

I have created the install script, but can't find a way to make the uninstall script.

Here is the project link --> https://github.com/open-sorcerer64/Droid-Cam-RPi

@Itai-Nelken and @Botspot what do you think

BTW, Get well soon @Botspot

open-sorcerer64 avatar Jul 29 '21 03:07 open-sorcerer64

No update guys!

open-sorcerer64 avatar Aug 01 '21 13:08 open-sorcerer64

Sorry, I don't have time to review the scripts right now. But it's on my todo list.

Itai-Nelken avatar Aug 01 '21 13:08 Itai-Nelken

Why do use && in every command, and also why do you install every dependency with one separate command, and instead of providing the tar.gz cant you provide the pre built deb, and what should the droidcam-raspberrypi-auto-install folder have ? Also aren't you installing/building in the droidcam-raspberrypi-auto-install directory so shouldn't removing that and uninstalling the dependencies be enough for uninstalling the app?

techcoder20 avatar Aug 02 '21 06:08 techcoder20

Hello

Why do use && in every command, and also why do you install every dependency with one separate command

I didn't knew that you can run the script even without using && which I will improve. I installed every dependency with a separate command because I was afraid of breaking the script, also this script will use pkg-install when it comes on Pi-Apps

and instead of providing the tar.gz cant you provide the pre built deb

I don't know how to make debs or make apt repos, so....... You can help me if you know, on my Discord

and what should the droidcam-raspberrypi-auto-install folder have

The script and the repository, I guess

open-sorcerer64 avatar Aug 02 '21 12:08 open-sorcerer64

I don't know how to make debs or make apt repos, so......

Are you not making and installing a deb here

sudo make install 
sudo make deb 
sudo dpkg -i libjpeg-turbo_2.1.0_armhf.deb

Cant you just add that deb file to your repo so that your dont have to build it every time

techcoder20 avatar Aug 02 '21 12:08 techcoder20

debs.tar.gz

@techcoder20 what do you think, will this work

open-sorcerer64 avatar Aug 05 '21 10:08 open-sorcerer64

Hello everyone

So, I have made the deb files as insisted by @techcoder20 you can see it at https://github.com/open-sorcerer64/Droid-Cam-RPi/tree/deb-testing I have not created the scripts as I am not sure if this will work or not, but it should be simple. I have done other things like adding the icon and stuff DroidCam.zip

@Itai-Nelken and @Botspot what do you think

open-sorcerer64 avatar Aug 09 '21 03:08 open-sorcerer64

Anyone who checked??

open-sorcerer64 avatar Aug 10 '21 05:08 open-sorcerer64

if the debs work than all that's left to do is to write the scripts. unfortunately we don't really have time for that... so can you write the scripts? if you need help just ask.

Itai-Nelken avatar Aug 10 '21 10:08 Itai-Nelken

I can't make the script! Things aren't working and also I have exams. Can you do it @Botspot?

open-sorcerer64 avatar Aug 15 '21 06:08 open-sorcerer64

Anyone

open-sorcerer64 avatar Aug 21 '21 10:08 open-sorcerer64

we don't have the time to make the scripts...

Itai-Nelken avatar Aug 21 '21 12:08 Itai-Nelken

we don't have the time to make the scripts...

Neither do I, so..... I think we should suspend this issue for now.

open-sorcerer64 avatar Aug 21 '21 16:08 open-sorcerer64

DroidCam.zip

Hello

Guys, I have made the install and uninstall scripts for both 32 and 64 bit. Please check

Also, I know it isn't perfect as we need to add desktop icons and stuff but I'll do it after the scripts are approved by @Botspot

open-sorcerer64 avatar Oct 15 '21 11:10 open-sorcerer64

Not working for me, it shows the error:

Installing DroidCam...
Cloning into 'Droid-Cam-RPi'...
Running pkg-install...
Running sudo apt update...


Hit:1 https://packages.microsoft.com/ubuntu/21.04/prod hirsute InRelease
Hit:2 https://itai-nelken.github.io/weekly-box86-debs/debian  InRelease
Hit:3 http://archive.raspberrypi.org/debian buster InRelease
Hit:4 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:5 https://deb.oxen.io buster InRelease
Hit:6 http://download.opensuse.org/repositories/home:/SmartFinn:/hardcode-tray/Debian_10  InRelease
Hit:7 https://download.docker.com/linux/raspbian buster InRelease
All packages are up to date.

Installing local libjpeg-turbo package...


libjpeg-turbo is already the newest version (2.1.0-20210803).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
libjpeg-turbo set to automatically installed.

Creating dummy deb...

Installing dummy deb...


Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 pi-apps-45c61c0c : Depends: gtk-3.0 but it is not installable
E: Unable to correct problems, you have held broken packages.

Apt finished.
Failed to install the packages!
APT reported these errors:
E: Unable to correct problems, you have held broken packages.
Cloning into 'droidcam'...
gcc  -Wall -O2 src/droidcam-cli.c src/connection.c src/settings.c src/decoder.c src/decoder_snd.c src/decoder_v4l2.c src/av.c src/usb.c src/queue.c -o droidcam-cli  -I/opt/libjpeg-turbo/include /opt/libjpeg-turbo/lib`getconf LONG_BIT`/libturbojpeg.a `pkg-config --libs --cflags libswscale libavutil` -lspeex -lasound -lpthread -lm -lusbmuxd
gcc  -Wall -O2 src/droidcam.c src/resources.c src/connection.c src/settings.c src/decoder.c src/decoder_snd.c src/decoder_v4l2.c src/av.c src/usb.c src/queue.c -o droidcam  `pkg-config --libs --cflags gtk+-3.0` `pkg-config --libs x11` `pkg-config --cflags --libs appindicator3-0.1` -I/opt/libjpeg-turbo/include /opt/libjpeg-turbo/lib`getconf LONG_BIT`/libturbojpeg.a `pkg-config --libs --cflags libswscale libavutil` -lspeex -lasound -lpthread -lm -lusbmuxd
src/droidcam.c: In function ‘the_callback’:
src/droidcam.c:276:4: warning: ‘gtk_menu_popup’ is deprecated: Use '(gtk_menu_popup_at_widget, gtk_menu_popup_at_pointer, gtk_menu_popup_at_rect)' instead [-Wdeprecated-declarations]
    gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 0, 0);
    ^~~~~~~~~~~~~~
In file included from /usr/include/gtk-3.0/gtk/gtklabel.h:34,
                 from /usr/include/gtk-3.0/gtk/gtkaccellabel.h:35,
                 from /usr/include/gtk-3.0/gtk/gtk.h:33,
                 from src/droidcam.c:9:
/usr/include/gtk-3.0/gtk/gtkmenu.h:138:9: note: declared here
 void    gtk_menu_popup    (GtkMenu        *menu,
         ^~~~~~~~~~~~~~
src/droidcam.c:281:4: warning: ‘gtk_menu_popup’ is deprecated: Use '(gtk_menu_popup_at_widget, gtk_menu_popup_at_pointer, gtk_menu_popup_at_rect)' instead [-Wdeprecated-declarations]
    gtk_menu_popup(GTK_MENU(wbMenu), NULL, NULL, NULL, NULL, 0, 0);
    ^~~~~~~~~~~~~~
In file included from /usr/include/gtk-3.0/gtk/gtklabel.h:34,
                 from /usr/include/gtk-3.0/gtk/gtkaccellabel.h:35,
                 from /usr/include/gtk-3.0/gtk/gtk.h:33,
                 from src/droidcam.c:9:
/usr/include/gtk-3.0/gtk/gtkmenu.h:138:9: note: declared here
 void    gtk_menu_popup    (GtkMenu        *menu,
         ^~~~~~~~~~~~~~
Copying files
+ cp uninstall /opt/droidcam-uninstall
+ cp icon2.png /opt/droidcam-icon.png
+ cp droidcam /usr/local/bin/
+ cp droidcam-cli /usr/local/bin/
+ set +x
Done
Webcam parameters: '640' and '480'
Building v4l2loopback-dc.ko
make: Entering directory '/home/pi/droidcam/v4l2loopback'
make -C /lib/modules/5.10.63-v8+/build M=/home/pi/droidcam/v4l2loopback modules
make[1]: Entering directory '/home/pi/droidcam/v4l2loopback'
make[1]: *** /lib/modules/5.10.63-v8+/build: No such file or directory.  Stop.
make[1]: Leaving directory '/home/pi/droidcam/v4l2loopback'
make: *** [Makefile:8: all] Error 2
make: Leaving directory '/home/pi/droidcam/v4l2loopback'

Failed to install DroidCam!
🔺Need help? Copy the ENTIRE terminal output or take a screenshot.
Please ask on Github: https://github.com/Botspot/pi-apps/issues/new/choose
Or on Discord: https://discord.gg/RXSTvaUvuu

cycool29 avatar Oct 15 '21 12:10 cycool29

@cycool29 your apt repos are PROBABLY corrupt. Can you please try to fix it. Also, for now you can install the dependencies from apt if pkg-install doesn't work.

open-sorcerer64 avatar Oct 16 '21 06:10 open-sorcerer64

@Botspot can you please check

open-sorcerer64 avatar Oct 16 '21 13:10 open-sorcerer64

That isn't a messed up apt. the package gtk-3.0 doesn't exist. also the error that stopped the script is make[1]: *** /lib/modules/5.10.63-v8+/build: No such file or directory. Stop.

Itai-Nelken avatar Oct 16 '21 14:10 Itai-Nelken

@cycool29 can you please install cmake and try again

open-sorcerer64 avatar Oct 17 '21 08:10 open-sorcerer64

@cycool29 can you please install cmake and try again

That's not the problem, the problem is this line: make[1]: *** /lib/modules/5.10.63-v8+/build: No such file or directory. Stop. Specifically /lib/modules/5.10.63-v8+/build: No such file or directory..

Itai-Nelken avatar Oct 17 '21 18:10 Itai-Nelken

@cycool29 can you please install cmake and try again

Sorry for the late reply.

Well I found I messed up my kernel and I reflashed my pi and the make[1]: *** /lib/modules/5.10.63-v8+/build: No such file or directory. Stop. problem solved.

I have improved your scripts in :

  • Use git_clone
  • Install libjpeg-turbo_2.1.0_armhf.deb with pkg-install
  • Added libasound2-dev for audio and removed gtk+-3.0 as it is not a package but regex
  • Added libplist-dev (from the dependencies list)
  • Added sudo ./install-sound for audio
  • Added few error messages
  • Use sudo if make failed
  • Use sudo for uninstallation
  • Cleanup after installation (remove Droid-Cam-RPi folder)

Tested on RPi OS armhf, works well with Google Meet, will test later with Zoom.

DroidCam.zip

cycool29 avatar Oct 18 '21 01:10 cycool29

@cycool29 can you please install cmake and try again

That's not the problem, the problem is this line: make[1]: *** /lib/modules/5.10.63-v8+/build: No such file or directory. Stop. Specifically /lib/modules/5.10.63-v8+/build: No such file or directory..

I didn't face this issue

open-sorcerer64 avatar Oct 18 '21 14:10 open-sorcerer64

@cycool29 can you please install cmake and try again

Sorry for the late reply.

Well I found I messed up my kernel and I reflashed my pi and the make[1]: *** /lib/modules/5.10.63-v8+/build: No such file or directory. Stop. problem solved.

I have improved your scripts in :

  • Use git_clone
  • Install libjpeg-turbo_2.1.0_armhf.deb with pkg-install
  • Added libasound2-dev for audio and removed gtk+-3.0 as it is not a package but regex
  • Added libplist-dev (from the dependencies list)
  • Added sudo ./install-sound for audio
  • Added few error messages
  • Use sudo if make failed
  • Use sudo for uninstallation
  • Cleanup after installation (remove Droid-Cam-RPi folder)

Tested on RPi OS armhf, works well with Google Meet, will test later with Zoom.

DroidCam.zip

Thanks 😊 It works with zoom. I am going to see if there's a new version of libjpeg-turbo that we can use

Also, can anyone test it on 64 bit? The process should be same except you'll have to install the arm64 version of libjpeg-turbo.

open-sorcerer64 avatar Oct 18 '21 14:10 open-sorcerer64

I just found a new version of libjpeg-turbo. I am adding it to the script and project file

open-sorcerer64 avatar Oct 19 '21 09:10 open-sorcerer64

@Botspot DroidCam.zip DroidCam is now completely ready for testing and merging it to Pi-Apps

open-sorcerer64 avatar Oct 19 '21 16:10 open-sorcerer64

Also, I think gtk+-3.0 is important but I am not sure

It gave me an error without it

open-sorcerer64 avatar Oct 19 '21 16:10 open-sorcerer64

Also, I think gtk+-3.0 is important but I am not sure

It gave me an error without it

The gtk+-3.0 is not a apt package, it is a regex. The name for it on apt is libgtk-3-dev. I think libgtk-3-dev and build-essential should be added to the pkg-install

But sometimes pkg-config can't find the gtk+-3.0. This often occurs if the PKG_CONFIG_PATH variable is not set correctly. So I added these few lines on my improved script:

#unset PKG_CONFIG_PATH if pkg-config unable to find gtk+3.0
if ! pkg-config --modversion gtk+3.0 &>/dev/null; then
  unset PKG_CONFIG_PATH
fi

This will check if pkg-config is able to find gtk+-3.0, if false, unset PKG_CONFIG_PATH . This solution is from this stackoverflow answer.

However, from the stackoverflow link, unsetting PKG_CONFIG_PATH sometimes won't fix the problem. It needs further debug and check for the correct path for PKG_CONFIG_PATH, but this is a bit hard for the script to do so for the user. Maybe we can add these lines in the install script:

# Check again if pkg-config is able to find gtk+-3.0 module
if ! pkg-config --modversion gtk+3.0 &>/dev/null; then
  error "pkg-config failed to find gtk+-3.0 module! \nPlease follow the instruction from https://stackoverflow.com/a/50038996 and run the script again."
fi

cycool29 avatar Oct 20 '21 00:10 cycool29

Any updates on this? I think it is ready to put on pi-apps. @Botspot

cycool29 avatar Nov 02 '21 02:11 cycool29

Except for the gtk+-3.0 problem. Everything works

You said you got an error without it, what is the error?

cycool29 avatar Nov 02 '21 02:11 cycool29

@Botspot DroidCam is ready to be added to Pi-Apps

open-sorcerer64 avatar Jan 01 '22 14:01 open-sorcerer64

@Botspot DroidCam is ready to be added to Pi-Apps

PR #1323 still has open suggestions to be made. Once all discussion is done I'd expect it can be merged.

Botspot avatar Jan 01 '22 16:01 Botspot

https://github.com/Botspot/pi-apps/pull/1239

cycool29 avatar Jan 03 '22 02:01 cycool29