Installation

The specs for Jukebox include a long list of dependencies on external programs. It seems intimidating at first, but many of the programs are included in standard Linux distributions.

We're going to assume you're using RedHat 7.x or Mandrake 8.1. Any distro should work of course and the following instructions will largely apply.

First, please be aware that Redhat 7.0 has quite a few problems and bugs. If you have the choice use 7.1 or Mandrake 8.1.

In the table you'll see the names of the packages you need to install. The names are approximated with `x' to indicate that any close version will probably work ( we didn't have a RedHat 7.2 cd set to check against ). Insert the CDs in the given order and install each package with rpm -ivh [name] and press [tab] to complete the name instead of the `x' character. Make sure you install them in the specified order. We assume your RH installation was a basic `Workstation' type. If you did a custom install, or `choose packages' then chances are you already some or all of these.

Download some files

Some rpms need to be downloaded. Here's why :

Redhat 7.0 bug fixes

Bladeenc

mpg123

Redhat 7.0 Workstation

Redhat 7.1 Workstation

Mandrake 8.1 Workstation

CD 1

aumix-2.x
apache-1.3.x
cdparanoia-xx
( probably is already installed )
xinetd2.1.x

CD 1

aumix-2.x
apache-1.3.x
cdparanoia-xx
( probably is already installed )
Perl-DBI-1.x
wget-1.5.x
php-4.0.x
xinetd2.1.x

CD:s

aumix-2.7
cdparanoia-IIIa9.8
apache-1.3.20
mod_php-4.0.6
php-gd-4.0.6
php-mysql-4.0.6
MySQL-3.23.41
MySQL-client-3.23.41
MySQL-shared-3.23.41
perl-Mysql-1.22_16
perl-MP3-Info-0.91
perl-MIME-Base64-2.12
wget-1.7
libcdaudio1-devel-0.99.4
libcdaudio1-0.99.4

CD 2

wget-1.5.x

CD 2

mysql-3.23.x
mysql-server-3.23.x
mysql-devel-3.23.x
php-mysql-4.0.x
perl-DBD-MySQL-1.2x

PowerTools CD

Perl-DBI-1.x
libcdaudio-0.9x

PowerTools CD

libcdaudio1.00

Download from net

Bladeenc ( hard to find, try a Google search on `bladeenc rpm' if not working )

Redhat.com 7.0 updates

glibc-2.2.4-18.7.0.i386.rpm
glibc-common-2.2.4-18.7.0.i386.rpm
glibc-devel-2.2.4-18.7.0.i386.rpm
libstdc++-2.96-85.i386.rpm

Why you need new mysql

mysql-3.23.32-1.7.i386.rpm
mysql-server-3.23.32-1.7.i386.rpm
mysql-devel-3.23.32-1.7.i386.rpm
perl-DBD-MySQL-1.2215-1.i386.rpm
php-4.0.4pl1-3.i386.rpm
php-mysql-4.0.4pl1-3.i386.rpm

mpg123 ( probably already have this, but there are problems with the RH version. Download and upgrade with rpm -F

Download from net

Bladeenc ( hard to find, try a Google search on `bladeenc rpm' if not working )

mpg123 ( probably already have this, but there are problems with the RH version. Download and upgrade with rpm -F

Download from net

Bladeenc ( hard to find, try a Google search on `bladeenc rpm' if not working )

mpg123 ( the version supplied by Mandrake may work OK, but you should upgrade with rpm -F if possible )

 

Raw Requirements - if you prefer to compile from the source.

MySQL 3.22b14 or above

http://www.mysql.com/

Apache 1.3.x

http://www.apache.org/

PHP3 or later With MySQL and GD PNG support

http://www.php.net/

libcdaudio

http://cdcd.undergrid.net/libcdaudio/

Version 0.99.4 or above libshout if icecast support is required ( optional )

http://developer.icecast.org/libshout/

aumix

Standard in RedHat/Mandrake based distributions

tplay or esdplay or play

tplay : http://www.cs.tut.fi/~ik/tplay.html or
esdplay : http://www.tux.org/~ricdude/EsounD.html
play is standard in RedHat/Mandrake in sox package

cdparanoia

http://www.xiph.org/paranoia/

bladeenc, lame or xing

bladeenc http://bladeenc.mp3.no/
lame http://internet.roadrunner.com/~mt/mp3
xing http://www.xing.com/

atd wget

http://ftp.sunet.se/pub/gnu/wget

mpg123

http://www.mpg123.de/

mpmf20 ( optional, for MPMan F20 player support )

http://www.world.co.uk/sba/mpman

rio ( optional, for Rio player support )

http://www.world.co.uk/sba/rio.htm

Perl 5.004 or later

http://www.perl.org/

MPEG::MP3Info (Perl module)

http://www.perl.org/

DBI (Perl module)

http://www.perl.org/

DBD::mysql (Perl module)

http://www.perl.org/

MIME::Base64 (Perl module)

http://www.perl.org/

 

Start some daemons

After installing the RPMs you probably need to start the apache and mysql daemons :

/etc/init.d/httpd start
/etc/init.d/mysqld start

Tweak system parameters

Several system parameters need to be adjusted to make the Jukebox work correctly. The most common problem is permissions on the cdrom drive. The cdrom on a RedHat 7.x and Mandrake system has permissions for owner and group to read, but not anyone else. This is a problem during ripping CDs because the ripping process is spawned with the apache user ID ( usually `nobody' ) which cannot access the CD drive.

Fix the CD permissions :

chmod a+r /dev/cdrom

RedHat & Mandrake systems require a further change : edit /etc/security/console.perms and look for the `cdrom' entry at the end of the file. Change the 0660 next to `root:disk' or 'root:cdrom' so that it reads 0666. This file is used to define permissions that are granted to users logging in from the console ( the keyboard & monitor physically attached to the box ). The reasoning is that anyone with physical access to the keyboard should also have access to the physical devices in the box, such as the CD. This program defines how those permissions are granted upon login from the console, and how they are revoked upon logout. If you don't edit this file then the system will revert the permissions to /dev/cdrom when the console logs out, for example at system reboot.

Installing Globecom Jukebox

After the marathon RPM session, we move on to the Gjukebox code. Download into a directory - /usr/src or /usr/local/src are good places. Become root if you're not already.

cd/usr/src
tar -xzf gjukebox.tgz
cd /usr/src/gjukebox
./build

The installer script begins by looking for a number of programs that it uses during execution. It prompts for the path to a program only if it cannot find it. If the program still cannot be found and it's essential to Gjukebox, the installer will terminate and you'll have to go back to the CDs and find that program. Some programs are optional and Gjukebox operates just fine without them. The first two questions from the installer are probably :

Cannot find program `mpmf20'...
Cannot find program `rio'...

Press enter and let the installer continue. These programs are for downloading songs to Mp3 players. If you own the player unit you'll have the software and if not you don't care.

Post install

After installation you should tweak a few final details :

  1. Make sure xinetd is running and start it with /etc/init.d/xinetd start if not. It won't run unless it has at least one service defined. A default RH7 workstation doesn't define any services to the process won't run though the start script claims it's OK. An xinetd service is created at end of the install script so after installing Jukebox you need to start it if it's not running.
  1. Run linuxconf and make sure mysql, apache and xinetd are set to run automatically. Under `control service activity' you'll see the options to do this.
  1. The Gnome cd player is set to launch automatically and play audio CDs when they're inserted. This gets annoying when you're ripping lots of CDs. To fix this click the `toolbox' icon in the Gnome task bar. Locate `peripherals' section on left side and click `CD Properties' In the Audio CDs section uncheck `Run command when CD is inserted'.
    If you have problems ripping CDs you might need to turn off the other options in this panel.
  1. Run aumix and set the overall volume to something reasonable. Check Pcm and Spkr outputs are OK also. Save the settings before you exit so they are restored on reboot.

Starting the Jukebox

/usr/local/jukebox/jukebox start

Start the Jukebox by running the `jukebox' script, passing either `start' or `stop'. The script launches two daemons : playit.pl and ripd.pl. Playit is responsible for grabbing the next song from the playlist and passing it to script that can handle that file format - playmp3.pl for mp3 files for example. Ripd.pl handles ripping CDs and also file format conversion and other batch tasks. If you import a bunch of MP3 files then ripd will handle the analysis of each file for the volume normalization.

Now point your browser to the IP of the machine + the path to the jukebox. The default path suggested by the installer is `music', something like `http://machine.domain.com/music' should work, or an `Ipaddress/music' or even just `localhost/music' if the browser is running on the same box.

You will immediately see a login window. Enter `admin' for the name and `2bchanged' for the password ( these are defaults created by the Jukebox ). After this you will see the welcome screen where you can setup a different account and choose the default UI theme.

Using the Jukebox is very simple. You will begin by either importing some existing MP3 files ( run the getmp3id3 script to batch import large numbers ) or rip your CD collection. Select individual songs for playing from the `Browse' view or entire Albums from the Album view.

Final steps

You might want to copy the `jukebox' script into /etc/init.d/ and then link from rcx.d to it so that it starts automatically on reboot.

 

Troubleshooting

No UI for Jukebox

Check processes running. On RH 7.x they are :

Apache

somepath/httpd [arguments]
    somepath/httpd [arguments...]
    somepath/httpd [arguments...]...

Mysql

anotherpath/safe_mysqld [arguments...]
    path/mysqld [arguments...]
    path/mysqld [arguments...]...

UI shows, but no songs play.

Check the obvious

Check the running processes. You should see

playit.pl
    perl /usr/local/jukebox/getnextmp3.pl
        /usr/bin/mpg123 -R dummy
ripd.pl

playit.pl is responsible for playing songs, calling Getnextmp3.pl to do the work. This script pulls the next song from the playlist and instructs mpg123 to play it. If the playlist is empty then it populates it with random songs according the groups setup.

If you don't see these processes then probably something has failed in starting or running the jukebox. You can get some additional information if you start the Jukebox daemons by hand :

cd /usr/local/jukebox
./jukebox stop
./playit.pl

Any errors generated by playit.pl or child processes will be directed to the window. This should help debug the problem

Try mpg123 standalone

cd /usr/local/jukebox
./jukebox stop
mpg123 [mp3 file name]

If this does not produce sound then something is broken between mpg123 and the soundcard. Check :

Can't RIP CDs

The first thing to check is permissions on the CD :

chmod a+r /dev/cdrom

RedHat & Mandrake systems require a further change : edit /etc/security/console.perms and look for the `cdrom' entry at the end of the file. Change the 0660 next to `root:disk' or 'root:cdrom' so that it reads 0666.

Is jukebox pointing to the right cdrom link ( /dev/cdrom ). Jukebox gets this from 'defsjukebox.pl', which in turn is set via the installer.

Does that link point to the right IDE device ? /dev/hdb or whatever.

Something else is opening the CD ? The Gnome cd player is set to launch automatically and play audio CDs when they're inserted. This gets annoying when you're ripping lots of CDs. To fix this click the `toolbox' icon in the Gnome task bar. Locate `peripherals' section on left side and click `CD Properties' In the Audio CDs section uncheck `Run command when CD is inserted'. You may also need to uncheck the automount options below this.

The ripping task is controlled by the ripd.pl daemon. Make sure it's running. If not try running it manually by stopping the jukebox and running `ripd.pl' from the prompt. It will fork to the background but debug and error output will get sent to the console :

cd /usr/local/jukebox
./jukebox stop
./ripd.pl

Another thing to try is to manually run one of the programs that accesses the CD drive :

cd /usr/local/jukebox
./trackno.pl cddbmatches

You should get the cd title etc and a list of track lengths.