[mythtv-users] TiVo Slide Remote, Linux and Scan Codes

jmk jmk at foofus.net
Fri Sep 3 18:11:45 UTC 2010


Hi Wayne,

On Fri, 2010-09-03 at 07:26 +0200, Wayne Thomas wrote:
> I recently added a patch to the hid-topseed driver to do exactly what
> you are trying to do (capture keys on a remote that weren't recognised
> out of the box).
> There is a good chance that your remote uses the same usage-page
> (0xffbc) as there have been a few appearing recently, you probably
> need to do exactly the same thing.  Use hexdump to view the output of
> a the hidraw device for couple of the non-working keys and I will see
> if you are in the same boat.

I've been reading from hidraw using a simple Perl script:

open(IN, "<", "/dev/hidraw5");
my($x);
while(1) {
  read(IN, $x, 1);
  my($hex);
  $hex = sprintf("%02x", ord($x));
  print "$hex";
}

Here's some of what I'm seeing:

SELECT: 0010410000100000001352
        0010410000100000001351
Left:   0010440000100000001351
Right:  0010450000100000001351
Up:     0010420000100000001352
Dn:     0010430000100000001352

ThumbDn: 001141001100001351
ThumbUp: 001142001100001352

1: 000100001e000000000000010000000000000000001351
2: 000100001f000000000000010000000000000000001351
3: 0001000020000000000000010000000000000000001351
4: 0001000021000000000000010000000000000000001352
5: 0001000022000000000000010000000000000000001352

The final byte appears to occasionally flip between 0x51 and 0x52. The
number of bytes sent also varies based on the key hit.

Are there any tricks to hexdump? "hexdump /dev/hidraw5" for two presses
of "5" returns:

0000000 0100 0000 001e 0000 0000 0100 0000 0000
0000010 0000 0000 1300 0052 0001 1e00 0000 0000

It appears to not be printing the entire code, only 16 bytes at a time.
Some of the byte pairs are also flipped and some are shuffled in a
nonsensical manner. For example, "0001" vs "0100" at the start of the
two responses for the "5" key (Perl method vs. hexdump).

How does one identify a device's usage page? "lsusb -vvv" doesn't give
me any usage page information for the Keypad interface. I started to
hack in some printk's in the hid code to print the value, but I don't
think I've gotten that correct yet.

Thanks,
Joe 







More information about the mythtv-users mailing list