This is a short description on how to configure a remote control (in this case the simple Hardkernel remote) for use with Volumio on a C1 or a C1+.
Start with installing lirc
apt-get update
apt-get -y install liblircclient0
apt-get -y install lirc
Starting lirc will throw an error, because there is no valid lircd.conf yet and the hardware.conf is not set properly either.
We also need to configure the HK remote for Volumio.
Start with lircd.conf, replace the contents of /etc/lirc/lircd.conf with this
begin remote
name lircd.conf
bits 16
flags SPACE_ENC|CONST_LENGTH
eps 30
aeps 100
header 8964 4507
one 544 1692
zero 544 561
ptrail 544
pre_data_bits 16
pre_data 0x4DB2
gap 107872
toggle_bit_mask 0x0
begin codes
KEY_LEFT 0x9966
KEY_RIGHT 0x837C
KEY_UP 0x53AC
KEY_DOWN 0x4BB4
KEY_ENTER 0x738C
KEY_HOME 0x41BE
KEY_MUTE 0x11EE
KEY_MENU 0xA35C
KEY_BACK 0x59A6
KEY_VOLUMEDOWN 0x817E
KEY_VOLUMEUP 0x01FE
KEY_POWER 0x3BC4
end codes
end remote
Continue with the hardware configuration, replace the contents of /etc/lirc/hardware.conf with the following:
# /etc/lirc/hardware.conf
#
MODULES="meson-ir"
DRIVER="default"
DEVICE="/dev/lirc0"
LIRCD_CONF=""
LIRCD_ARGS="--uinput"
#Enable lircd
START_LIRCD="true"
#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD="false"
#Try to load appropriate kernel modules
LOAD_MODULES="true"
# Default configuration files for your hardware if any
LIRCMD_CONF=""
#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn't have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to "false"
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""
This completes the lirc configuration, next we configure the remote with actions for Volumio.
I implemented these basic buttons as an working example.
There are better ways of doing this, using more of the available irexec options.
POWER, starts a shutdown
MUTE, will pause or play (toggle)
HOME, stops and clears the playlist
UP, plays the next song
DOWN, plays the previous song
LEFT, will seek 1% backwards
RIGHT, will seek 1% forward
MENU, shuffles the playlist
BACK, will stop and restart the currrent song
VOL -, lowers volume 2 steps
VOL +, raises volume 2 steps
Create a file /etc/lirc/lircrc with the following contents.
[code]## irexec
begin irexec
begin
prog = irexec
button = KEY_POWER
config = shutdown -h -P now
repeat = 0
end
begin
prog = irexec
button = KEY_DOWN
config = mpc consume off;mpc prev
repeat = 0
end
begin
prog = irexec
button = KEY_UP
config = mpc:consume off;mpc next
repeat = 0
end
begin
prog = irexec
button = KEY_VOLUMEUP
config = mpc volume +2
repeat = 1
end
begin
prog = irexec
button = KEY_VOLUMEDOWN
config = mpc volume -2
repeat = 1
end
begin
prog = irexec
button = KEY_RIGHT
config = mpc toggle;mpc seek +1%;sleep 0.1;mpc toggle
repeat = 0
end
begin
prog = irexec
button = KEY_LEFT
config = mpc toggle;mpc seek -1%;sleep 0.1;mpc toggle
repeat = 0
end
begin
prog = irexec
button = KEY_MUTE
config = mpc toggle
repeat = 0
end
begin
prog = irexec
button = KEY_BACK
config = mpc stop;mpc play
repeat = 0
end
begin
prog = irexec
button = KEY_HOME
config = mpc stop;mpc clear
repeat = 0
end
begin
prog = irexec
button = KEY_MENU
config = mpc shuffle
repeat = 0
end
begin
prog = irexec
button = KEY_ENTER
config = mpc consume off;mpc play
repeat = 0
end
end irexec[/code]
All set, reboot and enjoy
Gé