[LINUX] Generic HID Remote Driver for XBMC (Drivers for XBMC on Linux and XBMC Live) - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111) +---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52) +---- Thread: [LINUX] Generic HID Remote Driver for XBMC (Drivers for XBMC on Linux and XBMC Live) (/showthread.php?tid=88560) |
- coldsource - 2011-01-23 Hello Cucurbitace, Could you try this : Quote:uname -a And post the results here please. Also could you tell me which distribution you use ? Thanks - Cucurbitace - 2011-01-23 Hi, thanks for trying to help. I'm using Ubuntu 10.10 (32 bits) Here are the results of the commands: uname -a Code: 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 Code: ATTRS{[color=#990000]manufacturer[/color]}=="Linux 2.6.35-24-generic uhci_hcd" udevadm info --attribute-walk --name=/dev/hidraw3 | grep product Code: ATTRS{[color=#990000]product[/color]}=="UHCI Host Controller" I hope you can get something out of this. - coldsource - 2011-01-23 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 : Quote:lsusb 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. - Cucurbitace - 2011-01-23 Here goes lsusb: Code: Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub I suppose we can tell it is Zydacron HID Remote Control we're talking about. And here is the full attribute one: Code: Udevadm info starts with the device specified by the devpath and then Thanks. - coldsource - 2011-01-24 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 : hid_mapper_beta.tar.gz 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 ! - Cucurbitace - 2011-01-24 Thanks for the work. I'm going to give it a try right now! - Diego2002 - 2011-01-25 Hi Bob/coldsource! 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: 00033002000104280004012000030000:KEY_F 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? Thx Diego - coldsource - 2011-01-26 Diego, 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 uinputAnd then relaunch hid_mapper. If none of these work, could you post the result of : Quote:ls -l /dev/uinput 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). Bob - Cucurbitace - 2011-01-26 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. Anyway, it didn't work. Here is the result of the command: ./hid_mapper --learn --lookup-id --manufacturer '13ec' --product '0006' Code: Found 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: Code: Section "InputClass" And it works, my computer doesn't get input from the remote anymore. But the command still gives the same error. - coldsource - 2011-01-26 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. - Cucurbitace - 2011-01-26 Yup, my bad, I used the command as a normal user. Thanks. I'll give a try again as soon as I have full access to the media center. - Diego2002 - 2011-01-26 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:modprobe uinputQuote:Returns nothing (no output, not errors) So the next try: Quote:ls -l /dev/uinputQuote:crw-r----- 1 root root 10, 223 2011-01-26 20:52 /dev/uinput Quote:dmesg | tailQuote:[ 1080.652048] usb 3-4: new low speed USB device using ohci_hcd and address 2 Quote:uname -aQuote: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 At this point the bash signal dissapears, I can press any button, and only Ctrl-C stops whatewer it does... - coldsource - 2011-01-27 Hi Diego, The main problem comes from the fact that uinput if not built in your kernel. After loading the module with: Quote:modprobe uinputuinput 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.mapproved 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. - Cucurbitace - 2011-01-27 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. - Cucurbitace - 2011-01-27 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: Code: 0100000000520000:KEY_UP 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 ? Thanks. |