Pandora as a USB controller?


mmKALLL

Member
Joined
Dec 8, 2011
Messages
79
Age
30
Location
Here.
I'm not entirely sure on how USB ports (or most other ports, for that matter) work, but I'd like to know whether or not the Pandora's keyboard/gaming controls could be used in another computer by linking them through USB? (or, perhaps, Bluetooth?)


Another thing is - can you plug in USB keyboards or gaming controllers into the Pandora? I'm imagining having a TV-out cable in the future and then playing multiplayer without a console or computer inbetween with one player controlling using the Pandora.. :D
 
Another thing is - can you plug in USB keyboards or gaming controllers into the Pandora? I'm imagining having a TV-out cable in the future and then playing multiplayer without a console or computer inbetween with one player controlling using the Pandora.. :D
Yes, but since the Pandora's full-sized USB port is USB 2.0 High Speed only, you'll need to use a USB 2.0 High Speed hub (which will contain the relevant hardware for "translating" for the older USB standards) in order to connect USB 1.0 and USB 1.1 devices - which keyboards and gamepads often are.
 
About using the pandora as a USB keyboard/controller: Unless a program for that already exists and works on the pandora, it is unlikely to happen. Bluetooth is a horrible thing to program for.
 
I'm not entirely sure on how USB ports (or most other ports, for that matter) work, but I'd like to know whether or not the Pandora's keyboard/gaming controls could be used in another computer by linking them through USB? (or, perhaps, Bluetooth?)
Possible and often requested, but as long as no one starts implenting, it sadly won't happen

Another thing is - can you plug in USB keyboards or gaming controllers into the Pandora? I'm imagining having a TV-out cable in the future and then playing multiplayer without a console or computer inbetween with one player controlling using the Pandora.. :D
The Hardware side is not problematic (but as prometheus already pointed out, can be a little "tricky"), the question should rather be: "Which emulators do support external controls in the first place?"
 
It should actually be pretty easy by using the Pandoras USB OTG port and a standard A to Mini B USB cable.


You need to load the g_hid module (and compile it, if it isn't included in the OS, I don't have my Pandora with me to check). http://www.mjmwired.net/kernel/Documentation/usb/gadget_hid.txt


Next you simply need to make a client which captures keyboard/controller events and pass them to the g_hid dev node (/dev/hidgX according to the above documentation). This will make the Pandora simulate a usb keyboard, mouse or joystick/gamepad. The documentation includes sample code to send hid events.


I have never tried to use the g_hid module, but I did use g_serial to make the Pandora function as a USB CDC_ACM serial device, and enable serial communication between the Pandora and my PC.


No promises, but if g_hid is already included with the OS, then I might have a go at making a client.
 
It should actually be pretty easy by using the Pandoras USB OTG port and a standard A to Mini B USB cable.


You need to load the g_hid module (and compile it, if it isn't included in the OS, I don't have my Pandora with me to check). http://www.mjmwired..../gadget_hid.txt


Next you simply need to make a client which captures keyboard/controller events and pass them to the g_hid dev node (/dev/hidgX according to the above documentation). This will make the Pandora simulate a usb keyboard, mouse or joystick/gamepad. The documentation includes sample code to send hid events.


I have never tried to use the g_hid module, but I did use g_serial to make the Pandora function as a USB CDC_ACM serial device, and enable serial communication between the Pandora and my PC.


No promises, but if g_hid is already included with the OS, then I might have a go at making a client.

If you were to make a PND that does this and sell it on the Repo, I would buy it, if that's any sort of extra motivation to you. :p
 
PAndora as a USB controller to something else, I've thought about looking into but doubt anyone has done anything on..


Using USB controllers on Pandora is completely fine at the OS level, but its up to applications to support; it is actually not hard at all to handle them in code, but 98% of the gaming applications just assume pandora native controls (the controls built onto it, the d-pad.) A few emus (notably, notaz' ones) work fine with multiple sources of input and work great -- for example,using a bluetooth or usb gamepad talking to pandora, with pandora hooked up to TV, works _great_. (I've used iCP to play genesis, PSX and Atari ST games :)


jeff
 
qjoypad is worth mentioning (someone should maintain that on the Repo; it really is a great program to have). Basically, it just converts joystick buttons and stuff into keyboard presses, and since all the Pandora buttons are technically keyboard keys, it's easy to map it so that any controller with a SNES layout works like the built-in controls. Works great for lots of games, though it doesn't work on most of the emulators I've tried. I used qjoypad with a Dualshock 3 to play Aurora Rift 32X in my video review of the Pandora.
 
Last edited by a moderator:
No promises, but if g_hid is already included with the OS, then I might have a go at making a client.
g_hid is included in firmware, but I failed to get it to work, maybe you'd have better luck..
 
Last edited by a moderator:
g_hid is included in firmware, but I failed to get it to work, maybe you'd have better luck..
That doesn't give me much hope, but I'll give it a go. I've found that the g_* drivers coming with the Kernel are a bit hit & miss unfortunately and fixing them is beyond me. I got g_serial working easily, but g_printer was only half there (plug&play worked, but no communication).
 
g_hid is included in firmware, but I failed to get it to work, maybe you'd have better luck..
I was still on HF6, which didn't include g_hid, so I had to upgrade to SuperZaxxon B4. Unfortunately I can't get any of the USB gadget drivers to load at all (at least g_hid, and g_serial which did work for me before, and g_printer which never worked right, but would at least load).


If I boot with the 2.6.27 kernel, then I can use g_serial again as before.


Is there a chance that USB OTG is completely broken with the new kernel? I can't get USB networking going either, even using the bundled config UI to enable it (I see that the hybrid network/serial module g_cdc was loaded, but I couldn't manage any communication).


I guess there are two options, either build g_hid for the 2.6.27 kernel, or try to rebuild 3.2 with better OTG support. Hopefully this is just a build config change so I'll have a go.
 
I doubt g_hid was available in 2.6.27. g_cdc should work on 3.2, I use it daily. You are aware you need to remove any g_* drivers before loading another one, right? I've seen some problems unloading some of them on 3.2 though, you might sometimes need cold reboot for OTG to work again..
 
Last edited by a moderator:
I doubt g_hid was available in 2.6.27. g_cdc should work on 3.2, I use it daily. You are aware you need to remove any g_* drivers before loading another one, right? I've seen some problems unloading some of them on 3.2 though, you might sometimes need cold reboot for OTG to work again..
Yeah, I know that there can only be one gadget driver loaded. Actually what I did was enable it with the startup configuration gui included with the OS, and reboot. To eliminate the chance of me cocking it up. If you say it's working then I must have done something wrong. I checked the Super Zaxxon threads and saw that no-one else had reported any problems.


I did wonder about g_hid existing in 2.6.27, since you already included the useful modules anyway I would have thought you'd include it if it was there. Anyway, g_hid is definitely not working right, and it's a good excuse to start poking around with the Pandora Kernel. From reading the documentation properly (http://www.mjmwired.net/kernel/Documentation/usb/gadget_hid.txt), it seems that there is a little bit more work required than just building and loading the module, I'll need to tweak the platform code slightly.
 
How about someone just make a simple python script that will capture keypresses/joystick movement, send it to an Arduino via serial, then send to maybe another Arduino connected to another PC which can run a python script that receives that information and simulates keypresses/joysticks.
 
Could be done, but running the pandora as a USB HID would be neater :)
 
True. Can probably be easily done with a ftdi chip embedded in a USB cable.

Is there a program on the Pandora to make it emulate USB serial?
 
Why even bother with that?

You can set it up as a USB mass-storage device using only a miniB to fullA cable.

Its a software problem.
 
I think that most likely the easiest way to do it is to simply send the data to a client (server?) Running on the PC instead of using hid.
 
Well  yeah,  if you just want to use it with a specific PC that may work..  but using HID gives you a lot better flexibility,  because you could then just plug it into any machine with a usb port and you'd be ready to go.

- Neelix
 
Back
Top