Issue addressed
---------------
This concerns Teensyduino USB joystick, on a particular "problem machine", showing up in joy.cpl, but with the Properties window displaying blank, as though the joystick contains no analog or digital variables. On other machines the Teensy USB joystick works fine.
Short version of fix
--------------------
Delete from the registry all keys containing VID_16c0.
Explanation
------------
After a lot of inspection of Teensy USB traffic with USBLyzer, I think we have an answer and a fix for the problem. The USB activity during hot-plug indicates that on the problem machine, Windows associates driver mouhid.sys with the joystick. On machines that read the joystick properly, Windows associates the joystick with hidusb.sys.
The registry stores a lot of keys in various places that contain the Vendor Id used by the joystick: VID_16c0. It appears that the function of some of these keys is to remember the result of the first time the device was plugged in, and a driver found. There are separate keys for the different sub device Product Ids corresponding to Mouse, Keyboard, Debug and Joystick, and possibly Serial (depending on the setting for USB type in the Arduino environment), and this info may be stored separately per USB socket.
It seems that if that process decides on the "wrong" driver for some reason (for example, chooses the mouse driver mouhid.sys), then the system will be stuck with that choice in future. This mistaken association could perhaps happen during development with the Teensy, or perhaps due to interrupting the process of finding the right driver during initial plug-in.
In previous attempts to fix this problem, we used USBDeview to view information that Windows was retaining for various USB devices. In USBDeview we deleted all records associated with VID_16c0. This did not resolve the problem, and we wrongly concluded that this meant it wasn't a problem of wrong info being retained.
Prompted by inspecting the USB traffic, we tried to track down how the registry might be directing Windows to use mouhid.sys instead of hidusb.sys. However, there were far too many registry records to look at in detail (evidently more than USBDeview shows). So instead we decided to delete all keys containing VID_16c0 (probably more than a hundred deletions).
This is problematic because some of the sub keys have ownership set to System and are not viewable or deletable by even Admins. To get around this, we discovered that regedit can be launched via psexec
http://technet.microsoft.com/en-us/s.../bb897553.aspx so that it runs regedit as the System user:
In a Run-as-admin cmd window :
[path-to-psexec]\psexec.exe -i -s c:\windows\regedit.exe
pause
With all the VID_16c0 keys deleted, when we next plugged in the Teensy joystick, Windows went through the process of finding suitable drivers, and then joy.cpl worked properly.
Hope that helps!
-- Graham