DroidCam in Mageia-8

This forum is dedicated to packaging and translating :

On those activities rely the making of Mageia Linux Distribution.

Post all questions and information about packaging and translating : feedbacks, discussion about guidelines, packaging practices...

DroidCam in Mageia-8

Postby mgauser » Jul 14th, '21, 09:26

Preamble
---
Everything described below is checked simultaneously with the installation and testing android-tools-v31.0.2:
Mageia Bugzilla: https://bugs.mageia.org/show_bug.cgi?id=28860
android-tools-v31.0.2: https://github.com/AKotov-dev/android-tools-rpm

Related tools
---
ADBManager: https://github.com/AKotov-dev/adbmanager
ArEditor: https://github.com/AKotov-dev/areditor
DroidCam-RPM: https://github.com/AKotov-dev/droidcam-rpm

Image

Hello, friends.
My name is Alex, I'm from Russia. I apologize in advance for my bad English, as I communicate through an online translator.

Below I suggest that everyone who wants to test the work of packages android-tools-v31.0.2 and droidcam-v1.7.3. I have some difficulties with the smartphone microphone in Droidcam, so I turned to this forum, since proximity to the original source (Mageia) can help in the solution.

Recently, in my free time, I collected layouts of packages for DroidCam-v1.7.3 ( https://www.dev47apps.com )

Droidcam packages
---
URL: https://github.com/AKotov-dev/droidcam-rpm

dkms-v4l2loopback_dc-0.0.1-3.mrx8.noarch.rpm
droidcam-cli-1.7.3-1.mrx8.x86_64.rpm
droidcam-1.7.3-1.mrx8.x86_64.rpm

...they need to be installed and reboot the computer to raise the necessary kernel modules

If you don't need it anymore, you can delete everything installed above like this:
Code: Select all
urpme --auto dkms-v4l2loopback_dc

How it works
---
A small DroidCam server (better install DroidCamX) is installed on the smartphone from the store and launched. If WiFi is active on the smartphone, DroidCamX shows the IP address that is assigned to the smartphone and port 4747 (must be opened in iptables). If you run the DroidCam client on a computer with Mageia-8, you can immediately connect to the smartphone camera via WiFi. The second connection option is via adb and a USB cable (USB debugging mode is enabled on the smartphone, the smartphone must be connected and authorized, see the screenshot in the attachment).

The external microphone is used in Linux for this reason:
https://github.com/dev47apps/droidcam/issues/43

However, today there are successful attempts to use a microphone built into a smartphone...

Connecting a microphone from a smartphone (droidcam_audio)
---
After launching DroidCamX on a smartphone and the Droidcam client on Mageia-8, you need to do this:
Code: Select all
[[ $(pactl list | grep droidcam_audio) ]] || pacmd load-module module-alsa-source device=hw:Loopback,1,0 source_properties=device.description=droidcam_audio

...and the microphone will appear as "droidcam_audio" and work.

Microphone Test (droidcam_audio): http://webcammictest.com/check-mic.html

Additional information
---
https://github.com/dev47apps/droidcam/issues/54
https://github.com/dev47apps/droidcam/issues/60

I was never able to get the microphone to work without additional manipulations. Something should be started first, something second, something third: the kernel modules - videodev, v4l2loopback_dc, snd_aloop, DroidCam itself and the droidcam_audio device addition command. I have already tried all the recommended methods, but I can't do without manual intervention.

Question: Do you think, it is possible to properly connect the smartphone microphone via DroidCam in Mageia-8 without manual intervention? Thank you in advance...

Kind regards,
Alex
MSI H81M-ECO, Intel Core i3-4130T, Intel HD Graphics 4400 | Mageia-8 Budgie 10.5.3 x86_64
User avatar
mgauser
 
Posts: 15
Joined: Jul 14th, '21, 07:38
Location: Russia, Bogorodsk

Re: DroidCam in Mageia-8

Postby doktor5000 » Jul 14th, '21, 17:58

Hi there, thanks for sharing :D
Maybe a small hint - it's usually a good idea to introduce the software briefly. From what I understood droidcam allows to use your smartphone as a webcam, basically ?

mgauser wrote:Question: Do you think, it is possible to properly connect the smartphone microphone via DroidCam in Mageia-8 without manual intervention? Thank you in advance...


Shouldn't it be enough if you put your pacmd command after the start of droidcam and a short sleep, as in this example: https://github.com/dev47apps/droidcam/i ... -640776707
Maybe run it in a while loop until "pactl list | grep droidcam_audio" returns your smartphone microphone, and then run pacmd load-module.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16798
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: DroidCam in Mageia-8

Postby mgauser » Jul 14th, '21, 19:26

Hi, doktor5000.
Yes, DroidCam is a client for using a smartphone as a webcam.

The method you mentioned above may work, but not always: the sound may or may not come from the microphone. Similarly, if the string is load-module... put it directly in /etc/pulse/default.pa (this option is recommended by the DroidCam developer) - the microphone does not work at all. The situation is complicated by the fact that the connection (adb/wifi) can be terminated, for example, if I pull the cable out of the USB and then DroidCam needs to be restarted as well, and the question arises about resetting the previously created droidcam-audio. In general, this whole structure works somehow unstable.

DroidCam is quite common, and I was hoping that people have been using DroidCam for a long time in the form of already compiled files using ready-made installation scripts: https://www.dev47apps.com/droidcam/linux/ and will share the methods of reliable microphone launch in Mageia? :roll:
Last edited by isadora on Jul 14th, '21, 19:57, edited 1 time in total.
Reason: Quoting the former message is not appropriate
MSI H81M-ECO, Intel Core i3-4130T, Intel HD Graphics 4400 | Mageia-8 Budgie 10.5.3 x86_64
User avatar
mgauser
 
Posts: 15
Joined: Jul 14th, '21, 07:38
Location: Russia, Bogorodsk

Re: DroidCam in Mageia-8

Postby doktor5000 » Jul 14th, '21, 23:57

mgauser wrote:but not always: the sound may or may not come from the microphone.

Well you would need to figure out why that is the case, then that should be fixable or there are workarounds - but that's probably something you should ask upstream.

mgauser wrote:share the methods of reliable microphone launch in Mageia? :roll:

I don't think that's anything specific to Mageia, this should be the same under any linux distro with pulseaudio.

Most of what you described with droidcam restart or checking the connection should be pretty easy to check and handle in a script.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16798
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: DroidCam in Mageia-8

Postby mgauser » Jul 15th, '21, 11:26

Hi, doktor5000
In general, the sound from the microphone worked again in a strange way. :shock:
I wrote a line at the end of the file /etc/pulse/default.pa:
Code: Select all
load-module module-alsa-source device=hw:Loopback,1,0 source_properties=device.description=droidcam_audio

I rebooted the PC and selected the droidcam_audio microphone in pavucontrol. I started DroidCamX on my smartphone, started DroidCam on my computer, connected to my smartphone via USB, and work.

If you have some free time, could you check the same thing for yourself? If it works for you, then I will only have to do what is described below in the package...

%post:
Code: Select all
[[ $(grep "droidcam_audio" /etc/pulse/default.pa ) ]] || echo "load-module module-alsa-source device=hw:Loopback,1,0 source_properties=device.description=droidcam_audio" >> /etc/pulse/default.pa

%postun:
Code: Select all
if [ $1 -eq 0 ]; then sed -i '/droidcam_audio/d' /etc/pulse/default.pa; fi

I think this option will work until the first "Pulse" update (default.pa). Well, at least so... :)
MSI H81M-ECO, Intel Core i3-4130T, Intel HD Graphics 4400 | Mageia-8 Budgie 10.5.3 x86_64
User avatar
mgauser
 
Posts: 15
Joined: Jul 14th, '21, 07:38
Location: Russia, Bogorodsk

Re: DroidCam in Mageia-8

Postby doktor5000 » Jul 15th, '21, 17:23

IMHO You should not put it in a post script that way. What about a different user on the system if he doesn't want that device by default?
This should be handled in the startup script for droidcam, which should be run by the user and is then written to the per-user pulseaudio settings, not the systemwide /etc/pulse/default.pa
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16798
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: DroidCam in Mageia-8

Postby mgauser » Jul 15th, '21, 19:33

I completely agree with you, doctor5000. However, as can be seen from the description of the microphone connection in the author's repository, the author himself completely left this question to the user. And there is some truth in this - as many configurations as there are settings. The author is unlikely to do this, since he cannot guess all the configurations and every time he overwrites the file with the same (his) settings from the client on completely different systems-this means demolishing the previous settings (line) that the user changed before. As they say - the stick has two ends (well, or... the medal has two sides).

Quote from https://github.com/dev47apps/droidcam (Sound):
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.

On the other hand, the presence of another microphone in the context of another user is more of a plus than a minus, since he will also be able to use it for its intended purpose. Or maybe not use it.

In general, in order to temporarily consolidate what is still working for me, I updated the package with the additions listed above (1.7.3-2).

I'll wait, maybe someone will dare to put DroidCam on his computer. I still need the result of testing on other systems, so that there is something to compare it with... ;)

With respect,
Alex
MSI H81M-ECO, Intel Core i3-4130T, Intel HD Graphics 4400 | Mageia-8 Budgie 10.5.3 x86_64
User avatar
mgauser
 
Posts: 15
Joined: Jul 14th, '21, 07:38
Location: Russia, Bogorodsk

Re: DroidCam in Mageia-8

Postby mgauser » Jul 18th, '21, 07:31

upd: v1.7.3-3 - connecting a smartphone mic and launching droidcam via a script /usr/bin/droidcam.sh

Image

1. Install the droidcam packages
2. su/password; sed -i '/droidcam_audio/d' /etc/pulse/default.pa; reboot
3. Need to check the video broadcast over WiFi (it works via USB)

Check WebCam: https://webcammictest.com/
Check Microphone: https://webcammictest.com/check-mic.html
MSI H81M-ECO, Intel Core i3-4130T, Intel HD Graphics 4400 | Mageia-8 Budgie 10.5.3 x86_64
User avatar
mgauser
 
Posts: 15
Joined: Jul 14th, '21, 07:38
Location: Russia, Bogorodsk

Re: DroidCam in Mageia-8

Postby mgauser » Jul 19th, '21, 18:33

upd: 1.7.3-4 + backport dkms-v4l2loopback from Mageia-9 and replace dkms-v4l2loopback_dc

Before installing, you need to perform a complete removal of previous versions:
Code: Select all
urpme --auto dkms-v4l2loopback_dc
sed -i '/droidcam_audio/d' /etc/pulse/default.pa
reboot

...then install the new packages and restart the computer.

Testing video broadcasts to a virtual camera and display in Cheese and in the Google Chrome browser:
Code: Select all
gst-launch-1.0 -v filesrc location=1.mp4 ! decodebin ! videoconvert ! v4l2sink device=/dev/video0

Image

It seems that the native module dkms-v4l2loopback from Mageia-9 works better than the one running with the program dkms-v4l2loopback_dc, since the video broadcast in the browser immediately went on.

doktor5000, this is probably better, since Mageia-9 has already taken care of dkms-v4l2loopback? Maybe if dig deep into the repositories, can also find and DroidCam. :D

p.s. doktor5000, I wanted to ask you in addition... How would I better formulate the question?.. hmmm... In general, ...I don't write too much here? Maybe it's not accepted in your forum like this (because it's relatively quiet here)? It's just that yesterday I got a second vaccination against Covid-19, now I have 2 more days off. And I just need something to do. If I make a lot of "noise", I ask you to let me know about it.

With respect,
Alex
MSI H81M-ECO, Intel Core i3-4130T, Intel HD Graphics 4400 | Mageia-8 Budgie 10.5.3 x86_64
User avatar
mgauser
 
Posts: 15
Joined: Jul 14th, '21, 07:38
Location: Russia, Bogorodsk

Re: DroidCam in Mageia-8

Postby doktor5000 » Jul 19th, '21, 21:03

mgauser wrote:p.s. doktor5000, I wanted to ask you in addition... How would I better formulate the question?

Which question in particular ?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16798
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: DroidCam in Mageia-8

Postby morgano » Jul 19th, '21, 22:10

Hi Alex, Morgan from the bug here :)
I think you write good, and info seem good for someone needing this.

A short intro of what DroidCam is and what it does top in first post could have been nice. - most of us have not heard of DroidCam.

This forum is not very active Some of us like me check here now and then. Seem to be more action on the French forum MLO and there are also some other..
Mandriva since 2006, then Mageia since 2011 at home & work. Thinkpad T43 & T400, Dell M4400, Acer Aspire 7. Workstation using LVM, LUKS, VirtualBox, BOINC
morgano
 
Posts: 817
Joined: Jun 15th, '11, 17:51
Location: Kivik, Sweden

Re: DroidCam in Mageia-8

Postby mgauser » Jul 20th, '21, 07:00

@morgano
Hello, my friend, Morgan! :D
And I already didn't know what to think: at first I thought that someone was offended at me here, so they don't communicate (except for the administrator), later I thought that I typed the wrong forum address and checked if doktor5000 was in the Bugzilla messages; since it is there, which means there is also a connection with the forum. Anyway, I left the address there, and Morgan will definitely find me if anything happens. Hurray! So the forum is still true! In Russia, too, there is about the same activity on Linux forums, it's just that people have a lot of their own affairs and this is understandable.

To be honest, before going to a foreign forum for the first time, I read several articles on how to behave correctly with foreigners. The main idea that is written in them is a simple construction of phrases and preferably the absence of emotional notes, since everyone's mentality is different and what is common for some may be unacceptable for others. So I try to adhere to these rules, so as not to accidentally let go of some inappropriate joke or put the wrong smiley face.

Morgan, I'm sorry for distracting you from your vacation. Now I have at least figured out the reason for my groundless concern, thank you. :)
MSI H81M-ECO, Intel Core i3-4130T, Intel HD Graphics 4400 | Mageia-8 Budgie 10.5.3 x86_64
User avatar
mgauser
 
Posts: 15
Joined: Jul 14th, '21, 07:38
Location: Russia, Bogorodsk

Re: DroidCam in Mageia-8

Postby mgauser » Jul 20th, '21, 07:06

doktor5000 wrote:Which question in particular ?

Hi, doktor5000. :)
Comparing the work of dkms-v4l2loopback_dc (from the doidcam kit) and dkms-v4l2loopback (from Mageia-9) I noticed a certain difference: dkms-v4l2loopback_dc-shows the label (name of the virtual camera) "DroidCam" constantly and displays it in the system from the moment this module is loaded. But dkms-v4l2loopback displays the label of the virtual camera "DroidCam" only if a video stream arrives on a virtual device (for example, on /dev/video0). I have not dealt with this module before.

Question: Do you think the behavior of which of these modules is correct? Or is this difference insignificant?

Just in case, I will give the configuration files here:
/etc/modprobe.d/droidcam.conf
Code: Select all
options v4l2loopback card_label="DroidCam" exclusive_caps=1 width=640 height=480
options snd-aloop index=2

/etc/modules-load.d/droidcam.conf
Code: Select all
videodev
v4l2loopback
snd-aloop

Test script for Start/Stop the "DroidCam" Virtual Camera:
Code: Select all
#!/bin/bash

if [[ $(lsmod | grep "v4l2loopback") ]]; then
rmmod -f snd_aloop
rmmod -f v4l2loopback
rmmod -f videodev
echo "destroy cam..."
    else
modprobe videodev
modprobe v4l2loopback card_label="DroidCam" width=640 height=480 exclusive_caps=1
modprobe snd_aloop index=2
echo "create cam..."
fi;

#Show cam
v4l2-ctl --all

read $a

#DroidCam Video Test (play 2.mp4 to "DroidCam" as /dev/video0)
#gst-launch-1.0 -v filesrc location=2.mp4 ! decodebin ! videoconvert ! v4l2sink device=/dev/video0

exit 0;
MSI H81M-ECO, Intel Core i3-4130T, Intel HD Graphics 4400 | Mageia-8 Budgie 10.5.3 x86_64
User avatar
mgauser
 
Posts: 15
Joined: Jul 14th, '21, 07:38
Location: Russia, Bogorodsk

Re: DroidCam in Mageia-8

Postby doktor5000 » Jul 20th, '21, 19:03

mgauser wrote:Question: Do you think the behavior of which of these modules is correct? Or is this difference insignificant?

To be honest, that wouldn't matter to me as long as it works. But I also don't use droidcam, so you would have to decide that for yourself.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16798
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: DroidCam in Mageia-8

Postby mgauser » Jul 22nd, '21, 18:23

@doktor5000
I put together both options: with the ported v4l2loopback module and with the native v4l2loopback_dc. It is easier to work with the v4l2loopback_dc module, since the canonical v4l2loopback creates something like a "default dummy", which after loading the module needs to be loaded with the appropriate settings + give it a format and size on the fly. Otherwise, droidcam does not understand what kind of camera was slipped to him.
Code: Select all
modprobe v4l2loopback card_label="DroidCam" exclusive_caps=1
v4l2loopback-ctl set-caps "video/x-raw, format=I420, width=640, height=480" /dev/video0 &
droidcam &
...etc

I think that I need to temporarily stop, because this activity risks turning into "fanaticism". :D
MSI H81M-ECO, Intel Core i3-4130T, Intel HD Graphics 4400 | Mageia-8 Budgie 10.5.3 x86_64
User avatar
mgauser
 
Posts: 15
Joined: Jul 14th, '21, 07:38
Location: Russia, Bogorodsk

Re: DroidCam in Mageia-8

Postby mgauser » Aug 1st, '21, 14:06

Hello, doktor5000.
I couldn't get past the droidcam-v1.8.0 update, which was released recently. Now everything is working for me: both sound and Wi-Fi. :)

Image

droidcam-rpm's links:
---
1. A variant with the v4l2loopback_dc kernel module from droidcam (in the root dir): https://github.com/AKotov-dev/droidcam-rpm
2. A variant with the v4l2loopback module ported from Mageia-9 (archive dir): https://downgit.github.io/#/home?url=ht ... in/archive

Both options work. If use the variant with the native module from droidcam itself, there is less fuss with it, but this is adds the dkms package itself - v4l2loopback_dc. On the other hand, if use a backported module from Mageia-9 instead (v4l2loopback), there is more fuss, but there are fewer packages to build in the future. Which one do you think should be chosen as a priority? Which is more logical?

Kind regards,
Alex
MSI H81M-ECO, Intel Core i3-4130T, Intel HD Graphics 4400 | Mageia-8 Budgie 10.5.3 x86_64
User avatar
mgauser
 
Posts: 15
Joined: Jul 14th, '21, 07:38
Location: Russia, Bogorodsk

Re: DroidCam in Mageia-8

Postby doktor5000 » Aug 1st, '21, 14:08

IIRC in both cases you have a dkms package in addition to droidcam itself, so you always have 2 packages, no?
I'd choose the solution which is less work for the user.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16798
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: DroidCam in Mageia-8

Postby mgauser » Aug 1st, '21, 15:03

doktor5000 wrote:IIRC in both cases you have a dkms package in addition to droidcam itself, so you always have 2 packages, no?

DroidCam = droidcam + droidcam-cli + dkms-v4l2loopback_dc (or dkms-v4l2loopback from Mageia-9)

As a result, it turned out 2 different builds. If use dkms-v4l2loopback from Mageia-9, the method of initializing the camera itself is slightly changed in the GUI startup scripts (aka the droidcam package). The content of these two variants is different, if also take into account the loading configurations of the kernel modules. So I have a dilemma. :roll:
doktor5000 wrote:I'd choose the solution which is less work for the user.

Less work for the user? You probably mean that in the future, after the release of Mageia-9, the installation of dkms from the repository will be transparent to the user, so the option with a module from Mageia-9 is more preferable. Ok, so - the variant with the module from Mageia-9. Thank you for the hint.

p.s. I have such a online-translator here that I need to translate again after it, sorry. He translated to me that I should choose a solution that is less suitable for the user. So I had to translate your phrase in parts and then he said that it was about less work for the user. What a horror... :D
MSI H81M-ECO, Intel Core i3-4130T, Intel HD Graphics 4400 | Mageia-8 Budgie 10.5.3 x86_64
User avatar
mgauser
 
Posts: 15
Joined: Jul 14th, '21, 07:38
Location: Russia, Bogorodsk

Re: DroidCam in Mageia-8

Postby mgauser » Aug 7th, '21, 09:31

Hi, doktor5000.
Considering all the pros and cons, I concentrated on using the v4l2loopback_dc kernel module native to DroidCam. The author supports him and there is less hassle with him. By an additional request, an updated jpeg-progs-2.0.6 was added to the Mageia "updates-testing" repositories (29321): https://bugs.mageia.org/show_bug.cgi?id=29321 This allowed to get rid of problems with the transmission of the video stream "smartphone camera-DroidCam Client-Skype(...etc)" via Wi-Fi. Now, instead of the external "libjpeg-turbo", native Mageia packages are used.

Updated DroidCam Client packages: https://github.com/AKotov-dev/droidcam-rpm
---
dkms-v4l2loopback_dc-0.0.2-0.mrx8.noarch.rpm
droidcam-cli-1.8.0-1.mrx8.x86_64.rpm
droidcam-1.8.0-1.mrx8.x86_64.rpm

Sincerely,
Alex
MSI H81M-ECO, Intel Core i3-4130T, Intel HD Graphics 4400 | Mageia-8 Budgie 10.5.3 x86_64
User avatar
mgauser
 
Posts: 15
Joined: Jul 14th, '21, 07:38
Location: Russia, Bogorodsk

Re: DroidCam in Mageia-8

Postby mgauser » Aug 8th, '21, 09:25

Hello, doktor5000. Mageia has successfully updated libjpeg up to version 2.0.6. For this occasion, yesterday I made another version of the packages DroidCam. In this version, a self-contained "DroidCam Resolution" (Zenity), which is designed to change the camera resolution and is not included in the standard DroidCam project. Perhaps someone will want to test it...

RPM-packages DroidCam-Client-v1.8.0 for Mageia-8 [upd: 11.08.2021]

Image Image

GitHub: https://github.com/AKotov-dev/droidcam-rpm
Final packages v1.8.0-3: https://github.com/AKotov-dev/droidcam- ... tag/v1.8.0

Sincerely,
Alex
MSI H81M-ECO, Intel Core i3-4130T, Intel HD Graphics 4400 | Mageia-8 Budgie 10.5.3 x86_64
User avatar
mgauser
 
Posts: 15
Joined: Jul 14th, '21, 07:38
Location: Russia, Bogorodsk


Return to Packaging and translating for Mageia

Who is online

Users browsing this forum: No registered users and 1 guest