• 1
  • 9
  • 10
  • 11
  • 12(current)
  • 13
[LINUX] Generic HID Remote Driver for XBMC (Drivers for XBMC on Linux and XBMC Live)
Bob,
Nice work. This make many of my old devices usable.

Had enough success I thought I'd try it on a device I'd given up on, Fisher Price Digital Studio. So far this maps all of the buttons but they repeat and the learn tool sees changes in the pen but I can't figure out how to map them. But the key presses for this thing has 4 more bytes. For the button presses the are all ff but for the mouse movements the numbers vary. I suppose those are to describe the movement of the pointer.

I'm hopeful you or someone else can point me in the right direction to being able to map the pen movements, too.

Here is map for the buttons
# Power Button

47100000000002ffffffff:KEY_W

# Print

47000000040002ffffffff:KEY_PRINT

# Home

47000004000002ffffffff:KEY_HOME

# White

47010000000002ffffffff:KEY_A

# Black

47000000000202ffffffff:KEY_B

# Brown

47000000020002ffffffff:KEY_C

# Purple

47000002000002ffffffff:KEY_D

# Blue

47000200000002ffffffff:KEY_E

# Green

47020000000002ffffffff:KEY_F

# Yellow

47000000000102ffffffff:KEY_G

# Orange

47000000010002ffffffff:KEY_H

# Red

47000100000002ffffffff:KEY_I

# Color Wheel

47000001000002ffffffff:KEY_J

# Landscape Picture

47000800000002ffffffff:KEY_K

# Stamp Tool

47080000000002ffffffff:KEY_L

# Paint Bucket Tool

47000000000402ffffffff:KEY_M

# Redo or goback?

47040000000002ffffffff:KEY_N

# Star Burst

47000000000802ffffffff:KEY_O

# Shooting Star

47000000080002ffffffff:KEY_P

# ABCD

47000008000002ffffffff:KEY_Q

# Pencil

47001000000002ffffffff:KEY_R

# Paint Brush

47000010000002ffffffff:KEY_S

# Spray Can

47000000100002ffffffff:KEY_T

# Eraser

47000000001002ffffffff:KEY_U

# Toggle button

47000000000003ffffffff:KEY_V

And here is a sample of the learn for the pen movements. 47 00 00 00 00 00 02 is when the pressure tip is not pressed and 47 00 00 00 00 00 00 is when it is pressed.

47 00 00 00 00 00 02 7c 02 a6 01
47 00 00 00 00 00 02 6d 02 a3 01
47 00 00 00 00 00 02 56 02 b0 01
47 00 00 00 00 00 02 49 02 b3 01
47 00 00 00 00 00 02 38 02 b8 01
47 00 00 00 00 00 02 29 02 c0 01
47 00 00 00 00 00 00 08 02 d0 01
47 00 00 00 00 00 00 de 01 e2 01
47 00 00 00 00 00 00 af 01 f0 01
47 00 00 00 00 00 00 87 01 f4 01
47 00 00 00 00 00 00 66 01 eb 01
47 00 00 00 00 00 00 54 01 d2 01
47 00 00 00 00 00 00 4e 01 ac 01
47 00 00 00 00 00 00 54 01 80 01
47 00 00 00 00 00 00 5b 01 55 01
47 00 00 00 00 00 00 6d 01 37 01
47 00 00 00 00 00 00 85 01 28 01
47 00 00 00 00 00 00 97 01 29 01

jason@jason-lenovo:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 018: ID 0813:1006 Mattel, Inc.
Bus 002 Device 016: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
Bus 002 Device 005: ID 04f2:b1c1 Chicony Electronics Co., Ltd

udevadm info --attribute-walk --name=/dev/hidraw0
looking at device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/0003:0813:1006.000F/hidraw/hidraw0':
KERNEL=="hidraw0"
SUBSYSTEM=="hidraw"
DRIVER==""

looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/0003:0813:1006.000F':
KERNELS=="0003:0813:1006.000F"
SUBSYSTEMS=="hid"
DRIVERS=="generic-usb"

looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0':
KERNELS=="2-1.2:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="usbhid"
ATTRS{bInterfaceNumber}=="00"
ATTRS{bAlternateSetting}==" 0"
ATTRS{bNumEndpoints}=="01"
ATTRS{bInterfaceClass}=="03"
ATTRS{bInterfaceSubClass}=="00"
ATTRS{bInterfaceProtocol}=="00"
ATTRS{supports_autosuspend}=="1"

looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2':
KERNELS=="2-1.2"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{configuration}==""
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bmAttributes}=="80"
ATTRS{bMaxPower}=="100mA"
ATTRS{urbnum}=="1472"
ATTRS{idVendor}=="0813"
ATTRS{idProduct}=="1006"
ATTRS{bcdDevice}=="0092"
ATTRS{bDeviceClass}=="00"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{bNumConfigurations}=="1"
ATTRS{bMaxPacketSize0}=="8"
ATTRS{speed}=="12"
ATTRS{busnum}=="2"
ATTRS{devnum}=="18"
ATTRS{devpath}=="1.2"
ATTRS{version}==" 2.00"
ATTRS{maxchild}=="0"
ATTRS{quirks}=="0x0"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{authorized}=="1"
ATTRS{manufacturer}=="Fisher-Price"
ATTRS{product}=="DACS"
ATTRS{serial}=="DACS0000001"

looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1':
KERNELS=="2-1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{configuration}==""
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bMaxPower}==" 0mA"
ATTRS{urbnum}=="475"
ATTRS{idVendor}=="8087"
ATTRS{idProduct}=="0020"
ATTRS{bcdDevice}=="0000"
ATTRS{bDeviceClass}=="09"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="01"
ATTRS{bNumConfigurations}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{speed}=="480"
ATTRS{busnum}=="2"
ATTRS{devnum}=="2"
ATTRS{devpath}=="1"
ATTRS{version}==" 2.00"
ATTRS{maxchild}=="8"
ATTRS{quirks}=="0x0"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{authorized}=="1"

looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2':
KERNELS=="usb2"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{configuration}==""
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bMaxPower}==" 0mA"
ATTRS{urbnum}=="31"
ATTRS{idVendor}=="1d6b"
ATTRS{idProduct}=="0002"
ATTRS{bcdDevice}=="0301"
ATTRS{bDeviceClass}=="09"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{bNumConfigurations}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{speed}=="480"
ATTRS{busnum}=="2"
ATTRS{devnum}=="1"
ATTRS{devpath}=="0"
ATTRS{version}==" 2.00"
ATTRS{maxchild}=="3"
ATTRS{quirks}=="0x0"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{authorized}=="1"
ATTRS{manufacturer}=="Linux 3.1.0-1-686-pae ehci_hcd"
ATTRS{product}=="EHCI Host Controller"
ATTRS{serial}=="0000:00:1d.0"
ATTRS{authorized_default}=="1"

looking at parent device '/devices/pci0000:00/0000:00:1d.0':
KERNELS=="0000:00:1d.0"
SUBSYSTEMS=="pci"
DRIVERS=="ehci_hcd"
ATTRS{vendor}=="0x8086"
ATTRS{device}=="0x3b34"
ATTRS{subsystem_vendor}=="0x17aa"
ATTRS{subsystem_device}=="0x38b8"
ATTRS{class}=="0x0c0320"
ATTRS{irq}=="23"
ATTRS{local_cpus}=="ffffffff"
ATTRS{local_cpulist}=="0-31"
ATTRS{dma_mask_bits}=="32"
ATTRS{consistent_dma_mask_bits}=="32"
ATTRS{enable}=="1"
ATTRS{broken_parity_status}=="0"
ATTRS{msi_bus}==""
ATTRS{companion}==""
ATTRS{uframe_periodic_max}=="100"

looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
Reply
has anyone got this working on xbmc eden (i'm running xbmcbuntu 11.10)? I'm not sure why its not working correctly. i disabled lirc in /etc/lirc/hardware.conf. It seems like most of the buttons work except for a few:

0300100000000000:KEY_F8
01000c0000000000:KEY_F9
0100100000000000:KEY_F10
0100080000000000:KEY_F11

It worked previously on my older version of xbmcbuntu (10.04 or 10.10)?
Reply
Hi,

I am having a prblem with hid_mapper and my MCE remote. For some reason one press on the arrow keys gives 4 (or even more) on my xbmcbuntu box. Blacklisting the remote is working just fine, so no problems there. All other keys are also working. The only problem is repeatition of the arrow keys.

I have added the following line to rc.local file:
Code:
hid_mapper --lookup-id --manufacturer '0755' --product '2626' --map '/etc/mce_remote.map' &

The content of my mce_remote.map is as follows:

Code:
http://paste.ubuntu.com/919643/


Blacklisting in /usr/share/X11/xorg.conf.d/50-remote.conf is active and working
Code:
ection "InputClass"
Identifier "Remote blacklist"
MatchProduct "www.irfmedia.com"
Option "Ignore" "on"
EndSection

I have also tried with and without --disable repeat option, yet the same results are shown; two presses: 4 repeats 00000 4 repeats

Any idea how to solve this ?? Could it be a bug in the code?
Please advise.
Reply
Lightbulb 
(2011-12-25, 01:22)dodddummy Wrote: 47 00 00 00 00 00 02 is when the pressure tip is not pressed and 47 00 00 00 00 00 00 is when it is pressed.

47 00 00 00 00 00 02 7c 02 a6 01
47 00 00 00 00 00 02 6d 02 a3 01
47 00 00 00 00 00 02 56 02 b0 01
47 00 00 00 00 00 02 49 02 b3 01
47 00 00 00 00 00 02 38 02 b8 01
47 00 00 00 00 00 02 29 02 c0 01
47 00 00 00 00 00 00 08 02 d0 01
47 00 00 00 00 00 00 de 01 e2 01
47 00 00 00 00 00 00 af 01 f0 01
47 00 00 00 00 00 00 87 01 f4 01
47 00 00 00 00 00 00 66 01 eb 01
47 00 00 00 00 00 00 54 01 d2 01
47 00 00 00 00 00 00 4e 01 ac 01
47 00 00 00 00 00 00 54 01 80 01
47 00 00 00 00 00 00 5b 01 55 01
47 00 00 00 00 00 00 6d 01 37 01
47 00 00 00 00 00 00 85 01 28 01
47 00 00 00 00 00 00 97 01 29 01

I think the last 4 bytes are co-ordinates, so you need something like the mouse mode.
Reply
Hi,
Thank for this great soft that enable me to configure this cheap remote controler : http://www.aliexpress.com/product-gs/492...alers.html
I write a Howto (in french) here : http://doc.ubuntu-fr.org/tutoriel/hid to configure it whith lirc.

Are you thinking of create a graphical interface to easily configure remote controlers ?
Reply
(2011-06-25, 21:01)oscargirao Wrote:
Grez Wrote:Hi coldsource, hope you can help. I just upgraded the OS on my Jetway mini-top from Ubuntu 10.10 to 11.04 and the hid_mapper has stopped working Sad

I tried recompiling the version that worked previously, and also downloaded the most recent tarball you posted in this thread and compiled that but neither seems to work.

The --list devices option works OK and seems to show the same results as it always did, but either trying to run the hid_mapper or to learn both come up with "Unable to find specified HID device".

Strangely, the only thing that does work is the very first version you posted in this thread, hid_mapper.tar.gz -- this finds the device fine and the remote starts to work, but not all of the buttons work properly in this version which is why I had moved to the hid_mapper_beta version a long time ago.
I have the same problem when I plug an external USB disk to my Jetway. If I remove the disk and start the htpc without it plugged and then plug the disk after the xbmc starts the remote works fine.
Any ideas?

oscargirao,

Did you ever find a fix for this. I'm having the exact same issue. I have to unplug my external USB drive on boot or the hid_mapper does not work. Anyone have any ideas?
Reply
Hi,

Thanks everyone for getting this project where it is now.
I have a 1241:e000 receiver with a separate MCE remote.
The remote is found but I seem to have an issue with learn mode.

starting hid_mapper, I get:
Opened HID interface on /dev/hidraw2
Opened HID interface on /dev/hidraw3

But none of the keys I press give any result.

Any ideas?
Reply
Hi,

I have the following remote control :

IRF Media RC6 Remote

This works great using the following map file

irfmedia-rc6.map

04003D0000000000:KEY_ESC
01000C0000000000:KEY_CAMERA
0400280000000000:KEY_ZOOM
038100000000:KEY_POWER
0100080000000000:KEY_VIDEO
0300170000000000:KEY_TV
0100040000000000:KEY_RADIO
0100100000000000:KEY_AUDIO
0300100000000000:KEY_DVD
0300050000000000:KEY_REWIND
02B700000000:KEY_STOP
02B300000000:KEY_FASTFORWARD
02B600000000:KEY_PREVIOUSSONG
02CD00000000:KEY_PLAYPAUSE
02B500000000:KEY_NEXTSONG
02E900000000:KEY_VOLUMEUP
02EA00000000:KEY_VOLUMEDOWN
02E200000000:KEY_MUTE
0800070000000000:KEY_COMPUTER
0C00280000000000:KEY_MEDIA
0000520000000000:KEY_UP
0000510000000000:KEY_DOWN
0000500000000000:KEY_LEFT
00004F0000000000:KEY_RIGHT
0000280000000000:KEY_ENTER
00002A0000000000:KEY_BACK
0000650000000000:KEY_INFO
022402000000:KEY_PREVIOUSSONG
022502000000:KEY_NEXTSONG
0000290000000000:KEY_CLEAR
00001E0000000000:KEY_NUMERIC_1
00001F0000000000:KEY_NUMERIC_2
0000200000000000:KEY_NUMERIC_3
0000210000000000:KEY_NUMERIC_4
0000220000000000:KEY_NUMERIC_5
0000230000000000:KEY_NUMERIC_6
0000240000000000:KEY_NUMERIC_7
0000250000000000:KEY_NUMERIC_8
0000260000000000:KEY_NUMERIC_9
0000270000000000:KEY_NUMERIC_0
0200250000000000:KEY_NUMERIC_STAR
0200200000000000:KEY_NUMERIC_POUND
00004B0000000000:KEY_CHANNELUP
00004E0000000000:KEY_CHANNELDOWN
0100150000000000:KEY_RED
022302000000:KEY_GREEN
028A01000000:KEY_YELLOW

and can be run using the following command
Code:
sudo ./hid_mapper --lookup-id  --manufacturer '0755' --product '2626' --map './irfmedia-rc6.map'

I have mapped the "close" button to "ESC" rather than "Close" as this is more useful when using the remote with Performous.
If you wish to map the button to "Close" just change the first line in the map file.

Cheers, Ian
Reply
I guess I only needed a restart because the other day I was routinely using the remote under xbmc thinking I was in XP Media Centre and it worked!
Basic functions work already without a map file so I'm chuffed!
Reply
Hi everyone, maybe you can help me with this problem i'm having, i configured my remote to wake up after sleep and setting the power button to KEY_POWER, that works fine.
the problem is that when i wake up my laptop from the remote button i get "Error reading HID event", but if wake it from the laptop power button it keeps working correctly. im using xubuntu 12.04.
thank you, this is a great script
Reply
Hello,

i used the mapper with success on an aureal (hid-aureal), unfortunately it breaks on newer libc
(2.13 vs 2.17) this is caused by the deprecated fd_set from select and now it's suggested
to use poll instead.

mind to change that for recent machines ? or maybe you did already and i just didn't see that ?
Reply
Hi,
I have hacked the driver to make it work in my HD-PLEX based HTPC.
It works pretty well under Lubuntu 12.10, with HID 1241:e000
Still XBMC doesn't follow my wishes for all keys, it looks like there's somewhere a key definition that is used,
and that differs from my rc6 remote control.

If you wish, I can upload the updated driver, just let me know how to upload a file in this forum.

Regards,
Claudio
Reply
This is the GIT link to the updated driver
https://github.com/Claudio-Sjo/HID_linux_xbmc_driver
Reply
Hi, I recently upgraded my HTPC and the button mapped to the escape key stopped working.

So I thought I'd try recompiling the code for the updated librarys. This caused the following error :

hid.c: In function ‘read_hid_event’:
hid.c:238:2: error: unknown type name ‘fd_set’
fd_set rfds;
^
make: *** [hid.o] Error 1

This was fixed by adding the line :

#include <sys/select.h>

to hid.c

Then I recieved the error :

Error loading map file
[ MapReader ] Unknown key name at line 1

this was fixed by changing

while(i<KEY_NAME_MAXLENGTH && ptr[i]!='\0' && ptr[i]!='\n' && ptr[i]!=' ')
key_name[i] = ptr[i++];

to

while(i<KEY_NAME_MAXLENGTH && ptr[i]!='\0' && ptr[i]!='\n' && ptr[i]!=' ')
{
key_name[i] = ptr[i];
i++;
}

for some reason i seems to be pre incremented instead of post incremented in the original code.

Now the code compiles and runs, but still the escape key does not work :-(

edit: found the problem. Upgrading the computer wiped out my "/usr/share/X11/xorg.conf.d/50-remote.conf" file. DOH!
Reply
Hi.
I'm trying to use this program with a capture card's IR control without success.
The card is a Prolink Pixelview MPEG 8000, I have the IR on my /proc/bus/input/devices, but hid_mapper cannot find it.
Is it possible to use the remote this way?
Reply
  • 1
  • 9
  • 10
  • 11
  • 12(current)
  • 13

Logout Mark Read Team Forum Stats Members Help
[LINUX] Generic HID Remote Driver for XBMC (Drivers for XBMC on Linux and XBMC Live)7