User:Ned Scott/Sandbox

From Official Kodi Wiki
Jump to navigation Jump to search

Now we write a new rules file for udev:

nano /etc/udev/rules.d/10-irremote.rules

and put the following content in:

SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",ATTR{dev}=="13:68",SYMLINK="input/irremote0"
SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",ATTR{dev}=="13:69",SYMLINK="input/irremote1"

Note the numbers for idVendor and idProduct are the numbers we got from /proc/bus/input/devices.

Alternatively, you can avoid relying on specific minor numbers with:

KERNEL=="event*",SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",IMPORT{program}="input_id %p"
KERNEL=="event*",SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",ENV{ID_INPUT_KEYBOARD}=="1",SYMLINK="input/irremote0"
KERNEL=="event*",SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",ENV{ID_INPUT_MOUSE}=="1",SYMLINK="input/irremote1"

Note that without the KERNEL match irremote1 is attached to a device sometimes which seems to be an inappropriate ioctl device (no event but only mouse).

Now restart udev and trigger a new discovery:

restart udev #notice for Gentoo: rc-service udev restart
udevadm trigger

(Restarting udev is optional at least as of Ubuntu lucid, and likely others.)

Under /dev/input should now be two more symlinks: irremote0 and irremote1:

ls /dev/input