Kodi Community Forum

Full Version: [LINUX] Generic HID Remote Driver for XBMC (Drivers for XBMC on Linux and XBMC Live)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13
The blacklisting is only needed to block the key presses from your remote to the X server. If you have working buttons and you are satisfied with them you don't need to block it. And it won't be a problem if you have two devices which for example can send an 'F1' key press to the X server. You won't be using the two at the same time (I assume), so the X server will only know that the key press was an 'F1', it doesn't care about whom send it.

At least this is how I see, and I couldn't even map my HID device with hid_mapper yet. : ) However, blacklisting is a must for me, because my remote switches to tty2-4 with some key presses, and sends combinations like 'CTRL+ALT+SHIFT+F+F1+DEL+:D' and stuff to the X server.
UsagiYojimbo Wrote:I do not really understand why do you need hid_mapper, again?
If your HID device produces an event device (as mentioned above) X already uses it. You should be able to configure button-presses to key (or mouse) events in Xkbd...
Or you could use LiRC with driver devinput,too...

Also, my remote only produces stupid key presses (control shift ?) and is a PITA to set up in keymap.xml.

It would be much easier for me to be able to assign 'normal' keyboard keys to each button on the remote and use the default xbmc keymap - for example backspace for back, esc for home, c for contextual menu…

But to do this I need to get the blacklist to work…

Getting a fully working remote is the bane of my xbmc life - I would just buy a MCE2 remote, but it is impossible to find one where I live (France). If anyone has any ideas, please share!

Thanks!
Hi ximon,

Which distribution are you using ? MatchUSBID is refered in xorg.conf manual so it should work.

Anyway have you tried :
Quote:MatchVendor "HOLTEK"

I think it could work.
coldsource Wrote:Hi ximon,

Which distribution are you using ? MatchUSBID is refered in xorg.conf manual so it should work.

Anyway have you tried :


I think it could work.

I'm using XBMCLive Dharma. Tried "MatchVendor "HOLTEK"" and success!

Thanks so much for your help, and of course for the HID Mapper. Laugh
Mindzai Wrote:Hi coldsource

I'm having an issue with (I think) key up codes not being recognised for my remote. Learn mode worked fine and I made a map, I can start the driver but as soon as I press a button not much else works, it's as if the remote locks up.

I see that my remote is not sending 0 for a key up code in some cases, is this the issue? If so is there anything that can be done to correct it?

The remote seems to consist of 2 HID devices if that makes any difference.

Here is my key map, the commented code is the key up code for the associated key down code:

Code:
# Home
00040100:KEY_HOME
# 00 04 00 00

# Power
000202:KEY_POWER
# 00 02 00

# Red
00048000:KEY_RED
# 00 04 00 00

# Green
00040800:KEY_GREEN
# 00 04 00 00

# Yellow
00041000:KEY_YELLOW
# 00 04 00 00

# Blue
00042000:KEY_BLUE
# 00 04 00 00

# Live TV
00040200:KEY_TV
# 00 04 00 00

# Record
0003800000:KEY_RECORD
# 00 03 00 00 00

# Radio
0003040000:KEY_RADIO
# 00 03 00 00 00

# SAP
00040010:KEY_FAVORITES
# 00 04 00 00

# Teletext
00040020:KEY_TEXT
# 00 04 00 00

# Last Channel
00040040:KEY_LAST
# 00 04 00 00

# Subtitle
00040008:KEY_SUBTITLE
# 00 04 00 00

# Language
00040002:KEY_LANGUAGE
# 00 04 00 00

# Angle
00040002:KEY_ANGLE
# 00 04 00 00

# Back
0003000400:KEY_BACKSPACE
# 00 03 00 00 00

# Info
0003000002:KEY_INFO
# 00 03 00 00 00

# DVD Menu
00040004:KEY_MENU
# 00 04 00 00

# Volume Up
0003200000:KEY_VOLUMEUP
# 00 03 00 00 00

# Voulume Down
0003400000:KEY_VOLUMEDOWN
# 00 03 00 00 00

# Mute
0003100000:KEY_MUTE
# 00 03 00 00 00

# Channel/Page Up
0003000100:KEY_CHANNELUP
# 00 03 00 00 00

# Channel/Page Down
0003000200:KEY_CHANNELDOWN
# 00 03 00 00 00

# Up
0000520000000000:KEY_UP
# 00 00 00 00 00 00 00 00

# Down
0000510000000000:KEY_DOWN
# 00 00 00 00 00 00 00 00

# Left
0000500000000000:KEY_LEFT
# 00 00 00 00 00 00 00 00

# Right
00004f0000000000:KEY_RIGHT
# 00 00 00 00 00 00 00 00

# OK
0000280000000000:KEY_OK
# 00 00 00 00 00 00 00 00

# Play
0003000040:KEY_PLAY
# 00 03 00 00 00

# Pause
0003000080:KEY_PAUSE
# 00 03 00 00 00

# Reverse
0003000040:KEY_REWIND
# 00 03 00 00 00

# Forward
0003000008:KEY_FASTFORWARD
# 00 03 00 00 00

# Skip Backwards
0003020000:KEY_PREVIOUSSONG
# 00 03 00 00 00

# Skip Forward
0003010000:KEY_NEXTSONG
# 00 03 00 00 00

# Stop
0003001000:KEY_STOP
# 00 03 00 00 00

# 1
00001e0000000000:KEY_NUMERIC_1
# 00 00 00 00 00 00 00 00

# 2
00001f0000000000:KEY_NUMERIC_2
# 00 00 00 00 00 00 00 00

# 3
0000200000000000:KEY_NUMERIC_3
# 00 00 00 00 00 00 00 00

# 4
0000210000000000:KEY_NUMERIC_4
# 00 00 00 00 00 00 00 00

# 5
0000220000000000:KEY_NUMERIC_5
# 00 00 00 00 00 00 00 00

# 6
0000230000000000:KEY_NUMERIC_6
# 00 00 00 00 00 00 00 00

# 7
0000240000000000:KEY_NUMERIC_7
# 00 00 00 00 00 00 00 00

# 8
0000250000000000:KEY_NUMERIC_8
# 00 00 00 00 00 00 00 00

# 9
0000260000000000:KEY_NUMERIC_9
# 00 00 00 00 00 00 00 00

# 0
0000270000000000:KEY_NUMERIC_0
# 00 00 00 00 00 00 00 00

# Clear
00004c0000000000:KEY_CLEAR
# 00 00 00 00 00 00 00 00

# Enter
0000280000000000:KEY_ENTER
# 00 00 00 00 00 00 00 00

I'm still having no luck with this. I tried a different remote and that does the same. I notice that hid_mapper is exiting saying "Segmentation fault". It can't be an issue with the hardware because the second remote worked fine when I tested it at work (Ubuntu 10.10), but on my Live machine it breaks. Is there anything I can do to debug this?

Here is the output from the command:

Code:
karl@mediacenter:~/hid_mapper_beta$ sudo ./hid_mapper --lookup-id --manufacturer '046e' --product '5577' --map emprex.map
Loaded map file emprex.map
Found HID device
Opened HID interface on /dev/hidraw0
Opened HID interface on /dev/hidraw1
Generic USB mapper driver setup
Segmentation fault
Mindzai Wrote:I'm still having no luck with this. I tried a different remote and that does the same. I notice that hid_mapper is exiting saying "Segmentation fault". It can't be an issue with the hardware because the second remote worked fine when I tested it at work (Ubuntu 10.10), but on my Live machine it breaks. Is there anything I can do to debug this?

Hi Mindzai the segfault was a bug in the beta version. I've updated it :
hid_mapper_beta.tar.gz

This should solve your problems.
Hi coldsource,

Thanks, that's working perfectly. Finally a solution for getting my IR and RF remotes working! I've only ever had a few buttons working before, this is great! Thanks for providing this driver. I really think it should be incorporated into XBMC Live. I'm sure it would be trivial to write an addon which can generate map files.
Any ideas on problem mentioned previously? hoyanf back here had the same problem. Sorry to bring this up coldsource, but maybe these just slipped your attention.

What could be the problem? :/ Could that be an issue that my input.h missing a few keys? Invalid mapping file format? (Although, hid_mapper reported that it "Loaded map file /path/to/mapfile".)
Hi Psycho_Dad,

Sorry I had completely forgotten your previous post. Your problem might come from several things, I've noticed that some uinput files are not located the same way on ubuntu and debian.

I've updated beta version : hid_mapper_beta.tar.gz

This version should correct the errors in keys_definition.cpp so you should not have to edit this file anymore. It also checks several locations for uinput files which could be your problem. Don't forget to run modprobe uinput as debian kernel doesn't have built in support for uinput.

Let me know if it works
Does anyone has ideas for using the VFD of that same device? Eek
Hi everyone,

I've switched the current beta version to stable and uploaded the new beta version :
hid_mapper_beta.tar.gz

Improvements are :
  • Mouse Clicks :You can now use mouse clicks by setting BTN_LEFT, BTN_MIDDLE or BTN_RIGHT in the keyboard mapping. Remember not to place it in the mouse map or it will not work. The reason for this is that uinput treats mouse buttons as keyboard input.

  • CORE::LAST_KEY : This special keyboard event repeats the last pressed key (or button) whatever it is. This should make UsagiYojimbo's remote to work with key repetition

Here is a sample file that uses both new mappings :
Quote:0000050000000000:KEY_Z
2000000000000000:BTN_LEFT
0200000000000000:BTN_RIGHT
0000450000000000:CORE::LAST_KEY

I'm waiting for your feedback
Hi, I upgraded to the latest stable version since a lot of my keys weren't working (all the keys with 'short' codes, ie. 00040100), but now I can't get hid_mapper to run:

Code:
root@XBMCLive:~/hid_mapper# ./hid_mapper --lookup-id --manufacturer '1241' --product 'e000' --map 'SL-6399.map'
Error loading map file
[ MapReader ] Unknown key name at line 46

Any ideas? I'm using the same .map file that loaded fine with an older version…
Hi ximon,

Could you post the line that is not recognized as well as your linux distribution ?
Edit : can you post the whole file so I can test everything at once.

Thanks
I got it sorted, tried to post straight back but the forum seems a little flakey tonight…

My .map had a 'KEY_IO:' in it that was causing trouble, got rid of it and hid_mapper runs.

It's still not picking up a lot of buttons though, all the buttons that generate long codes in 'learn' mode work, like 'Select' for instance:
Code:
Opened HID interface on /dev/hidraw1
00 00 28 00 00 00 00 00
00 00 00 00 00 00 00 00

But all the buttons that generate shorter code pairs don't seem to work, like 'Start':
Code:
Opened HID interface on /dev/hidraw1
00 04 01 00
00 04 00 00

I don't know what I'm missing, any ideas?

Cheers!
Quite strange cause my remote also sends short and long codes and both are working.
Could you post the whole file I'll test it at home, it might be a problem with the key lookup that trigger only with special mappings.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13