devinacker / bsnes-plus

debug-oriented fork of bsnes
http://bsnes.revenant1.net
328 stars 92 forks source link

bsnes-plus randomly turning on airplane mode #303

Closed hellocatfood closed 1 year ago

hellocatfood commented 3 years ago

I compiled bsnes plus on ubuntu 21.04 and after loading a cartridge bsnes-plus will suddenly turn on aeroplane mode after around 20 seconds. I've tried with multipled cartridges and can't see any error messages in the terminal about it.

devinacker commented 3 years ago

That is bizarre. Does this only happen after loading a cartridge? (i.e. not when leaving the emulator idle with nothing loaded)

hellocatfood commented 3 years ago

Yes, correct. It operates normally otherwise.

I can turn aeroplane mode off but if the game is still running it'll turn it back on again after 20ish seconds.

devinacker commented 3 years ago

Does dmesg show anything suspicious around the time when airplane mode gets deactivated?

Sorry for not paying much attention to this issue so far, I don't really have an up-to-date Ubuntu VM handy at the moment.

hellocatfood commented 3 years ago

The only message from dmesg is

[22638.926440] wlp2s0: deauthenticating from [mac address] by local choice (Reason: 3=DEAUTH_LEAVING)

(I removed my mac address)

devinacker commented 3 years ago

What happens if you comment out the call to supressScreenSaver() here and rebuild? I wonder if the way that's implemented on Linux is just causing something strange to happen with power management.

hellocatfood commented 3 years ago

It worked! Been playing DK Country for 5 minutes and airplane mode hasn't been switched on. Thanks for addressing it

TheKodeToad commented 1 year ago

I realise this is old, but this is still an issue. It seems pressing keycode 255 activates airplane mode. Maybe another key should be used. Running xdotool keydown 255 also has this behaviour.

I've fixed this in a pr now.