Dequeu and Segmentation fault error

[10:27:58.591865985] [15071] WARN V4L2 v4l2_videodevice.cpp:2007 /dev/video4[26:cap]: Dequeue timer of 1000000.00us has expired!
[10:27:58.712828528] [15071] ERROR RPI pipeline_base.cpp:1336 Camera frontend has timed out!
[10:27:58.712869009] [15071] ERROR RPI pipeline_base.cpp:1337 Please check that your camera sensor connector is attached securely.
[10:27:58.712877472] [15071] ERROR RPI pipeline_base.cpp:1338 Alternatively, try another cable and/or sensor.

  • (Hailo Detection App:15059): CRITICAL : 18:51:44.009: void GstLibcameraSrcState::requestCompleted(libcamera::Request): assertion ‘wrap->request_.get() == request’ failed
    Segmentation fault

This is the error that I am facing while running my script this error pops out randomly. Does anyone know how to handle this issue because my script needs to run continuously.

Hey @malikharis3984,

It seems like the dequeue timer may have timed out, or there was an issue connecting to the camera sensor. Could you please provide more details about the script you’re running, the model you’re using, the host system, and any changes you’ve made if you based your script on our examples? This information will help us better understand the issue and assist you in resolving it.

We are using YOLOV8N-Face model and yolov8 post process that was given on hail_rpi5_examples. we just changed a thing, which is this that you use separate process to display the stream or video feed. we use that process to run some other functionality on the frame. but the pipeline is as it is yours. And error arise when we reduce the bypass queue size to lets say 5. and continously sit infront of camera to give it continous detection, it start to give this error, that deque timeout reached. and also sometimes give the segmentation fault.

It seems like the pipeline might be overloaded, which could be causing memory issues or timeouts when retrieving data from the deque. You might consider splitting the pipeline to better manage the functionality.

If you can, please provide more details about the pipeline. If it’s sensitive or company-related, feel free to send it to me via DM, and we can assist you more effectively.

 def get_pipeline_string(self):
        if self.source_type == "rpi":
            source_element = (
                "libcamerasrc name=src_0 auto-focus-mode=2 ! "
                f"video/x-raw, format={self.network_format}, width=1536, height=864 ! "
                + QUEUE("queue_src_scale")
                + "videoscale ! "
                f"video/x-raw, format={self.network_format}, width={self.network_width}, height={self.network_height}, framerate=30/1 ! "
            )
        elif self.source_type == "usb":
            source_element = (
                f"v4l2src device={self.video_source} name=src_0 ! "
                "video/x-raw, width=640, height=480, framerate=30/1 ! "
            )
        else:
            source_element = (
                f"filesrc location={self.video_source} name=src_0 ! "
                + QUEUE("queue_dec264")
                + " qtdemux ! h264parse ! avdec_h264 max-threads=2 ! "
                " video/x-raw, format=I420 ! "
            )
        source_element += QUEUE("queue_scale")
        source_element += "videoscale n-threads=2 ! "
        source_element += QUEUE("queue_src_convert")
        source_element += "videoconvert n-threads=3 name=src_convert qos=false ! "
        source_element += f"video/x-raw, format={self.network_format}, width={self.network_width}, height={self.network_height}, pixel-aspect-ratio=1/1 ! "

        pipeline_string = (
            "hailomuxer name=hmux "
            + source_element
            + "tee name=t ! "
            + QUEUE("bypass_queue", max_size_buffers=20)
            + "hmux.sink_0 "
            + "t. ! "
            + QUEUE("queue_hailonet")
            + "videoconvert n-threads=3 ! "
            f"hailonet hef-path={self.hef_path} batch-size={self.batch_size} {self.thresholds_str} force-writable=true ! "
            + QUEUE("queue_hailofilter")
            + f"hailofilter so-path={self.default_postprocess_so} {self.labels_config} qos=false ! "
            + QUEUE("queue_hmuc")
            + "hmux.sink_1 "
            + "hmux. ! "
            + QUEUE("queue_hailo_python")
            + QUEUE("queue_user_callback")
            + "identity name=identity_callback ! "
            + QUEUE("queue_hailooverlay")
            + "hailooverlay ! "
            + QUEUE("queue_videoconvert")
            + "videoconvert n-threads=3 qos=false ! "
            + QUEUE("queue_hailo_display")
            + f"fpsdisplaysink video-sink={self.video_sink} name=hailo_display sync={self.sync} text-overlay={self.options_menu.show_fps} signal-fps-measurements=true "
        )

This is the original pipeline that was given in detection.py in hailo-rpi5-examples. I am facing a segmentation fault error and mostly it appears when i run it on framerate=>20. This error does not comes after a specific time. It appears randomly and my code stops.