I'm trying to get my Countour Shuttlexpress working with usb host ( using cm7 nightlies )
I've already posted some of this in the usb-host thread but seems there is not much devs traffic there LINK
So I've decided to open a new thread hoping for some interest and maybe info for others who want to write/port their own usb-host drivers
Eventually what I'm trying to achieve is :
Jog Wheel - Controls system/media volume
Shuttle Knob - PREV/NEXT song on PowerAmp app
Buttons - Launch Apps , Jump To Screen #n , Run Terminal Commands
That's on the basic level of things
I don't have any coding skills in Linux ( I do know some java and c/c++ And I'm a fast learner )
In the past few days I've been setting up my first developing enviorment with Ubuntu 10.04 and learned a couple of things about android coding
Lets get back to the device
For now it's recognized as an HID device , and I can use getevent to get each function specific code
But nothing is mapped to any real function on the nook
Here is some info from the nook :
DMESG Log :
/proc/bus/input/devices
*the logs are from different sessions
using "getevent /dev/input/event7" I captured the events and isolated them
Buttons : ( numbered from left to right )
1.
2.
3.
4.
5.
Jog Wheel :
Shuttle Knob :
So , I have a few ideas on how to do it and I thought you might help me figure out the best way and guide me through it :
I have found a couple of things that might help
powermate.c in dalingrin's kernel seems to contain some code for it but I couldn't find any real thing that it does to it besides define the device
GITHUB Link
Here are some source codes for Linux ( which I thought at first to be drivers but they seem to be handlers/applications )
https://init.linpro.no/pipermail/skolelinux.no/cinelerra/2006-March/005665.html
http://www.reynwar.net/gnuradio/epydoc/gnuradio.wxgui.powermate-pysrc.html
Can I use the code from USB Mouse support and adapt it for my own input device? will it even work on CM7 since it's built for Iconia?
I've also looked into usbled.c in the kernel , comparing it to the original code from here http://www.linuxjournal.com/article/7353
It seems pretty much the same , so maybe porting the handler is the best and easiest way?
Any help would be appreciated , in the last 3 days I've read so much on linux/android developing and still feels like I know nothing
Thanks ,
Gutz
I've already posted some of this in the usb-host thread but seems there is not much devs traffic there LINK
So I've decided to open a new thread hoping for some interest and maybe info for others who want to write/port their own usb-host drivers
Eventually what I'm trying to achieve is :
Jog Wheel - Controls system/media volume
Shuttle Knob - PREV/NEXT song on PowerAmp app
Buttons - Launch Apps , Jump To Screen #n , Run Terminal Commands
That's on the basic level of things
I don't have any coding skills in Linux ( I do know some java and c/c++ And I'm a fast learner )
In the past few days I've been setting up my first developing enviorment with Ubuntu 10.04 and learned a couple of things about android coding
Lets get back to the device
For now it's recognized as an HID device , and I can use getevent to get each function specific code
But nothing is mapped to any real function on the nook
Here is some info from the nook :
DMESG Log :
Code:
<6>usb 1-1.2: new low speed USB device using musb_hdrc and address 4
<7>usb 1-1.2: skipped 1 descriptor after interface
<7>usb 1-1.2: default language 0x0409
<3>usb 1-1.2: device v0b33 p0020 is not supported
<7>usb 1-1.2: udev 4, busnum 1, minor = 3
<6>usb 1-1.2: New USB device found, idVendor=0b33, idProduct=0020
<6>usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
<6>usb 1-1.2: Product: ShuttleXpress
<6>usb 1-1.2: Manufacturer: Contour Design
<7>usb 1-1.2: uevent
<7>usb 1-1.2: usb_probe_device
<6>usb 1-1.2: configuration #1 chosen from 1 choice
<7>usb 1-1.2: adding 1-1.2:1.0 (config #1, interface 0)
<7>usb 1-1.2:1.0: uevent
<7>usbserial_generic 1-1.2:1.0: usb_probe_interface
<7>usbserial_generic 1-1.2:1.0: usb_probe_interface - got id
<7>usbhid 1-1.2:1.0: usb_probe_interface
<7>usbhid 1-1.2:1.0: usb_probe_interface - got id
<6>input: Contour Design ShuttleXpress as /devices/platform/musb_hdrc/usb1/1-1/1-1.2/1-1.2:1.0/input/input4
<6>generic-usb 0003:0B33:0020.0001: input: USB HID v1.10 Device [Contour Design ShuttleXpress] on usb-musb_hdrc-1.2/input0
<7>drivers/usb/core/inode.c: creating file '004'
<1>##- Data length: 2
Code:
I: Bus=0003 Vendor=0b33 Product=0020 Version=0110
N: Name="Contour Design ShuttleXpress"
P: Phys=usb-musb_hdrc-1.2/input0
S: Sysfs=/devices/platform/musb_hdrc/usb1/1-1/1-1.2/1-1.2:1.0/input/input7
U: Uniq=
H: Handlers=mouse3 event7
B: EV=17
B: KEY=1fff 0 0 0 0 0 0 0 0
B: REL=180
B: MSC=10
using "getevent /dev/input/event7" I captured the events and isolated them
Buttons : ( numbered from left to right )
1.
Code:
Press -
0004 0004 00090005
0001 0104 00000001
0000 0000 00000000
Release -
0004 0004 00090005
0001 0104 00000000
0000 0000 00000000
Code:
Press -
0004 0004 00090006
0001 0105 00000001
0000 0000 00000000
Release -
0004 0004 00090006
0001 0105 00000000
0000 0000 00000000
Code:
Press -
0004 0004 00090007
0001 0106 00000001
0000 0000 00000000
Release -
0004 0004 00090007
0001 0106 00000000
0000 0000 00000000
Code:
Press -
0004 0004 00090008
0001 0107 00000001
0000 0000 00000000
Release -
0004 0004 00090008
0001 0107 00000000
0000 0000 00000000
Code:
Press -
0004 0004 00090009
0001 0108 00000001
0000 0000 00000000
Release -
0004 0004 00090009
0001 0108 00000000
0000 0000 00000000
Code:
From -
0002 0007 00000001
0000 0000 00000000
To -
0002 0007 000000ff
0000 0000 00000000
Code:
Full right -
0002 0008 00000007
0002 0007 00000001
0000 0000 00000000
Full left -
0002 0008 fffffff9
0002 0007 00000001
0000 0000 00000000
So , I have a few ideas on how to do it and I thought you might help me figure out the best way and guide me through it :
- Using Tasker and write a script using Locale Execute plugin with getevent & other commands - Probably highly in-efficient and maybe slow?
- Write an app to run in the background , intercept the events and execute commands every x ms? How much is needed for a quick response?
- Write a driver ( or kernel module? ) for the device
- Maybe I can use the HID driver to do that?
- Port one of the sources I listed down to Android?
- Another thing I haven't thought of?
I have found a couple of things that might help
powermate.c in dalingrin's kernel seems to contain some code for it but I couldn't find any real thing that it does to it besides define the device
GITHUB Link
Here are some source codes for Linux ( which I thought at first to be drivers but they seem to be handlers/applications )
https://init.linpro.no/pipermail/skolelinux.no/cinelerra/2006-March/005665.html
http://www.reynwar.net/gnuradio/epydoc/gnuradio.wxgui.powermate-pysrc.html
Can I use the code from USB Mouse support and adapt it for my own input device? will it even work on CM7 since it's built for Iconia?
I've also looked into usbled.c in the kernel , comparing it to the original code from here http://www.linuxjournal.com/article/7353
It seems pretty much the same , so maybe porting the handler is the best and easiest way?
Any help would be appreciated , in the last 3 days I've read so much on linux/android developing and still feels like I know nothing
Thanks ,
Gutz
Last edited: