Building droidcam-cli from source on Pyra


rosietastic

Member
Joined
Sep 15, 2014
Messages
32
i am having fun trying to get Droidcam working on my Pyra.
it works fine on the same network with a browser (Vivaldi). with the cam running on an Android device.

i am trying to compile from source and have managed to create the turbojpeg library and droidcam-cli.
The client software installs fine (./install-client), but when i try to create the video piece (./installl-video) which should enable /dev/video0), i get the error as below. It looks like an architecture issue. but i am not sure what to do. Any help would be much appreciated. Anyone built droidcam ok?

rosie@zaphod:~/droidcam$ sudo ./install-video
Webcam parameters: '640' and '480'
Building v4l2loopback-dc.ko
make: Entering directory '/home/rosie/droidcam/v4l2loopback'
make -C /lib/modules/5.6.19-daveiii-pyradef-aufs/build M=/home/rosie/droidcam/v4l2loopback modules
make[1]: Entering directory '/usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs'
CC [M] /home/rosie/droidcam/v4l2loopback/v4l2loopback-dc.o
/bin/sh: 1: scripts/basic/fixdep: Exec format error
make[2]: *** [scripts/Makefile.build:268: /home/rosie/droidcam/v4l2loopback/v4l2loopback-dc.o] Error 2
make[2]: *** Deleting file '/home/rosie/droidcam/v4l2loopback/v4l2loopback-dc.o'
make[1]: *** [Makefile:1695: /home/rosie/droidcam/v4l2loopback] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs'
make: *** [Makefile:8: all] Error 2
make: Leaving directory '/home/rosie/droidcam/v4l2loopback'

Also. "file" gives this output on the fixdep file:
rosie@zaphod:~/droidcam$ file /usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs/scripts/basic/fixdep
/usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs/scripts/basic/fixdep: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=7d04e36eff6be20fda9163ffdc5e1a89adefb1e8, not stripped

Running droidcam-cli without the video build gives the predictable:

rosie@zaphod:~/droidcam$ ./droidcam-cli 192.168.0.19 4747
Error: Droidcam/v4l2loopback device not found (/dev/video[0-9]).
Did it install correctly?
If you had a kernel update, you may need to re-install.
 
I don't know.
Did you install some kernel headers manually for the wrong arch ?
Or play with cross compiling ?
In a normal debian I think fixdep is in linux-kbuild-* package. This is a dependency of linux-headers-*
It should be an executable for the system you're using (arm64, I think). not x86-64.
You may have installed a version for a different architecture, or have a wrong symlink somewhere. Or maybe some environment variable set to the wrong arch when compiling.
Sorry that I can't help more, I don't have pyra.
 
I don't know.
Did you install some kernel headers manually for the wrong arch ?
Or play with cross compiling ?
In a normal debian I think fixdep is in linux-kbuild-* package. This is a dependency of linux-headers-*
It should be an executable for the system you're using (arm64, I think). not x86-64.
You may have installed a version for a different architecture, or have a wrong symlink somewhere. Or maybe some environment variable set to the wrong arch when compiling.
Sorry that I can't help more, I don't have pyra.
Thanks pyrat.
i installed the kernel headers with :

sudo apt install linux-headers-`uname -r`

i am not intentionally cross compiling. but i am sure you are right. i must have made a mistake and downloaded something of the incorrect architecture somewhere.
 
Thanks pyrat.
i installed the kernel headers with :

sudo apt install linux-headers-`uname -r`
sounds right.
i am not intentionally cross compiling. but i am sure you are right. i must have made a mistake and downloaded something of the incorrect architecture somewhere.
Or maybe some build or install script you ran was written for amd64 and has some hardcode arch in package names or variables somewhere.
maybe try
dpkg -S /usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs/scripts/basic/fixdep
that should answer the name of the package that file came from, a colon, and the filename
You may then want to uninstall that package, depending on which it is.
You can ask for all packages installed for a certain architecture like:
apt list ~ramd64
or
apt list ~ri386

But it might be there and not come from any package but be isntalled somehow else, I don't know.
you may also type
env
and take a look at what variables you have. Maybe your CROSS_COMPILE or ARCH or some such is wrong ?
 
sounds right.

Or maybe some build or install script you ran was written for amd64 and has some hardcode arch in package names or variables somewhere.
maybe try
dpkg -S /usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs/scripts/basic/fixdep
that should answer the name of the package that file came from, a colon, and the filename
You may then want to uninstall that package, depending on which it is.
You can ask for all packages installed for a certain architecture like:
apt list ~ramd64
or
apt list ~ri386

But it might be there and not come from any package but be isntalled somehow else, I don't know.
you may also type
env
and take a look at what variables you have. Maybe your CROSS_COMPILE or ARCH or some such is wrong ?
Thanks again pyrat. Really helpful. i am learning a lot.

apt list ~ramd64
and
apt list ~ri386

both return no packages.

env
does not return CROSS_COMPILE or ARCH as a variable set.

The output from the dpkg command is :

dpkg -S /usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs/scripts/basic/fixdep
linux-headers-5.6.19-daveiii-pyradef-aufs: /usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs/scripts/basic/fixdep

i think i need these linux headers for the video module build.

As per your previous post fixdep in /usr/lib/linux-kbuild-5.10/scripts/basic/fixdep is from the armhf repo:
linux-kbuild-5.10: /usr/lib/linux-kbuild-5.10/scripts/basic/fixdep
fixdep from that repo runs fine if copied into the /usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs/scripts/basic location.
sudo ./video-install then fails at:

/bin/sh: 1: scripts/mod/modpost: Exec format error

rosie@zaphod:~/droidcam$ dpkg -S /usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs/scripts/mod/modpost
linux-headers-5.6.19-daveiii-pyradef-aufs: /usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs/scripts/mod/modpost


So it looks like there are binaries in the linux-headers-5.6.19-daveiii-pyradef-aufs: package that are not armhf.

Maybe i can recompile them?
 
Can it be a wrong symlink in some of the directories in the path to /usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs/scripts/basic/ ?
Bash:
F="/usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs/scripts/basic/fixdep" ; while [ "$F" != "/" ] ; do { if [[ -L "$F" ]] ; then ls -ld "$F" ; fi ; F=`dirname "$F"` ;  } ; done
 
Last edited:
Can it be a wrong symlink in some of the directories in the path to /usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs/scripts/basic/ ?
Bash:
F="/usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs/scripts/basic/fixdep" ; while [ "$F" != "/" ] ; do { if [[ -L "$F" ]] ; then ls -ld "$F" ; fi ; F=`dirname "$F"` ;  } ; don
Really appreciate your effort here.
I ran this for the fixdep and modpost files and got no outout.
 
Sorry, I mistyped "done".
So no symlinks.
I'm running out of ideas. Maybe just read the scripts you ran to build and install Droidcam (and linux-headers-5.6.19-daveiii-pyradef-aufs if you built it yourself) and see if there's some arch hardcoded there ?
Or maybe someone else may know.
 
Sorry, I mistyped "done".
So no symlinks.
I'm running out of ideas. Maybe just read the scripts you ran to build and install Droidcam (and linux-headers-5.6.19-daveiii-pyradef-aufs if you built it yourself) and see if there's some arch hardcoded there ?
Or maybe someone else may know.
Not sure if this is the right approach. i tried building the tools from the sources installed from inux-headers-5.6.19-daveiii-pyradef-aufs:

fixdep built successfully. but modpost gives me this:

rosie@zaphod:/usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs/scripts/mod$ sudo make modpost
cc modpost.c -o modpost
/usr/bin/ld: /tmp/cc1kulRI.o: in function `read_symbols':
modpost.c:(.text+0x2cb6): undefined reference to `handle_moddevtable'
/usr/bin/ld: modpost.c:(.text+0x2de0): undefined reference to `maybe_frob_rcs_version'
/usr/bin/ld: modpost.c:(.text+0x2e0a): undefined reference to `get_src_version'
/usr/bin/ld: /tmp/cc1kulRI.o: in function `main':
modpost.c:(.text+0x4052): undefined reference to `add_moddevtable'
collect2: error: ld returned 1 exit status
make: *** [<builtin>: modpost] Error 1
 
Not sure if this is the right approach. i tried building the tools from the sources installed from inux-headers-5.6.19-daveiii-pyradef-aufs:

fixdep built successfully. but modpost gives me this:

rosie@zaphod:/usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs/scripts/mod$ sudo make modpost
cc modpost.c -o modpost
/usr/bin/ld: /tmp/cc1kulRI.o: in function `read_symbols':
modpost.c:(.text+0x2cb6): undefined reference to `handle_moddevtable'
/usr/bin/ld: modpost.c:(.text+0x2de0): undefined reference to `maybe_frob_rcs_version'
/usr/bin/ld: modpost.c:(.text+0x2e0a): undefined reference to `get_src_version'
/usr/bin/ld: /tmp/cc1kulRI.o: in function `main':
modpost.c:(.text+0x4052): undefined reference to `add_moddevtable'
collect2: error: ld returned 1 exit status
make: *** [<builtin>: modpost] Error 1
Most probably is needed also the source of the kernel (not only the headers).

Searching the web i found that when you have source and headers go to main directory
/usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs
and type "make scripts" to delete and rebuild the scripts utility for Arm.
But don't have tested it...
 
Not sure if this is the right approach. i tried building the tools from the sources installed from inux-headers-5.6.19-daveiii-pyradef-aufs:

fixdep built successfully. but modpost gives me this:

rosie@zaphod:/usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs/scripts/mod$ sudo make modpost
I usually build like a nonroot user and install as root.
When I have built as root (with sudo) it often caused problems the next time I tried to build as normal user (output files created as root that the normal user can't replace/delete).
But if you always do it as root I guess it doesn't matter. Maybe you didn't have permission in the directory as user...
I prefer to run the fewer processes possible as root to avoid/mitigate any vulnerabilities.
cc modpost.c -o modpost
/usr/bin/ld: /tmp/cc1kulRI.o: in function `read_symbols':
modpost.c:(.text+0x2cb6): undefined reference to `handle_moddevtable'
/usr/bin/ld: modpost.c:(.text+0x2de0): undefined reference to `maybe_frob_rcs_version'
/usr/bin/ld: modpost.c:(.text+0x2e0a): undefined reference to `get_src_version'
/usr/bin/ld: /tmp/cc1kulRI.o: in function `main':
modpost.c:(.text+0x4052): undefined reference to `add_moddevtable'
collect2: error: ld returned 1 exit status
make: *** [<builtin>: modpost] Error 1
Bash:
apt build-dep linux-headers-5.6.19-daveiii-pyradef-aufs
might help, depending on how did you build and install before.
It should install all build dependent packages you might need that you may or may not have already
 
Most probably is needed also the source of the kernel (not only the headers).

Searching the web i found that when you have source and headers go to main directory

and type "make scripts" to delete and rebuild the scripts utility for Arm.
But don't have tested it...
Thanks Farox.
Have installed a couple of dependencies identified and tried "make scripts"
i have the kernel headers installed of course. but think i am missing the source.
i searched the wiki but am not sure where to get the source. i know it is based on Letux and includes much Pyra specific hard work.
The missing classmaps.h error seems to be encountered on other kernels, but as i have only installed the headers so far, it probably doesn't help.

rosie@zaphod:/usr/src/linux-headers-5.6.19-daveiii-pyradef-aufs$ sudo make scripts
YACC scripts/kconfig/parser.tab.[ch]
HOSTCC scripts/kconfig/lexer.lex.o
HOSTCC scripts/kconfig/parser.tab.o
HOSTCC scripts/kconfig/preprocess.o
HOSTCC scripts/kconfig/symbol.o
HOSTCC scripts/kconfig/util.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --syncconfig Kconfig
HOSTCC scripts/dtc/dtc.o
HOSTCC scripts/dtc/flattree.o
HOSTCC scripts/dtc/fstree.o
HOSTCC scripts/dtc/data.o
HOSTCC scripts/dtc/livetree.o
HOSTCC scripts/dtc/treesource.o
HOSTCC scripts/dtc/srcpos.o
HOSTCC scripts/dtc/checks.o
HOSTCC scripts/dtc/util.o
HOSTCC scripts/dtc/dtc-lexer.lex.o
HOSTCC scripts/dtc/dtc-parser.tab.o
HOSTLD scripts/dtc/dtc
HOSTCC scripts/selinux/genheaders/genheaders
scripts/selinux/genheaders/genheaders.c:19:10: fatal error: classmap.h: No such file or directory
#include "classmap.h"
^~~~~~~~~~~~
compilation terminated.
make[3]: *** [scripts/Makefile.host:107: scripts/selinux/genheaders/genheaders] Error 1
make[2]: *** [scripts/Makefile.build:505: scripts/selinux/genheaders] Error 2
make[1]: *** [scripts/Makefile.build:505: scripts/selinux] Error 2
make: *** [Makefile:1106: scripts] Error 2
 
From https://pyra-handheld.com/boards/threads/improve-volume-wheel-daemon-bounty.99430/post-1711470
Kernel sources are available in the message from aTc

I give a try and installed headers and sources in two separate directory but i made a mistake, i think they need to be on the same place...anyway i solved the missing headers copying there inside the other headers (so maybe the complete sources are not needed, but only some headers are missing ?)...but i have a problem scripts where not building....maybe i need to re-done the entire operation from start.
Next i try to compile Droidcam and after installing many missing libs i succefully built the program Droidcam(gui) and Droidcam-cli but after installing they didn't find libjpeg-turbo...maybe i need to check why (i installed in /opt/libjpeg-turbo as default).

Hope you could have more luck than me on building the kernel module.
 
Did you try to add it to LD_LIBRARY_PATH ?
I don't think /opt is in /etc/ld.so.conf.d/* in a normal Debian system ?
maybe
man ld.so
man ldconfig
 
Did you try to add it to LD_LIBRARY_PATH ?
I don't think /opt is in /etc/ld.so.conf.d/* /e in a normal Debian system ?
maybe
man ld.so
man ldconfig

Yes. when i built libjpeg_turbo. i had to update the lib path by adding to /etc/ld.so.conf.d/ and running ldonfig to apply
Glad you managed to build droidcam and droidcam-cli Farox

Like you Farox, i am still having trouble building the module with install-video
i obtained the kernel sources (from the legendary volume thread} and have now managed to successfully run make scripts. Again like you Farox, I resolved the missing headers from the kernel source.
However, I agree, running make scripts does not recreate modpost - even after removing the x86 binary and object from scripts/mod
When i try to make modpost directly from scripts/mod i get the below error. Any ideas?

make modpost
cc modpost.c -o modpost
/usr/bin/ld: /tmp/ccpckbqk.o: in function `read_symbols':
modpost.c:(.text+0x2cb6): undefined reference to `handle_moddevtable'
/usr/bin/ld: modpost.c:(.text+0x2de0): undefined reference to `maybe_frob_rcs_version'
/usr/bin/ld: modpost.c:(.text+0x2e0a): undefined reference to `get_src_version'
/usr/bin/ld: /tmp/ccpckbqk.o: in function `main':
modpost.c:(.text+0x4052): undefined reference to `add_moddevtable'
collect2: error: ld returned 1 exit status
make: *** [<builtin>: modpost] Error 1
 
Yes. when i built libjpeg_turbo. i had to update the lib path by adding to /etc/ld.so.conf.d/ and running ldonfig to apply
Glad you managed to build droidcam and droidcam-cli Farox

Like you Farox, i am still having trouble building the module with install-video
i obtained the kernel sources (from the legendary volume thread} and have now managed to successfully run make scripts. Again like you Farox, I resolved the missing headers from the kernel source.
However, I agree, running make scripts does not recreate modpost - even after removing the x86 binary and object from scripts/mod
When i try to make modpost directly from scripts/mod i get the below error. Any ideas?

make modpost
cc modpost.c -o modpost
/usr/bin/ld: /tmp/ccpckbqk.o: in function `read_symbols':
modpost.c:(.text+0x2cb6): undefined reference to `handle_moddevtable'
/usr/bin/ld: modpost.c:(.text+0x2de0): undefined reference to `maybe_frob_rcs_version'
/usr/bin/ld: modpost.c:(.text+0x2e0a): undefined reference to `get_src_version'
/usr/bin/ld: /tmp/ccpckbqk.o: in function `main':
modpost.c:(.text+0x4052): undefined reference to `add_moddevtable'
collect2: error: ld returned 1 exit status
make: *** [<builtin>: modpost] Error 1
I'm lost and clueless, so don't take me too serious, but has it correctly compiled file2alias.o ?
Likewise for sumversion.o

Might there be some other error previously in the build log that blocks that object file and then this is just a secondary consequence ?
 
I'm lost and clueless, so don't take me too serious, but has it correctly compiled file2alias.o ?
Likewise for sumversion.o

Might there be some other error previously in the build log that blocks that object file and then this is just a secondary consequence ?
I removed the file2alias.o and sumversion.o objects and tried "make scripts" again, but it does not rebuild modpost. Also when I "make modpost" directly in the mod directory, I get the same error as above.
Hopefully we can get some help here. Thanks for all of your efforts. Droidcam works well from a browser and gives the Pyra a wireless webcam. Be great to get the linux native client working.
 
Back
Top