Repository navigation
[Linux][Python][Multi-camera] “Frame didn't arrive within 5000” after repeated pipeline restarts — an isolated RSUSB workaround on Ubuntu 22.04 / kernel 6.8 #15457
Abao2
started this conversation in
Show and tell
Replies: 1 comment
|
Hi @Abao2 Thanks so much for such a detailed and helpful report - guides created by our community members are an invaluable reference! |
0 replies
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.
Hi everyone,
I am sharing a field report and a workaround for the following intermittent error:
This is related to #6628 because the visible symptom is similar, but I am not claiming that every occurrence of this error has the same root cause.
Environment
Symptoms
The cameras were detected correctly and sometimes worked normally.
However, after repeatedly starting and stopping the pipelines, one or more cameras would occasionally fail to deliver the first frame:
The resulting exception was:
Typical behavior:
Initial checks
I checked:
pipeline.stop()I changed the cleanup pattern to:
This cleanup is important because an exception should not leave a pipeline running.
However, proper
pipeline.stop()alone did not eliminate the intermittent timeout in my setup.Important observation
Before the workaround, the machine was using Ubuntu's stock
uvcvideokernel module.The Python package was installed, but the machine did not have a RealSense-patched kernel driver installed.
The cameras were accessible, so this was not simply a permission failure. The instability appeared during repeated stream initialization and recovery.
Workaround: isolated RSUSB backend
Instead of replacing the system kernel driver, I built the same librealsense version with:
RSUSB is a user-space implementation of the UVC/HID protocols. It communicates through the standard Linux USB subsystem but does not use
uvcvideoas the camera streaming backend.I installed it into an isolated prefix so that it did not overwrite the system librealsense installation.
Example:
I then loaded the isolated Python binding and shared library:
Verification:
python -c "import pyrealsense2 as rs; print(rs.__file__)"The output should point to the isolated RSUSB installation rather than the previous Python package.
Results on my machine
After switching to the isolated RSUSB backend:
The original
Frame didn't arrive within 5000timeout was not reproduced during these tests.Additional application changes
I also kept the following defensive changes:
pipeline.stop()in afinallyblock.hardware_reset()for every timeout.Important limitations
Frame didn't arrive within 5000is a general symptom, not a single bug.It may also be caused by:
Therefore, I am not suggesting that RSUSB is the universal solution for every frame timeout.
My conclusion is narrower:
The official documentation generally recommends the native backend for production. I selected RSUSB here because it allowed me to test an alternative backend without replacing the system kernel module.
I hope this report is useful to anyone seeing the same intermittent startup pattern. I would also be interested to hear whether others can reproduce this difference between the stock native backend and RSUSB on kernel 6.8.
All reactions