Hi,
I've a problem, xd.
I've a daemon (keysid,
http://keysid.sourceforge.net/) to read /dev/input/enventX to launch command/script when i use the correct key.
But If I use xbmc (without X, in raspberry pi with archlinux), xbmc "block" the input/event and I can't read the device.
I've tried to use triggerhappy,
https://github.com/wertarbyte/triggerhappy, even read the device with cat, cat /dev/input/event0 | hexdump -C. Always with the same results, I don't read anything if xbmc is running.
Could xbmc not capture all event?
Is there any other solution?
Thanks for everything
Hi,
I have exactly the same problem. Trying to use triggerhappy to catch event coming from FLIRC (emulated keyboard).
If i stop xbmc, everything works. If i start xbmc, it doesn't works anymore.
Code:
root@raspberrypi:~# cat /etc/debian_version
7.2
root@raspberrypi:~# dpkg -l | grep xbmc
ii xbmc 2:12.3-1 all XBMC Media Center (arch-independent data package)
ii xbmc-bin 2:12.3-1 armhf XBMC Media Center (binary data package)
root@raspberrypi:~# vcgencmd version
Feb 9 2014 22:37:28
Copyright (c) 2012 Broadcom
version b470eb8efd7b1419c9d4260ef748762ce9b0a23d (clean) (release)
Thanks
Found the reason, but not the solution.
XBMC use the EVIOCGRAB call to "grab" the device input:
Code:
/* grab device */
ret = ioctl(fd, EVIOCGRAB, 1);
if (ret && errno != EINVAL)
{
CLog::Log(LOGERROR, "CLinuxInputDevice: could not grab device: %s\n", m_fileName.c_str());
close(fd);
return false;
}
When the device is grabbed, the process has exclusive use of it.... sniff.
I tried to create 2 handlers "device/input", with udev, for the same device, but it doesn't work.
Here i am.
why don't you launch your prog from within xbmc(while its running)
You are right ! Thanks a lot. It's working like a charm now.
I made it like that:
- Harmony sends a key (whatever you want) to FLIRC
- FLIRC generate an F1/F2/F3/F4 keyboard key in XBMC (choose what you want too)
- XBMC execute a custom script based on that keys
The keymap.xml is the association keys/scripts:
Code:
vi /home/pi/.xbmc/userdata/keymaps/keymap.xml
<keymap>
<global>
<keyboard>
<f1 mod="ctrl">XBMC.RunScript(/home/pi/.xbmc/userdata/keymaps/mpd_stop.py)</f1>
<f2 mod="ctrl">XBMC.RunScript(/home/pi/.xbmc/userdata/keymaps/mpd_play.py)</f2>
<f3 mod="ctrl">XBMC.RunScript(/home/pi/.xbmc/userdata/keymaps/mpd_prev.py)</f3>
<f4 mod="ctrl">XBMC.RunScript(/home/pi/.xbmc/userdata/keymaps/mpd_next.py)</f4>
<f7 mod="ctrl">XBMC.RunScript(/home/pi/.xbmc/userdata/keymaps/mpd_pause.py)</f7>
</keyboard>
</global>
</keymap>
A custom example script:
Code:
cat /home/pi/.xbmc/userdata/keymaps/mpd_stop.py
#!/usr/bin/python
import os
os.system("mpc -h [email protected] stop >/dev/null")