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

Could not create device error on Raspberry Pi #4

Closed
JLBicho opened this issue Jan 2, 2024 · 11 comments
Closed

Could not create device error on Raspberry Pi #4

JLBicho opened this issue Jan 2, 2024 · 11 comments

Comments

@JLBicho
Copy link

JLBicho commented Jan 2, 2024

Hello,

I'm trying to use your docker with a Raspberry Pi 4 4GB, running Raspbian Bullseye aarch64. The docker compose build and docker compose up commands work without errors.
However, when I try to use the container I get the following error:

root@0c938c5b80bd:/ros2_ws# rs-enumerate-devices 
 02/01 17:55:11,308 ERROR [548659127392] (librealsense-exception.h:52) /dev/video10 is no video capture device Last Error: Invalid argument
 02/01 17:55:11,308 ERROR [548659127392] (sensor.cpp:661) acquire_power failed: /dev/video10 is no video capture device Last Error: Invalid argument
Could not create device - /dev/video10 is no video capture device Last Error: Invalid argument . Check SDK logs for details
 02/01 17:55:11,408 ERROR [548659127392] (librealsense-exception.h:52) /dev/video12 is no video capture device Last Error: Invalid argument
 02/01 17:55:11,409 ERROR [548659127392] (sensor.cpp:661) acquire_power failed: /dev/video12 is no video capture device Last Error: Invalid argument
Could not create device - /dev/video12 is no video capture device Last Error: Invalid argument . Check SDK logs for details
 02/01 17:55:11,509 ERROR [548659127392] (librealsense-exception.h:52) /dev/video18 is no video capture device Last Error: Invalid argument
 02/01 17:55:11,509 ERROR [548659127392] (sensor.cpp:661) acquire_power failed: /dev/video18 is no video capture device Last Error: Invalid argument
Could not create device - /dev/video18 is no video capture device Last Error: Invalid argument . Check SDK logs for details
Segmentation fault (core dumped)

The Raspberry detects the Realsense without problem:

$ lsusb 
Bus 002 Device 002: ID 8086:0b64 Intel Corp. Intel(R) RealSense(TM) 515

Am I missing something to configure in the docker or Raspberry?

Thank you!

@2b-t
Copy link
Owner

2b-t commented Jan 3, 2024

Hi @JLBicho
I sadly neither own a Raspberry nor a Realsense 515 myself but this might be connected to the device C-group rules of the Docker.
Could you:

  • Follow the steps in this document on the Raspberry (outside the Docker) to see if the Realsense for some reason is detected as a different associated major number (other than 81/189 that I set here)?
  • Send me the output of v4l2-ctl --list-devices that can be installed on Debian with sudo apt-get install v4l-utils?
  • Check the output of dmesg to see if there is something regarding the Realsense?

What you could also test is to run the container as privileged by adding privileged: true in the docker-compose.yml like in this old commit but I think that should not change anything:


and you might want to try this as well.

@JLBicho
Copy link
Author

JLBicho commented Jan 3, 2024

Hello @2b-t, thank you for the quick answer.
Here are my findings:

  • The device_cgroup_rulesseem to be the same, as the major number is also 81 in /dev/video0 which is the Realsense.
  • Output for v4l2-ctl --list-devices:
$ v4l2-ctl --list-devices
bcm2835-codec-decode (platform:bcm2835-codec):
	/dev/video10
	/dev/video11
	/dev/video12
	/dev/video18
	/dev/video31
	/dev/media2

bcm2835-isp (platform:bcm2835-isp):
	/dev/video13
	/dev/video14
	/dev/video15
	/dev/video16
	/dev/video20
	/dev/video21
	/dev/video22
	/dev/video23
	/dev/media0
	/dev/media3

rpivid (platform:rpivid):
	/dev/video19
	/dev/media1

Intel(R) RealSense(TM) 515: Int (usb-0000:01:00.0-1):
	/dev/video0
	/dev/video1
	/dev/video2
	/dev/video3
	/dev/video4
	/dev/video5
	/dev/video6
	/dev/video7
	/dev/media4
	/dev/media5
  • Output for dmesg:
[   63.523011] usb 2-1: new SuperSpeed USB device number 2 using xhci_hcd
[   63.544401] usb 2-1: New USB device found, idVendor=8086, idProduct=0b64, bcdDevice=10.58
[   63.544428] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   63.544444] usb 2-1: Product: Intel(R) RealSense(TM) 515
[   63.544458] usb 2-1: Manufacturer: Intel(R) RealSense(TM) Camera
[   63.544471] usb 2-1: SerialNumber: 00000000F1120028
[   63.569463] hid-generic 0003:8086:0B64.0001: hiddev96,hidraw0: USB HID v1.10 Device [Intel(R) RealSense(TM) Camera Intel(R) RealSense(TM) 515] on usb-0000:01:00.0-1/input7
[   63.664143] usb 2-1: Found UVC 1.50 device Intel(R) RealSense(TM) 515 (8086:0b64)
[   63.672014] input: Intel(R) RealSense(TM) 515: Int as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1:1.0/input/input2
[   63.672441] usb 2-1: Found UVC 1.50 device Intel(R) RealSense(TM) 515 (8086:0b64)
[   63.676427] usbcore: registered new interface driver uvcvideo

I've tried with privileged and it didn't work.

The last link you've sent does not work for me as I'm on Raspbian not Ubuntu, the config.txt is different.

Any of this additional information gives you a hint?

Thanks!

@2b-t
Copy link
Owner

2b-t commented Jan 3, 2024

As you can see /dev/video10, /dev/video12 and /dev/video18 are all associated with bcm2835-codec-decode and not the Realsense. From your log it is impossible to say what precisely causes the segmentation fault (whether it occurs when accessing the streams of the Realsense or the ones of other devices). In order to find the line that causes it, you would have to compile librealsense with debugging flags and run it inside gdb (see here and here).
As said it might be a permission problem that is not handled correctly by librealsense that makes the code just crash instead of outputting an error message. I have seen that you opened an issue on librealsense IntelRealSense/librealsense#12552 I will comment there.

@JLBicho
Copy link
Author

JLBicho commented Jan 3, 2024

Hello,

I've tried to pass only the /dev/video* related to the Realsense but then I get the MIPI error from the other issue.

I'll keep trying things and let you know.

Thank you!

@2b-t
Copy link
Owner

2b-t commented Feb 4, 2024

I will close this for now as I am pretty certain is is unrelated to the Docker container as such but rather to the Realsense driver.

The Realsense drivers are an incredibly fragile and messy piece of software that have several known problems with single-board computers such as the Raspberrys or the Nvidia Jetson embedded computing boards that Intel has failed to address over the last couple of years.

2b-t added a commit that referenced this issue Feb 4, 2024
…d the ROS driver with Raspberry Pis and Nvidia Jetsons
@2b-t 2b-t closed this as completed in b8ceee5 Feb 4, 2024
@Tianyuan-Wang
Copy link

Hi @JLBicho

I also encountered this issue when configuring D435i on Pi 4 (but without docker). I found RealSense SDK is trying to access bcm2835 related camera devices not the D435i.

I disabled the bcm2835-isp and bcm2835-codec modules so that they are not visible in /dev and got rs-enumerate-devices working.

I use the following commands (I was on Ubuntu Server 22.04 64bit for Pi 4):
sudo modprobe -r bcm2835_codec
sudo modprobe -r bcm2835_isp

Hope it helps.

@2b-t
Copy link
Owner

2b-t commented Mar 1, 2024

Excellent @Tianyuan-Wang, happy to hear that. I already thought that this might work but as I am not too familiar with the Raspberrys in detail, I do not know though if this impacts the functionality of the Raspberry Pi. From what I understand the two kernel modules are responsible for audio and video capture/playback.

@JLBicho
Copy link
Author

JLBicho commented Mar 2, 2024

Hi @Tianyuan-Wang, thank you for the information!
I'll try it as soon as possible and let you know

@JLBicho
Copy link
Author

JLBicho commented Mar 4, 2024

Hi again,

I've tried what @Tianyuan-Wang suggested, but as @2b-t said, removing the modules also removes the video capture.
Now I have this error

[realsense2_camera_node-1]  04/03 17:13:26,402 ERROR [281472485222624] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[realsense2_camera_node-1]  04/03 17:13:26,501 WARNING [281472485222624] (rs.cpp:312) null pointer passed for argument "device"
[realsense2_camera_node-1] [WARN] [1709568806.501901869] [camera.camera]: Device 1/1 failed with exception: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[realsense2_camera_node-1] [ERROR] [1709568806.502268346] [camera.camera]: The requested device with  is NOT found. Will Try again.
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)

I'm using Ubuntu Server 22.0464bit for Raspi 4.
Again, thanks both for the support. If I ever find out what's going on, I'll let you know!

@Tianyuan-Wang
Copy link

Hi @JLBicho,

Again, I got this error recently and had it solved by enabling the FORCE_RSUSB_BACKEND flag when using CMake to configure the SDK (found the solution on this page). It seems this is due to there is no kernel patch script available for Pi/ARM based Linux distributions while ROS node needs some functions provided by patched modules. @ev-mp explained this with more details here.

But when I run RealSense camera ros2 node I can only get point cloud stream with up to 480x270x6 profile and there are a lot of warnings like [realsense2_camera_node-1] 05/03 15:12:18,200 WARNING [281472308734176] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 (I run these without docker on Pi4). I don't know what the bottleneck is. The CPU usage stays at a low level. The USB interface reported is 3.2. I use the USB cable that came with the camera in the box. I also tried them on Pi5 with docker and got a similar performance. The only good news is at least I have some output from the camera.

Another thing is rs-depth and rs-enumerate-devices work well on Pi4 no matter whether FORCE_RSUSB_BACKEND is enabled or not. But on Pi5 I can only get them work with FORCE_RSUSB_BACKEND enabled. Haven't figured out what caused this difference.

Hope it helps.

@JLBicho
Copy link
Author

JLBicho commented Mar 11, 2024

Thank you @Tianyuan-Wang for the detailed explanation. I'll check it out and your repo about Ros node with Raspi.

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