loading

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.

About This Instructable

2,991views

27favorites

Bio: Systems Administrator and Software Programmer.
More by mirza irwan osman:Install Modem USB Device in Raspberry Pi Make the Volume Knob of Sound Blaster X-Fi Surround 5.1 Pro Sound Card Work in Raspberry Pi Create a Volume Control for USB Sound Card in Raspberry Pi 
Add instructable to: