[LINUX] Lirc and Apple Remote long press hack
#31
I have edited the first post. Rebuilt my htpc and teknos method is much simpler! Thanks tekno
Reply
#32
atvclient working with apple ir receiver 820-1947-a using git://github.com/janisc/atvclient.git under xbmcbuntu
Reply
#33
The only think I dislike about atvclient is that it uses a lot of cpu (5-8% on my htpc), even when it is doing nothing..
That said, I'm sick of fighting lirc, kernel modules, usbhid just to get my remote to work.. so the alternative is days of pain.. I'll setlle for 5-8% cpu. I might take a look at the atv source code at some point to see why its a cpu hog.
Reply
#34
@Julian.neil

I've followed your and @Desensitized threads to try and get my apple remote (A1294) working. I'm setting this up in a i5 Intel NUC. I had to follow this guide to get the IR sensor to pick up the remote in OpenElec.

I've got the remote working and the lircmangled script seems to be running but long button presses do not work. Looking at the keymap.xml, when in fullscreen video, the menu button is meant to act as a stop button. In my case, it does not stop the video but brings up the list menu where i started the show from.

My feeling is that the guide I had to use here (http://openelec.tv/forum/103-infared-rem...ilt-and-ir)

Can you give me some direction to help me get this to work. I'm so close but I think I'm missing something basic here.

Will appreciate any help you can swing my way.
Reply
#35
(2014-05-01, 23:23)Zieseniss Wrote: I've followed your and @Desensitized threads to try and get my apple remote (A1294) working. I'm setting this up in a i5 Intel NUC. I had to follow this guide to get the IR sensor to pick up the remote in OpenElec.
I'm not sure how it all hangs toegether under OpenElec. Last time I looked at openelec it used eventlircd in front of lircd, and this interfered with my socket wrapper.
Also.. you're using a NUC. Not having a NUC, I'm not sure how you configure it to detect apple remote IR.
Quote:I've got the remote working and the lircmangled script seems to be running but long button presses do not work. Looking at the keymap.xml, when in fullscreen video, the menu button is meant to act as a stop button. In my case, it does not stop the video but brings up the list menu where i started the show from.
It doesn't sound to me like xbmc is getting the output from lircmangled. Are you sure its coming through that way. Turn debugging on in xbmc and take a look in your log.
Quote:My feeling is that the guide I had to use here (http://openelec.tv/forum/103-infared-rem...ilt-and-ir)
This guide sets up the apple remote as a keyboard and uses keypresses for remote buttons.
On apple hardware, newer linux installs detect apple remote automatically and dispense with lirc altogether. The apple remote is detected as a usbhid device and interpreted as a keyboard. This also bypasses ir-keytable.. I'm yet to work out how to map the button presses to kepresses properly, or how to disable the IR device detection as a keyboard so I can use it with lirc. I installed atvclient instead as a workaround. this wont work for you, because you're not using apple hardware.
Quote:Can you give me some direction to help me get this to work. I'm so close but I think I'm missing something basic here.
Will appreciate any help you can swing my way.
I'd like to help, but cant really assist with openelec and NUC. The lircmangled should still work if you interpose it between lirc and xbmc, but I dont know how to do that on your sysyem.
The apple remote is ok, but I only used it because I had an old macbook lying around that I wanted to use as my media centre, and I think its the only IR remote that works with apple hardware. If I were setting up a NUC system, I'd probably go with something else.
If you pastebin an xbmc log with some button presses I might be able to point you in the right direction.
Reply
#36
@Julian.neil

You are right, it actually doesn't use lirc at all which is why nothing is working. It just links the remote presses to keyboard.xml. I edited the keyboard.xml file and it works to a point.

For example. I mapped <menu>BACK<menu> which now now makes the menu button act like the backspace button on a keyboard but when in the episode list of a tv show and I press menu, it takes me all the way back to the Home menu and not to the show list as it should. If I do the same with backspace, it works correctly. It's very weird.

edit:

OK, further testing shows thats when I press menu, the system is registering menu button down and menu button press up as the same thing. So everytime I press menu, I'm sending it twice to XBMC:

# ir-keytable -s rc0 -p NEC -t
Protocols changed to NEC
Testing events. Please, press CTRL-C to abort.
1399716305.965059: event MSC: scancode = 77e1406a
1399716305.965059: event key down: KEY_MENU (0x008b)
1399716305.965059: event sync
1399716306.214079: event key up: KEY_MENU (0x008b)
1399716306.214079: event sync

irw returns:

HTPC:~ # irw
8b 0 KEY_MENU devinput
8b 0 KEY_MENU_UP devinput

So basically, the remote works and it's probably set up correctly in the keyboard.xml file too, but because it's sending the command twice with every button press, it does everything twice ie: just 2 menus back instead of one.

Any idea's how to fix this so that it registers on button down or button up as the button press?
Reply
#37
Zieseniss:

You need to do some searching on kernel IR. Looks to me like you dont need lirc for your hardware. Try turning lirc off and see what happens.
You can remap the remote's buttons to keypresses using ir-keytable.. but I dont know how it is done.
Reply
#38
I was looking for something else and came across this thread, reantly updated, and with my own post, and thought this may be of interest as it allows the Apple IR receiver to be used with other NEC protocol remotes! Yea Baby!

http://forum.osmc.tv/showthread.php?tid=14293

If you go to page 5 of that thread, you will find the repo

I have this now running on two Apple TV 1s (crystalbuntu), 2 copies of Ubuntu Linux x86-32, and one copy Ubuntu Linux x86-64
Reply
#39
(2014-04-24, 01:08)joiegils Wrote: atvclient working with apple ir receiver 820-1947-a using git://github.com/janisc/atvclient.git under xbmcbuntu
I just installed Xbmcbuntu (Gotham) to a Mac mini 2006 (with upgraded cpu to 64bit core2duo) which is using 820-1947. I can confirm the forked atvclient indeed does work and the original did not.
Reply
#40
and you're right Soli, that works perfect but i notice same behaviour as i did with openelec (maybe it's also using atvclient):

if i pair the remote (hold menu and right), it says it's paired and still works, but all long presses stopped working
un-pair it again (hold menu and left) - it says un-paired and long presses are back to working, any ideas how to fix this?

-Deco
Reply
#41
Just checked on this thread randomly. I didn't even remember that I had posted here 4 months..so it's kinda neat that you just replied today.
If Openelec supports Apple Remote with long keypresses then chances are it's indeed using atvclient. I have the same problem, and just for the sake of it I also tried to build Kraqh3d's fork which recently incorporated the 820-1947 fix. It might be specific for 64bit builds as I do get some warnings when building. I've asked Kraqh3d about it.
Reply
#42
will it work with Kodi ?
Reply
#43
Hi julian.neil,

Your post is very valuable. But I would like to get a simpler explanation of what the above Python script does. As I understood, you connect to the LIRC socket and catch the signals of key presses and send them to a proxy? This proxy story I can't understand. What does it do? How lirc.xml, keyboard.xml come into play here?
Reply
#44
Hey Mr T.

The script listens to the output from lirc, interprets repeat lirc events as long presses and spews out lirc compatable output on another socket..
Xbmc (or kodi now) listens to this other socket instead of the standard lirc socket. xbmc can be configured to interpret the lirc signals via the xbmc configuration files. Best to read xbmc documentation form more info on that.. I'm not even sure what the current config files look like.

That said, I wrote this as a workaround 4 years ago. I'm sure it can work with kodi, but I haven't tried. Since the release of ubuntu 14.04 I've been using atvclient instead, although I did have to fiddle with libusb to get it to work without chewing up cpu cycles.
Reply

Logout Mark Read Team Forum Stats Members Help
[LINUX] Lirc and Apple Remote long press hack1