PiCamera v2(v3) issue (PrusaLink 0.7.0) with v4l2 error
 
Notifications
Clear all

PiCamera v2(v3) issue (PrusaLink 0.7.0) with v4l2 error  

  RSS
Petr Sedlák
(@petr-sedlak)
Member
PiCamera v2(v3) issue (PrusaLink 0.7.0) with v4l2 error

Hi,

I've been trying to figure this out for days. I'm not able to get the image using sudo libcamera-hello on PrusaLink 0.7.0 on RPI 3B+ (v1.2) with Picamera v3 (noir) or Picamera v2 (noir). This command will always raise an error. If I connect to prusaconnect, I don't even see the corresponding camera in the menu.


I have got V42L error for Picamera v2 (noir) : 

[1288] ERROR V4L2 v4l2_device.cpp:353 'imx219 10-0010': Unable to set controls: Device or resource busy

[1288] WARN RPI raspberrypi.cpp:383 Mismatch between Unicam and CamHelper for embedded data usage!


I have got V42L error for Picamera v3 (noir) : 

[939] ERROR V4L2 v4l2_device.cpp:353 'imx708_noir': Unable to set controls: Device or resource busy


 

Ofcourse  when I updated everything (even through rpi-update), I got the same results 🙁

I tried different HWs : I used different instances RPI 3B+ as well as different cables.

I tried different distributions: When I use official distribution BullEyes, it works perfectly and I got pictures by both cameras. 

 

I suppose that it is something simple but I am stuck.

I would appreciate any meaningful answer.

thanks.

Best Answer by Tojik:

Hi, try running

prusalink stop

then try again with libcamera-hello. PrusaLink might be trying to grab them and failing, but it does not let go of them for some reason blocking libcamera-hello
if you can, try veryfying that prusalink really stopped using sudo htop.
Please send logs from prusalink - in the web interface under settings you should be able to download the syslog file. It is easier putting it on gdrive or something like it and sending a link, because the forum does not like large files and seems to bug out sometimes. Thank you

Posted : 25/08/2023 2:13 pm
_KaszpiR_
(@_kaszpir_)
Honorable Member
RE: PiCamera v2(v3) issue (PrusaLink 0.7.0) with v4l2 error

can you provide details about below command:
```
cat /etc/os-release
```

on working and non-working setup?

See my GitHub and printables.com for some 3d stuff that you may like.

Posted : 26/08/2023 6:19 am
Petr Sedlák
(@petr-sedlak)
Member
Topic starter answered:
RE: PiCamera v2(v3) issue (PrusaLink 0.7.0) with v4l2 error

it is the same 🙁

working

PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

 

nonworking

Posted : 28/08/2023 8:03 am
Tojik
(@tojik)
Member Moderator
RE: PiCamera v2(v3) issue (PrusaLink 0.7.0) with v4l2 error

Hi, try running

prusalink stop

then try again with libcamera-hello. PrusaLink might be trying to grab them and failing, but it does not let go of them for some reason blocking libcamera-hello
if you can, try veryfying that prusalink really stopped using sudo htop.
Please send logs from prusalink - in the web interface under settings you should be able to download the syslog file. It is easier putting it on gdrive or something like it and sending a link, because the forum does not like large files and seems to bug out sometimes. Thank you

Posted : 28/08/2023 1:08 pm
_KaszpiR_
(@_kaszpir_)
Honorable Member
RE:

you could compare working/non working /boot/config.txt - maybe there are extra dtoverlay libs enabled?

especially look for camera_auto_detect=1 and  start_x=1
https://www.raspberrypi.com/documentation/computers/config_txt.html
Next, make sure to re-run software install steps https://www.raspberrypi.com/documentation/accessories/camera.html#preparing-the-software

Also looks like those Arducam modules, so they may not be loaded automatically, and that may need extra steps to install modules for it:

- for imx219 - https://docs.arducam.com/Raspberry-Pi-Camera/Native-camera/Quick-Start-Guide/ - I suggest to start with this one.
- for imx708 - https://docs.arducam.com/Raspberry-Pi-Camera/Native-camera/12MP-IMX708/#software

Installs may differ slightly because they require different modules to load.
Also make sure you plugged properly cables and the cables are not broken (it is really easy to damage the edge of the ribbon, been there...)

See my GitHub and printables.com for some 3d stuff that you may like.

Posted : 28/08/2023 1:22 pm
Tojik
(@tojik)
Member Moderator
RE: PiCamera v2(v3) issue (PrusaLink 0.7.0) with v4l2 error

He himself says those are Raspberry Pi cameras. They share the same Sony sensor tho. Kinda puzzled by your response, but thanks for participating 🙂

Posted : 28/08/2023 3:22 pm
Petr Sedlák
(@petr-sedlak)
Member
Topic starter answered:
RE: PiCamera v2(v3) issue (PrusaLink 0.7.0) with v4l2 error

Thank you very much, Tojik. 

Yes. PrusaLink was trying to grab them and failing. When I stopped prusalink, I was able to successfully acquire the image via libcamera-hello. Now I can see the image through prusalink, where I have it also turned on for prusaconnect.

The problem was, as in most cases, between the keyboard and the monitor. I'm a little embarrassed 🙂

Posted : 29/08/2023 7:05 am
Tojik
(@tojik)
Member Moderator
RE: PiCamera v2(v3) issue (PrusaLink 0.7.0) with v4l2 error

You haven't seen the two months it took me to add them 😀 It's ok, glad they work now

Posted : 29/08/2023 10:47 am
John Smith
(@john-smith-4)
Active Member
RE:

FYI,  I just integrated an IMX708 camera model B0312 from AduCam into a RPi 3B+ running PrusaLink.

I went to this website

https://docs.arducam.com/Raspberry-Pi-Camera/Native-camera/12MP-IMX708/#software

and followed EVERY one of the steps below (yes, every step including the stuff for the RPi4 even though it is an RPi3):

For Raspberry Bullseye users running on Pi 4, please do the following:

sudo nano /boot/config.txt

#Find the line: camera_auto_detect=1,update it to: camera_auto_detect=0

dtoverlay=imx708

#Save and reboot.

For Bullseye users running on Pi 0 ~ 3, please also:

Open a terminal Run sudo raspi-config

Navigate to Advanced Options

Enable Glamor graphic acceleration

Reboot your Pi

If you encounter the display issues, please also execute the following steps:

Open a terminal Run sudo raspi-config

Navigate to Advanced Options

Navigate to GL Driver

Select GL (Full KMS)

Reboot your Pi

This post was modified 6 months ago by John Smith
Posted : 10/11/2023 11:31 pm
Tojik and _KaszpiR_ liked
Tojik
(@tojik)
Member Moderator
RE: PiCamera v2(v3) issue (PrusaLink 0.7.0) with v4l2 error

PrusaLink has a camera whitelist. So please let me know if a new camera needs to be added. It has a whitelist because the libcamera library wants to detect even UVC stuff and that didn't work last time. Le whitelist: https://github.com/prusa3d/Prusa-Link/blob/ee1a1c3fe4cb333d6d4f786f8b35d6ed769834da/prusa/link/cameras/picamera_driver.py#L48

Posted : 13/11/2023 10:51 am
John Smith
(@john-smith-4)
Active Member
RE:

I can confirm that my camera did not automatically configure and operate on my RPi 3B+ even though it is an "IMX708" as appears in picamera_driver.py#L48

I bought it from Amazon https://a.co/d/a8qJWfD as a "Arducam for Raspberry Pi Camera Module 3, 12MP IMX708 75°(D) Autofocus Pi Camera V3, 15-22pin FFC Cable"   Out of the box, my camera circuit board was stamped with a "Rev A" although there are newer Revs available.

In my instructions above, the camera started to operate after I performed the following step: 

  • Select GL (Full KMS)

Perhaps the "Full KMS" must be loaded for some cameras to work?

 

This post was modified 6 months ago 2 times by John Smith
Posted : 13/11/2023 3:57 pm
_KaszpiR_
(@_kaszpir_)
Honorable Member
RE:

> Perhaps the "Full KMS" must be loaded for some cameras to work?

Official Arducam docs for IMX708 mention this, so yes. https://docs.arducam.com/Raspberry-Pi-Camera/Native-camera/12MP-IMX708/#standard-autofocus-imx708-camera-module

See my GitHub and printables.com for some 3d stuff that you may like.

Posted : 13/11/2023 8:57 pm
John Smith
(@john-smith-4)
Active Member
RE: PiCamera v2(v3) issue (PrusaLink 0.7.0) with v4l2 error

Any way to automate the loading of "full KMS" when IMX708 is detected? 

Posted : 13/11/2023 9:21 pm
_KaszpiR_
(@_kaszpir_)
Honorable Member
RE: PiCamera v2(v3) issue (PrusaLink 0.7.0) with v4l2 error

not really, because it is a parameter required on device boot

See my GitHub and printables.com for some 3d stuff that you may like.

Posted : 13/11/2023 10:08 pm
Tojik
(@tojik)
Member Moderator
RE: PiCamera v2(v3) issue (PrusaLink 0.7.0) with v4l2 error

That sucks,
is there anything I can do to every image that would broaden the list of supported cameras?
Especially this - dtoverlay=imx708 looks like it might break compatibility with other sensors, but make your arducam work

Posted : 14/11/2023 9:55 am
_KaszpiR_
(@_kaszpir_)
Honorable Member
RE:

Welcome to dtoverlay and hardware compatibility hell.

If it would be that easy it would be enabled by default 

See my GitHub and printables.com for some 3d stuff that you may like.

Posted : 14/11/2023 12:03 pm
Share: