astro-pi / python-sense-emu

An emulator for the Raspberry Pi Sense HAT
https://sense-emu.readthedocs.io/
Other
40 stars 25 forks source link

GUI window stops responding after processing a certain number of joystick events #31

Closed ticalc-travis closed 3 years ago

ticalc-travis commented 3 years ago

Platform: rPi 4, Raspberry Pi OS / Debian Buster

When running one of the joystick examples (joystick_loop.py or joystick_events.py), the sense_emu_gui process gets wedged after pressing joystick buttons in the GUI long enough. It's not even possible to quit; the close button and Quit command on the menu just lock up the interface further.

By adding code to the move_dot function of the Python example code to count how many times the routine is called, I find that this lock-up always happens after roughly 256 calls, give or take a few. I can reproduce this by running the example and pressing and releasing the simulated joystick buttons with the mouse or keyboard about 120–130 times (or simply pressing and keeping down an arrow key on the keyboard for a while, which is easiest). Once that number of events is reached, the sense-emu interface hangs.

waveform80 commented 3 years ago

Sorry for the delay in checking this out -- I don't seem able to reproduce this with an up to date RaspiOS Buster installation. I've tried with both mouse and keyboard activation of the joystick controls and, with a tweaked move_dot function in a (presumably) similar manner to yours, managed to get to well over 600 events with both methods.

I'm wondering if this was some issue in Gtk3 which has since been fixed -- is the problem still occurring for you?

ticalc-travis commented 3 years ago

Oddly, I can't reproduce it anymore either. Seems to work fine now on two different rPis. Originally I did attempt to reproduce the problem and it was occurring 100% reliably, but later I went on to developing a complete game using the emu and never hit the issue (and even stranger, it seems it resolved itself without having updated any packages or even rebooting). So yeah, no idea now what was going on. :-)

Well, I guess I'll close this, then, unless the symptom ever recurs. Not sure how I'd go about debugging it if did, though.