Volumio – Audio Media Player – Remote Control

I have been using Volumio on Raspberry Pi since Volumio version Beta 1.1 and I am happy with it that I can play my FLACs and MP3s directly from my home Free4NAS server via SMB mounts.

With my recent home audio upgrades, I want to control Volumio with remote control so I look for that info on the web.

https://volumio.org/forum/how-installed-lirc-with-receiver-and-remote-volumio-t360.html
https://volumio.org/forum/using-remote-with-volumio-t1923.html

My MCE remote is Rosewill RRC-126: http://amzn.com/B003WM5J0O

Installing lirc package:

 > ssh pi@volumio
 (password is raspberry)
 > sudo apt-get update
 > sudo apt-get install lirc

Testing:

 > mode2 -d /dev/lirc0

Now, if you press any button on the remote, you should see a bunch of pulse/space messages.

Editing /etc/lirc/hardware.con:

 > sudo vi /etc/lirc/hardware.conf
 
 # /etc/lirc/hardware.conf
 #
 # Arguments which will be used when launching lircd
 LIRCD_ARGS="--uinput" 
 
 #Don't start lircmd even if there seems to be a good config file
 #START_LIRCMD=false
 
 #Don't start irexec, even if a good config file seems to exist.
 #START_IREXEC=false
 
 #Try to load appropriate kernel modules
 LOAD_MODULES=true
 
 # Run "lircd --driver=help" for a list of supported drivers.
 DRIVER="default"
 # usually /dev/lirc0 is the correct setting for systems using udev
 DEVICE="/dev/lirc0"
 MODULES="mceusb"
  
 # Default configuration files for your hardware if any
 LIRCD_CONF=""
 LIRCMD_CONF=""

Now we need to learn lirc with IR commands:
http://lirc-remotes.sourceforge.net/remotes-table.html

 > sudo /etc/init.d/lirc stop
 > irrecord -n -d /dev/lirc0 ~/lircd.conf

Now copy this newly created lircd.conf

 > sudo mv /etc/lirc/lircd.conf /etc/lirc/lircd.conf.orig
 > sudo mv ~/lircd.conf /etc/lirc/lircd.conf

(for my Rosewill MCE USB dongle remote, I am using mceusb.lircd.conf)

Now start lircd

 > sudo /etc/init.d/lirc start

Testing Config file:

 > irw

Creating .lircrc file:

 > vi /home/pi/.lircrc
begin
  remote = mceusb
  button = KEY_PAUSE
  prog   = irexec
  config = mpc toggle
end
begin
  remote = mceusb
  button = KEY_NEXT
  prog   = irexec
  config = mpc next;mpc play
end
begin
  remote = mceusb
  button = KEY_AGAIN
  prog   = irexec
  config = mpc prev;mpc play
end
begin
  remote = mceusb
  button = KEY_STOP
  prog   = irexec
  config = mpc stop
end
begin
  remote = mceusb
  button = KEY_PLAY
  prog   = irexec
  config = mpc play
end

Running irexec as a background process:

 > irexec -d

Adding irexec to rc.local to startup after every reboot:

 > sudo vi /etc/rc.local
 (add this before exit 0)
(sleep 3;
sudo -u pi irexec -d
)&

Reboot