QOpenGLWidget: framerate with vsync is 30 FPS instead of 60, why? (On Raspberry Pi 4)
-
Hi! I have a simple application with
QOpenGLWidget
. I've overriden itspaintEvent()
and do simple painting withQPainter
. For framerate control I have ensured vsync (swapInterval == 1) and I have connected to the widgets'frameSwapped()
signal. This signal flags another thread to prepare data for the new frame, then that thread callsupdate()
on the widget.On my Windows desktop with Intel iGPU, with monitor set to 60 Hz, I get stable 60 fps (16.7 ms). But on Raspberry Pi 4B, with monitor again set to 60 Hz, and with the exact same code, I only get 30 FPS (33.2 ms). Why is that?
I have tried removing any painting to make sure it's not simply too slow, now I have this:
void paintEvent(QPaintEvent*) override { QPainter p{this}; }
And still it's 30 FPS, so it seems that this is what OpenGL is locked at. I don't imagine a no-op draw cannot complete in 16 ms.
I've tried single-, double- and triple-buffering, exact same result.
P. S. Qt 6.5.2 on Windows and 6.4.2 on Raspberry (the latest available from
apt
, as Qt Company doesn't offer ARM64 Linux binaries in its online installer, nor the installer itself for ARM64, for that matter).
The OS is the latest official Raspberry Pi OS (Bookworm) 64-bit. -
@devMiyax you're not on Pi, so I doubt it's the same issue.