|
Reposting my analysis I performed with a Rpi pico, oscilloscope and a photo diode from another site:
I created a test setup using a Raspberry Pi Pico running CircuitPython and a USB HiD library to emulate mouse clicks. I connected button switch to a GPIO pin and polled the state of the pin to send mouse click events over usb to my laptop. I connected a photo diode to the power rail of the pico and pointed it at the screen. Finally I connected the push button to channel 1 of my oscilloscope and the photo diode to channel 2. I created small application with raylib which would toggle the screen from black to white when clicked. When the screen changes from white to black, the voltage across of the photo diode would drop, which would create a falling edge I could trigger on using the oscilloscope. Test Setup: I ran the following tests on my AMD Framework 13, under CachyOS with all packages up to date. For each test I set the Raylib application to run at 800x600@60Hz and left the photo diode in place near the bottom right corner of the screen. For each test, the display output scaling was set to 1x (2256x1504), and variable refresh rate was disabled. Using the oscilloscope I measured from the first trigger buffer sample that the voltage of the button reached steady state to the first sample where the voltage on the photo diode dropped below steady state to 1.5v Caveats: The times seem high, but they encompass the entire chain of Push button -> App rendering next frame.
There is some loss in time resolution because of the abysmally small size of my cheap oscilloscope’s trace buffer.
I only collected 9 samples for each configuration because I’m clumsy on the controls of the oscilloscope and this took a little bit.
The raylib application was running under Xwayland for the Wayland tests which somewhat skews the results.
Results: KDE Plasma (X11): 154ms, 134ms, 136ms, 137ms, 126ms, 144ms, 135ms, 142ms, 150ms => Avg 139msKDE Plasma (Wayland): 181ms, 188ms, 139ms, 148m, 137ms, 156ms, 163ms, 164ms, 151ms => Avg 158ms Sway (Wayland): 172ms, 175ms, 168ms, 153ms, 144ms, 152ms, 161ms, 172ms, 156ms => Avg 161ms |