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.
Some rpms need to be downloaded. Here's why :
Redhat 7.0 bug fixes
Glibc on 7.0 is broken in several ways. While perhaps not directly affecting Gjukebox, you probably should upgrade. You're going to be downloading big files anyway to get the MySQL fixes so you may as well get these if you havn't already.
MySQL files were broken in several ways and upgrading is essential. The most glaring problem is permissions on /var/lib/mysql/mysql.sock. If you have the broken MySQL from 7.0 you simply must upgrade. The upgrade will also require the new version of perl-DBD-MySQL.
Bladeenc
Actually you can use Xing, Lame or Blade. My personal choice is blade because it supposedly does best on high bitrates. Since hard drives are so cheap now I see no reason to encode at less than 256kbits, so blade it is. The author of blade is deeply concerned about the MP3 patents owned by Thomson. As a consequence he distributes source only, relying on other people to package RPMs. The link points to a working RPM as of this writing.
mpg123
This mp3 player is included in the standard RH workstation install, and seems to work just fine. It unfortunately has a bug that affects use with Gjukebox only. The version built by RedHat is the `esd' version. It sends the sound output to the esd daemon rather than directly to the sound card. Esd can take several simultaneous sound sources and mix them, sending the mixed results to the sound card. The computer can therefore play an mp3 and can make sounds for error messages at the same time. Mpg123 as supplied by RedHat seems to have problems coping with esd output and remote mode ( specified with the -R option ), which is the mode required by Gjukebox. The problem is not immediately apparent because it manifests as clicks and pops on some songs. It's definitely a bug in mpg123.
The solution to this is to use a version of mpg123 that outputs directly to the soundcard and not via esd. You can either compile your own mpg123 or use the link to download the version built for Mandrake which works fine. You lose the extra functionality of esd but it's really not much a problem, and system performance is better anyway.
Redhat 7.0 Workstation |
Redhat 7.1 Workstation |
Mandrake 8.1 Workstation |
|
CD 1 aumix-2.x |
CD 1 aumix-2.x |
CD:s aumix-2.7 |
|
CD 2 wget-1.5.x |
CD 2 mysql-3.23.x | |
|
PowerTools CD Perl-DBI-1.x |
PowerTools CD libcdaudio1.00 | |
|
Download from net Bladeenc ( hard to find, try a Google search on `bladeenc rpm' if not working ) glibc-2.2.4-18.7.0.i386.rpm mysql-3.23.32-1.7.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 ) |
|
MySQL 3.22b14 or above |
|
|
Apache 1.3.x |
|
|
PHP3 or later With MySQL and GD PNG support |
|
|
libcdaudio |
|
|
Version 0.99.4 or above libshout if icecast support is required ( optional ) |
|
|
aumix |
Standard in RedHat/Mandrake based distributions |
|
tplay or esdplay or play |
tplay : http://www.cs.tut.fi/~ik/tplay.html
or |
|
cdparanoia |
|
|
bladeenc, lame or xing |
bladeenc http://bladeenc.mp3.no/ |
|
atd wget |
|
|
mpg123 |
|
|
mpmf20 ( optional, for MPMan F20 player support ) |
|
|
rio ( optional, for Rio player support ) |
|
|
Perl 5.004 or later |
|
|
MPEG::MP3Info (Perl module) |
|
|
DBI (Perl module) |
|
|
DBD::mysql (Perl module) |
|
|
MIME::Base64 (Perl module) |
After installing the RPMs you probably need to start the apache and mysql daemons :
/etc/init.d/httpd start |
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.
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 |
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.
The CPAN module will ask some basic configuration details. The most important is the prerequisites policy. This determines how CPAN will load other modules that are required by the module being installed. You must set this policy to 'ask' otherwise CPAN may decide you need a new version of Perl.
You also need to tell CPAN which mirrors to attempt to download from. You want 3 - 5 sites defined, so choose two countries with 2-3 sites from the first and 1-2 from the second. Don't put too many sites - CPAN is not smart about missing files and it will try each mirror in turn before giving up.
CPAN will also carp about needing Net::FTP or Bundle::libnet. Install these with `install Bundle::libnet' if you can be bothered.
Explanation of database users and passwords :
Mysql has an internal set of users and passwords. They are used to grant different access to different databases, and within a database each user can have different privileges. The user / password pairs are stored within Mysql and have no correlation with Unix system login / password pairs.
Login name for the Jukebox database user: The Jukebox connects to the database by supplying this login name and password. The process is invisible to the user. The name is created by the installer and is restricted to accessing the music database named in the previous step. While not a big security risk, you might want to choose something harder to guess than the defaults.
When a user adjusts the volume setting the browser sends commands to the web server Apache. The Jukebox PHP code running in Apache in turn sends the command to a process listening on port 1339. For security reasons this process accepts connections only from the local IP address ( ie the web server ). The only situation where the addresses will be on different machines in when the web server is running on a different machine than the machine producing output via the soundcard. This is very rare.
Post install
After installation you should tweak a few final details :
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.
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...]...
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 |
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 |
If this does not produce sound then something is broken between mpg123 and the soundcard. Check :
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 |
Another thing to try is to manually run one of the programs that accesses the CD drive :
|
cd /usr/local/jukebox |
You should get the cd title etc and a list of track lengths.