-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
2.34.0 435i libuvc python: frame latency/drops/incorrect emitter state #6202
Comments
@dkumor hello, thank you for the feedback. For the first point mentioned - #2 - discussed in #6191 as noted. Please pay attention that the following code can make things rather worse a priory it is assumed that the metadata value is coherent to laser state and that the shift occurs sometime into the streaming: # 0 here, because of issue 6191 (0 means laser is on)
if laser_on == 0: #3 - You should not assume that the frame type defines the underlying frame container structure as seen in the callback: def frame_callback(frame):
global numgyro, numaccel, numdepth, numvid, totframes
try:
totframes += 1
frame_type = frame.profile.stream_type()
if frame_type == rs.stream.accel:
numaccel += 1
elif frame_type == rs.stream.gyro:
numgyro += 1
else:
# It returns IR & depth as a frameset
frameset = frame.as_frameset()
for frame in frameset:
frame_type = frame.profile.stream_type()
if frame_type == rs.stream.infrared:
numvid += 1
elif frame_type == rs.stream.depth:
numdepth += 1
except Exception as e:
print("FAIL", e) This assumption will cause frame drops.
|
Hi, thanks for the quick response! Assuming that symptom 2 is a known problem that will be fixed in firmware, I guess all that is left is 1 and 3, great! 1 - python video delay
3 - dropped framesThanks! I didn't notice the def frame_callback(frame):
global numgyro, numaccel, numdepth, numvid, totframes
try:
if frame.is_frameset():
for f in frame.as_frameset():
frame_callback(f)
else:
totframes += 1
frame_type = frame.profile.stream_type()
if frame_type == rs.stream.accel:
numaccel += 1
elif frame_type == rs.stream.gyro:
numgyro += 1
elif frame_type == rs.stream.infrared:
numvid += 1
elif frame_type == rs.stream.depth:
numdepth += 1
except Exception as e:
print("FAIL", e)
What's weirder, on the raspberry pi, I get:
It looks like IMU data is OK on the pi, but I doubt the validity of the 120fps... What's weird is that I'm getting ~30 fps on PC, and 120??? on pi, whereas the configuration was for 60. It looks like the pi and PC might be exhibiting different issues entirely... |
@dkumor , actually your findings in 3 are consistent with 1 - in both cases the system runs properly on RPI but lags on PC, so the issue is isolated and reproduced on that particular PC only. As for the measurements you make - they do not take into account the fact that each sensor has a different startup (i.e time to first frame) interval which affects the calculations. |
Regarding the raspberry pi, the script above gathers data for 30 seconds, and results in an average of 120 frames per second, when configured to give 60 - while the inexact timestamps certainly affect the frame numbers,could such a thing could cause a doubling of frame numbers over nearly half a minute of data? As for the PC, this is an Arch system, with
|
@dkumor , pipeline callbacks are different from sensor's callback in the sense that they provide synchronized framesets. During synchronization it is inevitably that some frames will be transmitted more then once, as in the case of
This should explain the double frame rate in the above calculation for depth and rgb. As with the archlinux distro- unfortunately I'm not familiar with the |
Thanks for the explanation, I assumed that I looked at the However when trying
This means that the issue is there in the I really appreciate your help and patience! |
Depending on the use-case that you work on I would recommend to either:
It is still not clear whether the IMU rates you posted are due to HW, SW or Config issue. Therefore please run |
@dkumor Any other questions with the reply of ev-mp? Looking forward to your update. Thanks! |
I will close this issue for now - these problems are very similar to issues others are having, so I will wait for the next version of the software/firmware in hopes that their fixes will also solve my problems. I unfortunately don't currently have time to debug the issues myself. |
Hey @dkumor , forgive me if I sound out of the blue, but in one of your code snippets you have mentioned finding whether the IR emitter was on or off for every frame,
You are in fact one of the few people I found who used this feature. I was trying out the same thing and I got an error
Do you have any idea what this might mean? |
Issue Description
After upgrading to 2.34.0 from 2.33.1, I am getting issues with frames, the emitter, and dropped data when using the python wrapper. The same issues manifest on both archlinux and raspberry pi 4, both using libuvc. I don't know if they come from the same underlying problem or not, so I have included all the symptoms here. Note that none of the issues are present on 2.33.1.
Symptom 1: 1-2 second video delay on simple example
In previous versions, using
pipeline.wait_for_frames()
with depth and color streams showed video with negligible delay in default configuration. Now, there is a 1-2 second delay. The issue also manifests itself in the default examples, such as the opencv_viewer:https://github.com/IntelRealSense/librealsense/blob/master/wrappers/python/examples/opencv_viewer_example.py
If this is a change in default configuration, and not a bug, how would I go back to the previous behavior?
Symptom 2: Emitter on/off frames giving weird results
I am using emitter on/off at 60fps to get a stream of 30fps depth data, and 30fps IR camera data. However, the resulting video's frames have inconsistent/incorrect values for their laser state - the IR frames sometimes show laser, sometimes don't, and the depth frames likewise (all in the same run, meaning that the value of
df.get_frame_metadata(rs.frame_metadata_value.frame_laser_power_mode)
seems to switch meaning every couple frames). This might be related to #6191.Symptom 3: Lots of dropped frames
The above symptoms lead to the question of whether all the frames are even being received. The following code gets frames in a callback, and it looks like there is a huge amount of dropped data:
Running the above code gives
Note that the correct values would be:
Indeed, on 2.33.1, the values are close to the correct values.
Conclusion
The issues are present on two separate systems (both using libuvc), and are not present on an older version of librealsense. I hope that the code examples given above will be sufficient to reproduce the problems, since I would love to upgrade to the new librealsense version.
The text was updated successfully, but these errors were encountered: