[Linux Mint 20] Turn an old iPad into a camera on a cameraless PC (droidcam)

The other day, when I tried to put "droidcam" in Ubuntu 18.04 LTS in Linux Mint 20, the version has been upgraded from 1.5 to 1.6. , The procedure on the official website has changed slightly (after unzipping, the file date was 2020/11/5).

DroidCam(Dev47Apps) https://www.dev47apps.com/

material

--PC: FMV-BIBLO MG70W (2007, Core2Duo [email protected], 4GB memory) --Tablet: iPad 3 (iOS 9.3.5), Sharp SH-02M (Android 10) --App: Droidcam

Installation

For iPad / Android, install "Droidcam" from the official app store.

On the other hand, for PC = client, proceed according to the official procedure.

Droidcam Linux https://www.dev47apps.com/droidcam/linux/

Droidcam client

First, download, unzip, and install the client package.

cd /tmp/
wget https://files.dev47apps.net/linux/droidcam_latest.zip
unzip droidcam_latest.zip -d droidcam
cd droidcam && sudo ./install-client

Last time it was "sudo ./install", so there are some changes from here.

Standard v4l2 loopback driver

Next, around the v4l2loopback driver whose steps have been updated.

Although it says how to use the Droidcam customized v4l2loopback driver, it would be nice if the standard v4l2loopback driver was included, so it seems good to skip here ...

$ sudo apt list | grep v4l2

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

gem-plugin-v4l2/focal 1:0.94-1build2 amd64
libv4l2rds0/focal 1.18.0-2build1 amd64
libv4l2rds0/focal 1.18.0-2build1 i386
qv4l2/focal 1.18.0-2build1 amd64
qv4l2/focal 1.18.0-2build1 i386
v4l2loopback-dkms/focal-updates,focal-updates 0.12.3-1ubuntu0.1 all
v4l2loopback-source/focal-updates,focal-updates 0.12.3-1ubuntu0.1 all
v4l2loopback-utils/focal-updates,focal-updates 0.12.3-1ubuntu0.1 all

It's not included! (It was included in Ubuntu 18.04 LTS)

So install the v4l2 loopback driver.

$ sudo apt install v4l2loopback-dkms
Loading the package list...Done
Creating a dependency tree
Reading status information...Done
Suggested package:
  v4l2loopback-utils
The following packages will be newly installed:
  v4l2loopback-dkms
upgrade:0 pieces, new installation:Delete one:0 pieces, pending:1 piece.
27.I need to get a 2 kB archive.
An additional 109 kB of disk space will be consumed after this operation.
:
:
Loading new v4l2loopback-0.12.3 DKMS files...
Building for 5.4.0-53-generic
Building initial module for 5.4.0-53-generic
Done.

v4l2loopback.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-53-generic/extra/

depmod.....

DKMS: install completed.
$ sudo modprobe v4l2loopback
$ lsmod | grep v4l2loopback
v4l2loopback           40960  0
videodev              225280  1 v4l2loopback
$

When you start the Droidcam client

$ droidcam
Device /dev/video0 is 'Dummy video device (0x0000)' @ platform:v4l2loopback-000
Device /dev/video0 is 'Dummy video device (0x0000)' @ platform:v4l2loopback-000
Opened /dev/video0, fd:12
Audio loopback device not found.
Is snd_aloop loaded?
Audio: 

And the log is flowing qiita_20201114_1.png The DroidCam client app window opens.

When I started Droidcam on the iPad side, entered the IP address of the displayed iPad and pressed Connect, the connection of Droidcam was successful. However, when I tried to check it with VLC or Cheese, I got an error and was told that the device could not be found in the first place, so I could not see the image from the camera.

Droidcam custom v4l2 loopback driver

I don't know what I don't like, but for the time being I decided to follow the newly added "Droidcam customization driver" in the procedure.

$ sudo apt install linux-headers-`uname -r` gcc make
Loading the package list...Done
Creating a dependency tree
Reading status information...Done
gcc is already the latest version(4:9.3.0-1ubuntu2)is.
make is already the latest version(4.2.1-1.2)is.
linux-headers-5.4.0-53-generic is already the latest version(5.4.0-53.59)is.
linux-headers-5.4.0-53-generic was set to be manually installed.
upgrade:0 pieces, new installation:0, deleted:0 pieces, pending:1 piece.
$ sudo ./install-video 
Webcam parameters: '640' and '480'
Building v4l2loopback-dc.ko
:
(Make runs in a row)
:
Adding options v4l2loopback_dc width=640 height=480 to /etc/modprobe.d/droidcam.conf
Adding videodev to /etc/modules-load.d/droidcam.conf
Adding v4l2loopback_dc to /etc/modules-load.d/droidcam.conf
Done
$ lsmod | grep v4l2
v4l2loopback_dc        24576  0
v4l2loopback           40960  0
videodev              225280  2 v4l2loopback_dc,v4l2loopback
$

So, as described in the procedure, "v4l2loopback_dc" was added to the module.

Operation check (IP connection)

Start "droidcam" from the CLI again.

$ droidcam
Device /dev/video0 is 'Dummy video device (0x0000)' @ platform:v4l2loopback-000
Device /dev/video1 is 'Droidcam' @ platform:v4l2loopback_dc-000
Opened /dev/video1, fd:12
Audio loopback device not found.
Is snd_aloop loaded?
Audio: 

Similarly, the droidcam client application starts, but the contents of the log have changed slightly from the previous one.

When I entered the IP address on the iPad side and connected Droidcam and started "VLC" on the Mint side, "Droidcam" was displayed in [Device] → [Video Capture] in the playlist.

qiita_20201114_2.png

In Ubuntu (= Droidcam Ver1.5), it was necessary to select a device every time, but by registering the Droidcam custom v4l2loopback driver, it will be displayed in the list in the application (officially such). Written in the wind).

Then, when I selected this Droidcam and played it, I was able to see the image from the iPad camera on VLC.

qiita_20201114_3.png

The range I tried is as follows.

--VLC: I was able to display and record the camera image with video capture --zoom: Displayed in camera test --skype: Shown in camera test --cheese: It is displayed, but an error occurred immediately.

In Ubuntu18.04LTS, it was displayed without any problem in Cheese, but it was a bit disappointing that it did not work in Mint (maybe the version of Cheese is different?).

USB connection

In addition to IP connection, Droidcam can be connected in two ways: USB connection.

For iPad (iOS)

The target "old iPad" was able to use Droidcam without any problem even with a USB connection.

As far as I can see from the README, it seems that it is connected to iOS using "usbmuxd", but when I checked it, usbmuxd was already installed, so I didn't have to do any additional work.

By the way, it was Active by executing the following command after connecting to the iPad via USB.

$ sudo systemctl status usbmuxd
● usbmuxd.service - Socket daemon for the usbmux protocol used by Apple devices
     Loaded: loaded (/lib/systemd/system/usbmuxd.service; static; vendor preset: enabled)
     Active: active (running) since Fri 2020-11-13 16:05:37 JST; 2s ago
       Docs: man:usbmuxd(8)
   Main PID: 21824 (usbmuxd)
      Tasks: 2 (limit: 4602)
:

For Android

On the other hand, for Android, after setting the Android side to the developer mode, the connection is made using the Android development tool "adb", which is a little difficult.

--Install adb

$ sudo apt install adb

--Android device

The mode change will differ depending on the model and OS version, so it is for reference only (I am SH-02M).

  1. Switch to developer mode by repeatedly hitting "Build number" in [Settings] → [Device information].
  2. Turn on [Settings]-> [System]-> [Detailed Settings]-> [Developer Options]-> Debugging [USB Debugging].
  3. Connect your PC and Android device via USB. Press OK when asked if you want to connect
  4. Execute the following command from the PC terminal to check if the Android terminal is recognized.
$ adb devices
List of devices attached
999999999999999	device
$

After doing so far, start the Android Droidcam application → start the Droidcam client on the PC → select USB (Android) and press Connect, and finally you can use Droidcam with a USB connection with the Android terminal.

In addition, although it depends on the application and environment, the display seems to be faster with the USB connection than with the IP connection, so if you use it yourself, you will probably choose the USB connection.

Other

voice

When I tried it on Ubuntu, it was connected as a result of Areya Koreya, but strange driver information remained, so I have not implemented it this time (sorry).

Launcher registration

Follow the same procedure as Ubuntu.

As an additional point, by adding "Categories = Audio Video" to the desktop file, the Droidcam icon could be placed under "Sound and Video". qiita_20201115_6.png

Miscellaneous feelings

――I don't think the version of Droidcam is up, and my notes are no longer useful ... ――At this time, there are almost no PCs without a camera, so I wonder if Droidcam would be remote monitoring. However, with remote monitoring, there are cloud services (such as Alfred Camera), so I wonder if it will be used on old PCs.

Recommended Posts

[Linux Mint 20] Turn an old iPad into a camera on a cameraless PC (droidcam)
How to install Linux on a 32bit UEFI PC
How to turn a .py file into an .exe file
Install Linux (CentOS) on your PC using a USB stick