Closed sidy3d closed 3 days ago
Hi @sidy3d Thanks very much for your questions.
The frame queue can hold 16 frames of each stream type by default. The queue size can be increased to hold more frames simultaneously, at the expense of increased memory usage. The frame queue is like a continuously moving conveyor belt, with new frames arriving at the start of the conveyor and the oldest frames dropping off the queue at the end of it.
The documentation of the rs-callback C++ callback example program at the link below confirms that the callback can be called simultaneously from multiple sensors.
https://github.com/IntelRealSense/librealsense/tree/master/examples/callback
There is not information available though regarding whether or not callbacks wait until return, unfortunately.
https://github.com/IntelRealSense/librealsense/issues/6424 discusses callbacks in regard to IMU data.
I would consider the current FPS to be a better indicator of reduction in performance than frame drops.
Hi @MartyG-RealSense thank you very much for your response. To re-clarify my questions:
RS2_OPTION_FRAMES_QUEUE_SIZE
is full and the user is still holding on to all frames can we assume that new frames are dropped until the user has released the oldest frame?RS2_OPTION_TOTAL_FRAME_DROPS
is used to track cases when the user does not release frames fast enough. Can you elaborate more on this answer of why using FPS is better? I would appreciate answer from a developer on these questions.
Thanks,
When the frame queue is full it becomes 'jammed up', which can lead to warnings such as 'No Frames Received' and 'Frame didn't arrive within 5000' (no new frames during the last 5 seconds). Streaming stops once the queue is full until frame resources are released.
I will refer this question to my Intel RealSense colleagues. Thanks very much for your patience.
If you look at the frame drop graph in the RealSense Viewer tool, the line representing the drop rate can appear to be peaking continuously at the top of the graph whilst FPS remains high and stable. So when FPS is high and stable, the impression of poor performance given by the frame drop graph's peaks can be misleading.
Thanks for the answers. I look forward to the answer to questions 2. and 3.
Hi @sidy3d My Intel RealSense colleagues responded that there is "one callback per sensor. It gets calls whenever a frame becomes available and will wait until it returns. This is the same case for IMU".
Hello @MartyG-RealSense, that you very much for the reply. That has answered all of my questions, I will close this issue no.
You are very welcome, @sidy3d - I'm pleased that I could help. :)
Issue Description
Hi,
I understand that callbacks (described here) are not to be used for lengthy processing but what happens when they do not return fast enough (yes, I know that
rs2::frame_queue
exist to ease processing on another thread). Other camera libraries I’ve used document the behavior of callbacks though I can't find specific details for RealSense. Could you shed light on this?Example: Assume that streaming is done from a device at 90fps without synching and each sensor has its own callback. To avoid frame drops the callback should return in <11ms. Now assume that a single callback run took 500ms to run due to system load.
Questions:
RS2_OPTION_FRAMES_QUEUE_SIZE
? Do new frames get dropped when the buffer is full or does the oldest unclaimed frame get replaced?Frame Callback Color #<num> overdue
, canRS2_OPTION_TOTAL_FRAME_DROPS
be used to reliably check for frame drops?Thank you for the help.