Archive for February, 2007

Adding music to SlimServer

Original (now obsolete) strategy to manage music on Linux within VM.

  1. Stop SlimServer service
    
    # service slimserver stop
    
  2. Mount /audio for writing
    
    # mount -o remount,rw /audio
    
  3. Create destination path under /audio
    
    # mkdir -p /audio/syburgh
    
  4. Download new audio (note that /audio/syburgh/0001 is created because “0001″ is the name of the directory on the source FTP server)
    
    # pushd .
    # cd /audio/syburgh
    # wget --recursive --no-host-directories --timestamping ftp://192.168.1.19/0001/
    # popd
    
  5. Return /audio to read-only and start SlimServer service
    
    # mount -o remount,ro /audio
    # service slimserver start
    

Merge Awaken-style FLAC audio trees

Useful for merging multiple audio trees using symlinks, e.g. to merge the Awaken trees in /audio/awaken.

This is important for the Awaken trees because they are segmented by DVD. For individually extracted CDs this is not normally an issue because all tracks for the album are in the same directory

  1. Create target directory for merged tree
    
    # mkdir /home/slimserver/audiodir/awaken/
    
  2. Merge input trees
    
    # ~/walk.py /audio/awaken/ /home/slimserver/audiodir/awaken/
    

Ripping CD Audio

Now that the large Awaken encoding exercise is complete, it’s time to identify a sustainable way to support future expansion. Approach should be simple and sustainable

References

Tools

  • Exact Audio Copy to extract audio data from CD, collect metadata, and manage compression
  • FLAC for compressing audio data
  • freedb repository of CD metadata

Recommendations

  • Minimize EAC while it rips each disk. It displays progress in the window title and doesn’t seize foreground focus in strange ways. Still has issues with VirtuaWin virtual desktops
  • Encode FLAC files in background and hide the progress window (configured in EAC)
  • Can count number of CD folders by selecting all artist folders and viewing properties. Subtract number of selected artist folders from total number of folders displayed (e.g. if there are 31 folders, and 13 artists, there are 18 albums)

CDDA Extraction

  1. Start one copy of EAC, configure it, close it
  2. Open as many copies of EAC as there are CD drives to be used, select the appropriate drive for each instance
  3. Load a CD drive with an album
    1. Press Alt+G to look up metadata in freedb
    2. Press Shift+F5 to begin extracting audio data (automatically adds to queue for FLAC compression)
  4. When extraction of a disk is complete EAC will beep loudly. This means it is safe to put in another disk, but does not mean the compression of the disk is complete. If you aren’t extracting any more disks you must wait for the encoding queue to empty before exiting EAC
    • View contents of queue using Ctrl+Q

EAC Configuration

EAC options

General tab

  • Beep after extraction finished: checked
  • Eject CD after extraction finished: checked
General tab
  • Automatically write status report after extraction: checked
  • On extraction, start external compressors queued in the background: checked
    • Use: 1 simultaneous external compressor thread(s)
  • Do not open external compressor window: checked

Filename tab

  • Naming scheme: %D%C%N %T
  • Use various artist naming scheme: checked, Various Artists%D - %C%N %T

Drive options

Extraction Method

  • Secure modes: Secure mode with following drive features (recommended)
    • Drive caches audio data: checked
    • Drive is capable of retrieving C2 error information: checked

Compression options

External Compression

  • Use external program for compression: checked
  • Parameter parsing scheme: User Defined Encoder
  • Use file extension: .flac
  • Program, including path, used for compression: C:Program FilesFLACflac.exe
  • Additional command line options: -8 -V -T "artist=%a" -T "title=%t" -T "album=%g" -T "date=%y" -T "tracknumber=%n" -T "genre=%m" %s
  • Check for external program return code: checked

ID3 Tag

  • Nothing checked

freedb / Database options

freedb

  • Your E-Mail address: example@yahoo.com

LSI RAID Array Rebuild

LSI provides a number of utilities to manage the RAID controller (300-8XLP), of which megarc is the most useful. It is a command line setup and status tool, provided as a static binary for Linux (works within VMWare ESX server).

Functionality includes (-a0 indicates the first adaptor):

  • Display status of each logical drive
    
    $ megarc -ldInfo -a0 -Lall
    
  • Cause rebuild of disks connected to ports 1 and 6 (for SATA LSI controllers, channel is always 0)
    
    $ megarc -doRbld -RbldArray'[0:1]' -a0
    $ megarc -doRbld -RbldArray'[0:6]' -a0
    
  • Show rebuild status
    
    $ megarc -showRbld -a0
    
  • Show rebuild rate
    
    $ megarc -getRbldRate -a0
    
  • Default rebuild rate is 30%, this sets to 80%
    
    $ megarc -setRbldRate 80 -a0
    
  • Enable auto-rebuild of degraded array
    
    $ megarc -autoRbldOn -a0
    

Install PowerSave plugin for SlimServer

  1. Download
    
    $ wget http://ultratrendy.com:31888/slim/plugins/powersave/6.5r2/PowerSave.pm
    $ sudo mv PowerSave.pm /usr/local/slimserver/Plugins/
    
  2. Fix permissions
    
    $ sudo chown slimserver:slimserver /usr/local/slimserver/Plugins/PowerSave.pm
    

Install IRBlaster plugin for SlimServer

  1. Download and unpack plugin
    
    $ cd /usr/local/slimserver/Plugins
    $ sudo wget http://www.gwendesign.com/slimserver/src65/plugins/IRBlaster_06_11_02_v41.zip
    $ sudo unzip IRBlaster_06_11_02_v41.zip
    
  2. Add settings for Bose Wave radio
    
    $ cd IRBlaster
    $ sudo wget http://lirc.sourceforge.net/remotes/bose/WAVERADIO
    $ sudo wget http://lirc.sourceforge.net/remotes/bose/WaveRadioCD.irman
    $ sudo mv WAVERADIO WAVERADIO.conf
    $ sudo mv WaveRadioCD.irman WaveRadioCD.conf
    $ cd ..
    
  3. Ensure file ownership is uniform
    
    $ sudo chown -R slimserver:slimserver IRBlaster
    

Set up SlimServer 6.5.0 on CentOS 4.4

  1. Download RPM
    
    $ wget http://www.slimdevices.com/downloads/SlimServer_v6.5.0/SlimServer_v6.5.0.noarch.rpm
  2. Install Perl modules required by RPM package
    
    yum install perl-XML-Parser perl-Digest-SHA1 perl-Time-HiRes perl-DBI perl-Compress-Zlib perl-YAML-Syck
    yum install gcc mysql-server
    
  3. Install RPM
    
    $ sudo rpm -Uvh ./SlimServer_v6.5.0.noarch.rpm
    
  4. Create database in local MySQL instance
    
    yum install mysql
    $ sudo mysql
    mysql> create database slimserver;
    mysql> grant all on slimserver.* to slimserver@'localhost' identified by 'slim_passwd';
    $ sudo /sbin/chkconfig --levels 345 mysqld on
    
  5. Edit /etc/slimserver.conf
    
    dbsource: dbi:mysql:database=slimserver
    dbusername: slimserver
    dbpassword: slimserver_password
    
  6. Add user example to slimserver group
  7. Use magic SlimServer Perl module installer to add local cpies of required modules (hope yum can avoid this in the future)
    
    $ sudo /usr/local/slimserver/Bin/build-perl-modules.pl Time::HiRes
    $ sudo /usr/local/slimserver/Bin/build-perl-modules.pl Digest::SHA1
    
  8. Create SlimServer home directory (SlimServer root)
    
    $ sudo mkdir /home/slimserver
    $ sudo chown slimserver:slimserver /home/slimserver
    $ sudo chmod 0775 /home/slimserver
    
  9. Configure OS firewall
    
    3483:tcp - Name: SlimServer Control
    3483:udp - Name: SlimDiscovery
    9000:tcp - Name: SlimServer Web
    
  10. Configure daemon to start at boot
    
    $ sudo /sbin/chkconfig --levels 345 mysqld on