• 1
  • 2(current)
  • 3
  • 4
  • 5
  • 13
[LINUX] Generic HID Remote Driver for XBMC (Drivers for XBMC on Linux and XBMC Live)
Hello Cucurbitace,

Could you try this :
Quote:uname -a
udevadm info --attribute-walk --name=/dev/hidraw3 | grep manufacturer
udevadm info --attribute-walk --name=/dev/hidraw3 | grep product

And post the results here please.

Also could you tell me which distribution you use ?

Hi, thanks for trying to help. Smile I'm using Ubuntu 10.10 (32 bits)

Here are the results of the commands:

uname -a
Linux ubuntu 2.6.35-24-generic #42-Ubuntu SMP Thu Dec 2 01:41:57 UTC 2010 i686 GNU/Linux

udevadm info --attribute-walk --name=/dev/hidraw3 | grep manufacturer
ATTRS{[color=#990000]manufacturer[/color]}=="Linux 2.6.35-24-generic uhci_hcd"

udevadm info --attribute-walk --name=/dev/hidraw3 | grep product
ATTRS{[color=#990000]product[/color]}=="UHCI Host Controller"

I hope you can get something out of this. Big Grin
Ok, it seems the problem is that your device is UHCI and not OHCI (had only tested on OHCI) and so does not report proper informations.

Could you try :

And a full attribute walk :
Quote:udevadm info --attribute-walk --name=/dev/hidraw3

Not sure but I think even so it will report a proper Vendor ID and Product ID. If it is the case I'll write a patch so you can select the proper device by specifying ID instead of names and it should work.
Here goes lsusb:
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 002: ID 045e:0084 Microsoft Corp. Basic Optical Mouse
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 003: ID 0603:00f2 Novatek Microelectronics Corp.
Bus 004 Device 002: ID 1131:1004 Integrated System Solution Corp. Bluetooth Device
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID 13ec:0006 Zydacron HID Remote Control
Bus 003 Device 002: ID 04a9:2206 Canon, Inc. CanoScan N650U/N656U
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 009: ID 152e:2507 LG (HLDS)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I suppose we can tell it is Zydacron HID Remote Control we're talking about.

And here is the full attribute one:
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0/0003:13EC:0006.0001/hidraw/hidraw3':

  looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0/0003:13EC:0006.0001':

  looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0':
    ATTRS{bAlternateSetting}==" 0"

  looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb3/3-2':
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{version}==" 1.10"

  looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb3':
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{version}==" 1.10"
    ATTRS{manufacturer}=="Linux 2.6.35-24-generic uhci_hcd"
    ATTRS{product}=="UHCI Host Controller"

  looking at parent device '/devices/pci0000:00/0000:00:1a.0':

  looking at parent device '/devices/pci0000:00':

Thanks for the informations Cucurbitace,

It is working as I suspected, that is it reports only numeric vendor and product name. I have written a patch that you can download here :


Using this patch you can now use numeric IDs :
Quote:./hid_mapper --list-devices --lookup-id

Based on lsusb I think it should work with something like this :
Quote:./hid_mapper --learn --lookup-id --manufacturer '13ec' --product '0006'

Hope it will work !
Thanks for the work. I'm going to give it a try right now!
Hi Bob/coldsource! Smile

I'm using the next Ubuntu distribution:
Distributor ID: Ubuntu
Description: Ubuntu 10.04.1 LTS - XBMCLive Dharma
Release: 10.04
Codename: lucid

I compiled the code successfully now (after deleting the three keys from keys_definition.cpp). After that - I had the same problem as Cucurbitace, I needed to use the beta version. Everything worked, I created a map file, only to test, with this content:

I tried to load this map, but I received this error:
Loaded map file test.map
Found HID device
Opened HID interface on /dev/hidraw0
Unable to setup event device

I have to admit, I skipped a step: to blacklist the device in Xorg, becasuse I thought it's not necessary with this distro.

Could be this the problem?

Should I make a try?


Could you confirm me that learn mode is working ?
Also check that you are runing hid_mapper as root, uinput won't be able to create device as non-root.

You can also check the properties on uinput file :
Quote:ls -l /dev/uinput

It is possible that your kernel doesn't have built-in uinput support, as root try
Quote:modprobe uinput
And then relaunch hid_mapper.

If none of these work, could you post the result of :
Quote:ls -l /dev/uinput
dmesg | tail
uname -a

Concerning Xorg blacklist, I don't think it could cause the error. It is just used to avoid double keys inputs (from Xorg and from the HID mapper).

Hi Coldsource,

sorry for the late reply, I could not get full access to the computer before, it's the media server of the flat and I had to wait for no one to use it. Wink

Anyway, it didn't work. Sad

Here is the result of the command:

./hid_mapper --learn --lookup-id --manufacturer '13ec' --product '0006'

Found HID device
Unable to open HID device

At first I thought that is might be because I didn't blacklisted the remote from X11. So I did create a 50-remote.conf in /usr/share/X11/xorg.conf.d like you explained at the beginning of this thread. Here it is:

Section "InputClass"
Identifier "Remote blacklist"
MatchProduct "0006"
Option "Ignore" "on"

And it works, my computer doesn't get input from the remote anymore. But the command still gives the same error.
Hi Cucurbitace,

Are you sure you are running hid_mapper as root ? Detection can be done as non-root but not mapping.

Try running it with a sudo it should work.
Yup, my bad, I used the command as a normal user. Blush Thanks. I'll give a try again as soon as I have full access to the media center.
Hi Coldsource/Bob!

Yes, I can confirm, that learn mode is working, because when I press a button, a lot of numbers appear.

I logged in as root also.

Quote:ls -l /dev/uinput
Quote:ls: cannot access /dev/uinput: No such file or directory

Quote:modprobe uinput
Quote:Returns nothing (no output, not errors)

So the next try:
Quote:ls -l /dev/uinput
Quote:crw-r----- 1 root root 10, 223 2011-01-26 20:52 /dev/uinput

Quote:dmesg | tail
Quote:[ 1080.652048] usb 3-4: new low speed USB device using ohci_hcd and address 2
[ 1080.868282] usb 3-4: configuration #1 chosen from 1 choice
[ 1080.878639] input: LITEON Technology USB Multimedia Keyboard as /devices/pci0000:00/0000:00:04.0/usb3/3-4/3-4:1.0/input/input8
[ 1080.878938] generic-usb 0003:046D:C313.0002: input,hidraw1: USB HID v1.10 Keyboard [LITEON Technology USB Multimedia Keyboard] on usb-0000:00:04.0-4/input0
[ 1080.891323] input: LITEON Technology USB Multimedia Keyboard as /devices/pci0000:00/0000:00:04.0/usb3/3-4/3-4:1.1/input/input9
[ 1080.891672] generic-usb 0003:046D:C313.0003: input,hidraw2: USB HID v1.10 Device [LITEON Technology USB Multimedia Keyboard] on usb-0000:00:04.0-4/input1
[ 1122.959639] input: Generic USB input mapper as /devices/virtual/input/input10
[ 1154.209722] input: Generic USB input mapper as /devices/virtual/input/input11
[ 1343.287807] input: Generic USB input mapper as /devices/virtual/input/input12
[ 1387.907595] usb 3-4: USB disconnect, address 2

Quote:uname -a
Quote:Linux XBMCLive 2.6.32-26-generic #48-Ubuntu SMP Wed Nov 24 09:00:03 UTC 2010 i686 GNU/Linux

I tried to run once more the command, but now the message is different:
Quote:Loaded map file test.map
Found HID device
Opened HID interface on /dev/hidraw0
Generic USB mapper driver setup

At this point the bash signal dissapears, I can press any button, and only Ctrl-C stops whatewer it does...
Hi Diego,

The main problem comes from the fact that uinput if not built in your kernel. After loading the module with:
Quote:modprobe uinput
uinput is loaded correctly since you can see the uinput main device in /dev/uinput as ls shows.
I think the last try was the good one because the last message of :
Quote:Loaded map file test.map
Found HID device
Opened HID interface on /dev/hidraw0
Generic USB mapper driver setup
proved hid_mapper started correctly.

At this point you should be able to press the remote button you mapped as 'KEY_F' and see a 'F' appear in any X application. If it does not work try blacklisting your remote from Xorg because it can cause confilcts to have both Xorg and hid_mapper listen to the same device.

Remember that hid_mapper must be running when you press the remote button for this to work (pressing CTRL C will quit hid_mapper). If it is working you can do the full mapping and start hid_mapper at boot by starting it in /etc/rc.local.
It is working ! Thanks a lot ! I still have to make a clean map file (5 keys are not recognized and I have to figure out how map all the others). But congratulations coldsource, nice piece of coding you've made. Big Grin
I was hoping to use this post to share my map file, but I found another problem:

Every key that use a value above 9 (A to E) is not recognized by the program.

Here is my actual zydacron.map:


So this keys don't work: BACKSPACE, RIGHT, 1 and 2. I've tried to capitalize, but it doesn't change anything.

coldsource, any idea where it can come from ? Confused

  • 1
  • 2(current)
  • 3
  • 4
  • 5
  • 13
Thread Rating:
  • 7 Vote(s) - 5 Average

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