Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: USB Gamepad Question  (Read 1454 times)

0 Members and 1 Guest are viewing this topic.

Dmod

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 315
  • Last login:July 12, 2012, 06:50:45 pm
USB Gamepad Question
« on: July 12, 2007, 07:29:06 pm »
OK,  I've read all the posts and know that USB gamepads can register in a random fashion and the only way to guarantee a certain order is to plug them in one by one and wait to register but I'm still left with some odd behavior that I can't figure out.

(1)  Regardless of the order I plug in my two ultrastiks and logitech steering wheel, and location within the USB hub, the wheel is always recognized as wheel 1 and my ultrasticks always come up in MAME as joystick 2 and joystick 3 (and in the correct order for Player 1 and Player 2).  If I close MAME, disconnect the wheel, and restart MAME, the joysticks are now assigned as joystick 1 and joystick 2.

(2)  With the wheel plugged in, even though, MAME assigns the ultrastiks to joystick 2 and joystick 3, MaLa assigns them to joystick 1 and joystick 2.  For MaLa, the order at startup is important as the wheel will sometimes come up as joystick 1.

(3)  It seems like unplugging and replugging everything doesn't alter the order in which controls get recognized.  It seems like instead I have to go the device manager, delete all the human interface control information and then replug in order to change the order.

Does anyone understand why or how MAME and MaLa interpret and address usb controls and can explain this behavior?  Is there a reference somewhere that I could read to better understand this?

My Projects:
Suspended Animation Scratch-built Cab
Driveshaft Arcade Seat Platform

SavannahLion

  • Wiki Contributor
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5986
  • Last login:December 19, 2015, 02:28:15 am
Re: USB Gamepad Question
« Reply #1 on: July 12, 2007, 07:59:56 pm »
I fought with this too. I have a Bluetooth controller that's recognized as a USB controller and persists in the USB stack despite restarts and reassignment. Only way to get rid of it is to remove it from the HID list. In my case, it's believed the controller has such a low permanet ID # that it always gets assigned as controller 1 regardless of what else is connected. I haven't seen any solid documentation on this though. I guess I'll have to try out my USB sniffer to know for sure.

I've been reading the USB documentation for another project but I still don't understand how or why the Microsoft USB stack does what it does. :(

Green Giant

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1124
  • Last login:September 29, 2016, 06:50:57 pm
Re: USB Gamepad Question
« Reply #2 on: July 12, 2007, 10:03:57 pm »
I am pretty sure this is an issue with XP.  Have you tried booting up windows, then plugging them in in order.  Once windows sees them, it assigns the id.  You can unplug them and move them around but windows should keep the assignment.  Assuming this is gonna be permanent, you should let windows pick the setup and setup your controls based on that.  If you don't remove anything they should stay stable as that.
"He lives down there in his valley,
The cat stands tall and green,
Well, he ain't no prize, and there's no women his size,
And that's why the cat's so mean"
Toxic Arcade, my first build

AlexKidd

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 52
  • Last login:July 28, 2010, 06:46:24 pm
Re: USB Gamepad Question
« Reply #3 on: July 12, 2007, 11:52:33 pm »
I don't believe it's a windows issue. Logitech USB devices just seem to steal the first placement. I have some logitech USB gamepads that do the exact same thing. Really annoying. Back in the day it used to be that some games would only work if a joystick/gamepad was the first USB device. I think logitech has their devices grab the first spots so they work more easily in that situation. Really really annoying though. I've tried a bunch of different things and nothing seems to make them give up the spots. Independent of how they are plugged in or when or in what order they always take the first spot. So greedy.

SavannahLion

  • Wiki Contributor
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5986
  • Last login:December 19, 2015, 02:28:15 am
Re: USB Gamepad Question
« Reply #4 on: July 13, 2007, 12:16:47 am »
I think Randy knows what's up better than we do. Randys controllers are the only USB devices I've seen that allow the buyer to choose the ID number. Do the toys supercede other USB devices, like the Logitechs, when dealing with Window assignments?

ahofle

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4544
  • Last login:August 30, 2023, 05:10:22 pm
    • Arcade Ambience Project
Re: USB Gamepad Question
« Reply #5 on: July 13, 2007, 01:08:03 am »
Don't the ultrasticks allow the user to program their IDs at any time?

SavannahLion

  • Wiki Contributor
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5986
  • Last login:December 19, 2015, 02:28:15 am
Re: USB Gamepad Question
« Reply #6 on: July 13, 2007, 01:34:43 am »
Don't the ultrasticks allow the user to program their IDs at any time?

I've never noticed that. That's two then.

But that doesn't really resolve the problem with the Logitech wheel. I haven't purchased any of the upper end Logitech products recently, but I don't recall ever seeing Logitech with selectable ID's.

Dmod

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 315
  • Last login:July 12, 2012, 06:50:45 pm
Re: USB Gamepad Question
« Reply #7 on: July 13, 2007, 03:41:07 am »
The ultrasticks allow you to program them, at least with respect to one another.  But the IDs don't stay 1 and 2 when you plug in a logitech wheel or a red octane gamepad.

The logitech and red octane equipment always seems to come up as the first devices when they are plugged in, irregardless of the order in which you attach the devices.
My Projects:
Suspended Animation Scratch-built Cab
Driveshaft Arcade Seat Platform

Green Giant

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1124
  • Last login:September 29, 2016, 06:50:57 pm
Re: USB Gamepad Question
« Reply #8 on: July 13, 2007, 11:00:59 am »
I don't believe it's a windows issue.

This is a problem with Windows, or at least Windows is the reason for it happening.  Dmod was asking why mame/mala keeps reassigning the controls when windows assigns the ID number.

Even if the logitech device is grabbing the usb slot, it should remain stable in that spot as long as you don't unplug it.  If the logitech wheel wants the first USB slot, then let it have it.  Sounds like your problem is you have to unplug it, the logitech wheel, and store it somewhere.  A simple solution would be to leave it plugged in and inside your cab, should have some room in the bottom where the computer is.  If it repeats the problem of assignment every time, then you might as well assign the sticks and wheel in Mala and mame.  Might take a little while to reassign things, but in the long run you won't be deleting usb devices every time.

My cab did something similar when I was setting up the controls.  I assigned everything with a mouse attached along with the trackball.  Then when I removed the mouse, the trackball was reassigned.  Instead of redoing everything, I just leave the mouse sitting in the cab with the computer.
« Last Edit: July 13, 2007, 11:03:51 am by Green Giant »
"He lives down there in his valley,
The cat stands tall and green,
Well, he ain't no prize, and there's no women his size,
And that's why the cat's so mean"
Toxic Arcade, my first build

Dmod

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 315
  • Last login:July 12, 2012, 06:50:45 pm
Re: USB Gamepad Question
« Reply #9 on: July 13, 2007, 11:34:07 am »
The problem is the logitech wheel is going to be mounted on a seated platform that I can roll in front of my upright for driving games, so it's not really feasible to leave it plugged in all the time.

If the Logitech driver can steal the first slot, it should be possible to develop a similar utility that finds and recognizes your usb gamepads, allows you to specify the desired order of the devices, and reassigns the usb addresses.

You might still have to rerun the utility after hot-swapping a game controller but that would be easy to launch in a batch file whenever you start your front-end. 

If anyone can point me in the right direction to develop something like this, I might be willing to give it a go.
My Projects:
Suspended Animation Scratch-built Cab
Driveshaft Arcade Seat Platform

Dmod

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 315
  • Last login:July 12, 2012, 06:50:45 pm
Re: USB Gamepad Question
« Reply #10 on: July 13, 2007, 05:08:05 pm »
Looks like Logitech's Wingman Team did some work on this problem.  They list a utility that can be used to control joystick IDs here:

JoyIDs Utility

I'll give it a try tonight.
« Last Edit: July 13, 2007, 05:15:49 pm by Dmod »
My Projects:
Suspended Animation Scratch-built Cab
Driveshaft Arcade Seat Platform