First Usb Gamepad


Pleng

Well-Known Member
Joined
Dec 28, 2006
Messages
3,030
Small thing, but hey, there's not much happening here right now...

Will there be a way to set the Pandora up so that the first inserted USB gamepad over rides the built in controls?

I know that most games/emulators allow configuration of controls, but if you're having an evening of retro/homebrew gaming it could become quite tiresome having to reconfigure controls in every game/emulator you load up (and then possibly have to reconfigure them next time you want to play by yourself)
 
Pleng said:
Small thing, but hey, there's not much happening here right now...

Will there be a way to set the Pandora up so that the first inserted USB gamepad over rides the built in controls?

I know that most games/emulators allow configuration of controls, but if you're having an evening of retro/homebrew gaming it could become quite tiresome having to reconfigure controls in every game/emulator you load up (and then possibly have to reconfigure them next time you want to play by yourself)

Then why not instead request that emu authors allow you to save multiple control configurations? A much better solution, IMHO.

-God Ginrai
 
Last edited by a moderator:
How is relying on something to be programmed into every individual emulator/app/game for the system more elegant than having an OS feature deal with it?
 
Pleng said:
How is relying on something to be programmed into every individual emulator/app/game for the system more elegant than having an OS feature deal with it?

Because every controller is different, and coming up with an OS feature that pleases everyone's choices in configuration is next to impossible.

-God Ginrai
 
Last edited by a moderator:
Lunatic said:
Could you just make a symbolic link from /dev/<usbcontroller1> to /dev/js0?
For truth.
If I'm recalling correctly, it already detects the game controls as js0. If you really wanted this, knowing that there's a chance others may not want it, then it's really easy to write a script that removes /dev/js0 and symlinks the usb controller. You then write the script to do the opposite, and tie them to some daemon which detects plug and unplug of the USB controller. It's something you can add yourself (maybe with a little help from someone else) and your desire isn't enforced on anyone else. Everyone wins.
And this is why open source wins! ;)
 
Last edited by a moderator:
Thanks for the info. I had a feeling it would have something to do with bash scripts and symlinks (everything in unix usually does)!

Who said anything about imposing my desire on anybody else? I didn't suggest the Pandora should do this by default (hence the 'Will there be a way to set the Pandora up so that...' part of my post :))
 
or maybe those remapping apps so you remap the usb pad over the panda controls?
 
Or set the separate controls in each program and save separate configurations, then either copy in the one you want before running, or choose as an argument.
 
Another solution would be the same one I used in Open2X. If it works, I think it is the best solution because it works reliably 100% of the time and cannot be overridden, has little overhead, and is perfectly reconfigurable:

You modify the kernel so that a custom userspace daemon can take input from the desired, pre-configured USB gamepad and send the kernel ioctl() commands that force the individual GPIO ports of each of Pandoras button, trigger and DPAD inputs up or down. You might first have to reprogram the GPIO ports to be input versus output. The GP2X has the ability to read the data that the kernel itself just wrote into the port. If the Pandora userspace daemon does not detect a USB joystick connected at boot it does not bother with any of this and exits quietly when launched. The joystick driver is modified to optionally, on command, report no events to programs. This last bit of subterfuge allows seamless compatibility with all applications. Of course all of this works elegantly on a GP2X. Time will tell if Pandora supports this.

Otherwise the more elegant solution, going through the joystick code and modifying it so that js0 reports input from not only the Pandora but also a USB gamepad, is not a good one. Someone will release a library like Ryleh's minlib that reads the registers directly to acquire button input and only my method works for that. Asking devs to kindly not do this is not going to work IMO.
 
God Ginrai said:
Pleng said:
How is relying on something to be programmed into every individual emulator/app/game for the system more elegant than having an OS feature deal with it?

Because every controller is different, and coming up with an OS feature that pleases everyone's choices in configuration is next to impossible.

-God Ginrai

I disagree here because I think Open2X's USB->gamepad support is pretty much the answer to everyone's USB gamepad problems. It can be configured for *any* gamepad and works without any lag or overhead at all. It even supports the soft-reset ability of Open2X: when you press the secret button combo the kernel immediately kills off with extreme prejudice all but the essential apps it knows about, then quickly relaunches the user's desired menu system (GMenu2X on GP2X). So yes, there is a way to come up with an OS feature that does please everyone's configuration choices, see my above post.

With my solution, if you are sitting on your couch playing Pandora on a TV from a USB gamepad, if any app crashes and leaves you stranded or you cannot remember how to exit a game or app, you aren't ever having to get up and control the Pandora. Your USB gamepad can almost always reset everything and go back to the menu. Your menuing systems that are released that have poor USB gamepad support all instantly have perfect USB gamepad support, if already working with the Pandora's DPAD. You won't be able to map every button of the Pandora's keypad but I am betting it will work pretty nicely.
 
Last edited by a moderator:
God Ginrai said:
Because every controller is different, and coming up with an OS feature that pleases everyone's choices in configuration is next to impossible.

-God Ginrai

Hardly. Most USB controllers I've seen are pretty similar PS-2 copy jobbies. Anyway, an app that allows you to configure how the over-ride works as a 1 off would solve the issue instantly and then you wouldn't in the situation of relying on game/emulator programmers to provide these features. And why should you *expect* them all to provide the feature if they don't ever see themselves needing it.


Senor Quack said:
With my solution, if you are sitting on your couch playing Pandora on a TV from a USB gamepad, if any app crashes and leaves you stranded or you cannot remember how to exit a game or app, you aren't ever having to get up and control the Pandora. Your USB gamepad can almost always reset everything and go back to the menu. Your menuing systems that are released that have poor USB gamepad support all instantly have perfect USB gamepad support, if already working with the Pandora's DPAD. You won't be able to map every button of the Pandora's keypad but I am betting it will work pretty nicely.

Your solution sounds awesome. The technical details are somewhat over my head though. Would it allow the user to choose if they want this particular feature or not?
 
Last edited by a moderator:
Pleng said:
Your solution sounds awesome. The technical details are somewhat over my head though. Would it allow the user to choose if they want this particular feature or not?

Yes, Open2X already supports it on a per-application basis and also per-application support for masking js0's values as seen by the application, allowing perfect configurability.
 
Last edited by a moderator:
Senor Quack said:
If the Pandora userspace daemon does not detect a USB joystick connected at boot it does not bother with any of this and exits quietly when launched.
Does this mean that connecting a USB joystick involves rebooting the device? That's something I only want to do for kernel upgrades.
 
Last edited by a moderator:
WizardStan said:
Lunatic said:
Could you just make a symbolic link from /dev/<usbcontroller1> to /dev/js0?
For truth.
If I'm recalling correctly, it already detects the game controls as js0. If you really wanted this, knowing that there's a chance others may not want it, then it's really easy to write a script that removes /dev/js0 and symlinks the usb controller. You then write the script to do the opposite, and tie them to some daemon which detects plug and unplug of the USB controller. It's something you can add yourself (maybe with a little help from someone else) and your desire isn't enforced on anyone else. Everyone wins.
And this is why open source wins! ;)

Last time I checked it didn't. The analog had its own events, just like the action buttons..

Pleng said:
Small thing, but hey, there's not much happening here right now...

Will there be a way to set the Pandora up so that the first inserted USB gamepad over rides the built in controls?

I know that most games/emulators allow configuration of controls, but if you're having an evening of retro/homebrew gaming it could become quite tiresome having to reconfigure controls in every game/emulator you load up (and then possibly have to reconfigure them next time you want to play by yourself)

..therefore I wrote my own "driver" which can be found at: http://jayfoxrox.bplaced.net/pandora/public/Pandora-Input-Drivers/
It makes it possible to emulate the Pandora controls using a joystick and the other way around, creating a joystick device from the game controls (The button IDs recreate a layout very similar to the X360 controller).
 
Last edited by a moderator:
Senor Quack said:
Pleng said:
Your solution sounds awesome. The technical details are somewhat over my head though. Would it allow the user to choose if they want this particular feature or not?

Yes, Open2X already supports it on a per-application basis and also per-application support for masking js0's values as seen by the application, allowing perfect configurability.
Man I love what you did in Open2X! heh heh.

Basically if you have BoB and a USB joy you can use the GP2X in "home console" mode with the pad and your TV. Something that should have been possible from the start!
 
Last edited by a moderator:
j6cubic said:
Senor Quack said:
If the Pandora userspace daemon does not detect a USB joystick connected at boot it does not bother with any of this and exits quietly when launched.
Does this mean that connecting a USB joystick involves rebooting the device? That's something I only want to do for kernel upgrades.

Well I am sure there are numerous ways to configure it, and something that meets your requirements would of course be possible and probable.
 
Last edited by a moderator:
Senor Quack said:
God Ginrai said:
Pleng said:
How is relying on something to be programmed into every individual emulator/app/game for the system more elegant than having an OS feature deal with it?

Because every controller is different, and coming up with an OS feature that pleases everyone's choices in configuration is next to impossible.

-God Ginrai

I disagree here because I think Open2X's USB->gamepad support is pretty much the answer to everyone's USB gamepad problems. It can be configured for *any* gamepad and works without any lag or overhead at all. It even supports the soft-reset ability of Open2X: when you press the secret button combo the kernel immediately kills off with extreme prejudice all but the essential apps it knows about, then quickly relaunches the user's desired menu system (GMenu2X on GP2X). So yes, there is a way to come up with an OS feature that does please everyone's configuration choices, see my above post.

With my solution, if you are sitting on your couch playing Pandora on a TV from a USB gamepad, if any app crashes and leaves you stranded or you cannot remember how to exit a game or app, you aren't ever having to get up and control the Pandora. Your USB gamepad can almost always reset everything and go back to the menu. Your menuing systems that are released that have poor USB gamepad support all instantly have perfect USB gamepad support, if already working with the Pandora's DPAD. You won't be able to map every button of the Pandora's keypad but I am betting it will work pretty nicely.

I'm not saying such a feature is not good. I'm saying that there will be problems with button mapping.

Pleng said:
God Ginrai said:
Because every controller is different, and coming up with an OS feature that pleases everyone's choices in configuration is next to impossible.

-God Ginrai

Hardly. Most USB controllers I've seen are pretty similar PS-2 copy jobbies. Anyway, an app that allows you to configure how the over-ride works as a 1 off would solve the issue instantly and then you wouldn't in the situation of relying on game/emulator programmers to provide these features. And why should you *expect* them all to provide the feature if they don't ever see themselves needing it.

PS copies are almost always bad controllers made by people with no imagination. Just about any controller would be better, and I expect that many people who use USB controllers will use other types as well. Also, devs normally code an emulator because they see it as a challenge, IIRC, so I don't see how utility for their use would be one of their considerations in feature design.

-God Ginrai
 
Last edited by a moderator:
God Ginrai said:
PS copies are almost always bad controllers made by people with no imagination. Just about any controller would be better, and I expect that many people who use USB controllers will use other types as well. Also, devs normally code an emulator because they see it as a challenge, IIRC, so I don't see how utility for their use would be one of their considerations in feature design.

-God Ginrai
That's probably because PS-style controllers are what the most people want. I, for one, am perfectly happy with the PSX controller layout; then again I mostly play games that only need the d-pad. For those, a layout like the X-Box's would be fairly useless.
 
Last edited by a moderator:
j6cubic said:
God Ginrai said:
PS copies are almost always bad controllers made by people with no imagination. Just about any controller would be better, and I expect that many people who use USB controllers will use other types as well. Also, devs normally code an emulator because they see it as a challenge, IIRC, so I don't see how utility for their use would be one of their considerations in feature design.

-God Ginrai
That's probably because PS-style controllers are what the most people want. I, for one, am perfectly happy with the PSX controller layout; then again I mostly play games that only need the d-pad. For those, a layout like the X-Box's would be fairly useless.

The PSX controller's Dpad is only good for menus, and therefore turn-based RPGs. If you play games that use the dpad for any other function, the PSX controller and the 360 controller should be the last ones on your list.

-God Ginrai
 
Last edited by a moderator:
Back
Top