Re: Getting Philips Speechmike to work

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey Jiri,

Jiri Kosina schrieb:
> Thanks. The device seems to be violating HID specification in a 
> non-trivial way.
> 
> Could you please apply the debugging patch below and provide the very same 
> output again?
> 
> Also, what are the expected mappings of the buttons please (see the 
> existing KEY_ macros in include/linux/input.h).

The device (see the picture at http://tinyurl.com/q8pu3c) contains a
slider with the functionality for
fast forward:  KEY_FASTFORWARD
play:          KEY_PLAY
stop:          KEY_STOP
rewind:        KEY_REWIND

The slider can rest in the positions Play and Stop, resulting in
play onpress = stop onrelease
stop onrelease = play onpress

The slider cannot rest in the positions fast forward or rewind (top and
bottom position), so these work like "normal" buttons.

And four buttons:
INSTR.              ?                     spoken instruction (a marker)
INS/OVR        KEY_INSERT (?)             Insert/Overwrite
RECORD         KEY_RECORD
EOL            KEY_BREAK, KEY_CANCEL (?)  End-Of-Letter (a marker)

As you see, I'm not sure of what to do with those buttons except for the
record button. I didn't see any key code for "general purpose, not
listed here" buttons - or how do you handle such special-purpose devices?
I'm not entirely convinced to use KEY_INSERT for the INS/OVR
(insert/overwrite) button. This probably gets send to the X server and
toggles the regular (text input) insert/overwrite behavior? I don't
think this behavior is wanted and thus another key would be perhaps a
better idea?

> 
> diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
> index ac8049b..3ef2a3e 100644
> --- a/drivers/hid/usbhid/hid-core.c
> +++ b/drivers/hid/usbhid/hid-core.c
> @@ -891,6 +891,14 @@ static int usbhid_parse(struct hid_device *hid)
>  		dbg_hid_line(" %02x", (unsigned char) rdesc[n]);
>  	dbg_hid_line("\n");
>  
> +	/* SPEECHMIKE DEBUG */
> +	if (rdesc[26] == 0x75 && rdesc[27] == 0x08 &&
> +            rdesc[28] == 0x95 && rdesc[29] == 0x09) {
               ^^^^^^^^^^^^^^^^^
I had to add an (unsigned char) cast here, otherwise the branch is not
executed (printf("%x", rdesc[28]) gives me 0xffffff95).

> +		printk(KERN_DEBUG "SPEECHMIKE DEBUG -- ALTERING REPORT DESCRIPTOR\n");
> +		rdesc[27] = 0x01;
> +		rdesc[29] = 0x48;
> +	}
> +
>  	ret = hid_parse_report(hid, rdesc, rsize);
>  	kfree(rdesc);
>  	if (ret) {

I then pressed the buttons again and the results are at
http://philipp.wagner.name/temp/speechmike-debug/with-patch/

Thanks so much for taking time! I very much hope we can get this working.

Philipp
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux