Kodi Community Forum
[LINUX] HOW-TO get Hama MCE Remote Control to fully work in Ubuntu 9.04 - 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] HOW-TO get Hama MCE Remote Control to fully work in Ubuntu 9.04 (/showthread.php?tid=63152)

Pages: 1 2 3 4 5 6 7 8 9


- Juanjo - 2010-09-15

it seems the power key does not send a keyup code, so the program thinks its still pressed, there is probably a more elegant way to fix it, but since it is the only key i could find with that problem, i patched it here.

in file hama_mce.cpp, line 182:
if (repeat_fn != NULL && repeat_key != NULL)
change to
if (repeat_fn != NULL && repeat_key != NULL && repeat_key != "power")

still i have ditched this awesome tool, cos i quit xbmc and run tvtime for live tv, and this takes control over the remote, and it does not work with tvtime... im using a modified version of inputlirc guide also found in xbmc documentation now. only thing i cant make work is the mouse and diferentiating the right mouse button from the info button. the rest i mapped it all perfectly.

if/when i get another tv card ill surelly switch to tvheadend and definately go back to using hama_mce

Juanjo

---------
EDIT: I just downloaded the latest version, fyfe fixed the power button bug in the translation table


- Juanjo - 2010-09-15

@ fyfe:

i just noticed your new code which allows the keys to be remapped.

i have some programming skills, but most of what ive done, has been on windows.. i dont know a lot of linux insights, but is the code able (or maybe able, with a few mods) to work more alike lirc or make it to be able to send codes to other program other than xbmc ? i'd love to make this work with tvtime.
tv time uses an external program to send commands, and i am using irexec from lirc to make it work...

you think its possible to make this program work in a way similar as that ?

thanks in advance
Juanjo

EDIT: sorry for the repeated posting, hehe. my head is on a roll.
Ive tried to make the combo xbmc-tvtime work with this, but i had the problem that hama_mce keeps control of the 2 remote devices, so when i try to run inputlirc, it does not work, and if i kill hama_mce the devices are not restored, is there a way to gracefully end this program and release control over the devices so lircd can access them ? the devices disapear from the list when this program takes control..


- fyfe - 2010-09-15

hudo Wrote:fyfe,
2 points do:

- I noticed some sluggishness responding to key presses _sometimes_ Most of the time it works quite well. Aldo a tad slow for me... Smile
- Is there any particular reason buttons play and pause are mapped to the same event (pause)? Or it's my bad and remote.xml, keymap.xml, whatever.xml is to blame?

I get the sluggishness response sometimes as well, it's a problem with the remote hardware it can be a little inconsistent sending ir codes.

Play and pause both send the same code so there's no way to map them individually.

The problem with the power button getting stuck has been fixed in my code.


Juanjo,
I'll have a look at tvtime and see if it can be done.


- h.udo - 2010-09-15

Thanks for the prompt response, fyfe!

And thanks again for all your hard work!

hudo


- Juanjo - 2010-09-16

thanks fyfe, it would be very cool.
thanks for the work


EDIT: I just installed the latest v1.2 and the right click button is erratic. sometimes you get a emit_right_click, sometimes you get an info button, and sometimes you get nothing

i kinda found a way to recover the devices after hama_mce is killed, but it involves modprobe -r usbhid and modprobe usbhid again. but it needs sudo access, and i dont know how to make it work inside the X script that runXBMC generates. outside the X window i can make it work, bt inside X it asks for sudo password no matter what switch i use.. i need to figure this out, but having the functionality of :
IF is_running(XBMC)
send normal xbmc commands
else
send keystrokes
endif

would be awesome
thanks again fyfe!


- fyfe - 2010-09-16

Juanjo,
To fix your sudo problem edit the sudo config file:

$ sudo visudo

and add the following line

xbmc ALL = NOPASSWD: modprobe


- fyfe - 2010-09-16

Juanjo,
Ignore my last post try v1.3 instead. It releases the remote back to the system and recreates the missing devices when you exit hama_mce.


- Juanjo - 2010-09-16

AWESOME!

you are a genius, fyfe.
I just have 1 question, how do you gracefully exit hama_mce ?
or when it gets SIGKILL it exits and recreates the devices?

thanks a lot
Juanjo


- fyfe - 2010-09-16

Juanjo Wrote:AWESOME!

you are a genius, fyfe.
I just have 1 question, how do you gracefully exit hama_mce ?
or when it gets SIGKILL it exits and recreates the devices?

thanks a lot
Juanjo
It'll recreate the devices if you send it sigterm or sigint:

killall hama_mce
or
killall -s SIGINT hama_mce


- Juanjo - 2010-09-16

fyfe Wrote:It'll recreate the devices if you send it sigterm or sigint:

killall hama_mce
or
killall -s SIGINT hama_mce

Excelent, ill modify runXBMC to make it create a new script that kills hama_mce when xbmc exits and runs inputlirc for tvtime, and on exit tvtime, restart hama_mce before running xbmc again.

thanks a lot, fyfe, ill post results

Juanjo


- Juanjo - 2010-09-16

ok, i finally got it working, with a mix of modifying sudoers and the runXBMC launcher

it basicly does this:

runs hama_mce (i didnt install it, so it does not launch via udev)
runs xbmc

when xbmx exits (TV = yellow button)
kills hama_mce
service inputlirc restart (start should work since inputlircd dies when it looses control of hid device = when hama_mce is ran)
runs tvtime
on tvtime exit, the cycle begins again (i commenteed the touch command so the loop continues)

it works awesome. but the right button is still working partially, sometimes it sends an info command, and sometimes it detects ir correctly as a right click.

thanks fyfe, you rock. I will try now to reinstall dharma beta2, which made my remote stop working with inputlirc and thats why i wanted to start using hama_mce again.

Juanjo

EDIT:
I finally installed dharma beta2
everything runs perfect now, except for the randomness of the right click button!
thanks fyfe!


- Horscht - 2010-10-10

was anyone able to get the mousepad-thingy on the remote to work?

When I move the mouse with it, I don't see a mouse-pointer on the screen, but I see that I am actually highlighing stuff...


- Silence66 - 2010-11-01

thanks for your great script. compiled version 1.3 yesterday and everything works greatSmile i also tried version 1.4, but there i got a compile error of a missing directory


- fyfe - 2010-11-01

It's already fixed try v1.4.1


- Silence66 - 2010-11-02

thanksSmile will try it tomorrowSmile