Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install DroidCam on arm64 kernel with armhf OS? #218

Closed
cycool29 opened this issue Feb 24, 2022 · 6 comments
Closed

How to install DroidCam on arm64 kernel with armhf OS? #218

cycool29 opened this issue Feb 24, 2022 · 6 comments

Comments

@cycool29
Copy link

Describe the bug
I tried to install droidcam on my Raspberry Pi armhf OS with arm64 kernel enabled. I got the following error when running sudo ./install-video:

Webcam parameters: '640' and '480'
Building v4l2loopback-dc.ko
make: Entering directory '/home/pi/droidcam/v4l2loopback'
make -C /lib/modules/5.10.92-v8+/build M=/home/pi/droidcam/v4l2loopback modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.92-v8+'
arch/arm64/Makefile:25: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
  CC [M]  /home/pi/droidcam/v4l2loopback/v4l2loopback-dc.o
gcc: error: unrecognized command-line option ‘-mbranch-protection=pac-ret+leaf+bti’
gcc: error: unrecognized command-line option ‘-mstack-protector-guard=sysreg’
gcc: error: unrecognized command-line option ‘-mstack-protector-guard-reg=sp_el0’
gcc: error: unrecognized command-line option ‘-mstack-protector-guard-offset=1376’
make[2]: *** [scripts/Makefile.build:280: /home/pi/droidcam/v4l2loopback/v4l2loopback-dc.o] Error 1
make[1]: *** [Makefile:1825: /home/pi/droidcam/v4l2loopback] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.92-v8+'
make: *** [Makefile:8: all] Error 2
make: Leaving directory '/home/pi/droidcam/v4l2loopback'

Expected behavior
DroidCam installed as usual.

@aramg
Copy link
Collaborator

aramg commented Mar 5, 2022

Unfortunately this is a linker (gcc / ld) issue.
The Makefile (/usr/src/linux-headers-5.10.92-v8+/arch/arm64/Makefile) is part of your kernel headers and it doesn't work with the given gcc version.
You can try updating gcc or ask the this particular distro/kernel maintainers.

@Botspot
Copy link

Botspot commented Mar 5, 2022

The OS is armhf, but the kernel is aarch64. @aramg, would there be a way to force the Makefile to compile a 32-bit build?

@aramg
Copy link
Collaborator

aramg commented Mar 6, 2022

Not too sure how armhf/aarch64 coexsit, but the Makefile allows you to specify a KERNEL_DIR:

KERNEL_DIR=/lib/modules/?????/build make -C v4l2loopback

By default it was going into /lib/modules/5.10.92-v8+, maybe you have another option in /lib/modules/

@cycool29
Copy link
Author

cycool29 commented Mar 6, 2022

Not too sure how armhf/aarch64 coexsit, but the Makefile allows you to specify a KERNEL_DIR:

KERNEL_DIR=/lib/modules/?????/build make -C v4l2loopback

By default it was going into /lib/modules/5.10.92-v8+, maybe you have another option in /lib/modules/

I did try that before, but I got a list of errors.

Here is the full output:

Webcam parameters: '640' and '480'
Building v4l2loopback-dc.ko
make: Entering directory '/home/pi/droidcam/v4l2loopback'
make -C /lib/modules//5.10.92-v7l+/build M=/home/pi/droidcam/v4l2loopback modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.92-v7l+'
  CC [M]  /home/pi/droidcam/v4l2loopback/v4l2loopback-dc.o
In file included from ./include/asm/atomic.h:12,
                 from ./include/linux/atomic.h:7,
                 from ./include/asm-generic/bitops/lock.h:5,
                 from ./include/asm/bitops.h:32,
                 from ./include/linux/bitops.h:29,
                 from ./include/linux/kernel.h:12,
                 from ./include/linux/list.h:9,
                 from ./include/linux/preempt.h:11,
                 from ./include/linux/spinlock.h:51,
                 from ./include/linux/vmalloc.h:5,
                 from /home/pi/droidcam/v4l2loopback/v4l2loopback-dc.c:24:
./include/asm/cmpxchg.h:11:2: error: #error "Cannot use generic cmpxchg on SMP"
   11 | #error "Cannot use generic cmpxchg on SMP"
      |  ^~~~~
[snip]
compilation terminated.
make[2]: *** [scripts/Makefile.build:280: /home/pi/droidcam/v4l2loopback/v4l2loopback-dc.o] Error 1
make[1]: *** [Makefile:1825: /home/pi/droidcam/v4l2loopback] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.92-v7l+'
make: *** [Makefile:8: all] Error 2
make: Leaving directory '/home/pi/droidcam/v4l2loopback'

@aramg
Copy link
Collaborator

aramg commented Mar 6, 2022

The linux headers, regular headers, compiler all seem mis-matched. I am not sure what the fix is, sorry. This is on the distro/system, not a droidcam issue.

@Botspot
Copy link

Botspot commented Mar 6, 2022

Probably best to close this issue then.
This is a matter of finding a way to compile a 64-bit kernel module on a 32-bit toolchain.

@cycool29 cycool29 closed this as completed Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants