2009年12月30日水曜日

lirc installation on ubuntu 9.10

Finally I was able to make my SONY remote-con and receiver to work on my Ubuntu 9.10.

Hardwares:
SONY VAIO GigaPocket Remote controller RM-GP3 and
SONY VAIO PCVA-IR3U Infrared Receiver

(1) Check whether you have lirc installed.


# dpkg -l | grep lirc
ii liblircclient0


Install lirc

# apt-get install lirc
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libftdi1 setserial
Suggested packages:
lirc-modules-source lirc-x
The following NEW packages will be installed:
libftdi1 lirc setserial
0 upgraded, 3 newly installed, 0 to remove and 164 not upgraded.
Need to get 576kB/628kB of archives.
After this operation, 2769kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://archive.ubuntu.com karmic/main libftdi1 0.16-2 [17.5kB]
Get:2 http://archive.ubuntu.com karmic/universe lirc 0.8.6-0ubuntu2 [559kB]
Fetched 576kB in 3s (157kB/s)
Preconfiguring packages ...
dpkg: warning: obsolete option '--print-installation-architecture', please use '--print-architecture' instead.
Selecting previously deselected package libftdi1.
(Reading database ... 120334 files and directories currently installed.)
Unpacking libftdi1 (from .../libftdi1_0.16-2_i386.deb) ...
Selecting previously deselected package setserial.
Unpacking setserial (from .../setserial_2.17-45_i386.deb) ...
Selecting previously deselected package lirc.
Unpacking lirc (from .../lirc_0.8.6-0ubuntu2_i386.deb) ...
Processing triggers for sreadahead ...
Processing triggers for man-db ...
Processing triggers for doc-base ...
Processing 25 changed 1 added doc-base file(s)...
Registering documents with scrollkeeper...
Processing triggers for hal ...
Regenerating hal fdi cache ...
hal start/running, process 7976
Setting up libftdi1 (0.16-2) ...

Setting up setserial (2.17-45) ...
dpkg: warning: obsolete option '--print-installation-architecture', please use '--print-architecture' instead.
removing the old setserial entry in the rcn.d directories
Update complete.
dpkg: warning: obsolete option '--print-installation-architecture', please use '--print-architecture' instead.
dpkg: warning: obsolete option '--print-installation-architecture', please use '--print-architecture' instead.
Saving state of known serial devices... backing up /var/lib/setserial/autoserial.conf done.

Setting up lirc (0.8.6-0ubuntu2) ...

<---- at this point the lirc configuration text-menu will appear
<---- I selected "custom" for remote control
<---- I selected "custom" for IR Receiver

Processing triggers for libc-bin ...
ldconfig deferred processing now taking place


After lirc was installed.

dpkg -l | grep lirc
ii liblircclient0
ii lirc


(2) Plug in the USB IR unit PCVA-IR3U

Before plug it in, use "dmesg -c" to flush the kernel ring buffer first

# dmesg -c
...
...
...


Plug in the USB IR then run "dmesg -c" again. This will only shows the new devices.

# dmesg -c
[13346.292093] usb 3-2: new low speed USB device using uhci_hcd and address 2
[13346.489338] usb 3-2: configuration #1 chosen from 1 choice
[13346.551449] input: Sony Corporation Sony IR Receiver as /devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.0/input/input13
[13346.551703] generic-usb 0003:054C:0063.0002: input,hiddev96,hidraw1: USB HID v1.10 Keyboard [Sony Corporation Sony IR Receiver] on usb-0000:00:1d.1-2/input0


(3) check whether /dev/usb/hiddev0 file was created. It should after USB IR was plugged in. If not, maybe try unplug/plug or restart lirc process, using "/etc/init.d/lirc restart" command.

(4) Edit /etc/lirc/hardware.conf file and update the following entries.

#Enable lircd
START_LIRCD="true"

#Chosen Remote Control
REMOTE="Sony USB IR Receiver - or whatever"
REMOTE_MODULES=""
REMOTE_DRIVER=""
REMOTE_DEVICE="/dev/usb/hiddev0"
REMOTE_LIRCD_CONF=""
REMOTE_LIRCD_ARGS=""


# sudo /etc/init.d/lirc start
...


Point RM-GP3 to the receiver and start pressing!

Sorry I will update on how to customize the keys soon...


END