Connect Joystick to play games on android
来源:互联网 发布:章鱼软件 编辑:程序博客网 时间:2024/06/07 00:57
All most all of the android v4.0 and higher tablets are USB host enabled and comes with kernel modules of ps3/xbox joystick etc but i had a cheap chinese made USB joystick (DragonRise gamepad) which i wanted to connect and play games with on my momo9 tablet with CM10 and there was no kernel module available for my requirement so here is my story how i compiled kernel module.
Prerequisites
Then i started searching for the kernel module of my joystick and found many versions of generic joydev.ko but none of them were compatible for my device. When i used dmesg command to determine the cause for one of such module i found that the mismatch of vermagic which means that an android (linux) kernel module can be loaded only if it is compiled for the same linux version and if it is compiled for the CPU. Using uname -a command i found the linux kernel version and CPU which powers my android.
Once the kernel version is determined i again google for kernel module of my joystick which are build for my kernel and CPU but i was not able to find joystick kernel module for my momo9c with CM10 so i downloaded allwinner kernel source from https://github.com/christiantroy/linux-allwinner and the Sourcery CodeBench Lite edition from http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/ and then compiled the kernel module. I compiled the kernel module on Backtrack5 virtual machine using following commands
Then i moved the compiled module hid-dr.ko to the tablet to /system/modules/lib and loaded the module using insmod command and verified the new input joystick device using ls -l /dev/js? command. At last i downloaded a generic USB joystick android keylayout file for the joystick and moved it into the /system/usr/keylayout directoy.
Then i configured input devices and key mappings in nesoid emulator and started playing my favorite game on tablet with joystick. Though i have not tested but i am sure that if two joysticks are connected using USB OTG cable and USB Hub then multi-player games can also be played.
My compiled hid-dr.ko kernel module for Linux 3.0.6.36+ and the keylayout file can be downloaded from
https://dl.dropboxusercontent.com/u/48560079/joystick_hid_dr.zip contains hid-dr.ko and Vendor_0079_Product_0006.kl files.
Prerequisites
- Requires a root access.
- Joystick and micro USB OTG cable.
- Android Terminal emulator and busybox.
Then i started searching for the kernel module of my joystick and found many versions of generic joydev.ko but none of them were compatible for my device. When i used dmesg command to determine the cause for one of such module i found that the mismatch of vermagic which means that an android (linux) kernel module can be loaded only if it is compiled for the same linux version and if it is compiled for the CPU. Using uname -a command i found the linux kernel version and CPU which powers my android.
Once the kernel version is determined i again google for kernel module of my joystick which are build for my kernel and CPU but i was not able to find joystick kernel module for my momo9c with CM10 so i downloaded allwinner kernel source from https://github.com/christiantroy/linux-allwinner and the Sourcery CodeBench Lite edition from http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/ and then compiled the kernel module. I compiled the kernel module on Backtrack5 virtual machine using following commands
make ARCH=arm sun4i_crane_defconfigmake menuconfig ARCH=arm make modules ARCH=arm CROSS_COMPILE=/sourcery-arm-toolchain/bin/arm-none-eabi
Then i moved the compiled module hid-dr.ko to the tablet to /system/modules/lib and loaded the module using insmod command and verified the new input joystick device using ls -l /dev/js? command. At last i downloaded a generic USB joystick android keylayout file for the joystick and moved it into the /system/usr/keylayout directoy.
Then i configured input devices and key mappings in nesoid emulator and started playing my favorite game on tablet with joystick. Though i have not tested but i am sure that if two joysticks are connected using USB OTG cable and USB Hub then multi-player games can also be played.
My compiled hid-dr.ko kernel module for Linux 3.0.6.36+ and the keylayout file can be downloaded from
https://dl.dropboxusercontent.com/u/48560079/joystick_hid_dr.zip contains hid-dr.ko and Vendor_0079_Product_0006.kl files.
Happy gaming!!! and enjoy :)
From: http://anilsoni85.blogspot.com/2013/05/connect-joystick-to-play-games-on-your.html
0 0
- Connect Joystick to play games on android
- Play framework connect to sql server
- Connect to E680i on linux
- Let’s Play Games!
- HDU1564:play games
- Remove Google Play Games libraries on iOS (Unity3D开发之二十一)
- On Hat Puzzle 1.1: From Peter Winkler's "Games People Don't Play
- Android Input之JoyStick
- Android Input之JoyStick
- How to Build a Python Bot That Can Play Web Games
- connect to Oracle in Ruby on Rails.
- Can't connect to MySQL server on
- Programming 3D games on Android with Irrlicht and Bullet
- Programming 3D games on Android with Irrlicht and Bullet
- [agc016f]Games on DAG
- A class to play sound on netcf in CSharp
- How to play BreakerBall game on DragonBoard 410c ?
- [Android] Joystick游戏手柄开发
- Convert Sorted List to Binary Search Tree
- Ubuntu自动搭建VPN Server - PPTP的Shell脚本
- 黑马程序员—月薪1W的黑马训练营.Net一期朱磊的分享:逼着自己优秀
- 母函数
- PAT (Basic Level) Practise (中文)1005. 继续(3n+1)猜想 (25)
- Connect Joystick to play games on android
- sql语句优化
- SQLite数据库--SQLiteOpenHelper进行操作
- 泛型
- 初识NoSQL 快速认识NoSQL数据库 分析Analytics For Hackers: How To Think About Event Data
- Remove Nth Node From End of List
- manpage 中不同section中放的文件的类型
- 黑马程序员_java面试题交通灯管理系统
- 测试1