pyrealsense2 with opencv timeout

I’m trying to get an old project working again where I use opencv2 to display images from a realsense D415 in an x11-window-manager based project, but I get a runtime error when I wait for frames because they don’t arrive in time.

This is my code:
opencv_viewer_example.py.txt (3.2 KB)

The weird thing is that this other program that just displays the depth as ascii in the terminal works fine:
python-tutorial-1-depth.py.txt (1.9 KB)

(I’ve tried removing the queue from the first one to see if it makes a difference, but it just gives me a different timeout message)

Can anyone help?

I got things to work by backdating stuff, using the balenalib/raspberrypi3-64:bullseye-20220906 base image and librealsense v2.53.1, but I’m still fairly interested to try and work out what’s going on.