Yup, it’s another guide to installing Rivendell. This time, the fancy new 2.0.2 release, complete with all sorts of fantastic goodies. Let’s get started!
I’m not moving any of my Ubuntu stuff forward to 11.04 just yet; probably won’t for a while, given the situation with desktop managers and stability particularly on older hardware like the stuff we use at Insanity. So, 10.04.02 LTS it is. It’s still supported for a while and has no realtime issues like 10.10.
However, there’s one snag; in my last guide we used a Rivendell package provided by the guys at Tryphon. No such package currently exists for 2.0.x, so we’ll be rolling our own from source. This is far from ideal (and I am working to get 2.0.x packages for Debian made) but it’s a good start, and will work fine- upgrades are just a bit of a pain.
Okay. Let’s start with dependencies. I’m assuming a virgin from-source system here.
sudo aptitude install libcdparanoia-dev libflac++-dev libflac-dev \ libsamplerate0-dev libid3tag0-dev libid3-3.8.3-dev \ libcurl4-gnutls-dev libsndfile1-dev libpam0g-dev \ libsoundtouch1-dev alsa-source libtwolame-dev libmp3lame-dev \ libmad0-dev libqt3-mt-mysql qt3-dev-tools qt3-dev-tools-compat \ qt4-dev-tools libjack-dev libjack0.100.0-dev jackd qjackctl \ jackeq jack-rack jack-capture libasound2-dev mysql-client \ polymer qt3-qtconfig patchage
Stick that in your terminal and wait a few minutes. There’s a lot there. At some point, jackd will ask if you want to enable realtime priority – say yes. Once that’s done, download the Rivendell tarball and extract it. Then wander into that directory.
wget http://rivendellaudio.org/ftpdocs/rivendell/rivendell-2.0.2.tar.gz tar zxf rivendell-2.0.2.tar.gz cd rivendell-2.0.2
Next, configure it- the libexec path makes sure that the paths for some new RD2 services are set up properly (specifically Apache2). Note that if you need a HPI sound card to work in this box, now would be the time to go off and install the drivers from the AudioScience website (libhpi). Do that before this.
Now build it, and subsequently install all the binaries and libraries.
make sudo make install
This is going to take a while, even on decent modern hardware, so let me give you a taste of what’s still to come- specifically we’ve got one more hurdle ahead of us on top of the setup we needed for 1.7.2, which is the Apache web server. Rivendell 2.0.x uses a web service approach to import and export of audio data, which is a great leap forward- as well as making security improvements, it means you can delegate the import/export jobs to specific machines. Say you’ve got a pile of low-end production PCs- you don’t really want those guys to be on the front line of audio ingest. The high-end server in the rack that doesn’t do a lot, however, is completely the tool for the job. So you can tell those production PCs to use the import/export services of that server instead of their own. The flipside is we get to configure an extra thing, but it’s really a piece of cake. Don’t sweat it. And like MySQL, you don’t have to install Apache on every single machine you want to run Rivendell on, only the ones that will be using the import/export service.
Right. Chances are, make is probably still chugging away despite my attempt to distract you. Come back when it finishes.
All done? Installed? Okay, we’re about halfway there. You should now have a complete build of Rivendell with support for every format under the sun (that Rivendell supports, anyway- AAC/MP4 one day, I swear!) with support for ALSA or JACK or (if you installed libhpi before configuring) HPI sound cards. Next, let’s get the cosmetic things done- installing icons and menu items, ensuring bitmap fonts are enabled, that sort of thing.
sudo cp debian/*.desktop /usr/share/applications/ sudo cp debian/*.xpm /usr/share/pixmaps/ sudo rm -rf /etc/fonts/conf.d/70-no-bitmaps.conf sudo ln -s /etc/fonts/conf.avail/70-force-bitmaps.conf /etc/fonts/conf.d sudo fc-cache -f -v
That’s that out of the way. Next, set up a Rivendell user and group, add the current user to the audio group (for realtime permissions) and we can get on with the rest.
sudo adduser --system --no-create-home --disabled-login rivendell sudo addgroup rivendell sudo adduser rivendell rivendell sudo adduser `whoami` audio
Okay, we’re getting somewhere. Now, rd.conf. Either copy up conf/rd.conf-sample to /etc/rd.conf, or make a new one that looks a bit like this:
[Identity] AudioOwner=rivendell AudioGroup=rivendell Password=letmein [mySQL] Hostname=localhost Loginname=rduser Password=letmein Database=Rivendell Driver=QMYSQL3 [Logs] Facility=Syslog [Alsa] PeriodQuantity=4 PeriodSize=1024 [Tuning] UseRealtime=Yes RealtimePriority=9 [Format] Channels=2
Bam! Obviously you’ll want to use different passwords to the default and that sort of thing. We’re going with ALSA for now; using jackd is a simple (trivial, even) change to rd.conf. Check the conf/rd.conf-sample file in the source to find out how. Let’s get one other bit of housekeeping done now- we need to configure what sound cards we use for ALSA, which is set in /etc/asound.conf. But easier still, Rivendell provides a program to make this file for us. Pull up a terminal and run this to get this up and follow the instructions:
Once that’s done, let’s bop Apache on the head quickly. Note you only need this is if you’re running a single machine setup or if you’re installing on the machine you want to run import/export jobs on. There’s no harm in having apache/rdxport available, but it’s unneeded overhead if you’re going to delegate to other boxes anyway. Still, say we wanted to install it…
sudo apt-get install apache2 sudo cp conf/rd-bin.conf /etc/apache2/conf.d/ sudo service apache2 restart
Simple, right? Right. Let’s move on and get MySQL sorted out. This is for the main server only if you’re doing client-server stuff; you’ve already got the MySQL client installed if you’re building a client to connect to another existing MySQL server. Run this and when prompted, give it a nice secure password.
sudo apt-get install mysql-server
Let’s get the DB and sound path created and check all is well. Run this and when prompted enter your MySQL root password and the username ‘root’ (if this is your first DB – otherwise, it should just open. Close it, ignore any errors).
sudo mkdir /var/snd sudo chown rivendell:rivendell -R /var/snd rdadmin
Okay. We’ve only got to sort one little snag out before we’re good to go- making sure Rivendell services come up cleanly on startup of the machine. There’s complications here, specifically /var/run which gets purged on startup by Ubuntu. Rivendell expects /var/run/rivendell to exist and the rivendell user/group to be able to write there- PIDs are stored for various processes here. Let’s fix that by tweaking our initscript, then set the initscript to start Rivendell on boot.
sudo nano -w /etc/init.d/rivendell
In that script, add the following line before the line that reads ‘function StartDaemons’.
mkdir /var/run/rivendell 2>/dev/null
Okay, now run this- this will make Ubuntu start the daemons on boot.
sudo update-rc.d rivendell defaults
One last thing – edit /etc/pulse/client.conf and uncomment the autospawn=yes line, and set it to no. This stops pulseaudio taking over the sound card so ALSA can get at it.
sudo nano -w /etc/pulse/client.conf # (then do the edit) sudo killall pulseaudio
And now we reboot and if everything went to plan, you should now have a working Rivendell installation on your system! Check for ripcd/caed/rdcatchd running, fire up rdadmin and friends, and get to configuring your perfect station.
A few observations
Currently there’s a segfault in Rivendell 2.0.2 with some ALSA cards. If caed doesn’t start up and /var/log/messages has a pile of caed output and then a segfault and you’ve got multiple cards available to you in rdalsaconfig, try disabling/enabling each one till you find a working one. Use ‘sudo service rivendell restart’ to restart the daemons without rebooting.