Close

A problem and a workaround

A project log for MAME USB

Extensible USB controller for arcade machines

danjovicdanjovic 08/22/2015 at 00:460 Comments

the main reason MAME-USB undergo a design change was the fact that it was not being recognized during a power-up/restart of windows. Well this design presented a bug that I was not able yet to trace but have the following symtoms:

The scenario is: The computer is running Windows 7 an has a 4 port hub. The MAME-USB Board is connected to port 1, and windows recognizes it as a game controller.

After restart or cycling power, it stills being recognized as a game controller. Notice that it was enumerated before the Telephone (Scarlet)

The computer is then powered down and the MAME-USB controller is changed to another port than port 1, let's say to port 2.

Then, after computer is restarted, the device is recognized as a composite device that has a keyboard plus 3 game controllers (not shown in Devices And Printers)

Then, If you unplug and then reconnect the USB cable, Windows still seeing the device as a composite keyboard.

Next step is powerup/restart the computer. After that the device is always recognized a Keyboard controller, being enumerated before the cell phone (don1t have the screenshot, sorry)

The conclusion is:

When you connect the device with the computer working, windows recognizes the drivers accordingly and make some kind of cache for that USB port, thus the device can be left connected on the port (like the real use in a mame arcade)

But, if the device is being detected for the first time at a given USB port __during powerup__ windows does not recognize it properly and assigh a composite keyboard device driver for it. Such driver is persistent.

Now the workaround:

To correct the detection of the device we shall make windows dissociate the keyboard driver and then unplug and replug the device.

For doing that it is necessary to access the Device manager and search for the KEYBOARD tree, then right click on the "HID Keyboard Device" and choose "Uninstall" to unload the incorrect driver.

Then windows will forget the wrong driver and automatically detect the game controller and associate the correct driver.

Discussions