I understand your problem exactly.. ( previously used Act Labs ).
Your problem lies in a device ID changing for whatever reason?
I have a 2 computer setup and use a KVM switch that toggles between the
2 computers by the scroll lock key. I finally figured out if I wanted the MAME PC
light guns to work properly I could not switch to the second PC.
When I switched back it was re detecting my usb mouse and keyboard
which obviously changed the ideas around.
Your problem is similar you just need to isolate what is causing it!
When I want to use my Light guns I don't add anything usb or take anything
away. I have never had anymore problems at all once I realize this simple concept!
I play House of the Dead 1 -2 all the time with my Aimtracks..
Using the Trouble shooter APP
no problem their or with MAME.
It works flawlessly!