Remote Roadie rroadied - Remote Roadie Daemon
This documentation describes the architecture of the Remote Roadie suite of libraries and scripts, as well as the use of specific scripts included in the suite (primarily the rroadied server daemon).
This suite of tools enables the user to manage their collection of mp3, or other digital music files, to be played with the Xmms (the X MultiMedia System) software and controlled via remote through Lirc (the Linux Infrared Remote Control).
rroadied is a server written in Perl which provides the backbone for interaction between lirc and Xmms. Like the xmms lirc plugin, rroadied provides a mechanism to play, pause, stop, skip, etc., but rroadied also enable the loading of predefined playlists based on numeric codes and powerful functions such as saying the current artists name and song title, an advance randomize which avoids playing the same artist back- to-back, and the ability to remove an unwanted song from your playlists.
Required third-party software include:
XMMS (http://www.xmms.org)
LIRC (http://www.lirc.org)
Xmms::Remote
(http://www.cpan.org/authors/id/DOUGM/Xmms-Perl-0.10.tar.gz)
(And I believe Xmms::Remote requires the Xmms source code,
not just an .rpm)
Optional third-party software:
IBM ViaVoice
(http://www-4.ibm.com/software/speech/enterprise/te_5.html)
These tools have been tested with Xmms 1.2.5, LIRC 0.6.3, and Xmms::Remote 0.10, but should work with most versions. Xmms::Remote can be easily installed via Perl's CPAN modules:
perl -MCPAN -e 'install Bundle::Xmms'
It is assumed that all of other third party tools have been installed. See the appropriate instructions for their installation and configuration. Unlike the Xmms LIRC plugin, ViaVoice works without problems under the Remote Roadie.
> perl Makefile.PL
> make
> make test
> make install
Edit your $HOME/.lircrc file to interface with rroadied. Take a look
at the sample lircrc file (which will be placed in
$HOME/.rroadie/samples) to see how I have set it up. It is fairly
similar to the setup for the xmms plugin if you are familiar with that. See
the Lirc documentation if needed.
Make sure you do not have you Xmms Lirc plugin activated.
Edit the $HOME/.rroadie/rroadie.conf file to reflect your setup.
**IMPORTANT**
Use the b<rrdbgen> tool to create your SONG_DB file automatically from the
playlists in (and recursively, under) your PLAYLISTDIR. Alternatively, you
can edit the SONG_DB file manually to associate your playlists with various
three digit numbers. For example, if you want to /home/dave/music/playlists
/party.m3u to be activated when you press 0-0-3 on the remote, include the
line '003 party' in the SONG_DB.
Make sure xmms is started and start rroadied.
> rroadied [-d[#]] [CONFIG-FILE]
The optional flags are:
-d[#] turns on debugging, the optional number following -d
indicates the debug level (defaults to 10)
CONFIG-FILE points to the configuration file to use (defaults to
$HOME/.rroadie/rroadie.conf)
All of the Remote Roadie scripts take the same command line flags.
Configuration of Remote Roadie is done via two interfaces. First the remote keys are configured with a standard LIRC .lircrc config file. List rroadie as the program token. Here are two example key definitions:
begin
prog = rroadie
remote = son-cable
button = CABLE_PLAY
config = PLAY
end
begin
prog = rroadie
remote = son-cable
button = CABLE_PAUSE
config = PAUSE
end
Read the LIRC documentation for more details. The rroadied script understand the following list of commands:
PLAY FUNC
STOP 0-9
PAUSE
NEXT
PREV
SHUFFLE
VOL_UP
VOL_DOWN
GET_SONG_LIST
GET_PLAY_LISTS
SET_PLAY_LIST[#]
GET_PL_POS
SET_PL_POS[#]
The PLAY through SHUFFLE commands will respond as expected. The GET_SONG_LIST through SET_PL_POS commands are used by the web/cgi interface. And, the FUNC and numeric commands are detailed below.
In its default configuration, rroadied will interpret any series of three digits as an key to the a playlist listed in the song database file. For example, assuming your song database (SONG_DB) includes:
001 general
002 irish
003 jazz
004 classical
005 dinner
006 love
007 new
Pressing 0-0-5 will say ``Que dinner'' and load the playlist PLAYLIST_DIR/dinner.m3u
A five second pause will reset the input (i.e. pressing 0-2 pausing for five seconds and then 0-0-2 will load the PLAYLIST_DIR/irish.m3u playlist).
The locations of the PLAYLIST_DIR and SONG_DB, as well as several other options, must be configured in the $HOME/.rroadie/rroadie.conf file.
The FUNC command provides additional functionality by pressing the FUNC key followed by a single digit:
FUNC-1 Advanced Randomize (Don't play the
same artist within 10 songs)
FUNC-2 Sort
FUNC-4 Say Artist and Song Title
FUNC-7 Add song to pro list
FUNC-8 Add song to con list
FUNC-0 Add song to remove list
The pro/con list will be used in Advance Randomize in future versions to increase or decrease (respectively) the likelihood of a song being played. The remove list is used by the rrdelete script to remove unwanted songs from your playlists (not from your hard drive).
Before executing rroadied, edit configuration information in the $HOME/.rroadie/rroadie.conf file. The advance randomize functions assume that your music is stored in the directory hierarchy ARTIST_NAME/ALBUM/ songs, and will not work correctly if they are not organized as such ( future releases may support examining the ID3 tags in addition). Most other feature should work regardless of your music locations.
In order to interface with Xmms, rroadied should be run by the same user who runs Xmms and left running while IR commands are expected. It can be run in the background, or left in the foreground to view debugging information. When run, rroadied will connect to the LIRC socket and watch for any commands which prog token ``rroadie''. It will also listen to a socket on port 12001 which is used by rrclient to give primitive shell access to rrclient and rrcgi which provides web/cgi access.
Foreground:
> xmms &
> rroadied [-d[#]] [CONFIG-FILE]
Background:
> xmms >& /dev/null &; rroadie >& /dev/null &
The optional flags are:
-d[#] turns on debugging, the optional number following -d
indicates the debug level (defaults to 10)
CONFIG-FILE points to the configuration file to use (defaults to
$HOME/.rroadie/rroadie.conf)
Please do not distribute this package without my prior consent. By using these scripts you agree to take all responsibility for any problems which occur including, but not limited to, any unexpected data loss.
There are many items on the TODO list which are not list here, but here is a brief list of the most signficant items:
The Xmms::Remote and Bundle::Xmms modules, Lirc::Client module and the Xmms man page.
Updated last on $Date: 2003/07/15 00:07:54 $. Copyright 2001 and 2002 by Mark V. Grimes. Expected to be release under the GPL. Parts of these programs have been inspired by other software packages comments in each script gives credit to those who deserve it. Much of this POD is plagiarized from the XMMS LIRC plugin documentation.
Mark V. Grimes (mgrimes <at> alumni <dot> duke <dot> edu)