Jukebox HOWTO http://raf.org/jukebox/Jukebox-HOWTO raf v0.1, 20021208 This document explains how to use a Linux host connected to a sound system as a virtual jukebox that can be controlled from any host on a home network. ______________________________________________________________________ Table of Contents 1. Introduction 1.1 Copyright 1.2 Availability 1.3 Required Reading 1.4 Recommended Reading 2. Preparing the Linux host 2.1 Hardware 2.2 Software 3. Building the Jukebox 3.1 Configuration 3.2 The Music 3.3 Tables of Contents 3.4 Network Server 3.4.1 User 3.4.2 Daemon 3.4.3 Inetd 3.4.4 Xinetd 4. Using the Jukebox 4.1 Local 4.2 Network 4.2.1 Command line user interface 4.2.2 Graphical user interface 4.3 Search Terms 5. Commands 5.1 rip 5.2 riptrack 5.3 mktoc 5.4 toc2names 5.5 toc2tags 5.6 cdr/cdrw 5.7 burn/burnw 5.8 cdbackup 5.9 mp3backup 5.10 jukebox 5.11 jukeboxd 5.12 jukeboxc/jukeboxc.jar 5.13 jukeboxd-init.d 6. Questions 6.1 How do I rip an audio CD? 6.2 How do I burn an audio CD? 6.3 How do I backup an audio CD? 6.4 How do I burn a data CD? 6.5 How do I compile a CD of selected tracks from various sources? 6.6 How do I backup the jukebox? 6.7 How do I control the jukebox from a Windows host? 6.8 How do I add my existing mp3 collection to the jukebox? 6.9 How do I add my vinyl/tape collection to the jukebox? 6.10 How do I add support for another audio CD reader program? 6.11 How do I add support for another encoder program? 6.12 How do I add support for another player program? 6.13 Why can't jukebox find my player program? 6.14 Why does rip use temporary hard drive space? 6.15 How do I clean up wav files as soon as they are encoded? 6.16 Which reader should I use? 6.17 Which encoder should I use? 6.18 How long does it take to rip and encode an audio CD? 6.19 How much hard drive space will I need? 6.20 Can jukebox play music videos? 6.21 What can I do about CDR failures? 6.22 Any advice? _____________________________________________________________________ 1. Introduction This document is about using a Linux host to act as the "brains" of a home sound system. Computers are no good at playing music. That's what sound systems are for. But computers are very good and carrying out tedious instructions for indefinite periods of time without complaint. They are also good at retrieving, storing and transmitting data... So, if you want to listen to lots of music but are too lazy to keep changing CDs, you can store all of your CDs onto your Linux host and, from then on, just tell it what you want to hear and it will happily play your favourite music indefinitely. There are several virtual jukebox software packages available. This document only describes the one at http://raf.org/jukebox/ because it's the one I wrote and use. The others that I've seen all seem to require enormous applications like web servers and database servers and web browsers in order to function. This jukebox is tiny and more suited to those who prefer music to sitting in front of computers. 1.1 Copyright Copyright (C) 2002 raf This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or visit http://www.gnu.org/copyleft/gpl.html 1.2 Availability This document is available at: http://raf.org/jukebox/Jukebox-HOWTO 1.3 Required Reading CD-Writing-HOWTO: http://www.ibiblio.org/pub/Linux/docs/HOWTO/CD-Writing-HOWTO 1.4 Recommended Reading MP3-Box-HOWTO (an alternative to this): http://www.ibiblio.org/pub/Linux/docs/HOWTO/MP3-Box-HOWTO MP3-HOWTO: http://www.ibiblio.org/pub/Linux/docs/HOWTO/MP3-HOWTO Sound-HOWTO: http://www.ibiblio.org/pub/Linux/docs/HOWTO/Sound-HOWTO Sound-Playing-HOWTO: http://www.ibiblio.org/pub/Linux/docs/HOWTO/Sound-Playing-HOWTO 2. Preparing the Linux host Before you can start using your jukebox, there are numerous hardware and software prerequisites to meet. 2.1 Hardware The Linux host that will become the jukebox needs: - A CDRW drive - A sound card connected to a sound system - As much hard drive space as possible 2.2 Software The jukebox requires some of the following software. Many are alternatives and many are optional (see below). jukebox - turns your computer and sound system into a jukebox http://raf.org/jukebox/ cdrecord - CDR data or audio writing software ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/ (comes with redhat) mkisofs - create iso9660 file systems to be written to data CDRs (comes with cdrecord) (comes with redhat) cdda2wav - CD digital audio reader software (comes with cdrecord) (comes with redhat) cdparanoia - better CD digital audio reader software http://www.xiph.org/paranoia/ cdrdao - better audio CDR copying software http://www.ping.de/sites/daneb/cdrdao.html lame - wav to mp3 encoder http://www.mp3dev.org/mp3/ notlame - wav to mp3 encoder http://www.idiap.ch/~sanders/not_lame/ gogo - wav to mp3 encoder http://homepage1.nifty.com/herumi/gogo_e.html bladeenc - wav to mp3 encoder http://bladeenc.mp3.no/ oggenc - wav to ogg encoder (part of vorbis-tools) http://www.vorbis.com/ (comes with redhat) flac - wav to flac encoder/decoder http://flac.sourceforge.net/ sox/play - wav player (also used to play flac) http://sox.sourceforge.net/ (comes with redhat) mpg321 - mp3 player http://mpg321.sourceforge.net/ ogg123 - ogg player (part of vorbis-tools) http://www.vorbis.com/ (comes with redhat) CDDB_get - perl module to get the cddb info for an audio cd http://armin.emx.at/cddb/ MP3::Info - perl module to add tags to mp3 files http://sourceforge.net/projects/mp3-info/ vorbiscomment - add tags to ogg files (part of vorbis-tools) (comes with oggenc) (comes with redhat) metaflac - add tags to flac files (comes with flac) daemon - turns other processes into daemons http://libslack.org/daemon/ jdk-1.2+ - java software development kit http://java.sun.com/ jre-1.2+ - java runtime engine http://java.sun.com/ jukebox is what this howto is about. cdrecord and mkisofs are needed to write data CDRs/CDRWs (i.e. cdr, cdrw, mp3backup). cdrecord or cdrdao is needed to write audio CDRs/CDRWs (i.e. burn, burnw, cdbackup). cdparanoia or cdda2wav is needed to read audio CDs (i.e. rip, riptrack, cdbackup). lame, notlame, gogo or bladeenc is needed to convert wav to mp3 (i.e. rip). oggenc is needed to convert wav to ogg (i.e. rip). flac is needed to convert wav to flac and back again (i.e. rip, jukebox). sox/play is needed to play wav or flac files (i.e. jukebox). mpg321 is needed to play mp3 files (i.e. jukebox). ogg123 is needed to play ogg files (i.e. jukebox). CDDB_get is needed to get cddb info for audio CDs (i.e. rip, mktoc). MP3::Info is needed to add tags to mp3 files (i.e. rip, toc2tags) vorbiscomment is needed to add tags to ogg files (i.e. rip, toc2tags) metaflac is needed to add tags to flac files (i.e. rip, toc2tags) daemon is needed by the network server to launch jukebox (i.e. jukeboxd). jdk-1.2+ is needed to compile the graphical jukebox client (i.e. jukeboxc.jar). jre-1.2+ is needed to run the graphical jukebox client (i.e. jukeboxc.jar). perl and/or bourne shell are needed by all of the jukebox scripts. The core requirements are perl, cdrecord, bladeenc, mpg321 and jukebox. The jukebox network server requires daemon. The others just improve things. Linux comes with perl and cdrecord. It also comes with ogg support. If you want ogg files rather than mp3 files, then you don't need bladeenc or mpg321. 3. Building the Jukebox Once installed, jukebox needs to be configured. Once configured, you need to start ripping lots of audio CDs and creating table of contents files. Then, the jukebox network server should be started and clients installed on, or made accessible to, all hosts in the home network that need access to the jukebox. 3.1 Configuration The jukebox configuration file is /etc/jukebox.conf. It's a bourne shell script fragment that defines all of the parameters used by the scripts in the jukebox suite. Keep it simple. Some of the scripts that read the configuration file are not shell. They're perl scripts with minimal parsing. The configuration file defines the following variables: cdr_rdev='0,0,0' Specify the CDROM/CDR/CDRW device to read from using the SCSI notation needed by cdrecord. cdr_wdev='0,0,0' Specify the CDR/CDRW device to write to using the SCSI notation needed by cdrecord. cdr_opt='burnproof' Specify any write options supported by your CDR/CDRW device. cdr_size='700' The size (in MB) of the CDR discs that you use to backup your mp3/ogg collection. cdr_spd='24' The CDR write speed cdrw_spd='10' The CDRW write speed cdrd_spd='40' The CD read speed cdr_rip='cdparanoia' The cdda to wav reader software to use. Only cdda2wav and cdparanoia are supported. But jukebox is extensible. To use an unsupported reader, the complete command line must be specified here. Consider adding support for other reader software. It's only a couple of extra lines in two files. wav_enc='bladeenc' The encoder software to use. This can encode wav files into any format. The only supported encoders are lame, notlame, gogo, bladeenc, oggenc and flac (i.e. mp3, ogg, flac). But jukebox is extensible. To use an unsupported encoder, all command line options must be specified here and the names of the files to encode will be appended before execution. Consider adding support for other encoders. It's only a couple of extra lines in one file. enc_bits='192' The average encoding bitrate for mp3 and ogg encoding. The default, 192, is the lowest bitrate that anyone seems to recommend. A smaller bitrate results in lower sound quality and smaller files. A higher bitrate results in higher sound quality and larger files. cdr_bak='cdrdao' The wav to CDR writer software to be used by cdbackup. Only cdrdao and cdrecord are supported. If cdrecord is specified, rip (i.e. cdparanoia or cdda2wav) is used to read the audio CD and burn (i.e. cdrecord) is used to write the tracks to CDR. If cdrdao is specified, then cdrdao is used for both reading and writing. cdr_drv='generic-mmc' The driver to be used by cdrdao. This needs to be set if cdrdao can't determine the driver to use by itself. cdr_sdrv='generic-mmc' The source driver to be used by cdrdao. This needs to be set when reading and writing are happening on different devices and cdrdao can't determine the source driver to use by itself. juke_root='/mnt/music' A colon separated list of directories containing wav/mp3/ogg/flac... track files and table of contents files. This should represent vast amounts of storage dedicated to audio tracks for the jukebox. juke_tmp='/mnt/music/tmp' A temporary directory with enough space for an entire cd for cdbackup. juke_toc='00*.toc' A file glob for table of contents file names (must have exactly one '*'). When ripping CDs this is used to construct tocfile names and jukebox uses it to locate tocfiles under the directories in juke_root. Since this glob controls tocfile name creation and access, it's a good idea to never ever change it. juke_fmt='wav,mp3,ogg,flac' A comma separated list of valid track file name extensions. There should be a corresponding player command specified in juke_player for each format here. juke_player='wav=play,mp3=mpg321 -q,ogg=ogg123 -q,flac=flac -sdc % | play -t wav -' A comma separated list of mappings between sound file formats and the programs that play them. The file name extension for the format appears on the left of an equals sign or colon. The player command appears on the right. If there are no commas and no equals signs or colons, the value is interpreted as an mp3 player command. If the player command contains any single "%" characters, they are replaced with the name of the track file to be played. Otherwise, the name of the track file to be played is added to the command as its last argument. If the player contains any "%%" strings, they are replaced by single "%" characters. juke_host='jukebox' The name or IP address of the host running the jukebox network server. It's good if you can create a DNS alias called "jukebox" for the jukebox server. The parameter in this file only affects local jukebox clients, not remote clients. juke_addr='0.0.0.0' The address to which the jukebox server should bind. juke_port='1221' The TCP port on which the jukebox server should listen. juke_user='jukebox' The user as which to run the jukebox server. This needs to be a user with sufficient privileges to use the sound device but with read only access to the filesystem. juke_gap='2' The delay (in seconds) between tracks for the jukebox server. This only applies when tracks are played in random order. When played sequentially, the jukebox server doesn't add any extra gap between tracks but it does add a gap before the first track. When the jukebox is stopped and then immediately started again (e.g. when a new request to play music arrives), problems can occur. I've seen the following errors: mpg321: Can't find a suitable libao driver. (Is device in use?) ogg123: Could not load default driver and no driver specified in config file. Exiting. These errors often mean that the permissions of the sound device are preventing access. In this case they seem to mean that the sound device isn't available yet. Presumably the last process to use it hasn't finished dying (from a term signal) yet. A non-zero gap seems to alleviate this problem because it causes the jukebox to pause before the first track. juke_opts='short' Specifies whether jukebox and jukeboxc should accept long or short command line options. The standard perl module, Getopt::Long, requires the presence of a "--" argument before any arguments that begin with "+" because it thinks they are options (unless $POSIXLY_CORRECT is set in the environment). Since it is expected that these two scripts will receive many command line arguments that begin with "+", the default is to only handle single letter options via the Getopt::Std module. Note that, with either short or long options, "--" must be used whenever there are search terms that begin with "-" because these really do look like options. juke_names='simple' Specifies the style of names that toc2names should generate. There are two naming styles supported. The "simple" style has dashes instead of spaces, no upper case characters, very little punctuation and no 8 bit characters. The "complex" style preserves spaces, upper case and accented characters. simple example: 01-track-title.mp3 complex example: 01 Track Titlé.mp3 3.2 The Music Now for the physical labour. Putting your CDs onto your Linux host is a lot of work. It only takes 5-10 minutes to read a CD (40x with cdparanoia) but it take can take 10-55 minutes on a 450MHz processor to encode the data into mp3 or ogg format. That means spending weeks if not months feeding CDs to your computer while it slowly digests them. The utility provided by jukebox for performing the task of ripping audio CDs is called rip. It performs the following tasks: - Reads the digital audio data from the CD onto the hard drive - Encodes the data into mp3/ogg/flac... format - Creates a table of contents (cddb or manually) - Names track files to match their titles - Tags mp3/ogg/flac files When rip is given a command line argument, it creates a directory by that name under the first directory specified in the juke_root variable in /etc/jukebox.conf. It is expected that this directory name will be a two level directory. The first component names the artist. The second component names the album. This is not strictly necessary, though. For example: rip janis-joplin/cheap-thrills Creates the directory /mnt/music/janis-joplin/cheap-thrills and places track files in that directory. Then you are asked if you want to create a table of contents file. You need to say yes if this album is to be used by jukebox. You will then be asked if you want to obtain artist, album and track titles from freedb.org. If so, the tocfile is created and populated. Otherwise, a mostly empty tocfile will be created and you'll need to enter this information manually with your favourite text editor. The track files are then converted into mp3/ogg/flac format unless this has been suppressed with the -w option. Finally, you are asked if you want to name the track files so as to resemble their respective track titles in the tocfile. You need to say yes to this if this album is to be used by jukebox. Finally, you are asked if you want to tag the mp3/ogg/flac files with this information. This isn't required by jukebox but you might find it useful if you ever intend to transfer mp3 files to a portable mp3 player. As mentioned earlier, encoding is time consuming. If you have many CDs to rip, you obviously don't want to do them one at a time. Fortunately, you can set up multiple rip commands in separate shell windows. They have to be started in a staggered fashion because only one CD can be in the CDRW drive at a time. As soon as the first rip command has finished reading the CD and its tocfile has been created, it will start to encode the track files. Swap the CD immediately with the next one then start the next rip command. Repeat this process as many times as you like then walk away from the computer for the next few hours. This way you have a pipeline of CDs being ripped and can get through them much more quickly. 3.3 Tables of Contents As each album is ripped into its own directory, a table of contents file is created to name and describe the tracks in that directory. The preferred method of creating tocfiles is cddb which obtains the data from the net and prepopulates a tocfile in the format needed by jukebox. If cddb can't be used, the track titles (and possibly the artist name and album title) need to be entered into the tocfile manually. A template of the right form is created for you to edit with your favourite text editor. The tocfiles look like: Artist: Janis Joplin Title: Cheap Thrills Jukebox: rock blues 60s hard awesome female vocal 01 Combination of the Two 02 I Need a Man to Love 03 Summertime 04 Piece of My Heart 05 Turtle Blues 06 Oh, Sweet Mary 07 Ball and Chain Even if you used cddb to create the tocfile, you will need to further annotate an album or individual tracks. When jukebox searches for tracks that match a user's selection criteria, a track matches if any of the following match: - Artist name - Album title - Track title - Jukebox tags Jukebox tags are special words that categorise albums and tracks. Any words following the "Jukebox:" header at the top of a tocfile apply to all tracks in that album/directory. An individual track can, in addition, have its own jukebox tags that look like: "[Jukebox: tag...]" after the track title. When jukebox performs a "strict" search, only the jukebox tags are examined when finding selected tracks. Consider classifying albums and tracks thoughtfully. More detailed classification gives you more sophisticated searching capabilities later on. You can include any sort of information about the track: genre, year/decade recorded, country/culture of origin, live vs studio, tempo, reactions. Any such information can be used in jukebox to select or avoid certain classes of music. The most decadent feature of jukebox is that the default selection (when none is specified by the user) is a strict search for jukebox tags that match the current user's login name. This means that if your favourite albums and/or tracks are tagged with your login name, then jukebox will, by default, play your favourite tracks. Similarly, each member of a household can have their favourite tracks and albums tagged. Here are some sample jukebox tags but feel free to tag your music in any way you see fit. rock rockabilly glam punk black metal thrash surf garage pub grunge seattle jazz ragtime bebop bigband swing boogiewoogie dixieland free acid funk jive blues delta stlouis louisiana chicago downhome gutbucket stomp prewar dirty reggae ska dub ragamuffin rap gansta pranks techno rave hiphop triphop trance club house dance eurotechno eurohouse eurodance tribal urban gogo gabber hi-nrg newbeat freestyle anime gfunk industrial breakbeat hardcore drill grindcore ghettotech biphop idm country western bluegrass americana texmex christian rodeo yodeling square honkytonk bakersfield outlaw queercore riotgrrl doowop pop britpop boyband girlband rnb bubblegum jpop synthpop skiffle anti twee alternative indie newage newwave darkwave fusion crossover nova gothic classical symphonies operas operettas arias cantatas fugues canons concertos chamber sonatas musique-concrete divas counter tenors oratorios madrigals motets serenades preludes waltzes ballet suites folk shanties filk ballad torchsong gospel ccm avantgarde primus booty chanson jam terror negerpunk polskpunk space cult psychedelic madchester shoegazing disco soul motown muzak crooners lounge barbershop karaoke childrens nursery rhymes lullabies holiday military march tattoo ballroom world european african asian indian australian pacific american usa english british canadian oz aboriginal celtic irish welsh french spanish portuguese italian german tibetan chinese japanese hawaiian cajun latin carribean andean brazillian cuban arabic egyptian pakistani hindustani continental goa algerian tuvan gypsy armenian azerbaijani greek iranian iraqi israeli kurdistani kyrgyztani lebanese turkish bossanova calypso candombe carnatic chacha conjunto corrido fado flamenco junkanoo mariachi merengue norteno ranchero rhumba salsa samba tango tejano vallenato zydeco taiko afrobeat afropop hi-life mquanga juju soukous township qawwali rai polka rebetiko gamelan zarzeula klezmer chazzanut male female vocal instrumental spoken poetry acappella chant choral acoustic electric electronic power ambient microtonal noise fractal tv radio movie theatre showtunes dancehall musical cabaret vaudeville broadway soundtracks themes string guitar piano brass woodwind drum bass percussion gregorian medieval romantic renaissance baroque contemporary traditional modern early late recent new progressive neo mod post retro revival solo duet trio quartet band choir orchestra north south east west central live studio 20s 30s 40s 50s 60s 70s 80s 90s 00s awesome excellent good fair bad crap weird comedy novelty happy depressing disturbing death relaxing political protest class gender race war peace hard soft easy loud quiet fast slow hot cool smooth explicit driving cooking gardening meditating housework washingup party 3.4 Network Server If the jukebox needs to be accessible from multiple hosts on a home network, you will need to set up the jukebox network server. There are two ways to do this: as a daemon that runs forever or as an inetd or xinetd client (see below). The jukebox server listens on all addresses at TCP port 1221 (by default). The clients assume that the jukebox server's hostname is "jukebox". While it is easy enough to tell the clients to use a different hostname, if there are several client hosts, it might be simpler to just create the appropriate DNS alias for the jukebox host (if you have a local DNS zone) so that the clients just work. If a different port is to be used, then clients need to be told what port to connect to each time they are launched. It might be worth modifying the source code before installing the clients. 3.4.1 User The jukebox server must run as a non-root user. This user needs to have permanent write permission to the sound device. On systems with pam_console (e.g. redhat), the ownership and permissions of various devices are modified whenever a user logs onto the console. So when someone logs in, the sound device becomes owned by them. When they log out, the sound device reverts back to root ownership. Clearly, the sound device needs to be permanently group writable and the jukebox user must be a member of the group in question. If your system uses pam_console (e.g. redhat-7.3), from the jukebox source directory, type (as root): make install-perm This will create the group "audio" and the user "jukebox" as the only member of that group. Then it modifies the /etc/security/console.perms so that the sound device is group writable and owned by group "audio". groupadd audio useradd -d /tmp -M -g audio jukebox perl -pi -e 's/^( +)0600( + +)0600( root)$/${1}0660${2}0660${3}.audio/' /etc/security/console.perms The last line changes this (in /etc/security/console.perms): 0600 0600 root into: 0660 0660 root.audio On Debian systems, /dev/dsp is writable to group "audio" so all you have to do is put the jukebox user in the audio group. useradd -d /tmp -g audio jukebox If your system does not use pam_console and /dev/dsp isn't already group writable, you probably have to do the following: groupadd audio useradd -d /tmp -g audio jukebox chgrp audio /dev/dsp chmod 660 /dev/dsp If this is not done, and the user that owns the jukebox server does not have write permission to the sound device, mpg321 will emit the following error: Can't find a suitable libao driver. (Is device in use?) 3.4.2 Daemon To run the jukebox network server as a daemon that starts up every time the system is booted, from the jukebox source directory, type (as root): make install-server This will ensure that the jukebox server is always running whenever the host is up. This should work on any Linux system since it can create all of the necessary symlinks in the init.d and rc?.d directories under /etc or modify the rc.local file, depending on the system. To start it immediately, reboot or type one of the following: /etc/rc.d/init.d/jukeboxd start # redhat /etc/init.d/jukeboxd start # SVR4 /opt/jukebox/bin/jukeboxd-init.d start # BSD (and all of the above) The last example assumes that jukebox was installed under /opt/jukebox. This script is an SVR4 style init script that takes the following arguments: start - Start the jukebox network server stop - Stop the jukebox network server status - Show whether the jukebox server is up or down restart - Stop then start the jukebox network server reload - Stop then start the jukebox network server On systems with SVR4 style boot sequences, the jukebox server will be started in run levels 2, 3, 4 and 5 and it will be stopped in run levels 0 (halt), 1 (single user) and 6 (reboot). On systems with BSD style boot sequences, the jukebox server will be started whenever the system boots. 3.4.3 Inetd To run the jukebox network server as an inetd client that only runs when each client connects, from the jukebox source directory, type (as root): make install-inetd This will add the following line to /etc/services: jukebox 1221/tcp It also adds the following line to /etc/inetd.conf: jukebox stream tcp nowait jukebox /usr/sbin/tcpd /opt/jukebox/bin/jukeboxd If you don't have tcpwrappers (i.e. /usr/sbin/tcpd), then get it and use it. Then tell inetd to reload its configuration (something like): /etc/rc.d/init.d/inetd reload 3.4.4 Xinetd To run the jukebox network server as an xinetd client that only runs when each client connects, from the jukebox source directory, type (as root): make install-xinetd This will add the following line to /etc/services: jukebox 1221/tcp It also creates /etc/xinetd.d/jukebox with the following contents: service jukebox { socket_type = stream wait = no user = jukebox server = /opt/jukebox/bin/jukeboxd only_from = 127.0.0.1 10.0.0.0/8 172.16.0.0/16 192.168.0.0/16 disable = no } If your home network uses public IP addresses, you'll have to change the value of "only_from" to match your network. Then tell xinetd to reload its configuration (something like): /etc/rc.d/init.d/xinetd reload 4. Using the Jukebox Once the jukebox software is installed and your CDs have been transferred to your Linux host, you can play music. There are two methods for doing this depending on whether or not the jukebox network server is running. If you will be the only user of the jukebox and the server is not running, use the "jukebox" command to play music. If multiple people will be using the jukebox via its network server, then use one of the jukebox network clients to play music. 4.1 Local The "jukebox" command is used for direct, local use of the jukebox. This program must not be used if the jukebox network server is running. This is the program that selects tracks to be played and then plays them. There are many options to this program that enable the user to play music or just print selected tracks (just file names on their own or with artist, album and track titles and even with all jukebox tags that apply to each track). It's even possible to list all jukebox tags with a histogram of their use. The non-option command line arguments, if any, specify the search terms to be used when selecting tracks. If no search terms are given, jukebox plays your favourite tracks (i.e. tracks tagged with your login name). See section 4.3 for an explanation of search terms. See "man jukebox" or "jukebox -h" for more details. 4.2 Network There are two jukebox network clients, one with a command line interface (jukeboxc) and one with a graphical interface ("java -jar jukeboxc.jar" or "jukeboxc -g"). These must be used exclusively (in favour of "jukebox" itself) when there are multiple users of the jukebox. 4.2.1 Command line user interface The command line jukebox client is called "jukeboxc". It takes most of the same options as "jukebox" itself. The only options it doesn't take are those that don't make sense for a network client to specify (such as where the music is stored, what program should be used to play the tracks, and other options that exist just for the jukebox server to use). It takes additional options that do make sense for a client: -H host, -P port (these values default to the juke_host and juke_port variables in /etc/jukebox.conf) and -g which starts up the graphical client. See "man jukeboxc" or "jukeboxc -h" for more details. 4.2.2 Graphical user interface The graphical jukebox client is a Java Swing application that should run on any platform that has Java installed (at least version 1.2). It is much the same as the command line version except that there are buttons and checkboxes instead of options, a search term text entry field instead of command line arguments, and when listing selected tracks, they appear in a window rather than on standard output. You can save a list of selected tracks to a "playlist" file and load them in again later to be played. You can reorder the tracks in a playlist either with the graphical jukebox client or with your favourite text editor. The only command line arguments are to specify the host and port to connect to. These default to "jukebox" and 1221, respectively. When started by jukeboxc, the host and port are always specified. See "man jukeboxc.jar" or "jukeboxc -g -h" or "java -jar jukeboxc.jar -h" for more details. Windows hosts that need to run the graphical jukebox client must have the Java 1.2 runtime engine installed. They also need access to jukeboxc.jar. If the jukebox software was installed in a directory that is exported by Samba, then Windows just needs a shortcut with something like the following command: javaw -jar //host/share/jukeboxc.jar Where "host" is the name of the jukebox host running Samba and "share" is the name of the SMB share that contains the jukebox installation. A possible smb.conf extract for this is: [share] comment = jukebox path = /opt/jukebox/bin read only = yes public = no If Samba is not going to be used to provide access to the graphical client, then the jukeboxc.jar file must be copied to the Windows client hosts and a shortcut must be created with a command something like the following: javaw -jar C:/app/jukebox/jukeboxc.jar 4.3 Search Terms Selecting tracks to be played is a lot like using a web search engine. If multiple words are used, then tracks that contain any of the words in their artist name, album title, track title or jukebox tags will match. Words starting with a '+' must all be present for a track to match. Words starting with a '-' must all be absent for a track to match. Words can be grouped together by enclosing them with single or double quotes which must pair up. To search for a word containing an apostrophe, enclose the word in double quotes (i.e. to search for ain't, use "ain't"). Quoting multiple words is usually only useful when selecting by artist name or by album or track title. Searches are case and accent insensitive. A strict search can be performed by selecting the "Strict" checkbox in the graphical client or by using the -j option in the command line client (or jukebox itself). Strict searches ignore artist names, album titles and track titles. Only the jukebox tags are inspected to determine which tracks match the search criteria. 5. Commands Jukebox consists of many scripts. Some of these deal with building a wav/mp3/ogg/flac collection, playing it and backing it up. Others are generally useful for reading and writing audio and data cds. This section describes each program in turn. Run each program with the -h option or read its manpage for more details. 5.1 rip This command reads an entire audio CD using the software specified in the cdr_rip variable in /etc/jukebox.conf. The only programs supported are cdparanoia and cdda2wav but it is possible to specify a different reader. If the wav files already exist and you just want to encode them, use the -n option which suppresses reading. The track files are placed into the directory specified on the command line which is taken to be relative to the first directory listed in the juke_root variable in /etc/jukebox.conf. This directory is created if necessary. The directory on the command line is expected (but not required) to have two levels: the first directory component is for the artist, the second is for the album. If no directory argument was supplied, track files are placed in the current directory. Then the user is asked if they want to create a table of contents file. The tocfile is created using mktoc (see below) which asks the user if they want to obtain information about the CD from the internet. If so, the tocfile will be prepopulated with cddb information obtained from freedb.org. Otherwise, a mostly empty template is created. This template will contain the artist and album title (if a two-level directory was supplied on the command line) and a numbered line for each track file. The user will have to enter the actual titles in the next step. The -t option suppresses tocfile creation. Then the user is asked if they want to edit the tocfile. This is almost always needed. If cddb wasn't used or failed or didn't contain an entry, the user must enter track titles (and possibly artist and album titles). Whether cddb was used or not, the user has to enter jukebox tags (as discussed in section 3.3). The editing is done using $EDITOR if it is defined, or with /bin/vi otherwise. The -e option suppresses editing the tocfile. Then the track files (in wav format) are encoded into a smaller format such as mp3, ogg or flac using the software specified in the wav_enc variable in /etc/jukebox.conf. The supported encoders are lame, notlame, gogo, bladeenc, oggenc and flac but it is possible to specify a different encoder. The -w option suppresses encoding. After encoding the tracks, the original wav files are deleted. The -k option suppresses deletion. Then the user is asked if they want to name the track files after the corresponding track titles. cdparanoia and cdda2wav produce very boring file names (i.e. track-##.cdda.wav, audio_##.wav). The jukebox requires track names to start with their index numbers and it's a good idea to name the track files anyway to make it possible to identify a track just by looking at a directory listing (rather than having to look in the tocfile). The track files are named by toc2names (see below) which uses the track titles in the tocfile and transforms them into sensible file names. The -m option suppresses the naming of the track files. Finally, the user is asked if they want to add tags to the (mp3, ogg or flac) track files. The track files are tagged by toc2tags. This is useful if mp3 files are to be transferred to a portable mp3 player. The jukebox doesn't use tags. The -g option suppresses tagging the track files. Example: Rip a CD for use by the jukebox rip janis-joplin/cheap-thrills Example: Rip a CD to the current directory, leaving in wav format rip -w Example: Rip a CD to the current directory, encoding to the default format rip See "man rip" for more details. 5.2 riptrack This command reads a single track or a range of tracks from an audio CD into wav files in the current directory. The software used to read the tracks is the same as that used by rip (i.e. cdparanoia or cdda2wav). This command is mostly useful when compiling a CD of selected tracks from multiple sources (aka "making a tape"). In this case, there would be no sense in converting the tracks to mp3 format as they are about to be written back to CDR. To copy an entire audio CD, use cdbackup. If you use riptrack and do want to encode the resulting wav files, use rip (with -n) to do the encoding. Example: Read the first three tracks from three CDs and burn them onto a CDR mkdir compilation # insert 1st cd riptrack 1 3 mv *01*.wav compilation/01.wav mv *02*.wav compilation/02.wav mv *03*.wav compilation/03.wav # insert 2nd cd riptrack 1 3 mv *01*.wav compilation/04.wav mv *02*.wav compilation/05.wav mv *03*.wav compilation/06.wav # insert 3rd cd riptrack 1 3 mv *01*.wav compilation/07.wav mv *02*.wav compilation/08.wav mv *03*.wav compilation/09.wav # insert cdr burn compilation/*.wav # clean up rm -rf compilation See "man riptrack" for more details. 5.3 mktoc This command creates a table of contents template file. It is used by rip. The user is asked if they want to obtain cddb information about the CD currently in the drive from the internet (i.e. freedb.org). If so, and there is cddb information about the CD, the tocfile will contain the artist name, album title, the names of all tracks and a single jukebox tag containing the cddb category for the CD. If cddb is not used, the artist and album title will be prepopulated with the information specified on the command line (if any). There will also be a line for each track containing just the index number of the track. The user has to add the track titles manually afterwards. Whether cddb is used or not, the resulting tocfile needs to be edited to supply more jukebox tags for later use when searching via jukebox (as discussed in section 3.3). By default, the tocfile is named 00.toc. Although, when this command is used by rip, this is overridden to be 00--.toc if rip's command line argument specifies both the artist and the album in the form of a two level directory. See "man mktoc" for more details. 5.4 toc2names This command names track files (wav, mp3, ogg, flac, ...) based on the information in the tocfile in the current directory. It is used by rip. The tocfile is defined to be the file that matches the glob in the juke_toc variable in /etc/jukebox.conf. This glob can be overridden with the -t option. There are two naming styles supported. The "simple" style has dashes instead of spaces, no upper case characters, very little punctuation and no 8 bit characters. The "complex" style preserves spaces, upper case and accented characters. The default style is specified in the juke_names variable in /etc/jukebox.conf. It can be overriden with the -s option. For each track title in the tocfile, the following transformations are performed to create a simple file name for the corresponding track file: - Remove accents from accented characters - Convert upper case to lower case - Remove anything in square brackets - Unabbreviate "in'" into "ing" - Unabbreviate "o'" into "of" - Unabbreviate "&" into " and " - Replace spaces and slashes with dashes - Remove all unacceptable characters (i.e. [^!?a-z0-9-]) - Strip leading and trailing dashes - Compress strings of dashes - And end up with [- ].<format> The user must confirm or override all suggested names. Simple names look like: 01-track-title.mp3 Complex names look like: 01 Track Titlé.mp3 See "man toc2names" for more details. 5.5 toc2tags This command adds tags to mp3/ogg/flac files based on the information in the tocfile in the current directory. It is used by rip. The tocfile is defined to be the file that matches the glob given as the value of juke_toc in /etc/jukebox.conf. This glob can be overridden with the -t option. Each mp3/ogg/flac track file in the current directory has the following tags added: - Title - Artist - Album - Comment (the "Jukebox:" header and track specific "Jukebox:" tags) - Genre (the first word of the "Jukebox:" header value if possible) - TrackNumber The genre is the first word of the "Jukebox:" header value which should be the category retrieved via cddb. For mp3 files, if this is not acceptable to MP3::Info, then the genre tag is not written to the file. The other tags are truncated if necessary to fit in the limited space (28 or 30 characters) allowed by id3 tags. This is not so for ogg or flac files. See "man toc2tags" for more details. 5.6 cdr/cdrw This command uses cdrecord to write files and directories or an iso9660 image to a CDR/CDRW. When the command is called "cdr", it writes at CDR speed. When called "cdrw", it first blanks the CDRW and then writes at CDRW speed. The CDR/CDRW device and all other parameters are obtained from /etc/jukebox.conf. The command line arguments are passed through directly to mkisofs along with the -graft-points option. See "man mkisofs" for more details. In short, this means that if a single directory is specified, its contents will appear in the root directory of the CDR/CDRW. If multiple directories are specified, all of their contents will be merged to form the root directory of the CDR/CDRW. To specify that multiple directories should appear in the root directory of the CDR/CDRW, they must be "grafted" into position with mkisofs' -graft-points notation. When writing an iso9660 image, the -i option must be given and there can be only one command line argument, the name of the iso9660 image file. Example: Write the contents of a directory to CDR cdr dir Example: Write a file and three directories to CDRW cdrw file dir1/=dir1 dir2/=dir2 dir3/=dir3 Example: Write an iso9660 image to CDR cdr -i mycd.iso See "man cdr" and "man cdrw" for more details. 5.7 burn/burnw This command uses cdrecord to write the wav files specified on the command line to an audio CDR/CDRW. When the command is called "burn", it writes at CDR speed. When called "burnw", it first blanks the CDRW and then writes at CDRW speed. Example: Write all wav files in the current directory to CDR burn *.wav Example: Write all wav files in the current directory to CDRW burnw *.wav See "man burn" and "man burnw" for more details. 5.8 cdbackup This command copies an audio CD to CDR. After the copy has been made, the user is asked if they want to make another backup. The method used to copy the audio CD is specified in the cdr_bak variable in /etc/jukebox.conf. The only valid values are "cdrecord" and "cdrdao". If set to "cdrecord", then the rip and burn commands are used to read and write the audio tracks. If set to "cdrdao", then cdrdao is used to do both the reading and writing. The "cdrecord" method results in a two second gap between each track. The "cdrdao" method results in a copy with the same inter-track gaps as the original CD. This is obviously better for live CDs where there should be no gap between tracks. The "cdrdao" method also preserves the cddb identifier of the original CD. Example: Backup an audio CD cdbackup See "man cdbackup" for more details. 5.9 mp3backup This command copies your entire mp3/ogg collection to a set of CDR discs. This equates to all of the directories in all of the directories specified in the juke_root variable in /etc/jukebox.conf. If rip was called with the two-level directory argument on the command line when the mp3/ogg collection was built, then the top level directories will correspond to the artists names and there will be album directories beneath them. Otherwise, the top level directories will correspond to album titles. As many album directories as possible are grouped together such that they fit on a CDR of the size (in MB) specified in the cdr_size variable in /etc/jukebox.conf. This is 700 by default. If any album directory is too large, mp3backup will abort. This is extremely unlikely even if you use flac or wav files. A catalogue is created to show which directory appears on which CDR (since there will be many CDRs required to backup a typical mp3/ogg collection). This catalogue file is written to all of the backup CDRs. After each CDR is written, this program asks you to confirm that the write was successful. If it wasn't, insert another CDR and try again. To restore an mp3/ogg backup, just mount each CDR in turn and copy its contents back to your music partition(s). Note: This command probably works just as well with recordable DVDs and you'd need far fewer of them (especially if you use flac or wav files). Example: Backup entire mp3/ogg collection mp3backup See "man mp3backup" for more details. 5.10 jukebox This command plays selected music continuously in random or sequential order. CDs that have been transferred to the hard drive using rip are available to be played by jukebox. The command line arguments select tracks to be played. Jukebox looks at the table of contents files created by rip (via mktoc) to determine which tracks match the selection criteria. Searches may be strict or loose. Strict searches only examine the jukebox tags associated with each album or track (See section 3.3). Loose searches (the default) also examine artist names and album and track titles when looking for the selection criteria. The selection criteria take the form of words or quoted phrases with optional '+' and '-' prefix characters. Like web searches, for a track to match the selection criteria, it's data (artist, album, track, tags) must: - contain all terms starting with '+' - not contain any terms starting with '-' - contain at least one of the terms that don't start with '+' or '-' The default selection (i.e. no command line arguments) is a strict search for jukebox tags that match the current user's login name (i.e. $LOGNAME). This means that if your favourite albums and/or tracks are tagged with your login name, then jukebox will, by default, play your favourite tracks. Jukebox has four separate, mutually exclusive functions: - Use command line arguments to select tracks and then play them - Use command line arguments to select tracks and print them out - Use command line arguments to select tracks and print a tag histogram - Read a playlist of track file names and then play them There are many options that affect how the selection criteria are interpreted or how the tracks are played or what details should be printed for each track. Note: This command must only be used directly when there is only a single user of the jukebox and the jukebox network server is not running. If the server is running, then jukeboxc or jukeboxc.jar must be used instead (at least to play music). Example: Play your favourite tracks jukebox Example: List your favourite tracks jukebox -n Example: Create a playlist file of Eric Clapton tracks jukebox -n 'eric clapton' > eric.play Example: Play tracks from a playlist file jukebox -f - < eric.play Example: List all known tags and a histogram of their use jukebox -T -a Example: Play a single album in order, then stop jukebox -s +"janis joplin" +'cheap thrills' Example: Play a single song over and over and over again jukebox -c 'night and day' Example: Play female jazz singers of the 1940's (two versions) jukebox -j +female +vocal +jazz +40s jukebox -jm female vocal jazz 40s Example: Play anything but the Wiggles jukebox -- -wiggles Note that the "--" argument signifies the end of the command line options. It is needed whenever a search term begins with "-". If jukebox has been configured to accept long options, then it is also needed whenever a search term begins with "+". See "man jukebox" for more details. 5.11 jukeboxd This command is the jukebox network server. It binds to and listens on the address and port specified in the juke_addr and juke_port variables in /etc/jukebox.conf. By default, the address is 0.0.0.0 and the port is 1221. These values can also be supplied on the command line. When a jukebox client makes a request to play music, jukeboxd launches jukebox as a named daemon to service the request, then it disconnects from the client. When a client makes a request to stop playing music, jukeboxd stops the named jukebox daemon. When tracks are played in random order, there is a gap between each track specified in the juke_gap variable in /etc/jukebox.conf. This is two seconds by default. When tracks are played in sequential order, there is a gap before the first track but none between tracks. This command is either launched by init at boot time (see jukeboxd-init.d) or by inetd or xinetd whenever a client makes a connection. jukeboxd is smart enough to know the difference and act appropriately in each context. See "man jukeboxd" for more details. 5.12 jukeboxc/jukeboxc.jar This command is the jukebox network client. There are two versions of this command. One is a command line utility written in perl (jukeboxc). The other has a graphical interface written in java (java -jar jukeboxc.jar) The graphical client is intended for Windows hosts but can also be run on Linux hosts with "jukeboxc -g". The command line client is very similar to jukebox itself. The graphical client uses checkboxes, buttons and a text entry field instead of options and arguments but is otherwise very similar. Both can be used to select and play or list tracks, and to save playlists to files and play them later. See "man jukeboxc" and "man jukeboxc.jar" for more details. 5.13 jukeboxd-init.d This command is the init/boot script that launches jukeboxd every time the system boots. This script takes the usual assortment of SVR4-style init script arguments: start - Start the jukebox network server stop - Stop the jukebox network server status - Show whether the jukebox server is up or down restart - Stop then start the jukebox network server reload - Stop then start the jukebox network server Note: This command must not be used if inetd or xinetd has been set up to run jukeboxd when jukebox clients connect to the jukebox host. See "man jukeboxd-init.d" for more details. 6. Questions This section answers some questions that I thought people might ask. 6.1 How do I rip an audio CD? To rip an audio CD into wav files in the current directory: rip -w To rip an audio CD into mp3/ogg/flac files for use by jukebox: rip artist-name/album-title See section 5.1 for more details. 6.2 How do I burn an audio CD? To burn the wav files in the current directory to a CDR: burn *.wav See section 5.7 for more details. 6.3 How do I backup an audio CD? cdbackup See section 5.8 for more details. 6.4 How do I burn a data CD? cdr cdrootdir See section 5.6 for more details. 6.5 How do I compile a CD of selected tracks from various sources? Use riptrack to assemble the tracks and burn to write them to a CDR. See section 5.2 for more details and an example. 6.6 How do I backup the jukebox? mp3backup See section 5.9 for more details. 6.7 How do I control the jukebox from a Windows host? Run the jukebox network server on a Linux host (see section 3.4) and use the graphical jukebox network client (see section 4.2.2) from the Windows host. 6.8 How do I add my existing mp3 collection to the jukebox? Adding existing mp3 files to the jukebox collection involves either adding their directory to the juke_root variable in /etc/jukebox.conf (see section 3.1) or creating directories under one of the existing juke_root directories and placing mp3 files into these directories. Each directory containing mp3 files must have a table of contents file to provide names and tags for all of the tracks in its directory (see section 3.3). mktoc might be useful here for creating tocfile templates. If each directory represents a CD, and the CD is at hand, then mktoc can use cddb to obtain artist, album and track details to create the tocfile needed by jukebox. 6.9 How do I add my vinyl/tape collection to the jukebox? To play music, the "line out" socket of your computer's sound card should be connected to one of the RCA inputs to your sound system's amplifier. To copy your vinyl/tape collection, you have to reconnect the computer and sound system so that the amplifier's "rec out" socket is connected to the sound card's "line in" socket. Then, play your vinyl albums and audio tapes while the computer is running recording software (e.g. sox/rec or mpegrec). You will probably want some sound editing software (e.g. audacity) to partition the recorded data into tracks. The resulting wav files (if rec was used) can be encoded to a smaller format and placed into directories accessible to jukebox by using rip. Finally, tocfiles must be created with mktoc and the tracks may need to be named with toc2names (see sections 3.3 and 6.8) so that jukebox will know that they're there and know what they are. 6.10 How do I add support for another audio CD reader program? Look for the following code in rip and riptrack: case "$cdr_rip" in cdda2wav) rip_args="...";; cdparanoia) rip_args="...";; esac Add a case for the new reader program and specify all of the arguments it requires. You may also want to add a new command line option to select this reader in favour of the default specified in /etc/jukebox.conf. Note that even without this code change, the same effect can be achieved with the --reader option to both rip and riptrack. 6.11 How do I add support for another encoder program? Look for the following code in rip: case "$wav_enc" in lame|notlame|gogo) wav_enc_args="...";; bladeenc) wav_enc_args="...";; oggenc) wav_enc_args="...";; flac) wav_enc_args="...";; esac Add a case for the new encoder program and specify all of the arguments it requires. You may also want to add a new command line option to select this encoder in favour of the default specified in /etc/jukebox.conf. Note that even without this code change, the same effect can be achieved with rip's --encoder option. 6.12 How do I add support for another player program? To use a different program to play tracks, just modify the juke_player variable in /etc/jukebox.conf. See section 3.1 for more details. 6.13 Why can't jukebox find my player program? When the jukebox network server is being used, the PATH environment variable is set to /bin:/usr/bin so any commands used in the juke_player variable (directly or indirectly) must either be in /bin or /usr/bin or they must be absolute paths. 6.14 Why does rip use temporary hard drive space? Some audio CD ripping programs read one track at a time and pipe the audio data straight into an encoder program so as not to use any intermediate storage. The rip program that comes with jukebox doesn't do this for a very good reason. Reading one track at a time and encoding it on the fly means that the CD pretty much has to stay in the drive until the all tracks have been encoded. Reading a CD only takes 5-10 minutes (40x with cdparanoia). Encoding a CD can take 10-55 minutes on my 450MHz Celeron (depending on the format and encoder). Reading the entire CD onto hard drive before encoding means that the CD can be taken out of the drive as soon as the reading ends and the tocfile has been created but before the encoding begins. Then another CD can be inserted immediately and the process repeated in a new rip process. Once enough CDs have been read and are now being encoded, you can walk away from your computer for a while. In other words, saving on hard drive space can mean ripping 1 CD every 15-65 minutes. Using the hard drive can mean ripping 1 CD every 5-10 minutes. Pipelining is your friend. Hard drives are cheap. Time is not. People who use gogo on a 2GHz+ machine probably think I'm being silly but those who don't have 2GHz+ machines or who prefer ogg will appreciate it. It does mean that you need lots of spare hard drive space (e.g. 3GB to rip 5 CDs at once) but that's one of the fundamental assumptions of jukebox: That you want to play lots of music and have lots of hard drive space in which to store it all. 6.15 How do I clean up wav files as soon as they are encoded? When using an encoder that takes two arguments (i.e. in.wav out.mp3), the wav files are automatically deleted as soon as they can be. However, when using an encoder that takes any number of wav filename arguments, the wav files aren't deleted until all files have been encoded. If you want each wav file to be deleted as soon as it has finished being encoded (helps pipelined rips when running out of disk space), you could use this script: #!/usr/bin/perl -w use strict; # scavenge - delete wav files as soon as their mp3 counterparts are finished die "usage: $0 directory\n" unless defined $ARGV[0]; chdir $ARGV[0] or die "failed to chdir($ARGV[0])\n"; for (;;) { my @wav = glob '*.wav'; die "no wav files found\n" unless @wav; my @mp3 = glob '*.mp3'; exit 0 if @mp3 && @wav == 1; # let rip delete the last one for (@wav) { my ($prefix, $index, $suffix) = $_ =~ /^(.*)(\d\d)(.*)\.wav$/ or die "Unexpected filename: $_\n"; my $next = sprintf '%02d', $index + 1; print("unlink $_\n"), unlink($_) if -f "$prefix$next$suffix.mp3"; } select(undef, undef, undef, 5); } Here's an example use: rip artist-name/album-title # in one window daemon scavenge /mnt/music/artist-name/album-title # in another window 6.16 Which reader should I use? Use cdparanoia. Unlike cdda2wav, it pays more attention to what it's doing and performs error correction for scratched CDs. Some CDs are beyond hope, though, so don't expect miracles. 6.17 Which encoder should I use? For best sound quality, use flac (lossless compression). For much smaller files, use ogg (lossy compression). The files are about the same size as mp3 (also lossy) but ogg claims to have better acoustic models than mp3 so less damage is done to the sound quality. For compatibility with the rest of the universe, use mp3. There are more mp3s around than any other format. Hence there is much better support around for mp3 than any other format. Portable mp3 players exist (wearable, vehicle). Portable ogg/flac players do not yet exist. There are many mp3 encoders (e.g. lame, notlame, gogo, bladeenc). I don't know which is "best". There are comparisons available on the web. Read them. Experiment, compare and decide in accordance with your needs. I'm sure they're all fine choices if the bitrate is high enough. For speed, use gogo. But remember, sound quality is more important than encoding speed. You're only going to encode a track once but you may listen to it many times. In other words, it depends :) 6.18 How long does it take to rip and encode an audio CD? Reading speed depends on your CDR device and on the health of the CD. On modern drives it only a takes a 5-10 minutes (40x with cdparanoia). If the CD is damaged, it can take much longer. Encoding speed depends on which encoder you use and the speed of your computer. The table below shows how long it took my 450MHz Celeron to encode a 766MB CD (Janis Joplin with Big Brother And The Holding Co. Live at Winterland '68). gogo 607.96s user 11.73s system 98% cpu 10:29.12 total lame 1551.87s user 10.88s system 98% cpu 26:26.51 total notlame 1740.58s user 9.85s system 98% cpu 29:31.50 total bladeenc 1967.17s user 9.64s system 98% cpu 33:18.48 total flac 2357.53s user 15.86s system 98% cpu 39:59.26 total oggenc 3264.64s user 10.50s system 98% cpu 55:24.38 total Whichever encoder you use, it takes time. It can take weeks or months to transfer a large CD collection to computer. 6.19 How much hard drive space will I need? This depends on the format and bitrate that you use. The table below shows the amount of space needed to store the CD used in section 6.18 using different encoders. The bitrate used for the ogg and mp3 files is 192 kbps. This seems to be the minimum bitrate that anyone recommends. Obviously a lower bitrate produces smaller files and a higher bitrate produces larger files. Also note that CDs vary wildly in size. The figures below assume that all CDs are enormous. Encoder Size Percentage 1000 CDs -------- --------------- ---------- -------- wav 804055336 bytes 100.00% 805GB flac 479735863 bytes 59.67% 480GB oggenc 110431557 bytes 13.73% 111GB lame 109422112 bytes 13.61% 110GB notlame 109422112 bytes 13.61% 110GB gogo 109408959 bytes 13.61% 110GB bladeenc 109398940 bytes 13.61% 110GB At the time of writing, ogg and mp3 are the only formats useful for storing large numbers of audio CDs. Storing 1000 CDs can be achieved with these formats on current hard drives. It will require 500GB or 1TB hard drives for flac or wav to be useful. 6.20 Can jukebox play music videos? Jukebox is extensible with respect to file formats and player software so it's capable of playing anything, including music videos such as MPEG files. However, you need player software that takes a file name argument, plays the file and then terminates. Usually, MPEG player software doesn't automatically terminate when it has finished playing the file because that's not normal GUI behaviour. This needs to be addressed before the player can be used by jukebox. Assuming you have such a player, it can be used by jukebox by modifying the juke_fmt and juke_player variables in the configuration file. See section 3.1 for more details. 6.21 What can I do about CDR failures? Sometimes nothing but try again with another CDR. However, many times a CDR will fail to burn just because you're trying to write to it too fast. But all is not lost! When you try to burn a CDR and it fails at the very beginning (before it's written anything), just try again with the same disc at half the speed of the previous attempt. This will usually work and you won't have to throw away as many CDRs as you thought. You can even set the default writing speed to half of what the drive is capable to improve the chance of burns working first time if you don't mind the extra time lost. 6.22 Any advice? For the ultimate in slack, define one of the following aliases: alias j=jukebox # when not using the jukebox network server alias j=jukeboxc # when using the jukebox network server Then, to start playing your favourite tracks, all you have to type is: j And to stop the music: j . It doesn't get much easier than that (ok, alias !='j .').