An I/O controller for virtual pinball machines: accelerometer nudge sensing, analog plunger input, button input encoding, LedWiz compatible output controls, and more.

Dependencies:   mbed FastIO FastPWM USBDevice

Fork of Pinscape_Controller by Mike R

Issue: Pinscape Controller prevents PC from sleeping

I can't get my VP to go into sleep mode using the standard Windows 10 setup as soon as the Pinscape Controller (ext. board + power board, TSL1410 plunger) is plugged into USB. With an USB tracer, I see 15 bytes HID packets coming in on the JS interface every 10 milliseconds, resetting Windows' idle timer, effectively preventing sleep. Is this behavior by design? Is this something that could be changed in the firmware?


19 Dec 2020

Yes, the joystick updates are by design. That's just how the Windows USB joystick interface works, I'm afraid; Windows polls incoming packets, so the joystick has to send packets constantly. You can turn it off by disabling the joystick input in the config tool, but if you want plunger or accelerometer input, that's probably not an ideal solution.

You might check to see if you have any third-part software on the Windows side that might be keeping the machine awake. I talked to someone recently who ran into something similar, and it turned out it was a screen saver that was monitoring the joystick. They were able to change a setting in the screen saver to disable that.

20 Dec 2020

Thanks for the quick response. I figured as much already having a quick look at the source code. I tried to kill every process/service to get to a bare minimum, but the machine still wouldn't sleep. I did find a - somewhat dirty - workaround for this problem though: I use an AutoHotKey script to monitor the "Shift" keys and call Windows' suspend (or power off) functions when no key press is detected within x minutes. I'm pasting it here in case it'll help somebody save a few of those hours I spent diagnosing this problem in the future ;-)

AHK Shutdown Timer.ahk

; AHK replacement for Windows' sleep funtionality, if Pinscape's joystick
; interface is preventing your PC from sleeping.
; Compile it and link/copy it to the 'shell:startup' folder.

; max idle time in minutes
ShutdownMinutes := 60

; how to shutdown - see AHK docs
ShutdownType := 1 + 8

#SingleInstance force
SendMode Input
SetWorkingDir %A_ScriptDir%

LastTick := A_TickCount

SetTimer, CheckTicks, 60000 ; every minute

LastTick := A_TickCount

if ((A_TickCount - LastTick) > (ShutdownMinutes * 1000*60)) {
  ShutDown, ShutdownType
22 Dec 2020

You might also try looking here:

...and if that's not it, try a Google search for "joystick Windows sleep" - I suspect you've got something like the above going on.