Introduction: Reuse Unwanted Infrared Remote Control to Use With XMMS2 Music Player

About: Systems Administrator and Software Programmer.

Introduction

It's a good idea to remote control XMMS2 media player via infrared for the same reason one does it with XBMC/KODI. I rummaged in my box of parts and found this infrared remote control of a Home Theatre DVD system which I threw away many years ago.

Scope

This instructable will show:

1. Install a LIRC client called lxmms2 whose job is to bind LIRC to XMMS2

2. Configure lxmms2 to listen for specific LIRC events and inform XMMS2 to respond accordingly

Target Reader

Anyone with a Raspberry Pi running Raspbian OS.

Step 1: Install XMMS2 Music Player

Complete the steps in "Play Music on Raspberry Pi Using XMMS2" instructable. Ensure that all the steps are successfully completed.

Step 2: Record and Map the Infrared Remote Control Unit With LIRC Daemon

Step 3: Install and Deploy Lxmms2 Package

Open terminal emulator in Raspberry Pi.
Install lxmms2 package

<p>sudo apt-get update</p>sudo apt-get install lxmms2
lxmms2 program requires XMMS2 server to be running in order to start.
XMMS2 server will auto start any script that is placed in ~/.config/xmms2/startup.d directory after it finishes loading.

Write a script to start lxmms2 in the backgound.

$vim ~/start_lxmms2.sh 

Place the script start_lxmms2.sh script in ~/.config/xmms2/startup.d directory

$cp ~/start_lxmms2.sh ~/.config/xmms2/startup.d/
<p>An illustration of my simple script is shown in the screenshot.</p>

Step 4: Bind LIRC Events With XMMS2 Events

Open terminal emulator in Raspberry Pi.

Disable the system lircrc configuration file

$cd /etc/lirc 

$mv lircrc lircrc.bk

Create a .lircrc configuration file in the home directory

$vi ~/.lircrc

Enter the necessary values that binds the LIRC events (eg. KEY_PLAY) to xmms2 events (eg. play). I have a screenshot of my .lircrc for illustration.

Step 5: Test

Reboot the Raspberry Pi

Point infrared remote control unit at the Raspberry Pi and press PLAY.

If nothing happens, it's time to debug.