Repository navigation
RealSense: no frames or IMU with enable_imu=True under librealsense RSUSB (two contexts claim the same USB interfaces) #4467
alxbouchard
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
real-sense-camerawithenable_imu=Truegets no frames and no IMU samples when librealsense is built with the RSUSB (libusb) backend.Setup
CONFIG_HID_SENSOR_*)faf1bed(same code path on currentmain)-DFORCE_RSUSB_BACKEND=ON(the only way to reach the IMU without the hid-sensor drivers),realsense_nativebuilt with cargo against itCommand
What happens
realsense_nativeopens the camera twice:imu_openin its own context, thencapture_threadin a second one. Under RSUSB each context claims the USB interfaces itself, so the second one finds them busy:Then
no frames within 1s/no IMU samples within 1sforever. Once the process segfaulted and the camera stopped enumerating (error -71) until replugged. Withenable_imu=Falsevideo works. With the default V4L backend the kernel arbitrates the interfaces, which is probably why the D455 setup doesn't see this.Proposed fix
One context and one pipeline for all streams (color, depth, IR, accel/gyro), started with a frame callback. Measured on the setup above: color/depth 14.97 Hz, IMU 399 Hz, clean stops 8/8. Stopping a callback pipeline over RSUSB takes ~2.3 s, so
shutdown_timeoutgoes to 5 s.Branch: https://github.com/alxbouchard/dimos/tree/alxbouchard/fix/realsense-single-context. I'll open it as a draft PR linked here. Happy to change the approach if you prefer something else.
All reactions