Discussion:
Writing HID driver for a USB phone handset IPEVO VP170 (0x1778:0x0403)
Robin H. Johnson
2007-03-19 08:39:59 UTC
Permalink
Hi,

USB drivers in general are something a little new to me, but I picked up a USB
phone handset a little while ago, and while the USB-Audio portion of it works
great, none of the buttons actually do anything, and the LED doesn't light up
yet.

Here's the manuf's page on the phone: http://www.ipevo.com/v2/prod/p111444.htm

libhid appears to need hackery as it only looks at the EP1IN endpoint, while
this device uses EP3IN for the keypad, even fixing that to do a lookup of the
correct input and interface number it still doesn't like the unit, so I figured
probably better to post here and see if somebody had better pointers to being
able to use the data. A userspace app would probably be the most use, but I'll
settle for actually managing to receive the data!

Using Pete's binary usbmon, I can see that each of the 25 buttons has a unique
code, and pressing said button repeatedly cycles a second byte through values
0-3 (looping).

usb 2-1: new full speed USB device using ohci_hcd and address 2
usb 2-1: configuration #1 chosen from 1 choice
input: ÿ Free-1 USB Phone as /class/input/input4
input: USB HID v1.00 Device [ÿ Free-1 USB Phone] on usb-0001:01:0b.1-1

The iManufacturer is set to 0xFF.

Here is the interface and endpoint for the controls. I find it odd that the HID
Report Descriptor is not present. I suspect it will contain the LED control as
well.

Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Devices
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.00
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 50
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0007 1x 7 bytes
bInterval 10
--
Robin Hugh Johnson
Gentoo Linux Developer & Council Member
E-Mail : ***@gentoo.org
GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85
Jiri Kosina
2007-03-19 13:34:20 UTC
Permalink
Post by Robin H. Johnson
Here is the interface and endpoint for the controls. I find it odd that the HID
Report Descriptor is not present. I suspect it will contain the LED control as
well.
Could you please compile some recent kernel with HID debugging support
(Device Drivers -> HID devices -> HID debugging support in menuconfig),
and show us the output both from the time you connect the device (this
will give, among other things, a report descriptor, so it will be possible
to see how to interpret the data from the device)? This will also log the
contents of received reports when you press the buttons, and also the
mappings that hid-input has established (if any) when parsing the report
descriptor.

Thanks,
--
Jiri Kosina

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-***@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Robin H. Johnson
2007-04-25 07:48:45 UTC
Permalink
Post by Jiri Kosina
Post by Robin H. Johnson
Here is the interface and endpoint for the controls. I find it odd that the HID
Report Descriptor is not present. I suspect it will contain the LED control as
well.
Could you please compile some recent kernel with HID debugging support
(Device Drivers -> HID devices -> HID debugging support in menuconfig),
and show us the output both from the time you connect the device (this
will give, among other things, a report descriptor, so it will be possible
to see how to interpret the data from the device)? This will also log the
contents of received reports when you press the buttons, and also the
mappings that hid-input has established (if any) when parsing the report
descriptor.
The attached file usb-capture-startup-ipevo.log details the hid-debug output
from when I plug it in, to when it produces no more automatic output.

Thereafter, the output looks like this for all button presses.
Notice the X and Y in the output. I have a detailed mapping of the keys below.
[ 3479.472985] drivers/hid/hid-core.c: report (size 7) (unnumbered)
[ 3479.472985] drivers/hid/hid-core.c: report 0 (size 7) = f0 XX YY 00 00 00 00
[ 3479.472985] hid-debug: input Consumer.00e9 = 0
[ 3479.472985] hid-debug: input Consumer.00ea = 0
[ 3479.472985] hid-debug: input Consumer.00e2 = 0
[ 3479.472985] hid-debug: input Consumer.0000 = 0
[ 3479.472985] hid-debug: input Consumer.0000 = 1
[ 3479.472985] hid-debug: input Consumer.0000 = 1
[ 3479.472985] hid-debug: input Consumer.0000 = 1
[ 3479.472985] hid-debug: input Consumer.0000 = 1
[ 3479.472985] hid-debug: input Consumer.0000 = XX
[ 3479.472985] hid-debug: input Consumer.0000 = YY
[ 3479.472985] hid-debug: input Consumer.0000 = 0
[ 3479.472985] hid-debug: input Consumer.0000 = 0
[ 3479.472985] hid-debug: input Consumer.0000 = 0
[ 3479.472985] hid-debug: input Consumer.0000 = 0

YY is always 0..3, seems to be a small cycle counter (that wraps) over the
scope of ALL buttons. Eg pressing Mute, then Keypad7 will increment the counter
by two.

XX mapping table (hex):
1c = 'Skype'
c1 = 'Out'/+
c3 = 'List'
1d = Selector-Up
1e = Selector-Down
1f = No/Onhook
20 = Yes/Offhook
2f = Mute
f1 = Circle (GROUP 0)
f2 = Diamond
f3 = Square
32 = Volume Up
33 = Volume Down
b0 = Keypad 0
b1 = Keypad 1
b2 = Keypad 2
b3 = Keypad 3
b4 = Keypad 4
b5 = Keypad 5
b6 = Keypad 6
b7 = Keypad 7
b8 = Keypad 8
b9 = Keypad 9
ba = Keypad *
bb = Keypad #
--
Robin Hugh Johnson
Gentoo Linux Developer & Council Member
E-Mail : ***@gentoo.org
GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85
Jiri Kosina
2007-04-27 09:59:43 UTC
Permalink
Post by Robin H. Johnson
Notice the X and Y in the output. I have a detailed mapping of the keys below.
[ 3479.472985] drivers/hid/hid-core.c: report (size 7) (unnumbered)
[ 3479.472985] drivers/hid/hid-core.c: report 0 (size 7) = f0 XX YY 00 00 00 00
[ 3479.472985] hid-debug: input Consumer.00e9 = 0
[ 3479.472985] hid-debug: input Consumer.00ea = 0
[ 3479.472985] hid-debug: input Consumer.00e2 = 0
[ 3479.472985] hid-debug: input Consumer.0000 = 0
[ 3479.472985] hid-debug: input Consumer.0000 = 1
[ 3479.472985] hid-debug: input Consumer.0000 = 1
[ 3479.472985] hid-debug: input Consumer.0000 = 1
[ 3479.472985] hid-debug: input Consumer.0000 = 1
[ 3479.472985] hid-debug: input Consumer.0000 = XX
[ 3479.472985] hid-debug: input Consumer.0000 = YY
[ 3479.472985] hid-debug: input Consumer.0000 = 0
[ 3479.472985] hid-debug: input Consumer.0000 = 0
[ 3479.472985] hid-debug: input Consumer.0000 = 0
[ 3479.472985] hid-debug: input Consumer.0000 = 0
Hi Robin,

this doesn't look particularly good.
Post by Robin H. Johnson
YY is always 0..3, seems to be a small cycle counter (that wraps) over the
scope of ALL buttons. Eg pressing Mute, then Keypad7 will increment the counter
by two.
1c = 'Skype'
c1 = 'Out'/+
c3 = 'List'
1d = Selector-Up
1e = Selector-Down
1f = No/Onhook
20 = Yes/Offhook
2f = Mute
f1 = Circle (GROUP 0)
f2 = Diamond
f3 = Square
32 = Volume Up
33 = Volume Down
b0 = Keypad 0
b1 = Keypad 1
b2 = Keypad 2
b3 = Keypad 3
b4 = Keypad 4
b5 = Keypad 5
b6 = Keypad 6
b7 = Keypad 7
b8 = Keypad 8
b9 = Keypad 9
ba = Keypad *
bb = Keypad #
This doesn't seem like it would be anyhow compatible with standardized HID
Usage Tables - the codes are just different than what the standard
specifies.

I'll inspect the report descriptor in a further detail and will let you
know if there is a possibility how to fix this on-the-fly, but maybe
writing a separate (userland, using hiddev or just-being-created hidraw
interface) driver would be better.

Thanks for the report,
--
Jiri Kosina
SUSE Labs

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
linux-usb-***@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Loading...