After folks get past the easy install of Rivendell they many times hear about JACK and all the neat things you can do with it. However, JACK is a program that has a lot of twists and turn to figure out mostly because the packagers have decided against a one-size-fits-all setup. The Ubuntu/Debian packages for Rivendell seem a bit that way too considering how much “tweeking” we do after the packages are installed to get it to work correctly on RRAbuntu.

Now I would not say RRAbuntu is a one-size-fits-all installation. It is more like a it-is-a-good-place-to-start-and-it-works-this-way-so-why-fix-it installation (Just try and say that 5 times fast! ).

The biggest issues with getting JACK setup are:

1) Figuring out JACK’s idiosyncrasies

2) Figuring out the best way to interface JACK with current sound systems

3) Figuring out the best way to interconnect JACK aware programs with JACK

Now before we begin, why might you want to setup JACK with RRAbuntu? With the default RRAbuntu installation we use ALSA and disable Pulse Audio. We do the later because we do not want Pulse Audio to grab the sound card and then Rivendell cannot use it.

ALSA only allows one audio application at a time to use a sound card. You could install another sound card and use one for Rivendell and the other sound card for other applications. However, I am not going to cover that in this post.

With JACK we still use ALSA but JACK handles all the connection to ALSA. The best way to think of JACK is like a big patch panel for audio. We can connect audio applications and sound devices together automatically or manually. This allows us to have Rivendell on a computer and also run Audacity to edit some audio and still be able to hear it. JACK stands for the Jack Audio Connection Kit . It is a recursive acronym in that it refers to itself. Considering that ack is a sound of disgust in some places in the world it is all the better to name it JACK and not ACK.

But some of you may say, “Hey what about Pulse Audio? It is the default sound system on Ubuntu and I want to hear the system sounds and such.” Well since the last version of RRAbuntu was released (1.13) I have learned how to interface JACK and PulseAudio so that you can have sound from non-JACK aware applications as well, however this has proved not so stable in testing when stopping and restarting jackd. I am still working on this but the fact that a reboot was needed to allow jackd to start again is not a good thing in my book. I need to research that setup more.

So, on to the setup. First the assumptions. You did an install from the RRAbuntu 1.13 CD and ran the First Run script. This may work with other Rivendell versions (1.7.2 is what we are testing with) or other releases or Ubuntu distros (Ubuntu Lucid 10.04 LTS in what we are using). And once again the point is not to assume you know anything nor to teach you, so if you learn something that is great bit it may take a bit of reading up on your part.

1) Stop the Rivendell daemons

sudo /etc/init.d/rivendell stop

2) Setup a startup script which waits to start Rivendell until jackd has started. Download the startup script from my blog posthere (right-click> “Save Linked Content As…”) and save it as /etc/init.d/rivendell. Make it executable and change the variableWAITFORJACK=0 to WAITFORJACK=1.

6) At this point the easiest thing to do is reboot the computer. This will start the Rivendell daemons, JACK Control and jackd and set the proper group permissions.

7) Set Audio Output and Inputs up in RDAdmin to use the outputs and inputs you want for each Rivendell application. First go to RDAdmin>Manage Hosts> select the host >Edit>Audio Resources Scroll down and look for the title “AUDIO ADAPTERS“. Under it it should say:

If it does then you can click Close. In the Host: menu that you will be looking at you can go in to RDLibrary, RDCatch, RDAirplay, RDPanel and RDLogEdit and assign what inputs and outputs you want to use for what functions in those programs. Jack has 8 inputs and outputs numbered 0-7 The card number will be 0 as that is what card we have JACK setup as. By default they will be set to Card 0, Port 0.

8 ) Check connections in Jack Control. Click on the JACK icon in the task bar, then click on the Connect button. Check that you have connections between the rivendell_0:playback ports and the system:playback ports so you can hear sound in Rivendell. You should see a line connecting them.

JACK Control Taskbar Icon

The yellow play symbol in the JACK Control taskbar icon means jackd was started by a program other than JACK Control. A green play symbol means jackd was started by JACK Control. In the screen shot above I had started it from the command line.

9) Test: Play a sound in Rivendell and see if it works!

Again if you don’t want to do all that copy and pasting I am providing a script that will do all this for you. One word of warning do not have any other package managers running when you try to run the script. Especially keep an eye out for the update manager. It has a way of automatically starting and then minimizing itself.

Rant

You might ask why I choose the title I did. Why the hard way? Well it is because others and myself have worked so hard to make Rivendell so easy to install on Ubuntu. But it seems that some people want to do the heavy lifting themselves and jump into Rivendell (Linux and the command line too) head first. Now by working on RRAbuntu I am not wanting to end up with what Ham(Amateur) Radio operator call “appliance operators”.

This term refers to people that can use something but have absolutely no idea as to how it works. With true every day appliances this may not be a bad thing. Does the average person need to know how the toaster works to enjoy toasted bread. Not really but if something breaks the average person is going to just put the toaster in the garbage and get a new one.

A radio automation system is not a toaster. Someone will need to know how to administer the system, period! Otherwise one day it will burn your toast or stop working. Setting up a radio automation system is not a matter of plugging it into the power and inserting bread.

The point of RRAbuntu is to get people over that initial installation learning curve that meant for many that they walked away from Rivendell sans toast. They never figured out how to plug it in or where to put the bread. I find this sad and it is the reason RRAbuntu exists today.

That all said if you think that installing Rivendell will some how magically teach you what you need to know about administering it, or you like to learn things the hard way, then this tutorial is for you. Don’t get me wrong. You will learn some things, some useful and other will be just frustrating. I will not assume you know anything but I will not attempt to teach you what all the commands that we will use mean. That is up to you to figure out.

I highly recommend cutting and pasting the commands into the terminal. Be especially careful of long commands on narrow screens as you may need to scroll to the right to select all of the command. The command line can be a very hard place. One false character including spaces could mean the command does not work.

Note I said hard way not the hardest way as there are two harder ways to install. Next in hardness is compiling and after that compiling from cvs. So, I you are just looking for something really hard to do you may want to move on and go straight to compiling the cutting edge, bleeding heart code from cvs that may or may not work.

Be for warned that for this installation I am going to be very narrow and focused. Others have published tutorials. There is a INSTALL.txt included with the source code when you compile. There is also the very good blog post by Alban. However even he was broader than I am going to be as his tutorial was for Debian and Ubuntu.

I will be using Alban blog post and the scripts that we use in RRAbuntu as the basis for this tutorial. I will focus this tutorial on Ubuntu and specifically Ubuntu 10.04 LTS (Long Term Support) release and Rivendell version 1.7.2 and only one sound card. If you choose to use this tutorial with any other Linux distro, Ubuntu release, or Rivendell version it just might not work, unless you know how “this” toaster works.

So, please do not post comments asking how to plug in a different Linux toaster or where to put the toast in an other Ubuntu release, or how to output or input toast from more than one toaster at a time.

Since you are doing things the hard way I will let you figure out how to install Ubuntu 10.04 LTS on your own. I also trust that you have an ALSA compatible sound card on the computer you are going to install on.

Before you start to install Rivendell you need to decide what to do with Pulse Audio. This is the default sound system on Ubuntu. You need to make the hard decision of what to do with pulse audio. I will present two options. Option one works with the ALSA sound system and the other with JACK and Pulse Audio.

Option A is to basically turn Pulse Audio off and there by allow Rivendell to be the only application to use the sound card using ALSA. Thats right in this option no other program can use the sound card, but hey maybe this is what you want if this is your on-air log playback computer. You do not want systems sounds going out over the air in addition to what is playing in Rivendell.

Option B is to setup Rivendell with JACK and set up Pulse Audio to work with JACK. This allows you to still use your sound card with other applications in addition to Rivendell. However, this is even harder to setup as you need to setup jack, get jack and the daemons to all start in the correct order, etc. So, for now I am not going to cover how to do this, but if enough people ask in the comments I might make a future blog post with that info.

Instructions

I would highly recommend that you read to the end of this blog post before starting to work through these installation instructions.

Step 1. Say goodbye to pulseaudio. I am taking much of this from the Rivendel wiki page that I put together on it. You need to copy /etc/pulse/client.conf to ~/.pulse/client.conf. Use this command to check if you have a .pulse folder and if not, make it.

if [ ! -d ~/.pulse ]; then mkdir ~/.pulse; fi

Now you can copy client.conf with the following command in a terminal:

cp /etc/pulse/client.conf ~/.pulse/client.conf

Then and change the line: ; autospawn = yes to autospawn = no by running in a terminal the following commands :

to check if pulseaudio is still running. If you do not get back something similar to:

PID TTY TIME CMD
17065 ? 00:00:02 pulseaudio

Then pulse audio is still running, however if you get back:

PID TTY TIME CMD

Then all is well and pulse audio is not running anymore. However if each time you run the command to kill pulse audio it is still there when you run the command to check if it is running and the PID number keeps going higher then you have not turned off autospawning. Maybe you edited the file by hand and missed the fact that you needed to delete the semicolon(;) at the front of the line in client.conf Well one step down, want to continue or are you ready to do download the RRAbuntu CD and drink your favorite beverage in the mean time?

Step 2. Add the Tryphon repository to your software sources. The good people at Tryphon produce packages for Debian and Ubuntu. If you ever have to compile Rivendell you will be thankful for the work they have saved you. May be a good idea to drop them a thank you for packaging and maintaining the repository for Rivendell among other programs. The repository is locate at debian.tryphon.eu and there you can read more about it. However, what you want to do right now is tell our computer to use the tryphon repository as a software source.

Then make apt aware of the new Tryphon software repository by issuing the following command:

sudo apt-get update

Step 3. Install needed MySQL packages (client and server) as the tryphon packages do not have them listed as a dependency so they will not be installed automatically when installing Rivendell. You also need to start the MySQL server. You can do this with the commands:

When the Configuring mysql-server dialog pops up answer the “New password for the MySQL “root” user:” with a password. Remember/write this down as you will need it later. <OK> reenter the password and once more <OK>.

Step 4. Setup Linux user and group that the Rivendell daemons and applications will run as. The following commands will setup the Linux user you are running as as the Rivendell Linux user. I will also use the group rivendell as the Rivendell group.

sudo groupadd -f rivendell
sudo adduser $(whoami) rivendell

Step 5. Setup the Rivendell group, in our case rivendell, with real time running privileges with the following commands.

After this you need to log out and then back in again for the real time privileges to take effect.

Step 6. Create a ALSA configuration file. Normally you do not need an ALSA configuration file but Rivendell looks for one and more importantly for entries withrd in them. I am going to assume you do not have an ALSA configuration file and we will create one from scratch with the commands:

When the Configuring jackd dialog pops up, answer the question “Enable realtime process priority?” with <Yes>. When the Rivendell configuration dialog pops up answer the question “Configure Rivendell and rd.conf through debconf?” with <No>.

Step 11. Create test tone cart if it failed to be created correctly with this command:

Step 12. Start Rivendell for the first time. Since this is the first time there will not be a rivendell database. In order to create it you will be asked for the root mysql login and password that you setup when mysql was installed.

You should get back a “Created Database” dialog. Click OK and RDAdmin will start.

User Name: admin

Password: This is blank. Don’t enter anything in the password field just hit enter.

You can now start RDAirplay from the Sound & Video menu. Click the Add button, select the test tone, add it to the log, then click start.

Bash Script

I have made a bash script of all the commands in this blog post if you do not want to do a lot of copying and pasting you are welcome to use it. The instruction for it are this.

1. Download it and save it in your home directory. So, if your Linux login is johndoe you would save it as

/home/johndoe/lucid-1.7.2-install.sh

2. Make the script executable by running the command:

chmod +x ~/lucid-1.7.2-install.sh

3. Run the script to install Rivendell with the command:

~/lucid-1.7.2-install.sh

4. Any time you are asked for a password at the command prompt like so, “[sudo] password for johndoe:“, enter your Linux password.

5. Any time it asks you on the command line “Do you want to continue [Y/n]?” just hit the Enter key to answer yes.

6. When the Configuring mysql-server dialog pops up answer the “New password for the MySQL “root” user:” with a password. Remember/write this down as you will need it later. <OK> reenter the password and once more <OK>.

8. When the Rivendell configuration dialog pops up answer the question “Configure Rivendell and rd.conf through debconf?” with <No>.

One thing that I experience a couple of times and figured out how to get around it by accident, is that before the Configuring jackd dialog comes up my terminal went blank. That is correct, all the text in the terminal disappeared. I waited a while to give it time to come up switch to another open program and back, but only when I in the terminal when to File>Open Tab and then switch back to the original tab that the script was running in did I see the “Configure jackd” dialog.

Testing

After five working installs of Ubuntu Lucid 10.04 LTS (and two failed with disk errors), I managed to get everything working correctly in the right order. So this is not a off the cuff blog post that has not been tested or tested on a system that was halfway configured. I hope that this will help some people just like RRAbuntu has to be able to install Rivendell for the first time easily.