Soundstation: 3 - Jukebox music setup
So, it looks like everything is working as it should - time to start feeding the machine with some CDs!
3a - Eject!
The first basic thing I want to have is to be able to eject the CD-tray using the remote.
- I created therefore the file ~/.lircrc and inserted the lines...
begin prog = irexec button = Go config = /home/shared/scripts/move_cdtray & end
- ...and in the script itself I wrote just this:
#![=/=]bin/sh eject -T;
- Restart now lircd with...
/etc/init.d/lircd restart
3b - Feed it
Now that we can insert and eject CDs, we're ready to rip songs off the CDs.
- The first thing I do is to set ~/.lircrc - I therefore inserted the following instructions:
begin prog = irexec button = Record config = /home/shared/scripts/rip_cd_trigger & end
- The contents of /home/shared/scripts/rip_cd_trigger are:
cd /home/media/music xterm -e "/home/shared/scripts/rip_cd_body";
- Make sure that you have a directory called /home/media/music, or whichever directory you want to use, and that it has plenty of free space.
- In the script /home/shared/scripts/rip_cd_body I wrote:
#The small -t argument will retract the CD-tray if it's out, but only if the CD-player supports it - try this out before activating it in the script - in my case I had to shutdown the PC completely to recover from this command. #eject -t abcde -a cddb,read,normalize,encode,tag,move,clean -c /etc/abcde/abcde.conf -N -o mp3 #In this case, abcde will take care of ejecting the CD when it's done #eject -T & #No need for the time being to normalize the files, as abcde is taking care of that. #/home/shared/scripts/normalize_new_files echo "Have a look at the output - 15 seconds..." sleep 15
- Check that you have the programs abcde, cdparanoia, normalize and lame installed and if not, emerge them.
- Have a look here at the settings of /etc/abcde/abcde.conf I'm using - I set it to have the songs ripped in high quality, variable bitrate depending on the complexity of the song, in MP3 'cause my player unluckily doesn't support OGG :o(
- If you start now the script, you'll see that it will complain about not finding normalize-audio. Create therefore a symlink to it:
ln -s /usr/bin/normalize /usr/bin/normalize-audio
- At this point you can start ripping your first cd.
3b - Take control
So, to summarize the current state:
- The hardware is working.
- X is working, using Enlightenment as window manager
- Enlightenment is configured to show automatically Amarok, which I use as music player, on desktop 1 during startup.
- Enlightenment is configured to show on desktop 2 the rip activities if started, desktop 3 is still free and desktop 4 shows nxtvepg, which is as well started automatically when Enlightenment is started.
- Lirc is configured, and works. The demon is started during bootup and irexec and irevent are loaded automatically when Enlightenment is started.
I will now configure Lirc to handle the remote control events depending on which desktop is currently selected.
- The first thing I do is to write a script which returns the desktop number that is currently selected:
DESK_NBR_FULLSTRING=$(eesh desk ?) DESK_NBR=`expr substr "$DESK_NBR_FULLSTRING" 18 1` echo $DESK_NBR
- Now I use the previous script to write a second one that returns the application name depending on the desktop that is selected:
#Deliver as argument to this script the number of the desktop #E.g. desk_config 2 #Returns the name of the application installed in each desktop case "$1" in 0) echo amarok; ;; 1) echo cdripper; ;; 2) echo mythtv; ;; 3) echo nxtvepg; ;; *) echo none; ;; esac
- The previous script is used in multiple ones that I place in the directory /home/shared/scripts/remote_buttons/ that will handle all different keys of the remote control. Here an example of the script called remote_play that handles the Play button:
DESK_NBR=$($(echo $STESCRIPTS)/desk_identify) PROGRAM=$($(echo $STESCRIPTS)/desk_config $(echo $DESK_NBR)) case "$PROGRAM" in amarok) dcop amarok player play & ;; cdripper) echo serial killer & ;; mythtv) echo movies & ;; nxtvepg) echo watching TV! & ;; none) echo STEERROR in "$0" - application for desktop nbr $DESK_NBR is not defined yet & ;; *) echo STEERROR notspecified "$0" & ;; esac
- Voilą, all what is missing now is to configure ~/.lircrc to execute the above script when the Play button is pressed:
begin prog = irexec button = Play config = /home/shared/scripts/remote_buttons/remote_play & end
- Now I restard lircd, and after that I start as well irexec, and after pushing on the remote on Play... I hear the song :o)
I went on configuring all remaining buttons like this, adding scripts in /home/shared/scripts/remote_buttons and adding lines in ~/.lircrc.
3c - Bad screen
Well, what can I say: all in all I think that the Xenarc 700TSV / 700YYV screen is too small.
I therefore decided to get a new one - not 7 anymore but 8, with this time a native resolution of 800x600.
The result was this, a kind of no-name touchscreen with model number XDXS080Z which I bought here (incredibly fast delivery in Switzerland).
I was quite scared of not finding any drivers for Linux, but surprise! After plugging it in and booting the PC, it was using the same drivers the Xenarc used. I just had to change in the script tchscreen_getevent the string TOUCHSRCHSTR="EGALAX" to TOUCHSRCHSTR="TOUCHSCREEN" and everything was working fine, apart of course the fact that the screen had to be recalibrated.
The recalibration took as usual a couple of hours, but after having some raw numbers, I did some manual fine-tuning, and ended up having the following numbers in /etc/X11/xorg.conf:
Option "MinX" "30" Option "MinY" "108" Option "MaxX" "1890" Option "MaxY" "1870"
About the screen resolution, as the monitor documentation doesn't include (of course) any kind of technical specs, I can tell you that I am using the following modeline...
ModeLine "800x600" 40.0 800 840 968 1056 600 601 605 628 +hsync +vsync
...which I think are more or less the standard VESA settings for LCD screens. The finetuning of the above numbers was done by using xvidtune. Have eventually a look at my Linux notes for alternative programs that can be used to get those numbers.
Well the new monitor is all in all very nice (mine is black), definitely bigger than the previous one and works fine (until now).
Chapter 1 - Theory & hardware
Chapter 2 - Initial setup
Chapter 3 - Jukebox music setup <= You are here
Chapter 4 - CPU throttling & Co.
Chapter 5 - Watch movies
Back to Soundstation main