Announcement: Raspberry Pi 4 Model B with two USB 3 ports now available
Hi everyone,
A new 'Raspberry Pi 4 Model B' development board is now available to purchase that has two USB 3 ports.
https://www.raspberrypi.org/products/raspberry-pi-4-model-b/
Hi @MartyG-RealSense Thanks for sharing this info. I want to connect and sync around 8 D415 cameras. To transfer frames, I am thinking to use one raspberry pi 4 model to connect to 2 cameras via usb 3 and a ethernet hub to connect raspberry pi to central system. So, I will be having 4 raspberry pi's which connects 8 cameras to central system. Apart from this I will be using a sync cable to sync all the cameras. Is it possible to do so? or can you suggest any better approach.
Your proposed setup sounds like the EtherSense project that was created by an Intel RealSense employee, with two cameras on each board instead of one.
https://github.com/krejov100/EtherSense
If the spec of the board is equal to or greater than the original-model Up Boards used in the EtherSense example (Pi 4 is superior) then it should be able to cope with 2 cameras on the same board. Two D415 cameras have been successfully used on the 'Up Squared' board (a newer and more powerful Up Board model).
An Intel Support team member thought that even an original Up Board should be able to cope with two cameras so long as a mains-powered USB 3 hub was used with the board in order to stably meet the power needs of the cameras. The 400 Series cameras have a 'Vision Processor D4' hardware board inside them to handle processing of captured camera data and reduce the need for a powerful CPU / GPU on the computing device that the cameras are attached to. So a low-spec board should be able to handle two cameras as long as the resolutions being used are not excessively high.
Given that the Pi 4 has performance equal to an entry-level PC though, in theory you should be able to get good camera performance out of it.
I'll write in this issue. I'll create a new one if you wish.
I'm currently trying to get a D435 working on an rpi4 with the latest raspbian-lite image on 4.19.56-v7l+ kernel. As far as I know, a new kernel must be compiled since the required drivers aren't enabled in the stock kernel. I also had to port the patches to the latest raspberry kernel, and I'm not 100% if I did everything correctly. A few changes from the ubuntu patches had already been committed to upstream. Here's the modified patch that can be applied on the latest raspberry kernel: https://raw.githubusercontent.com/Delicode/librealsense/master/scripts/realsense_raspberry4.patch
To begin with, here's the steps I took so far:
Backup everything in /boot somewhere else so you can restore your system if the new kernel doesn't boot. Then install required packages and get the kernel sources
sudo apt-get install build-essential bison flex bc git libncurses-dev libssl-dev libprotobuf-dev cmake libusb-1.0-0-dev
cd ~
git clone -b rpi-4.19.y https://github.com/raspberrypi/linux.git --depth 1 rpi-4.19.y
cd rpi-4.19.y
Apply the kernel patches:
wget https://raw.githubusercontent.com/Delicode/librealsense/master/scripts/realsense_raspberry4.patch
patch -p1 < realsense_raspberry4.patch
Customize the config to enable the drivers which librealsense requires:
make bcm2711_defconfig
make menuconfig
Enable the following drivers if they aren't enabled:
- HID_SENSOR_HUB in Device Drivers -> HID support -> HID bus support -> Special HID drivers
- HID_SENSOR_ACCEL_3D in Device Drivers -> Industrial I/O support -> Accelerometers
- HID_SENSOR_GYRO_3D in Device Drivers -> Industrial I/O support -> Digital gyroscope sensors
- USB_VIDEO_CLASS in Device Drivers -> Multimedia support -> Media USB Adapters
- VIDEO_V4L2 in Device Drivers -> Multimedia support
Compile the kernel and install it:
make ARCH=arm -j4 zImage modules dtbs
sudo make ARCH=arm modules_install
sudo cp arch/arm/boot/dts/*.dtb /boot/
sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
sudo cp arch/arm/boot/zImage /boot/kernel7l.img
sudo reboot
If the raspberry doesn't boot, restore the backupped /boot folder.
While following /var/log/kern.log, enable the new drivers:
sudo modprobe videodev
sudo modprobe uvcvideo
sudo modprobe hid_sensor_accel_3d
sudo modprobe hid_sensor_gyro_3d
If no errors appear, add the drivers in /etc/modules as follows:
videodev
uvcvideo
hid_sensor_accel_3d
hid_sensor_gyro_3d
Compile librealsense. I'm not building the examples due to large dependencies. They also don't currently link against librealsense.so. To fix this, add -latomic in the linker flags.
cd ~
git clone https://github.com/intelrealsense/librealsense
cd librealsense
mkdir build && cd build
cmake .. -DBUILD_EXAMPLES=false
make -j3
Copy udev rules and enable them:
sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger
Then try plugging the USB device in and follow kern.log. These are the errors I get:
Jul 3 10:19:19 raspberrypi kernel: [ 48.661873] usb 2-1: new SuperSpeed Gen 1 USB device number 2 using xhci_hcd
Jul 3 10:19:19 raspberrypi kernel: [ 48.692670] usb 2-1: New USB device found, idVendor=8086, idProduct=0b07, bcdDevice=50.b6
Jul 3 10:19:19 raspberrypi kernel: [ 48.692686] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jul 3 10:19:19 raspberrypi kernel: [ 48.692699] usb 2-1: Product: Intel(R) RealSense(TM) Depth Camera 435
Jul 3 10:19:19 raspberrypi kernel: [ 48.692712] usb 2-1: Manufacturer: Intel(R) RealSense(TM) Depth Camera 435
Jul 3 10:19:19 raspberrypi kernel: [ 48.692723] usb 2-1: SerialNumber: 824613021757
Jul 3 10:19:19 raspberrypi kernel: [ 48.696896] Unable to handle kernel paging request at virtual address 00001000
Jul 3 10:19:19 raspberrypi kernel: [ 48.700885] pgd = b24e8643
Jul 3 10:19:19 raspberrypi kernel: [ 48.704783] [00001000] *pgd=80000000004003, *pmd=00000000
Jul 3 10:19:19 raspberrypi kernel: [ 48.708697] Internal error: Oops: 207 [#1] SMP ARM
Jul 3 10:19:19 raspberrypi kernel: [ 48.712560] Modules linked in: bnep hci_uart btbcm serdev bluetooth ecdh_generic 8021q garp stp llc evdev brcmfmac vc4 brcmutil v3d drm_kms_helper gpu_sched sha256_generic drm cfg80211 drm_panel_orientation_quirks snd_soc_core rfkill snd_compress snd_bcm2835(C) snd_pcm_dmaengine snd_pcm syscopyarea raspberrypi_hwmon snd_timer sysfillrect hwmon sysimgblt fb_sys_fops snd bcm2835_codec(C) bcm2835_v4l2(C) v4l2_mem2mem bcm2835_mmal_vchiq(C) videobuf2_dma_contig v4l2_common argon_mem uio_pdrv_genirq uio fixed hid_sensor_gyro_3d hid_sensor_accel_3d hid_sensor_trigger hid_sensor_iio_common hid_sensor_hub industrialio_triggered_buffer kfifo_buf industrialio uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common videodev media ip_tables x_tables ipv6
Jul 3 10:19:19 raspberrypi kernel: [ 48.731215] CPU: 0 PID: 32 Comm: kworker/0:1 Tainted: G C 4.19.56-v7l+ #1
Jul 3 10:19:19 raspberrypi kernel: [ 48.736041] Hardware name: BCM2835
Jul 3 10:19:19 raspberrypi kernel: [ 48.740852] Workqueue: usb_hub_wq hub_event
Jul 3 10:19:19 raspberrypi kernel: [ 48.745687] PC is at uvc_probe+0x38/0x21f4 [uvcvideo]
Jul 3 10:19:19 raspberrypi kernel: [ 48.750485] LR is at usb_probe_interface+0xec/0x27c
Jul 3 10:19:19 raspberrypi kernel: [ 48.755252] pc : [<bf125aac>] lr : [<c076021c>] psr: 20000013
Jul 3 10:19:19 raspberrypi kernel: [ 48.760064] sp : efa71960 ip : efa71a38 fp : efa71a34
Jul 3 10:19:20 raspberrypi kernel: [ 48.763629] r10: 00000000 r9 : bf13265c r8 : dc65dc00
Jul 3 10:19:20 raspberrypi kernel: [ 48.765584] r7 : bf137034 r6 : dc65dc78 r5 : dbfe7000 r4 : 00001000
Jul 3 10:19:20 raspberrypi kernel: [ 48.767538] r3 : dc65dc00 r2 : 00008086 r1 : bf13265c r0 : dbfe7000
Jul 3 10:19:20 raspberrypi kernel: [ 48.769471] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Jul 3 10:19:20 raspberrypi kernel: [ 48.771402] Control: 30c5383d Table: 1cbe3fc0 DAC: fffffffd
Jul 3 10:19:20 raspberrypi kernel: [ 48.773347] Process kworker/0:1 (pid: 32, stack limit = 0x3b1e475f)
Jul 3 10:19:20 raspberrypi kernel: [ 48.775308] Stack: (0xefa71960 to 0xefa72000)
Jul 3 10:19:20 raspberrypi kernel: [ 48.777268] 1960: 00000000 dcdd3840 efa7198c efa71978 c098df54 c02930f0 c1027718 dcdd3840
Jul 3 10:19:20 raspberrypi kernel: [ 48.779272] 1980: efa719a4 efa71990 c098f500 c0435c74 dcdd3840 c0435d0c efa719c4 c0e94ad8
Jul 3 10:19:20 raspberrypi kernel: [ 48.781274] 19a0: c099336c c0e94ad8 c099336c 00000000 00000000 c0e94ad8 c099336c 00000013
Jul 3 10:19:20 raspberrypi kernel: [ 48.783306] 19c0: bf137034 dc65dc00 bf13265c 00000000 efa719fc efa719e0 c03051a4 c030634c
Jul 3 10:19:20 raspberrypi kernel: [ 48.785361] 19e0: dc65dc78 dc65dc00 00000013 bf137034 efa71a14 efa71a00 c099336c dbfe7000
Jul 3 10:19:20 raspberrypi kernel: [ 48.787424] 1a00: dbfe7020 dbfe7098 efa71a34 dbfe7020 dbfe7000 dc65dc78 bf137034 dc65dc00
Jul 3 10:19:20 raspberrypi kernel: [ 48.789492] 1a20: bf13265c 00000000 efa71a6c efa71a38 c076021c bf125a80 c0438a8c ffffffed
Jul 3 10:19:20 raspberrypi kernel: [ 48.791590] 1a40: efa71a6c c114c440 dbfe7020 c114c444 00000000 00000000 bf137034 00000021
Jul 3 10:19:20 raspberrypi kernel: [ 48.793693] 1a60: efa71a9c efa71a70 c06d62d4 c076013c 00000000 dbfe7020 bf137034 dbfe7020
Jul 3 10:19:20 raspberrypi kernel: [ 48.795801] 1a80: c06d6768 00000001 c114c41c 00000000 efa71ad4 efa71aa0 c06d6564 c06d60d4
Jul 3 10:19:20 raspberrypi kernel: [ 48.797933] 1aa0: c075f808 c075f754 dbfe7000 bf137034 bf137034 efa71b2c dbfe7020 c06d6768
Jul 3 10:19:20 raspberrypi kernel: [ 48.800097] 1ac0: 00000001 c114c41c efa71af4 efa71ad8 c06d6828 c06d6500 00000000 c1004d88
Jul 3 10:19:20 raspberrypi kernel: [ 48.802287] 1ae0: efa71b2c c06d6768 efa71b24 efa71af8 c06d4300 c06d6774 efa71b24 ef99986c
Jul 3 10:19:20 raspberrypi kernel: [ 48.804482] 1b00: dcd02238 396b0673 dbfe7020 c1004d88 dbfe7054 dc65dc78 efa71b5c efa71b28
Jul 3 10:19:20 raspberrypi kernel: [ 48.806700] 1b20: c06d6040 c06d427c c097d0a0 dbfe7020 00000001 396b0673 c0245a6c dbfe7028
Jul 3 10:19:20 raspberrypi kernel: [ 48.808917] 1b40: dbfe7020 c106f330 dc65dc78 dbfe7020 efa71b6c efa71b60 c06d68a8 c06d5f6c
Jul 3 10:19:20 raspberrypi kernel: [ 48.811122] 1b60: efa71b8c efa71b70 c06d5324 c06d6898 dbfe7028 c1004d88 00000000 dc65dc78
Jul 3 10:19:20 raspberrypi kernel: [ 48.813321] 1b80: efa71bdc efa71b90 c06d1be8 c06d529c dbfe7260 c106f318 efa71bc4 efa71ba8
Jul 3 10:19:20 raspberrypi kernel: [ 48.815519] 1ba0: c07510cc c0750d08 ef2a0000 396b0673 00000000 dbfe7000 dc65dc00 c0bd4c40
Jul 3 10:19:20 raspberrypi kernel: [ 48.817733] 1bc0: dbfe6820 dbfe7250 dc65dc78 dbfe7260 efa71c7c efa71be0 c075df14 c06d1878
Jul 3 10:19:20 raspberrypi kernel: [ 48.819952] 1be0: 00000001 00000000 00000000 00000000 00001388 c0bf640c efa71c2c dbfe724c
Jul 3 10:19:20 raspberrypi kernel: [ 48.822190] 1c00: 00000014 00000005 dbfe7200 00000001 00000001 00000001 c0bd4b40 c075cdfc
Jul 3 10:19:20 raspberrypi kernel: [ 48.824439] 1c20: c106f488 c106f330 dbfe720c dc728194 dc65dc04 dc728180 c0bf640c c0bd4b14
Jul 3 10:19:20 raspberrypi kernel: [ 48.826711] 1c40: ef2a0000 00000001 dc65dc78 dbfe724c c0769728 dc65dc00 00000001 c114c444
Jul 3 10:19:20 raspberrypi kernel: [ 48.828988] 1c60: 00000000 00000000 c106fad8 00000021 efa71c94 efa71c80 c076995c c075da70
Jul 3 10:19:20 raspberrypi kernel: [ 48.831263] 1c80: c106fad8 dc65dc00 efa71cac efa71c98 c0760118 c076990c c114c440 dc65dc78
Jul 3 10:19:20 raspberrypi kernel: [ 48.833570] 1ca0: efa71cdc efa71cb0 c06d62d4 c07600f0 00000000 dc65dc78 c106fad8 dc65dc78
Jul 3 10:19:20 raspberrypi kernel: [ 48.835904] 1cc0: c06d6768 00000001 ef8dee00 00000000 efa71d14 efa71ce0 c06d6564 c06d60d4
Jul 3 10:19:20 raspberrypi kernel: [ 48.838259] 1ce0: efaa34b8 00000000 efa71d0c efa71cf8 c106fad8 efa71d6c dc65dc78 c06d6768
Jul 3 10:19:20 raspberrypi kernel: [ 48.840615] 1d00: 00000001 ef8dee00 efa71d34 efa71d18 c06d6828 c06d6500 00000000 c1004d88
Jul 3 10:19:20 raspberrypi kernel: [ 48.842998] 1d20: efa71d6c c06d6768 efa71d64 efa71d38 c06d4300 c06d6774 efa71d64 ef99986c
Jul 3 10:19:20 raspberrypi kernel: [ 48.845382] 1d40: efaa3538 396b0673 dc65dc78 c1004d88 dc65dcac ef206c78 efa71d9c efa71d68
Jul 3 10:19:20 raspberrypi kernel: [ 48.847756] 1d60: c06d6040 c06d427c c097d0a0 dc65dc78 00000001 396b0673 c0245a6c dc65dc80
Jul 3 10:19:20 raspberrypi kernel: [ 48.850171] 1d80: dc65dc78 c106f330 ef206c78 dc65dc78 efa71dac efa71da0 c06d68a8 c06d5f6c
Jul 3 10:19:20 raspberrypi kernel: [ 48.852598] 1da0: efa71dcc efa71db0 c06d5324 c06d6898 dc65dc80 c1004d88 00000000 ef206c78
Jul 3 10:19:20 raspberrypi kernel: [ 48.855046] 1dc0: efa71e1c efa71dd0 c06d1be8 c06d529c c06c1780 c106f1cc dc4c74c0 393831f4
Jul 3 10:19:20 raspberrypi kernel: [ 48.857501] 1de0: 3932313a efa71d00 60437c0a 396b0673 efa71e18 dc65dc00 dc65dc78 dc728440
Jul 3 10:19:20 raspberrypi kernel: [ 48.859973] 1e00: ef206c00 00000001 00000000 ef271f00 efa71e5c efa71e20 c075425c c06d1878
Jul 3 10:19:20 raspberrypi kernel: [ 48.862463] 1e20: 00000003 000000b6 00000000 ef271f00 efa71e5c dc65dc00 00000005 00000000
Jul 3 10:19:20 raspberrypi kernel: [ 48.864950] 1e40: ef206c00 00000001 00000000 ef271f00 efa71efc efa71e60 c0755d88 c0753fe4
Jul 3 10:19:20 raspberrypi kernel: [ 48.867439] 1e60: efa71ec6 00000000 60000013 c0bd42c8 006000c0 c0c00404 00000096 ef2a0000
Jul 3 10:19:20 raspberrypi kernel: [ 48.869916] 1e80: c114c840 ef29c19c ef271c20 dc65de9c c1004d88 ef206cac ef29c000 ef271e40
Jul 3 10:19:20 raspberrypi kernel: [ 48.872397] 1ea0: 00000002 ef206c00 ef271c00 ef29c008 ef29c19c ef271e38 ef271e34 ef271e00
Jul 3 10:19:20 raspberrypi kernel: [ 48.874899] 1ec0: eff26900 00000203 ef271f04 396b0673 efa71efc ef271f00 efa12280 eff21a40
Jul 3 10:19:20 raspberrypi kernel: [ 48.877403] 1ee0: eff26900 00000000 ef271f04 00000000 efa71f34 efa71f00 c023d470 c0754f90
Jul 3 10:19:20 raspberrypi kernel: [ 48.879872] 1f00: eff21a40 eff21a40 eff21a40 efa12280 efa12294 eff21a40 00000008 eff21a58
Jul 3 10:19:20 raspberrypi kernel: [ 48.882358] 1f20: c1003d00 eff21a40 efa71f74 efa71f38 c023e534 c023d240 efa70000 c0b8642c
Jul 3 10:19:20 raspberrypi kernel: [ 48.884846] 1f40: c10956c6 ffffe000 c0243a68 efa72040 efa0fcc0 00000000 efa70000 efa12280
Jul 3 10:19:20 raspberrypi kernel: [ 48.887336] 1f60: c023e4d4 ef90de74 efa71fac efa71f78 c0243f70 c023e4e0 efa7205c efa7205c
Jul 3 10:19:20 raspberrypi kernel: [ 48.889751] 1f80: ffffe000 efa0fcc0 c0243e04 00000000 00000000 00000000 00000000 00000000
Jul 3 10:19:20 raspberrypi kernel: [ 48.892083] 1fa0: 00000000 efa71fb0 c02010ac c0243e10 00000000 00000000 00000000 00000000
Jul 3 10:19:20 raspberrypi kernel: [ 48.894321] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Jul 3 10:19:20 raspberrypi kernel: [ 48.896448] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
Jul 3 10:19:20 raspberrypi kernel: [ 48.898593] [<bf125aac>] (uvc_probe [uvcvideo]) from [<c076021c>] (usb_probe_interface+0xec/0x27c)
Jul 3 10:19:20 raspberrypi kernel: [ 48.900740] [<c076021c>] (usb_probe_interface) from [<c06d62d4>] (really_probe+0x20c/0x2c8)
Jul 3 10:19:20 raspberrypi kernel: [ 48.902893] [<c06d62d4>] (really_probe) from [<c06d6564>] (driver_probe_device+0x70/0x184)
Jul 3 10:19:20 raspberrypi kernel: [ 48.905058] [<c06d6564>] (driver_probe_device) from [<c06d6828>] (__device_attach_driver+0xc0/0xe4)
Jul 3 10:19:20 raspberrypi kernel: [ 48.907248] [<c06d6828>] (__device_attach_driver) from [<c06d4300>] (bus_for_each_drv+0x90/0xd4)
Jul 3 10:19:20 raspberrypi kernel: [ 48.909448] [<c06d4300>] (bus_for_each_drv) from [<c06d6040>] (__device_attach+0xe0/0x148)
Jul 3 10:19:20 raspberrypi kernel: [ 48.911656] [<c06d6040>] (__device_attach) from [<c06d68a8>] (device_initial_probe+0x1c/0x20)
Jul 3 10:19:20 raspberrypi kernel: [ 48.913856] [<c06d68a8>] (device_initial_probe) from [<c06d5324>] (bus_probe_device+0x94/0x9c)
Jul 3 10:19:20 raspberrypi kernel: [ 48.916091] [<c06d5324>] (bus_probe_device) from [<c06d1be8>] (device_add+0x37c/0x624)
Jul 3 10:19:20 raspberrypi kernel: [ 48.918330] [<c06d1be8>] (device_add) from [<c075df14>] (usb_set_configuration+0x4b0/0xa04)
Jul 3 10:19:20 raspberrypi kernel: [ 48.920591] [<c075df14>] (usb_set_configuration) from [<c076995c>] (generic_probe+0x5c/0x84)
Jul 3 10:19:20 raspberrypi kernel: [ 48.922849] [<c076995c>] (generic_probe) from [<c0760118>] (usb_probe_device+0x34/0x4c)
Jul 3 10:19:20 raspberrypi kernel: [ 48.925108] [<c0760118>] (usb_probe_device) from [<c06d62d4>] (really_probe+0x20c/0x2c8)
Jul 3 10:19:20 raspberrypi kernel: [ 48.927378] [<c06d62d4>] (really_probe) from [<c06d6564>] (driver_probe_device+0x70/0x184)
Jul 3 10:19:20 raspberrypi kernel: [ 48.929637] [<c06d6564>] (driver_probe_device) from [<c06d6828>] (__device_attach_driver+0xc0/0xe4)
Jul 3 10:19:20 raspberrypi kernel: [ 48.931909] [<c06d6828>] (__device_attach_driver) from [<c06d4300>] (bus_for_each_drv+0x90/0xd4)
Jul 3 10:19:20 raspberrypi kernel: [ 48.934176] [<c06d4300>] (bus_for_each_drv) from [<c06d6040>] (__device_attach+0xe0/0x148)
Jul 3 10:19:20 raspberrypi kernel: [ 48.936450] [<c06d6040>] (__device_attach) from [<c06d68a8>] (device_initial_probe+0x1c/0x20)
Jul 3 10:19:20 raspberrypi kernel: [ 48.938743] [<c06d68a8>] (device_initial_probe) from [<c06d5324>] (bus_probe_device+0x94/0x9c)
Jul 3 10:19:20 raspberrypi kernel: [ 48.941034] [<c06d5324>] (bus_probe_device) from [<c06d1be8>] (device_add+0x37c/0x624)
Jul 3 10:19:20 raspberrypi kernel: [ 48.943318] [<c06d1be8>] (device_add) from [<c075425c>] (usb_new_device+0x284/0x44c)
Jul 3 10:19:20 raspberrypi kernel: [ 48.945596] [<c075425c>] (usb_new_device) from [<c0755d88>] (hub_event+0xe04/0x11a8)
Jul 3 10:19:20 raspberrypi kernel: [ 48.947866] [<c0755d88>] (hub_event) from [<c023d470>] (process_one_work+0x23c/0x518)
Jul 3 10:19:20 raspberrypi kernel: [ 48.950166] [<c023d470>] (process_one_work) from [<c023e534>] (worker_thread+0x60/0x5b8)
Jul 3 10:19:20 raspberrypi kernel: [ 48.952460] [<c023e534>] (worker_thread) from [<c0243f70>] (kthread+0x16c/0x174)
Jul 3 10:19:20 raspberrypi kernel: [ 48.954755] [<c0243f70>] (kthread) from [<c02010ac>] (ret_from_fork+0x14/0x28)
Jul 3 10:19:20 raspberrypi kernel: [ 48.957046] Exception stack(0xefa71fb0 to 0xefa71ff8)
Jul 3 10:19:20 raspberrypi kernel: [ 48.959317] 1fa0: 00000000 00000000 00000000 00000000
Jul 3 10:19:20 raspberrypi kernel: [ 48.961610] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Jul 3 10:19:20 raspberrypi kernel: [ 48.963891] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
Jul 3 10:19:20 raspberrypi kernel: [ 48.966142] Code: e50b0038 e50b3054 e2433078 e50b3050 (15943000)
Jul 3 10:19:20 raspberrypi kernel: [ 48.968481] ---[ end trace 80f1a4e587dbfe6f ]---
Attached is a full kern.log for one boot, just in case there's something at boot time you need to see. kern.log
@SirDifferential I don't know about your error, probably you can go through the below link which may be helpful. https://dev.intelrealsense.com/docs/using-depth-camera-with-raspberry-pi-3
I think I solved part of the problem. These commits:
- https://github.com/raspberrypi/linux/commit/3bc85817d7982ed53fbc9b150b0205beff68ca5c
- https://github.com/raspberrypi/linux/commit/088ead25524583e2200aa99111bea2f66a86545a
change how UVC drivers add their quirks into the driver description by using the UVC_QUIRK_INFO macro and then change the struct size. I added that macro to the Realsense devices and the driver no longer crashes. Here are the changes: https://github.com/Delicode/librealsense/commit/cbe84c7400fa9450e1db4d616494957f35c91d70
However, the sensor doesn't work. Here's what kern.log has to say upon plugging in the device:
Jul 5 08:27:30 raspberrypi kernel: [ 51.711813] usb 2-1: new SuperSpeed Gen 1 USB device number 2 using xhci_hcd
Jul 5 08:27:30 raspberrypi kernel: [ 51.742621] usb 2-1: New USB device found, idVendor=8086, idProduct=0b07, bcdDevice=50.b6
Jul 5 08:27:30 raspberrypi kernel: [ 51.742637] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jul 5 08:27:30 raspberrypi kernel: [ 51.742649] usb 2-1: Product: Intel(R) RealSense(TM) Depth Camera 435
Jul 5 08:27:30 raspberrypi kernel: [ 51.742662] usb 2-1: Manufacturer: Intel(R) RealSense(TM) Depth Camera 435
Jul 5 08:27:30 raspberrypi kernel: [ 51.742673] usb 2-1: SerialNumber: 824613021757
Jul 5 08:27:30 raspberrypi kernel: [ 51.755188] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435 (8086:0b07)
Jul 5 08:27:30 raspberrypi kernel: [ 51.763890] uvcvideo: Unable to create debugfs 2-2 directory.
Jul 5 08:27:30 raspberrypi kernel: [ 51.764295] uvcvideo 2-1:1.0: Entity type for entity Intel(R) RealSense(TM) Depth Ca was not initialized!
Jul 5 08:27:30 raspberrypi kernel: [ 51.764311] uvcvideo 2-1:1.0: Entity type for entity Processing 2 was not initialized!
Jul 5 08:27:30 raspberrypi kernel: [ 51.764326] uvcvideo 2-1:1.0: Entity type for entity Camera 1 was not initialized!
Jul 5 08:27:30 raspberrypi kernel: [ 51.764685] input: Intel(R) RealSense(TM) Depth Ca as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1:1.0/input/in
put2
Jul 5 08:27:30 raspberrypi kernel: [ 51.766025] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435 (8086:0b07)
Jul 5 08:27:30 raspberrypi kernel: [ 51.769303] uvcvideo: Unable to create debugfs 2-2 directory.
Jul 5 08:27:30 raspberrypi kernel: [ 51.769676] uvcvideo 2-1:1.3: Entity type for entity Processing 7 was not initialized!
Jul 5 08:27:30 raspberrypi kernel: [ 51.769691] uvcvideo 2-1:1.3: Entity type for entity Extension 8 was not initialized!
Jul 5 08:27:30 raspberrypi kernel: [ 51.769706] uvcvideo 2-1:1.3: Entity type for entity Camera 6 was not initialized!
Here's what my program says upon trying to access the device:
Depth stream created: 1280 x 720 at 30 FPS
Color stream created: 1920 x 1080 at 30 FPS
streams created
Device serial is: 825312070308
camera product id: 0B07
Changing preset to High Accuracy
streams started
rs_error was raised when calling rs2_get_video_stream_intrinsics(from:0xa9409e88, intr:0xb2f09d90):
get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
Failed getting depth stream intrinsics
And kernel says the following at the same time:
Jul 5 08:27:59 raspberrypi kernel: [ 81.132582] uvcvideo: Failed to query (GET_CUR) UVC control 1 on unit 3: -32 (exp. 1024).
Jul 5 08:28:01 raspberrypi kernel: [ 82.337162] usb 2-1: USB disconnect, device number 2
Jul 5 08:28:01 raspberrypi kernel: [ 82.807323] usb 2-1: new SuperSpeed Gen 1 USB device number 3 using xhci_hcd
Jul 5 08:28:01 raspberrypi kernel: [ 82.838108] usb 2-1: New USB device found, idVendor=8086, idProduct=0b07, bcdDevice=50.b6
Jul 5 08:28:01 raspberrypi kernel: [ 82.838124] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jul 5 08:28:01 raspberrypi kernel: [ 82.838137] usb 2-1: Product: Intel(R) RealSense(TM) Depth Camera 435
Jul 5 08:28:01 raspberrypi kernel: [ 82.838150] usb 2-1: Manufacturer: Intel(R) RealSense(TM) Depth Camera 435
Jul 5 08:28:01 raspberrypi kernel: [ 82.838161] usb 2-1: SerialNumber: 824613021757
Jul 5 08:28:01 raspberrypi kernel: [ 82.842038] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435 (8086:0b07)
Jul 5 08:28:01 raspberrypi kernel: [ 82.846255] usb 2-1: WARN: Max Exit Latency too large
Jul 5 08:28:01 raspberrypi kernel: [ 82.846272] usb 2-1: Could not enable U2 link state, xHCI error -22.
Jul 5 08:28:01 raspberrypi kernel: [ 82.846951] uvcvideo: Unable to create debugfs 2-3 directory.
Jul 5 08:28:01 raspberrypi kernel: [ 82.848169] uvcvideo 2-1:1.0: Entity type for entity Intel(R) RealSense(TM) Depth Ca was not initialized!
Jul 5 08:28:01 raspberrypi kernel: [ 82.848188] uvcvideo 2-1:1.0: Entity type for entity Processing 2 was not initialized!
Jul 5 08:28:01 raspberrypi kernel: [ 82.848203] uvcvideo 2-1:1.0: Entity type for entity Camera 1 was not initialized!
Jul 5 08:28:01 raspberrypi kernel: [ 82.848982] input: Intel(R) RealSense(TM) Depth Ca as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1:1.0/input/in
put3
Jul 5 08:28:01 raspberrypi kernel: [ 82.851382] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435 (8086:0b07)
Jul 5 08:28:01 raspberrypi kernel: [ 82.854756] uvcvideo: Unable to create debugfs 2-3 directory.
Jul 5 08:28:01 raspberrypi kernel: [ 82.855164] uvcvideo 2-1:1.3: Entity type for entity Processing 7 was not initialized!
Jul 5 08:28:01 raspberrypi kernel: [ 82.855179] uvcvideo 2-1:1.3: Entity type for entity Extension 8 was not initialized!
Jul 5 08:28:01 raspberrypi kernel: [ 82.855193] uvcvideo 2-1:1.3: Entity type for entity Camera 6 was not initialized!
Jul 5 08:28:02 raspberrypi kernel: [ 84.086422] uvcvideo: Failed to query (GET_CUR) UVC control 2 on unit 3: -32 (exp. 1).
Jul 5 08:28:02 raspberrypi kernel: [ 84.198338] uvcvideo: Failed to query (GET_CUR) UVC control 1 on unit 3: -32 (exp. 1024).
Jul 5 08:28:03 raspberrypi kernel: [ 85.256602] uvcvideo: Failed to query (SET_CUR) UVC control 1 on unit 3: -110 (exp. 1024).
Jul 5 08:28:04 raspberrypi kernel: [ 85.866513] uvcvideo: Failed to query (SET_CUR) UVC control 1 on unit 3: -110 (exp. 1024).
Jul 5 08:28:05 raspberrypi kernel: [ 86.476385] uvcvideo: Failed to query (SET_CUR) UVC control 1 on unit 3: -110 (exp. 1024).
Jul 5 08:28:05 raspberrypi kernel: [ 87.086378] uvcvideo: Failed to query (SET_CUR) UVC control 1 on unit 3: -110 (exp. 1024).
Jul 5 08:28:06 raspberrypi kernel: [ 87.696245] uvcvideo: Failed to query (SET_CUR) UVC control 1 on unit 3: -110 (exp. 1024).
Jul 5 08:28:07 raspberrypi kernel: [ 88.306145] uvcvideo: Failed to query (SET_CUR) UVC control 1 on unit 3: -110 (exp. 1024).
Jul 5 08:28:07 raspberrypi kernel: [ 88.916069] uvcvideo: Failed to query (SET_CUR) UVC control 1 on unit 3: -110 (exp. 1024).
Jul 5 08:28:08 raspberrypi kernel: [ 89.525966] uvcvideo: Failed to query (SET_CUR) UVC control 1 on unit 3: -110 (exp. 1024).
Jul 5 08:28:08 raspberrypi kernel: [ 90.135834] uvcvideo: Failed to query (SET_CUR) UVC control 1 on unit 3: -110 (exp. 1024).
Jul 5 08:28:09 raspberrypi kernel: [ 90.745741] uvcvideo: Failed to query (SET_CUR) UVC control 1 on unit 3: -110 (exp. 1024).
Jul 5 08:28:10 raspberrypi kernel: [ 91.355665] uvcvideo: Failed to query (SET_CUR) UVC control 1 on unit 3: -110 (exp. 1024).
Jul 5 08:28:10 raspberrypi kernel: [ 91.965585] uvcvideo: Failed to query (SET_CUR) UVC control 1 on unit 3: -110 (exp. 1024).
Jul 5 08:28:11 raspberrypi kernel: [ 92.575504] uvcvideo: Failed to query (SET_CUR) UVC control 1 on unit 3: -110 (exp. 1024).
Jul 5 08:28:11 raspberrypi kernel: [ 93.185432] uvcvideo: Failed to query (SET_CUR) UVC control 1 on unit 3: -110 (exp. 1024).
Jul 5 08:28:12 raspberrypi kernel: [ 93.795367] uvcvideo: Failed to query (SET_CUR) UVC control 1 on unit 3: -110 (exp. 1024).
Jul 5 08:28:13 raspberrypi kernel: [ 94.405296] uvcvideo: Failed to query (SET_CUR) UVC control 1 on unit 3: -110 (exp. 1024).
Jul 5 08:28:13 raspberrypi kernel: [ 95.015268] uvcvideo: Failed to query (SET_CUR) UVC control 1 on unit 3: -110 (exp. 1024).
Edit: Here's what rs-depth C example says:
pi@raspberrypi:~/librealsense/examples/C/depth $ LD_LIBRARY_PATH=/home/pi/librealsense/build/ ./a.out
There are 1 connected RealSense devices.
Using device 0, an Intel RealSense D435
Serial number: 825312070308
Firmware version: 05.11.06.250
rs_error was raised when calling rs2_pipeline_wait_for_frames(pipe:0x1843e60):
Frame didn't arrived within 15000
@SirDifferential Were you able to make it work on the Raspberry Pi 4? I have similar issues as you (https://github.com/IntelRealSense/librealsense/issues/4375#issuecomment-509984739).
@Gagnon06 No, I was not. I'm wondering if this is a kernel problem in 4.19. I updated my x86 laptop to Debian Buster and compiled 4.19.59 with the librealsense patches applied, but I'm getting pretty much identical results to running the code on raspberry 4: The basic, minimal examples sometimes work, increasing resolution to 1280x720 causes more problems, and the more advanced commands such as presets, emitters and getting fov cause the device to disconnect.
I'm afraid this needs a look from someone who knows something about the kernel's USB and UVC drivers.
@SirDifferential I may I found a way to patch this kernel version. Intel has recipes for Yocto, which the last release supports kernel 4.19. I applied the patches from here : https://github.com/IntelRealSense/meta-intel-realsense/tree/master/recipes-kernel/linux/linux-yocto and recompiled the modules (the same way you described in this comment : https://github.com/IntelRealSense/librealsense/issues/4272#issuecomment-508015848). The rs-depth example seems to be more reliable now, but I still have some problems with my own software.
Error: hwmon command 0x10 failed
I will continue to investigate.
I applied the yocto patches to debian buster 4.19.59 kernel (https://github.com/Delicode/librealsense/blob/master/scripts/debianbuster-4.19.59.patch) and raspbian kernel (https://github.com/Delicode/librealsense/blob/master/scripts/realsense_raspberry4.patch), and the results are largely the same. It might be that the 1280x720 depth feed works better, although sometimes on pressing ^C to close the example the the kernel prints this:
Jul 17 08:19:07 raspberrypi kernel: [ 895.260494] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.260528] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.260568] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.260574] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.260581] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.260609] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.260614] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.260649] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.260654] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.260658] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.260688] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.260728] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.260733] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.260769] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.260812] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.260849] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.260889] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.260894] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.260929] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.260969] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261009] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261014] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261049] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261089] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261129] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261134] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261169] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261174] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261209] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261214] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261249] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261254] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261290] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261329] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261370] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261375] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261379] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261410] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261450] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261490] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261495] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261530] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261579] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:07 raspberrypi kernel: [ 895.261672] xhci_hcd 0000:01:00.0: WARN Event TRB for slot 2 ep 0 with no TDs queued?
Jul 17 08:19:17 raspberrypi kernel: [ 905.437936] usb 2-1: Disable of device-initiated U1 failed.
Jul 17 08:19:22 raspberrypi kernel: [ 910.477978] usb 2-1: Disable of device-initiated U2 failed.
Jul 17 08:19:23 raspberrypi kernel: [ 910.628899] usb 2-1: reset SuperSpeed Gen 1 USB device number 5 using xhci_hcd
Jul 17 08:19:28 raspberrypi kernel: [ 915.678053] usb 2-1: device descriptor read/8, error -110
Jul 17 08:19:28 raspberrypi kernel: [ 915.797943] usb 2-1: reset SuperSpeed Gen 1 USB device number 5 using xhci_hcd
Jul 17 08:19:33 raspberrypi kernel: [ 920.878047] usb 2-1: device descriptor read/8, error -110
Jul 17 08:19:33 raspberrypi kernel: [ 921.268438] usb 2-1: reset SuperSpeed Gen 1 USB device number 5 using xhci_hcd
In the above print, my raspberry actually froze and required a hard reboot by plugging the power. Another time after closing the rs-depth example with ^C the device stopped being accessible:
pi@raspberrypi:~/librealsense/examples/C/depth $ LD_LIBRARY_PATH=/home/pi/librealsense/build/ ./a.out
There are 1 connected RealSense devices.
rs_error was raised when calling rs2_create_device(info_list:0x1c79820, index:0):
set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
I also managed to get the device running on x86 Debian Buster in the realsense viewer with these patches, although it's spotty at best. I get errors like this when I try to control assorted knobs in the UI:
get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Device or resource busy
But sometimes the D435 still reacts to the instructions even if an error is shown. Unfortunately some controls don't seem to work, namely the presets. The D435 is detected as a USB 3.2 device though, so that eliminates a few possibilities. The C rs-depth works without issues on this x86 buster though when using 1280x720. The D435 does not get disconnected when I run the program several times.
EDIT: Looking at the kernel changes, 4.17 and 4.18 added quite a few changes to USB. Might be worth investigating those:
- https://kernelnewbies.org/Linux_4.17#Universal_Serial_Bus
- https://kernelnewbies.org/Linux_4.18#Universal_Serial_Bus
Just tested the rs-depth example with a resolution of 1280x720 and it seems to work fine. As for the problem I had before (hwmon command 0x10 failed), it was when we were trying to get the info (rs2::device::get_info) on the device too soon after setting it up and enabling the feed. Now the camera is working well, the only problem I see is a kernel log that shows up :
[ 198.567278] uvcvideo: Failed to query (GET_CUR) UVC control 1 on unit 3: -32 (exp. 1024).
[ 199.261753] uvcvideo: Failed to query (GET_CUR) UVC control 1 on unit 3: -32 (exp. 1024).
[ 199.312128] uvcvideo: Failed to query (GET_CUR) UVC control 1 on unit 3: -32 (exp. 1024).
[ 199.462983] uvcvideo: Failed to query (GET_CUR) UVC control 1 on unit 3: -32 (exp. 1024).
[ 199.513449] uvcvideo: Failed to query (GET_CUR) UVC control 1 on unit 3: -32 (exp. 1024).
[ 200.065930] uvcvideo: Failed to query (GET_CUR) UVC control 1 on unit 3: -32 (exp. 1024).
[ 200.116269] uvcvideo: Failed to query (GET_CUR) UVC control 1 on unit 3: -32 (exp. 1024).
EDIT : For reference, I am using the D415 camera.
EDIT 2 : I have been playing with the delay I added and it looks like with a delay of 2 seconds everything seems fine, but with a delay of 1 second I sometime get the same error :
set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Device or resource busy
According to this : https://github.com/IntelRealSense/librealsense/issues/2850, it should be fixed. To be continued...
That's a good find. I switched over the development branch with that fix applied, but don't see any improvements on the raspberry, even with some sleeps added. I spent a few hours debugging the communications with strace, but I'm not exactly sure what's happening there, but verified that calling rs2_toggle_advanced_mode seems to always cause the device to be disconnected. I modified rs-depth example to have:
// Get the first connected device
// The returned object should be released with rs2_delete_device(...)
rs2_device* dev = rs2_create_device(device_list, 0, &e);
check_error(e);
print_device_info(dev);
rs2_toggle_advanced_mode(dev, 1, &e);
check_error(e);
/* Determine depth value corresponding to one meter */
uint16_t one_meter = (uint16_t)(1.0f / get_depth_unit_value(dev));
// Create a pipeline to configure, start and stop camera streaming
// The returned object should be released with rs2_delete_pipeline(...)
rs2_pipeline* pipeline = rs2_create_pipeline(ctx, &e);
check_error(e);
and stepped through the code, and made the following findings.
After executing
send_receive(encode_command(ds::fw_cmd::EN_ADV, enable));
in /home/pi/librealsense/src/ds5/advanced_mode/advanced_mode.cpp:55, and then further
auto res = _hw_monitor->send(input);
in librealsense/src/ds5/advanced_mode/advanced_mode.cpp:781, the first error is printed in kern.log
Jul 18 12:03:06 raspberrypi kernel: [ 295.196397] uvcvideo: Failed to query (GET_CUR) UVC control 1 on unit 3: -32 (exp. 1024).
Then, in in /home/pi/librealsense/src/ds5/advanced_mode/advanced_mode.cpp:56,
send_receive(encode_command(ds::fw_cmd::HWRST));
eventually calls the following:
(gdb) bt
#0 librealsense::uvc_sensor::invoke_powered<librealsense::locked_transfer::send_receive(std::vector<unsigned char, std::allocator<unsigned char> > const&, int, bool)::{lambda(librealsense::platform::uvc_device&)#2}>(librealsense::locked_transfer::send_receive(std::vector<unsigned char, std::allocator<unsigned char> > const&, int, bool)::{lambda(librealsense::platform::uvc_device&)#2}) (this=0x12efa4, action=...) at /home/pi/librealsense/src/sensor.h:227
#1 0xb62cc65c in librealsense::locked_transfer::send_receive (this=0x131668,
data=std::vector of length 24, capacity 24 = {...}, timeout_ms=5000,
require_response=true) at /home/pi/librealsense/src/hw-monitor.h:219
#2 0xb62c847c in librealsense::hw_monitor::send (this=0x11d04c,
data=std::vector of length 24, capacity 24 = {...})
at /home/pi/librealsense/src/hw-monitor.cpp:117
#3 0xb5e86cec in librealsense::ds5_advanced_mode_base::send_receive (this=0x12ed44,
input=std::vector of length 24, capacity 1024 = {...})
at /home/pi/librealsense/src/ds5/advanced_mode/advanced_mode.cpp:781
#4 0xb5e828fc in librealsense::ds5_advanced_mode_base::toggle_advanced_mode (this=0x12ed44,
enable=true) at /home/pi/librealsense/src/ds5/advanced_mode/advanced_mode.cpp:55
#5 0xb5e6f9bc in rs2_toggle_advanced_mode (dev=0x134410, enable=1, error=0xbefff40c)
at /home/pi/librealsense/src/ds5/advanced_mode/rs_advanced_mode.cpp:46
#6 0x000110dc in main () at rs-depth.c:102
and kern.log shows the device disconnecting and reconnecting.
After this, the device may stream a few odd frames, but then the connection dies. If the advanced mode is not toggled, the device appears to stream fine.
HWRST sounds like some sort of hardware reset. Does this break something with the new kernel if the device has to restart to apply the new configuration?
Anyone with any luck? I am also failing using RPi 4 :(
Did either @filipematosinov or @SirDifferential or anyone try installing ubuntu on the RP4 to accomplish this, or would this add even more headaches? :)
I got librealsense and pyrealsense2 working on RPi4 with Rapsbian Buster :) I don't know which version of Ubuntu is available for the RPi4, but the MATE is not yet.
I got librealsense and pyrealsense2 working on RPi4 with Rapsbian Buster :) I don't know which version of Ubuntu is available for the RPi4, but the MATE is not yet.
Hi, @filipematosinov Could you share the steps you did? I would like to build the lib for my raspberry pi 4 too
Thanks in advance.
Using Raspbian Buster follow the normal instuctions for Raspbian with a slight modification. Check here https://github.com/IntelRealSense/librealsense/issues/4565#issuecomment-518359584
I am trying to set up a PI 4 for use with a D435 and T265 and having a lot of trouble - I can't even get the realsense viewer running. I've been following the guide for the pi3 found here https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_raspbian.md as suggested by @filipematosinov (using raspian buster as well). I get an error at the beginning steps that the following packages are not found:
E: Unable to locate package libdrm-amdgpu1-dbg E: Unable to locate package libdrm-exynos1-dbg E: Unable to locate package libdrm-freedreno1-dbg E: Unable to locate package libdrm-nouveau2-dbg E: Unable to locate package libdrm-omap1-dbg E: Unable to locate package libdrm-radeon1-dbg E: Unable to locate package libdrm-tegra0-dbg E: Unable to locate package libdrm2-dbg
when I try to run to run realsense-viewer at the end of all the steps, I get zsh: command not found: realsense-viewer
I would appreciate any help! Also would love some clarification on https://github.com/IntelRealSense/librealsense/issues/4565#issuecomment-518359584 for making this modification once things are more up and running - I'm not so clear on how and where all those changes are made.
@MartyG-RealSense -- do you recommend for now just using an upsquared board? I've been having a really hard time trying to get the raspberry pi 4 to work.
Up Squared boards certainly are compatible with 400 Series cameras. Up use the board in their own RealSense robotics maker kit.
https://support.intelrealsense.com/hc/en-us/community/posts/360033532514-RealSense-and-the-AAEON-UP-Squared-Robomaker-Dev-Kit-
Thanks @MartyG-RealSense - I have seen that kit - I was just wondering what your take is on the probability of the raspberry pi 4 becoming viable for realsense.