[WORKAROUND] Intermittent USB gamepad disconnections

This is for discussing general topics about how to use VirtualBox.
Post Reply
twipley
Posts: 72
Joined: 5. Jul 2011, 20:46
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

[WORKAROUND] Intermittent USB gamepad disconnections

Post by twipley »

I have encountered a problem. In the past, this has been working correctly, but now the joystick (controller) I have gets disconnected every few minutes (sometimes, twice a minute; sometimes, it goes tens of minutes before doing so) from VirtualBox. I am running Linux Mint (Ubuntu). I have tried everything I could think of: reinstalling the VBox extension pack (which I have installed trying to solve the problem), disabling 2.0 (EHCI) support, removing the pack, using filters, reinstalling the guest system (XP), changing gamepads, USB ports, host settings and drivers, and more.

I have found a workaround, which I am posting in case someone else ever encounters this issue.

It is going with a key remapper. I had a hard time finding one which was working, installable, without mentionning (or so) the large package dependencies.

The solution I have found is using JJK, a Java joystick-to-keyboard mapper (link: http://code.google.com/p/java-joystick-to-key/). It is lite, requires (I believe) no installation or packages not present in Ubuntu by default, and does the job. For example, in my case, I was playing a (thus-virtualized) game which uses the directional pad and a few other buttons. On the host, I remapped every gamepad buttons or axe extremums to random keys (one does not even need to remember which are mapped to which). Then, guest-side, without passing the gamepad straight to it -- that is, going without "direct" guest access to this host USB device -- I fired up the emulator (game) and pressed joystick buttons to define controls. Instead of "left," for example, appeared the "a" key. The guest "thinks" you are using the keyboard, while in fact you are using the gamepad.

That way, I have been playing for an hour, without even getting a single disconnection, so I believe this to be a viable workaround.

EDIT: I have never found the culprit. Was it the used gamepads (e.g., problematic wires), USB ports, or some specific software configuration (I am using operating-system defaults, and seem to have been the only one suffering from this issue)? Nevertheless, it now works wonders.

EDIT: forget it, it still disconnects -- so that has nothing whatsoever to do with VirtualBox.
Post Reply