Replies: 10 comments 21 replies
-
Probably want to validate that libcamerify works with other applications. e.g. ffmpeg, ffplay, v4l2-utils, vlc, etc. Possibly also look for whether libcamerify created a different(additional?) device (e.g. /dev/video1) rather than just /dev/video0 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Sorry the link was lost: kbingham/libcamera#69 |
Beta Was this translation helpful? Give feedback.
-
Looking at the logs - the libcamerify v4l2 layer gets called for 'open' - but never seems to get called for any of the ioctls on that device, so we can't intercept the calls and use libcamera. Does motion do anything that would prevent an LD_PRELOAD library from intercepting ioctls to a V4L2 video device? (That's what I think is failing) |
Beta Was this translation helpful? Give feedback.
-
From the other linked issue, the My first impression is that it is a ARM64 related issue. (The 32 bit works fine on my PI) I not own any ARM64 capable hardware however so it impossible for me to validate. I suppose I'd need you to change over to 32 bit image and validate that. For transparency, the specific start up section of the code is here. Motion starts by initializing the default parameters, gets user parameters, opens the device, checks the compatibility of the device, selects the input channel, applies user parameters, etc. From the other message log, the call to check for VIDIOC_QUERYCAP on the start up processes is where it fails. At this point in the startup process, virtually nothing has occurred. Motion is opening the device and very first call to any ioctl fails. |
Beta Was this translation helpful? Give feedback.
-
I forgot to add a couple of suggestions:
|
Beta Was this translation helpful? Give feedback.
-
@joeschmitt Motionplus would be an option for you now. I just added functionality for revising / changing all the controls on the camera so that provides a lot more flexibility than libcamerify. But...you would need to check the documentation on the differences to ensure that Motionplus still meets your needs. |
Beta Was this translation helpful? Give feedback.
-
https://busybox.busybox.narkive.com/jynzqsFW/patch-fix-ioctl-wrappers-for-64-bit-systems Looks like the use of an old xioctl here in motion is the fault. |
Beta Was this translation helpful? Give feedback.
-
Closing issue/discussion. The Motion code has been revised to use "unsigned long" in the ioctl call |
Beta Was this translation helpful? Give feedback.
-
I can confirm that installing everything from sources (libcamera/libcam-apps/motion) from default branches works: Motion 4.5.1+git20230416-c28d41b
The most important thing was building motion from master, but thankfully docs are straightforward. |
Beta Was this translation helpful? Give feedback.
-
Did you read the guide?
Yes
What is the base version number of Motion being used?
4.5.x
What was the install method?
Installed via package tool
What is base architecture?
ARM-64bit
What is the distro being used?
Raspbian
Disto version number
bullseye
Camera type(s) being used?
PI cam via libcamerify
Describe the issue/problem and steps to reproduce
I'm experiencing a similar issue to that discussed in #1434, i.e. calling
motion
withlibcamerify
is throwing the following error:This is a fresh install of motion on Raspberry Pi OS Bullseye (64-bit). The camera is a Raspberry Pi Camera Module 1 but I've recently purchased a Raspberry Pi Camera Module 3 which won't run in legacy mode, hence libcamera being the only option going forwards.
Relevant Motion log output (at log_level 8)
Beta Was this translation helpful? Give feedback.
All reactions