XBMC Community Forum
[LINUX] Generic HID Remote Driver for XBMC (Drivers for XBMC on Linux and XBMC Live) - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: XBMC General Help and Support (/forumdisplay.php?fid=111)
+---- Forum: Linux and Live support (/forumdisplay.php?fid=52)
+---- Thread: [LINUX] Generic HID Remote Driver for XBMC (Drivers for XBMC on Linux and XBMC Live) (/showthread.php?tid=88560)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18


- Diego2002 - 2011-01-27 23:48

Hi Coldsource!

I tried this x11/xorg blacklisting, but in /usr/share/x11 there isn't such folder xorg.conf.d.

The situation anyway isn't changed, my custom map isn't recognized.

Slowly I give up, because I have only two buttons (Power off, and Win key), which aren't working on my remote, I try to live without these. Frown


- coldsource - 2011-01-28 11:50

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

My fault it was a bug in the code. I have updated the beta version to correct this. Try redownloading the archive to see if it works.


Still not detecting these keys - akr884 - 2011-01-28 12:47

coldsource Wrote:My fault it was a bug in the code. I have updated the beta version to correct this. Try redownloading the archive to see if it works.

First of all, thanks a lot for these drivers.
I just downloaded the beta version again and it has the same issue with not detecting keypresses that have letters (for me a - f).

edit: Updating the beta driver on my laptop didn't work (I use it for testing) but installing the beta cleanly on my Media Center PC worked.


- Cucurbitace - 2011-01-29 11:22

Hi,

Congratulations coldsource, the new beta is doing really good. Smile

Here is my map:
Code:
0100000000520000:KEY_UP
0100000000510000:KEY_DOWN
0100000000500000:KEY_LEFT
01000000004F0000:KEY_RIGHT
0100000000280000:KEY_ENTER
01000000002A0000:KEY_BACKSPACE
0400040000000000:KEY_C
0500200000000000:KEY_PREVIOUSSONG
0500010000000000:KEY_PLAYPAUSE
0500100000000000:KEY_NEXTSONG
0500080000000000:KEY_R
0500400000000000:KEY_STOP
0500040000000000:KEY_F
0501000000000000:KEY_KPPLUS
0502000000000000:KEY_KPMINUS
0401000000000000:KEY_HOME
0508000000000000:KEY_PAGEUP
0510000000000000:KEY_PAGEDOWN
0504000000000000:KEY_MUTE
0500020000000000:KEY_TAB
01000000001E0000:KEY_1
01000000001F0000:KEY_2
0100000000200000:KEY_3
0100000000210000:KEY_4
0100000000220000:KEY_5
0100000000230000:KEY_6
0100000000240000:KEY_7
0100000000250000:KEY_8
0100000000260000:KEY_9
0100000000270000:KEY_0
0602000000000000:KEY_S
0402000000000000:KEY_F11
0400200000000000:KEY_V
0408000000000000:KEY_F9
0410000000000000:KEY_F8
0420000000000000:KEY_F10
0480000000000000:KEY_F12

I add to edit keyboard.xml config from XBMC too in order to have all the keys working the way I wanted. Here are the changes:
Code:
<f12>XBMC.ActivateWindow(VideoLibrary,MovieTitles)</f12>
<f11>XBMC.ActivateWindow(VideoLibrary,TvShowTitles</f11>
<f10>XBMC.ActivateWindow(VideoLibrary,Plugins)</f10>
<f9>XBMC.ActivateWindow(MyMusic)</f9>
<f8>XBMC.ActivateWindow(Pictures)</f8>

At the moment I still run it manually, as soon as you think it's not a beta anymore, I'll install it properly.

Thanks again for the great work.


Buttons Sticking - akr884 - 2011-01-30 21:55

I've got a generic USB HID mce remote: 073a:2230 that has a mouse input pad.

The button presses that it sends is something like this for the mouse pad
020000xx

with the xx starting off as one thing and changing maybe 7 times before it sticks definitively (if I hold the button down).

Each direction has a unique pattern, but no matter which number I choose in the sequence as the Action capture to define the button in my .map file, the button sticks until I push another button.

It's not a deal-breaker, but I was wondering if there is a possible fix for this.

I tried to block out only the keyboard and not the mouse input in xorg, but I couldn't get that to work either.

It shows up as /dev/input/by-id/xxx/mouse
and
/dev/input/by-id/xxx/mouse-event-server - but this one is the only one that shows up on the event input query using cat.


- Grez - 2011-01-31 22:59

This is brilliant, thank you so much Coldsource, this driver/app has solved all my Remote niggles with my Jetway Mini-TOP.

The jetway has a built in IR that shows up as:

Found HID device at /dev/hidraw3
Manufacturer : Cy se̪http://www.ir
Product name : http://www.irfmedia.com UIR

Here's my map, I basically remapped most of the more useless buttons on the bundled remote into keys to do useful things in XBMC as follows:

Standby = L (next sub)
Close = Q (add to queue)
Magnifier = A (audio delay)
www = T (toggle subs)
Full Screen = Z (aspect ratio)
Desktop = O (codec info)
Mic OSD = C (context menu)
WindowToggle = I (info)

Code:
0000500000000000:KEY_LEFT
0000520000000000:KEY_UP
00004f0000000000:KEY_RIGHT
0000510000000000:KEY_DOWN
0000290000000000:KEY_BACKSPACE
0000280000000000:KEY_ENTER
02b4000000:KEY_R
02cd000000:KEY_P
02b3000000:KEY_F
02b6000000:KEY_COMMA
02b7000000:KEY_X
02b5000000:KEY_DOT
00004b0000000000:KEY_PAGEUP
00004e0000000000:KEY_PAGEDOWN
02e9000000:KEY_VOLUMEUP
02ea000000:KEY_VOLUMEDOWN
02e2000000:KEY_MUTE
04002b0000000000:KEY_I
0700310000000000:KEY_C
0224020000:KEY_BACK
0225020000:KEY_FORWARD
0400280000000000:KEY_Z
0800070000000000:KEY_O
0223020000:KEY_T
08002e0000000000:KEY_A
0382000000:KEY_L
04003d0000000000:KEY_Q
00004c0000000000:KEY_DELETEFILE
0100100000000000:KEY_AUDIO
0100080000000000:KEY_VIDEO
0c00280000000000:KEY_ESC

I then made my Harmony remote learn all these, mapped them to the right buttons on the Harmony and I can shove the useless bundled remote into a drawer. Big Grin


- coldsource - 2011-02-01 12:49

Hi everyone and thanks for the feedback.

Based on your results and on the tests I have made I think the beta version is now stable enough, so I have placed it as stable.

I'll post a startup script using upstart for those using ubuntu so you can cleanly start the mapper at boot time.


akr884 :
Some devices simulate multiple interfaces (for mouse and keyboard for example).
When you start the mapper, do you see multiple :
Quote:Opened HID interface on ...
And if it is the case could you post the output at startup.
If I understand your problem, the mapping works but the key repetition doesn't. Is it right? I'm not sure to understand what you would like to do.

Could you also post the exact model of your remote ?

Thanks everyone


- Shayan - 2011-02-02 01:58

Thanks for putting this together, it works great. It got me to register just to say thanks for putting this together.

However, there was one bug I ran into. When I do a ./hid_mapper --list-devices, I have 6 devices attached to my machine, the last 3 of them have the Manufacturer as unknown. So in this block of code

Code:
            if(get_file_contents(filename,buf,256)<0)
            {
                if(manufacturer==0)
                    printf("  Manufacturer : Unknown\n");
                else
                {
                    closedir(dh);
                    return -1;
                }

Even though it found my HID device earlier in its loop, the code still exits out with a -1 causing the program to say the HID device was not found.

I did a quick hack, which works for me. If it found some devices earlier, return 0 instead of -1, but I didn't go and check if that works if the valid HID device is after devices with an unknown manufacturer.

Here's my updated block of code

Code:
            if(get_file_contents(filename,buf,256)<0)
            {
                if(manufacturer==0)
                    printf("  Manufacturer : Unknown\n");
                else if(hid_device->num_interfaces>0) {
                    closedir(dh);
                    return 0;
                }
                else {
                    closedir(dh);
                    return -1;
                }
            }

Hope this helps.


- coldsource - 2011-02-02 10:42

Hi Shayan,

Shayan Wrote:However, there was one bug I ran into. When I do a ./hid_mapper --list-devices, I have 6 devices attached to my machine, the last 3 of them have the Manufacturer as unknown.

I think you could use the --lookup-id if some devices have unknown manufacturer or product name, it should do the trick.

Quote:./hid_mapper --list-devices --lookup-id



- UsagiYojimbo - 2011-02-02 13:29

Thanks for this driver!
It works with the IR receiver in my ModeCom FEEL 607 MediaCenter case. I will post the mappings for my remotes (i have 2 of them). Nerd