[DEV] USB gamepad on official ROM - Galaxy S II Original Android Development

Hi,
after weeks of trying to figure out out the kernel works, I finally managed to have a working USB gamepad on my Galaxy SII !
It's quite buggy/unstable for now but N64oid detected my buttons
It's only working on the official firmware, I'm using 2.3.3 KG1 and only tested on this firmware.
I tested many different gamepads and the only one that I got working is the "Thrustmaster Firestorm digital 3" USB gamepad (it only cost 7 € here !!!)
So what's the steps now ?
- as root "insmod joydev.ko"
- plug your gamepad and type "dmesg" to get more infos about the gamepad detected
- now the gamepad device must have been created : /dev/input/js0
- type "cat /dev/input/js0" in a terminal and when you press your gamepad buttons some weird characters should appear, if not your gamepad is not supported!
- now type "chmod 777 /dev/input/js0"
- install my modified GamepadIME apk
- In Android settings, language and keyboard, check gamepad then select the gamepad IME as the main input method.
- if you're lucky, you'll be notified that your gamepad is detected.
- Your gamepad is simulating a key press so you can see it working in an input area.
A video showing my gamepad in action : http://www.youtube.com/watch?v=6XEqaqum_PE

It doesn't recognize my dualshock 2 at all and my old WingMan is recognized but the buttons presses aren't.
Great work nonetheless. I hope someone (or you ) can expand on your great work and add more gamepad compatibility.

dualshock 2 is not USB ? I also compiled the full joystick kernel modules (xpad, gamepad,iforce,sidewinder, tmdc etc) so it may help with other ones but as I don't have the hardware I can't check the code.
Anyway, only generic gamepads may work, I really tried hard on the Xbox360 one but failed again and again...

Well... USB devices are supported native in 2.3.4
Sent from my GT-I9100 using XDA App

jknvv13 said:
Well... USB devices are supported native in 2.3.4
Sent from my GT-I9100 using XDA App
Click to expand...
Click to collapse
No, joystick support is added to Android 3 only. Also USB device is a generic word for something that uses USB so only a small part of the whole USB devices is really supported by Android for now (keyboards and mice mainly).

alx5962 said:
dualshock 2 is not USB ?
Click to expand...
Click to collapse
I obviously used an adapter
My PS3 recognizes both the WingMan and the DS2, so I suppose they are generic in some way.

FPRobber said:
I obviously used an adapter
My PS3 recognizes both the WingMan and the DS2, so I suppose they are generic in some way.
Click to expand...
Click to collapse
That kind of adapter uses the gamepad kernel module, not the joydev one so that's why it doesn't work.

alx5962 said:
- install my modified GamepadIME apk
Click to expand...
Click to collapse
What did you modify?
I investigated a bit: It's possible to detect button presses without the module and my GamepadIME. But the events are a bit strange. From Activity.onKeyDown() with neither joydev.ko nor GamepadIME:
Code:
KeyEvent{action=0 code=0 repeat=0 meta=0 scancode=306 mFlags=8}
"code=0" might lead to the strange effects I have with NESoid: single button presses seem to activate all buttons at once.
So if the emulator/game developers take care for this and analyze also "scancode" and not only "code",
- it's possible to play games without root/module/GamepadIME with the buttons of a gamepad
- it's possible to play games with root/module/GamepadIME with the sticks of a gamepad or with one of those retro adapters for old digital joysticks.

Can anyone compile joydev.ko for AOSP based roms like MIUI and CM7? Or mabye someone can guide me in compiling this?

My experience:
1- copy files (joydev.ko and GamepadIMEAlex.apk) to galaxy S2
2-open root explorer in galaxy S2 and select joydev.ko and copy
open lib folder
open modules folder
click on mounted r/w and now you can see mounted r/o
3- pasted into modules the file joydev.ko
4-open android terminal in galaxy S2
write su (now have super user permissions)
write :
cd lib
cd modules
insmod joydev.ko (and ok 0 errors, terminal do not say nothing)
5- to plug a gamepad and wait 5-8 seconds
6- write: dmesg in terminal and you will can see gamepad detected or not
7- write: cat /dev/input/joydev.ko and press gamepad buttons ,
two things can happen: Nothing or Yes it is running
8- Install GamepadIMEAlex.apk
9- now into ajustements ,
look into keyboard/language and mark gamepad option
and in select input method (select gamepad)
10- good lucky
Ps3 original gamepad Only run bluetooth mode thanks sixaxis 0.32 apk in original stock rom 2.3.4 ,Are not running with usb mode
Ps3 clone-copy gamepad, are not running (not bluetooth, not usb mode)
MAXFIRE G-08XU GENIUS 8 BUTTON USB GAMEPAD Are running ok ,Yes

Any possibility to use this with ps3 sixaxis?
Sent from my GT-I9100 using xda premium

you can already use a wireless ps3 controller with our phone using sixaxis bluetooth protocol/driver.

equlizer said:
you can already use a wireless ps3 controller with our phone using sixaxis bluetooth protocol/driver.
Click to expand...
Click to collapse
Where can i get thw driver? Didnt know
Sent from my GT-I9100 using xda premium

sixaxis is in the market. Get the free one first to make sure it works (just in case)

zylor said:
Where can i get thw driver? Didnt know
Sent from my GT-I9100 using xda premium
Click to expand...
Click to collapse
i think u have to use cyanogen or miui cause the bluetooth stacks are missing in the original/custom rom i tried it with the wiimote and it worked only on CM and miui.dunno if sixaxis are using the same stacks.try it out

haieb said:
i think u have to use cyanogen or miui cause the bluetooth stacks are missing in the original/custom rom i tried it with the wiimote and it worked only on CM and miui.dunno if sixaxis are using the same stacks.try it out
Click to expand...
Click to collapse
It works with the official ROMs now too.

nothing person readed my post?????
I said in page 1,
Ps3 original gamepad Only run bluetooth mode thanks sixaxis 0.32 apk in original stock rom 2.3.4 ,Are not running with usb mode
and in cyanogen roms ,it was running before.
In new android sandwich I think that all gamepads will be working

Will this work on Galaxy Note Stock ROM (2.3.6)?
Brgds... /Tubgirl

Tubgirl said:
Will this work on Galaxy Note Stock ROM (2.3.6)?
Brgds... /Tubgirl
Click to expand...
Click to collapse
Just try and keep us informed

Can you compile the kernel module also for the CyanogenMod Kernel?

Related

[Q] Using an xbox 360 controller w/ pershoot's kernel and stock 3.1

Hi, so I'm trying to use an xbox 360 for pc controller. I have a galaxy tab 10.1 running stock 3.1 (w/ touchwiz). It is rooted and I flashed pershoot's kernel (http://forum.xda-developers.com/showthread.php?t=1138167). It says it supports 360 controllers, so I'm not sure what the problem is. Do i have to flash a custom rom?
When I attach the usb receiver to the tab through the usb adapter, it lights up, stays lit up, and it seems like the controller can even connect to it, but the controller doesn't work at all. Nothing shows up in the input settings area either.
Thanks for any help
edit:
In case anyone finds this through searching and is having a similar problem, reddit user misfeasor answered the question for me, here is his response/solution:
"It does support it, unlike the stock kernel, but the modules (or drivers in other words) aren't built-in to the kernel but have to be installed so to speak after every reboot. Some roms have init.d support which would allow you to create a script that can run the commands at startup.
I believe the two modules you would need are ff-memless.ko and xpad.ko and both are in the lib-2636.4.tar.gz at http://droidbasement.com/db-blog/. You need to put these files somewhere on your tablet storage. Then, to insmod the modules run these commands in a terminal app or adb shell:
insmod <path-to-file>/ff-memless.ko
insmod <path-to-file>/xpad.ko
Finally, plug in your controller receiver and it should hopefully work.
Edit: You might need to run "su" before the commands above depending on if you are executing commands as root by default or not."

help with sixaxis ps3 control

ive tried to get it to work on my rooted smasung galxy s2 tmobile but wont give me the bluetooth address
http://www.dancingpixelstudios.com/contact.html
Have a problem?
Don't forget to check the FAQ for answers to the most commonly asked questions.
Email
Please send all support emails, feature requests & general enquiries to [email protected]
artojeda1988 said:
ive tried to get it to work on my rooted smasung galxy s2 tmobile but wont give me the bluetooth address
Click to expand...
Click to collapse
1.First off install Sixaxis Controller Checker app from market
2.Run it and after some errors and saying your phone is compatible it should give
you an adress - write it down
3.Install Sixaxis Pair Tool (SPT in further text) from dancing pixel studios website
4.Connect your PS3 controller via usb you got with your PS3
5.Wait until the drivers install
6.SPT will show your current bluetooth master adress - WRITE it down ( so you
can restore it when you want to use it with your PS3)
7.Enter a new adress ( the one you got in step 2) - disconnect after this
8.Install Sixaxis Controller app and run it
9.Turn on your controller
10. It should now connect, the only thing remaining is to change default input to
PS3 controller in settings
11.Thats it!
The t-mobile version has issues with the current version of the app. I have a fix for this which should be up within a week.

[Q] Customized Keylayout For Gamepad

Greetings!
I Have created a gamelayout for my ps2 usb adapter controller, the problem is that it doesn't get detected in Android, it's detected under linux (I attach some images) and the .kl file -It's inside "Vendor_12bd_Product_e002.zip" yes it's codified in UNIX, not MAC or DOS-.
I followed the tutorial from here.
I don't know if this has to anything but my tablet is a chinese Pipo S1 dual core Rockhip 1.6ghz gpu mali 400 with the stock software -Jellybean 4.1.1-.
As I stated, the controller gets detected, but the problem is that I want it to get detected as it should -Since it has plug for 2 usb controllers- in "Android" not in "Linux", hence, the .kl I used is not being detected and doesn't apply my mapping.
Any ideas?
PS: I already did the changes for r w r r, I used the terminal too -command ls -l /system/usr/keylayout- (image attached) Do I need to declare this new Keylayout somewhere?
Edit: The new configuration does get dettected though, the device isn't is because the modules are lacking due to the kernel source is not released and haven't compiled the .ko for generic gamepads
So finally is the Customised layout working?? If yes please let me know how?? Because for me it's not working.
Yes for games with native support, I havn't been able to make it work with USB Joystick center due to the lack of modules for generic gamepads

[Q] Help about attaching a webcam to android devic

Hello friends and happy new year for all.
I have a question about using webcams in an android device,
can anyone help me
I mean , I want to attach my webcam to my android device (Xperia mini pro) but I don't know how to do it.
please help me.
You don't.
I find a way
I allso found a way in youtube but I don't know how to us it
I hope masters in here can help me
but I cant send the link here so I write the search words
Usage of USB webcam with customized Galaxy Nexus (android 4.0.3)
search in youtube
Why nobody don't help me ???
lovelysunset said:
Why nobody don't help me ???
Click to expand...
Click to collapse
Read the description of the video.
Sent from my Galaxy Nexus using xda premium
Attaching any USB peripheral requires the device to have USB On-The-Go (OTG) support. A lot of the newer (and high-end) devices have this, but yours does not. So it's not possible. It's not just a simple software mod. USB OTG requires the device to have a USB port that's capable of delivering power output to power low power USB peripherals like keyboards, mice, flash drives. For that same reason, in the video it is mentioned that only low power webcams work. It's at the hardware level, so no it won't be possible with your phone at all.
Sent from my Desire HD using xda premium
sashank said:
Attaching any USB peripheral requires the device to have USB On-The-Go (OTG) support. A lot of the newer (and high-end) devices have this, but yours does not. So it's not possible. It's not just a simple software mod. USB OTG requires the device to have a USB port that's capable of delivering power output to power low power USB peripherals like keyboards, mice, flash drives. For that same reason, in the video it is mentioned that only low power webcams work. It's at the hardware level, so no it won't be possible with your phone at all.
Click to expand...
Click to collapse
Thanks for your answer but I can use usb devices like Flash memory , usb mouse & keyboard , game pad and my 500 GB hard drive and also I can use usb power for my usb speaker .
is this not enough to being a device to support USB ?
can you help me in this way.
Thanks man!
lovelysunset said:
Thanks for your answer but I can use usb devices like Flash memory , usb mouse & keyboard , game pad and my 500 GB hard drive and also I can use usb power for my usb speaker .
is this not enough to being a device to support USB ?
can you help me in this way.
Click to expand...
Click to collapse
Yes you're right, your device does indeed have full OTG support. Sony never mentioned it in the official specifications, but I did a search in your device's forum and found info about it. In that case, I guess the procedure to getting the webcam to work is more hardware specific, so can't say whether it can or cannot work with your device. Your best bet is to ask a dev for your device about it, and see if they're interested to look into it. Also, the guy in the video said only low power webcams work. This is because the USB port can't deliver that much power output.
Having USB Host mode and even a powered USB hub is not enough to use a USB webcam.
You need kernel support and a custom app that accesses video4linux interface (/dev/videoX) OR a patched android framework that routes video4linux interface to android's standard camera API.
In other words, you must be able to modify and compile your own kernel and custom ROM for your particular device.
sashank said:
Yes you're right, your device does indeed have full OTG support. Sony never mentioned it in the official specifications, but I did a search in your device's forum and found info about it. In that case, I guess the procedure to getting the webcam to work is more hardware specific, so can't say whether it can or cannot work with your device. Your best bet is to ask a dev for your device about it, and see if they're interested to look into it. Also, the guy in the video said only low power webcams work. This is because the USB port can't deliver that much power output.
Click to expand...
Click to collapse
thanks a lot for your answer
brugobo said:
Having USB Host mode and even a powered USB hub is not enough to use a USB webcam.
You need kernel support and a custom app that accesses video4linux interface (/dev/videoX) OR a patched android framework that routes video4linux interface to android's standard camera API.
In other words, you must be able to modify and compile your own kernel and custom ROM for your particular device.
Click to expand...
Click to collapse
thanks
but can you help me about edit my kernel (boot.img) and which app I can use ??
lovelysunset said:
thanks
but can you help me about edit my kernel (boot.img) and which app I can use ??
Click to expand...
Click to collapse
You can't just edit the boot.img, you have to edit the source and then compile it. Either learn how to program etc. Or ask a developer for your device to have a look.
Sent from my Galaxy Nexus using xda premium
NIMBAH said:
You can't just edit the boot.img, you have to edit the source and then compile it. Either learn how to program etc. Or ask a developer for your device to have a look.
Sent from my Galaxy Nexus using xda premium
Click to expand...
Click to collapse
thanks a lot man!
I have a Sony Ericsson Xperia Neo V running Lupus kernel and FXP152 (CM10) ROM. My phone's specification says it supports USB OTG. How can I get this feature?
Also, I am unable to use USB Mass storage mode. Its disabled for some reason. Can anyone explain?
answer
feeroz123 said:
I have a Sony Ericsson Xperia Neo V running Lupus kernel and FXP152 (CM10) ROM. My phone's specification says it supports USB OTG. How can I get this feature?
Also, I am unable to use USB Mass storage mode. Its disabled for some reason. Can anyone explain?
Click to expand...
Click to collapse
hi dear
for your broblem
first of all you must buy a cable that mach your phone port
second your phone must be unlock and root
third you must use modules that is with kernel (flash with CMW) and then install ModuleLoader.apk and select the modules you installed
then you must install a app (like stickmount.apk) to mount the usb you attached
you can found apps in apknew site
may this help you
sashank said:
Yes you're right, your device does indeed have full OTG support. Sony never mentioned it in the official specifications, but I did a search in your device's forum and found info about it. In that case, I guess the procedure to getting the webcam to work is more hardware specific, so can't say whether it can or cannot work with your device. Your best bet is to ask a dev for your device about it, and see if they're interested to look into it. Also, the guy in the video said only low power webcams work. This is because the USB port can't deliver that much power output.
Click to expand...
Click to collapse
Totally agree with Sashank
lovelysunset said:
hi dear
for your broblem
first of all you must buy a cable that mach your phone port
second your phone must be unlock and root
third you must use modules that is with kernel (flash with CMW) and then install ModuleLoader.apk and select the modules you installed
then you must install a app (like stickmount.apk) to mount the usb you attached
you can found apps in apknew site
may this help you
Click to expand...
Click to collapse
Thanks.
How do i get my device identified in my PC as a Disk Drive? I have tried flashing the following UMS zip, but no help on FXP152:
forum.xda-developers.com/showpost.php?p=34956370&postcount=4174
answer
feeroz123 said:
Thanks.
How do i get my device identified in my PC as a Disk Drive? I have tried flashing the following UMS zip, but no help on FXP152:
forum.xda-developers.com/showpost.php?p=34956370&postcount=4174
Click to expand...
Click to collapse
hello dear
I sow that page but I've no idea why you cant see the drive in your computer
first of all you must ENABLE your USB debuging from your device
and make sure you have installed your phones driver in your computer
maybe your phone is in MTA mode so you can see your drive under your phones name in camputer
and make sure your cable is working fine.
may this helpfull
lovelysunset said:
hello dear
I sow that page but I've no idea why you cant see the drive in your computer
first of all you must ENABLE your USB debuging from your device
and make sure you have installed your phones driver in your computer
maybe your phone is in MTA mode so you can see your drive under your phones name in camputer
and make sure your cable is working fine.
may this helpfull
Click to expand...
Click to collapse
Yes, I had enable mass_storage in buil.prop file before flashing that zip. Actually it used to work in FXP 148. But now am on FXp 152 ROm, and now that patch is not working.
I have USB device drivers for my phone from some other path. But thats not getting identified by driver update.
Currently, my phone gets identified in MTP mode in Device Manger, but no drivers installed (shows as yellow question mark).

Xiaomi Box s 4k MDZ-22-AB PS3 Controller?

Hy Guys.
Is there a way to connect a Bluetooth PS3 Controller to the Xiaomi BOX MDZ-22-AB?
I have tried the pairing with the micro usb cable but it didn't work.
I have read that there is a root necessary. Is it correct? Is there a good tutorial?
Thanks in advance.
I have the same doubt about this!
Beerle said:
Hy Guys.
Is there a way to connect a Bluetooth PS3 Controller to the Xiaomi BOX MDZ-22-AB?
I have tried the pairing with the micro usb cable but it didn't work.
I have read that there is a root necessary. Is it correct? Is there a good tutorial?
Thanks in advance.
Click to expand...
Click to collapse
hello
yes you can do that with sixaxis controller
- first you need check if your device is compatible or not
- download sixaxis compatibility checker and check if your device is compatible
- if yes then you need to download the sixaxis controller app (root needed )
- install it
- change the bluetooth master address for your ps 3 controller to your box Bluetooth address (use otg cable to connect your controller and change the master address with siaxsis app if you don't have the otg cable then you can do that or your pc with sixaxis application for windows )
unplug the cable and click start on sixaxsis then pair your controller
SlamD said:
hello
yes you can do that with sixaxis controller
- first you need check if your device is compatible or not
- download sixaxis compatibility checker and check if your device is compatible
- if yes then you need to download the sixaxis controller app (root needed )
- install it
- change the bluetooth master address for your ps 3 controller to your box Bluetooth address (use otg cable to connect your controller and change the master address with siaxsis app if you don't have the otg cable then you can do that or your pc with sixaxis application for windows )
unplug the cable and click start on sixaxsis then pair your controller
Click to expand...
Click to collapse
Thank you but i had already done this and it didn't work.

Categories

Resources