Device or resource busy and other errors OV64A40 B0483

  1. Where did you get the camera module(s)?
    ArduCam Online Store

  2. Model number of the product(s)?
    B0483

  3. What hardware/platform were you working on?
    Raspberry Pi 5 - 8GB

  4. Instructions you have followed. (link/manual/etc.)
    64MP OwlSight - Arducam Wiki

  5. Problems you were having?
    I am seeing multiple errors from the camera (getting worse with time).

“Unable to set controls”

[4:38:30.512373220] [34796] ^[1;32m INFO ^[1;37mRPI ^[1;34mpisp.cpp:695 ^[0mlibpisp version v1.0.5 999da5acb4f4 17-04-2024 (14:29:29)
[4:38:30.513293276] [34796] ^[1;31mERROR ^[1;37mV4L2 ^[1;34mv4l2_device.cpp:353 ^[0;32m'ov64a40 6-0036': ^[0mUnable to set controls: Device or resource busy
[4:38:30.523168987] [34796] ^[1;32m INFO ^[1;37mRPI ^[1;34mpisp.cpp:1154 ^[0mRegistered camera /base/axi/pcie@120000/rp1/i2c@88000/ov64a40@36 to CFE device /
dev/media1 and ISP device /dev/media0 using PiSP variant BCM2712_C0
[4:38:30.523258305] [34796] ^[1;32m INFO ^[1;37mRPI ^[1;34mpisp.cpp:695 ^[0mlibpisp version v1.0.5 999da5acb4f4 17-04-2024 (14:29:29)
[4:38:30.523847662] [34796] ^[1;31mERROR ^[1;37mV4L2 ^[1;34mv4l2_device.cpp:353 ^[0;32m'ov64a40 4-0036': ^[0mUnable to set controls: Device or resource busy
[4:38:30.531115305] [34796] ^[1;32m INFO ^[1;37mRPI ^[1;34mpisp.cpp:1154 ^[0mRegistered camera /base/axi/pcie@120000/rp1/i2c@80000/ov64a40@36 to CFE device /
dev/media3 and ISP device /dev/media2 using PiSP variant BCM2712_C0
[4:38:30.531299220] [34791] ^[1;32m INFO ^[1;37mCamera ^[1;34mcamera.cpp:990 ^[0mPipeline handler in use by another process
ERROR: *** failed to acquire camera /base/axi/pcie@120000/rp1/i2c@88000/ov64a40@36 ***

“Failed to start streaming”

INFO Camera camera_manager.cpp:284 libcamera v0.2.0+46-075b54d5
[0:27:04.143228322] [3606]  INFO RPI pisp.cpp:662 libpisp version v1.0.4 6e3a53d137f4 14-02-2024 (14:00:12)
[0:27:04.160797057] [3606]  INFO RPI pisp.cpp:1121 Registered camera /base/axi/pcie@120000/rp1/i2c@88000/ov64a40@36 to CFE device /dev/media0 and ISP device /dev/media2 using PiSP variant BCM2712_C0
[0:27:04.160936891] [3606]  INFO RPI pisp.cpp:662 libpisp version v1.0.4 6e3a53d137f4 14-02-2024 (14:00:12)
[0:27:04.173655189] [3606]  INFO RPI pisp.cpp:1121 Registered camera /base/axi/pcie@120000/rp1/i2c@80000/ov64a40@36 to CFE device /dev/media1 and ISP device /dev/media4 using PiSP variant BCM2712_C0
Mode selection for 4624:3472:12:P
    SBGGR10_CSI2P,1920x1080/0 - Score: 11359.2
    SBGGR10_CSI2P,2312x1736/0 - Score: 9096
    SBGGR10_CSI2P,3840x2160/0 - Score: 5359.24
    SBGGR10_CSI2P,4624x3472/0 - Score: 1000
    SBGGR10_CSI2P,8000x6000/0 - Score: 2476.58
    SBGGR10_CSI2P,9248x6944/0 - Score: 3024
Stream configuration adjusted
[0:27:04.174718306] [3598]  INFO Camera camera.cpp:1183 configuring streams: (0) 4624x3472-YUV420 (1) 4624x3472-RGGB16_PISP_COMP1
[0:27:04.174890400] [3606]  INFO RPI pisp.cpp:1405 Sensor: /base/axi/pcie@120000/rp1/i2c@80000/ov64a40@36 - Selected sensor format: 4624x3472-SRGGB10_1X10 - Selected CFE format: 4624x3472-PC1R
[0:27:05.180054159] [3606] ERROR V4L2 v4l2_device.cpp:353 'bu64754 4-0076': Unable to set controls: Connection timed out
[0:27:06.238058286] [3606] ERROR V4L2 v4l2_videodevice.cpp:1906 /dev/video6[38:cap]: Failed to start streaming: Connection timed out
ERROR: *** failed to start camera ***

“Connection timed out”

[2024-05-17 09:41:21,130: INFO/MainProcess] Task picam.tasks.take_photo[ec622240-c06f-4862-a7da-821e7952e382] succeeded in 0.962037811999835s: None
[2024-05-17 09:41:24,244: INFO/MainProcess] picam.tasks.take_photo[8fd66faa-6b8a-4fbe-a883-6a7e01d08a25]:
[2024-05-17 09:41:24,244: INFO/MainProcess] picam.tasks.take_photo[8fd66faa-6b8a-4fbe-a883-6a7e01d08a25]: [2:13:20.764534353] [17178] �[1;32m INFO �[1;37mCamera �[1;34mcamera_manager.cpp:284 �[0mlibcamera v0.2.0+120-eb00c13d
[2:13:20.781031637] [17184] �[1;32m INFO �[1;37mRPI �[1;34mpisp.cpp:695 �[0mlibpisp version v1.0.5 999da5acb4f4 17-04-2024 (14:29:29)
[2:13:20.794516895] [17184] �[1;32m INFO �[1;37mRPI �[1;34mpisp.cpp:1154 �[0mRegistered camera /base/axi/pcie@120000/rp1/i2c@88000/ov64a40@36 to CFE device /dev/media2 and ISP device /dev/media0 using PiSP variant BCM2712_C0
[2:13:20.794759454] [17184] �[1;32m INFO �[1;37mRPI �[1;34mpisp.cpp:695 �[0mlibpisp version v1.0.5 999da5acb4f4 17-04-2024 (14:29:29)
[2:13:20.805288667] [17184] �[1;32m INFO �[1;37mRPI �[1;34mpisp.cpp:1154 �[0mRegistered camera /base/axi/pcie@120000/rp1/i2c@80000/ov64a40@36 to CFE device /dev/media3 and ISP device /dev/media1 using PiSP variant BCM2712_C0
[2:13:20.805805656] [17178] �[1;33m WARN �[1;37mV4L2 �[1;34mv4l2_pixelformat.cpp:344 �[0mUnsupported V4L2 pixel format RPBP
Mode selection for 4624:3472:12:P
SBGGR10_CSI2P,1920x1080/0 - Score: 11359.2
SBGGR10_CSI2P,2312x1736/0 - Score: 9096
SBGGR10_CSI2P,3840x2160/0 - Score: 5359.24
SBGGR10_CSI2P,4624x3472/0 - Score: 1000
SBGGR10_CSI2P,8000x6000/0 - Score: 2476.58
SBGGR10_CSI2P,9248x6944/0 - Score: 3024
Stream configuration adjusted
[2:13:20.806183329] [17178] �[1;32m INFO �[1;37mCamera �[1;34mcamera.cpp:1183 �[0mconfiguring streams: (0) 4624x3472-YUV420 (1) 4624x3472-BGGR_PISP_COMP1
[2:13:20.806268608] [17184] �[1;32m INFO �[1;37mRPI �[1;34mpisp.cpp:1450 �[0mSensor: /base/axi/pcie@120000/rp1/i2c@80000/ov64a40@36 - Selected sensor format: 4624x3472-SBGGR10_1X10 - Selected CFE format: 4624x3472-PC1B
[2:13:21.820054845] [17184] �[1;31mERROR �[1;37mV4L2 �[1;34mv4l2_device.cpp:353 �[0;32m'bu64754 4-0076': �[0mUnable to set controls: Connection timed out
[2:13:22.910060188] [17184] �[1;31mERROR �[1;37mV4L2 �[1;34mv4l2_videodevice.cpp:1906 �[0;32m/dev/video6[38:cap]: �[0mFailed to start streaming: Connection timed out
ERROR: failed to start camera
  1. The dmesg log from your hardware?
    N/A

  2. Troubleshooting attempts you’ve made?

Reviewed code, changed code so that the camera process does not conflict.

  1. What help do you need?

i. Advice about detecting what processes are holding up the camera or holding onto the ‘pipeline’.
ii. Which pipeline is it referring to?
iii. I am running duel cameras (2 x 64 MP). How do I make sure the cameras pick different pipelines each time so there is no conflict?
iv. The errors seem random. I have tried to narrow it down, but the first and second errors above are very random.

Follow up question

  • I noticed that both cameras open up the stream twice. Why does this happen? and can it be stopped?

Sorry for constantly commenting. I got a different error now as well.

Failed to queue buffer 0: Invalid argu

Stream configuration adjusted
[5:37:12.275293567] [41552] ^[1;32m INFO ^[1;37mCamera ^[1;34mcamera.cpp:1183 ^[0mconfiguring streams: (0) 4624x3472-YUV420 (1) 4624x3472-BGGR_PISP_COMP1
[5:37:12.275434938] [41558] ^[1;32m INFO ^[1;37mRPI ^[1;34mpisp.cpp:1450 ^[0mSensor: /base/axi/pcie@120000/rp1/i2c@80000/ov64a40@36 - Selected sensor format:
 4624x3472-SBGGR10_1X10 - Selected CFE format: 4624x3472-PC1B
[5:37:19.347992017] [41552] ^[1;33m WARN ^[1;37mV4L2 ^[1;34mv4l2_pixelformat.cpp:344 ^[0mUnsupported V4L2 pixel format RPBP
Mode selection for 9248:6944:12:P
    SBGGR10_CSI2P,1920x1080/0 - Score: 27551.2
    SBGGR10_CSI2P,2312x1736/0 - Score: 25288
    SBGGR10_CSI2P,3840x2160/0 - Score: 21551.2
    SBGGR10_CSI2P,4624x3472/0 - Score: 17192
    SBGGR10_CSI2P,8000x6000/0 - Score: 5384.58
    SBGGR10_CSI2P,9248x6944/0 - Score: 1000
Stream configuration adjusted
[5:37:19.348512277] [41552] ^[1;32m INFO ^[1;37mCamera ^[1;34mcamera.cpp:1183 ^[0mconfiguring streams: (0) 9248x6944-YUV420 (1) 9248x6944-BGGR_PISP_COMP1
[5:37:19.373067794] [41558] ^[1;32m INFO ^[1;37mRPI ^[1;34mpisp.cpp:1450 ^[0mSensor: /base/axi/pcie@120000/rp1/i2c@80000/ov64a40@36 - Selected sensor format:
 9248x6944-SBGGR10_1X10 - Selected CFE format: 9248x6944-PC1B
[5:37:22.405736629] [41558] ^[1;31mERROR ^[1;37mV4L2 ^[1;34mv4l2_videodevice.cpp:1697 ^[0;32m/dev/video36[46:cap]: ^[0mFailed to queue buffer 0: Invalid argu
ment
[5:37:22.405766241] [41558] ^[1;31mERROR ^[1;37mRPISTREAM ^[1;34mrpi_stream.cpp:276 ^[0mFailed to queue buffer for ISP Stitch Output
[5:37:22.482212039] [41558] ^[1;35mFATAL ^[1;37mdefault ^[1;34mv4l2_videodevice.cpp:1960 ^[0;32m/dev/video36[46:cap]: ^[0massertion "cache_->isEmpty()" faile
d in streamOff()
Backtrace:
libcamera::V4L2VideoDevice::streamOff()+0x19c (/usr/lib/aarch64-linux-gnu/libcamera.so.0.2.0 [0x00007ffeeead6cfc])
libcamera::RPi::PipelineHandlerBase::stopDevice(libcamera::Camera*)+0x44 (/usr/lib/aarch64-linux-gnu/libcamera.so.0.2.0 [0x00007ffeeeaffa24])
libcamera::PipelineHandler::stop(libcamera::Camera*)+0x40 (/usr/lib/aarch64-linux-gnu/libcamera.so.0.2.0 [0x00007ffeeeaac894])
libcamera::Object::message(libcamera::Message*)+0x78 (/usr/lib/aarch64-linux-gnu/libcamera-base.so.0.2.0 [0x00007ffeee4e87a8])
libcamera::Thread::dispatchMessages(libcamera::Message::Type)+0x1c4 (/usr/lib/aarch64-linux-gnu/libcamera-base.so.0.2.0 [0x00007ffeee4eadc8])
libcamera::EventDispatcherPoll::processEvents()+0x44 (/usr/lib/aarch64-linux-gnu/libcamera-base.so.0.2.0 [0x00007ffeee4e1a14])
libcamera::Thread::exec()+0x74 (/usr/lib/aarch64-linux-gnu/libcamera-base.so.0.2.0 [0x00007ffeee4ea7b4])
libcamera::CameraManager::Private::run()+0xac (/usr/lib/aarch64-linux-gnu/libcamera.so.0.2.0 [0x00007ffeeea881dc])
??? [0x00007ffeee7ee9dc] (/usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.30 [0x00007ffeee7ee9dc])
start_thread+0x2b8 (./nptl/pthread_create.c:442)
thread_start+0xc (../sysdeps/unix/sysv/linux/aarch64/clone.S:82)

[2024-05-23 13:19:40,330: INFO/MainProcess] Task picam.tasks.take_photo[e872897f-8544-4d71-ae6f-0fe7fd2735a9] succeeded in 12.40120906499942s: None
[2024-05-23 13:19:48,903: INFO/MainProcess] Task picam.tasks.take_photo[ecfe5626-78a4-4d8c-8578-52cfba47a787] succeeded in 20.954714851999597s: None

Hi @wallarug
I would like to know if these problems are coming up when you run your code. How about the output of the commands below:

libcamera-still -t 0 --camera 0
libcamera-still -t 0 --camera 1

I have not tried -t 0 yet.

Command 1:

$ libcamera-still -t 0 --camera 0
[13:13:24.493709368] [50362]  INFO Camera camera_manager.cpp:284 libcamera v0.2.0+120-eb00c13d
[13:13:24.510371735] [50365]  INFO RPI pisp.cpp:695 libpisp version v1.0.5 999da5acb4f4 17-04-2024 (14:29:29)
[13:13:24.524028891] [50365]  INFO RPI pisp.cpp:1154 Registered camera /base/axi/pcie@120000/rp1/i2c@88000/ov64a40@36 to CFE device /dev/media2 and ISP device /dev/media0 using PiSP variant BCM2712_C0
[13:13:24.524121668] [50365]  INFO RPI pisp.cpp:695 libpisp version v1.0.5 999da5acb4f4 17-04-2024 (14:29:29)
[13:13:24.535923923] [50365]  INFO RPI pisp.cpp:1154 Registered camera /base/axi/pcie@120000/rp1/i2c@80000/ov64a40@36 to CFE device /dev/media3 and ISP device /dev/media1 using PiSP variant BCM2712_C0
Preview window unavailable
[13:13:24.538829524] [50362]  WARN V4L2 v4l2_pixelformat.cpp:344 Unsupported V4L2 pixel format RPBP
Mode selection for 4624:3472:12:P
    SBGGR10_CSI2P,1920x1080/0 - Score: 11359.2
    SBGGR10_CSI2P,2312x1736/0 - Score: 9096
    SBGGR10_CSI2P,3840x2160/0 - Score: 5359.24
    SBGGR10_CSI2P,4624x3472/0 - Score: 1000
    SBGGR10_CSI2P,8000x6000/0 - Score: 2476.58
    SBGGR10_CSI2P,9248x6944/0 - Score: 3024
Stream configuration adjusted
[13:13:24.539179337] [50362]  INFO Camera camera.cpp:1183 configuring streams: (0) 4624x3472-YUV420 (1) 4624x3472-RGGB_PISP_COMP1
[13:13:24.539314522] [50365]  INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@88000/ov64a40@36 - Selected sensor format: 4624x3472-SRGGB10_1X10 - Selected CFE format: 4624x3472-PC1R
#0 (0.00 fps) exp 66658.00 ag 8.00 dg 1.00
#1 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
#2 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
#3 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
#4 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
#5 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
#6 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
#7 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
#8 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
#9 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
#10 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
. . . (continues forever)

Command 2:

(.venv) live@cscs-0002:~ $ libcamera-still -t 0 --camera 1
[13:14:52.135063536] [50375]  INFO Camera camera_manager.cpp:284 libcamera v0.2.0+120-eb00c13d
[13:14:52.150937100] [50378]  INFO RPI pisp.cpp:695 libpisp version v1.0.5 999da5acb4f4 17-04-2024 (14:29:29)
[13:14:52.165348908] [50378]  INFO RPI pisp.cpp:1154 Registered camera /base/axi/pcie@120000/rp1/i2c@88000/ov64a40@36 to CFE device /dev/media2 and ISP device /dev/media0 using PiSP variant BCM2712_C0
[13:14:52.165431611] [50378]  INFO RPI pisp.cpp:695 libpisp version v1.0.5 999da5acb4f4 17-04-2024 (14:29:29)
[13:14:52.177792811] [50378]  INFO RPI pisp.cpp:1154 Registered camera /base/axi/pcie@120000/rp1/i2c@80000/ov64a40@36 to CFE device /dev/media3 and ISP device /dev/media1 using PiSP variant BCM2712_C0
Preview window unavailable
[13:14:52.180757269] [50375]  WARN V4L2 v4l2_pixelformat.cpp:344 Unsupported V4L2 pixel format RPBP
Mode selection for 4624:3472:12:P
    SBGGR10_CSI2P,1920x1080/0 - Score: 11359.2
    SBGGR10_CSI2P,2312x1736/0 - Score: 9096
    SBGGR10_CSI2P,3840x2160/0 - Score: 5359.24
    SBGGR10_CSI2P,4624x3472/0 - Score: 1000
    SBGGR10_CSI2P,8000x6000/0 - Score: 2476.58
    SBGGR10_CSI2P,9248x6944/0 - Score: 3024
Stream configuration adjusted
[13:14:52.181122861] [50375]  INFO Camera camera.cpp:1183 configuring streams: (0) 4624x3472-YUV420 (1) 4624x3472-RGGB_PISP_COMP1
[13:14:52.181235583] [50378]  INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@80000/ov64a40@36 - Selected sensor format: 4624x3472-SRGGB10_1X10 - Selected CFE format: 4624x3472-PC1R
#0 (0.00 fps) exp 66658.00 ag 8.00 dg 1.00
#1 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
#2 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
#3 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
#4 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
#5 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
#6 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
#7 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
#8 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
#9 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
#10 (7.66 fps) exp 66658.00 ag 8.00 dg 1.00
. . . (continues)

Not exactly sure what this shows you? The errors are intermittent and appear random.

I normally run the command(s) like so:
/usr/bin/libcamera-still --width 9248 --height 6944 --camera 0 -o /path/to/image.jpg -n

… which should be exactly the same behaviour.

Hi @wallarug
The problem could be caused by your code. Are you comfortable to post your code here?