Install under Debian
From Rivendell Wiki
This page describes how to install a dedicated server for Rivendell under a Debian GNU/Linux system.
Contents |
Prerequisites and Assumptions
- Debian GNU/Linux. Any flavor, oldstable, stable, testing or unstable.
- Current desktop PC hardware, a backup solution in mind, and an Uninterruptible Power Supply.
- X11. Rivendell is written using Qt, so it fits in very well with KDE
- Ideally use the Real Time Kernel: http://pkg-freebob.alioth.debian.org/lowlat.html
- You have read the documentation for Rivendell
- The Tryphon packages assume a large /var/ partition: All sound files live in /var/snd/. The MySQL DB also lives in /var/lib/mysql/
- Best practice is to run Linux Software RAID, with LVM2 on top. You can set this up directly from the installer. Note that grub cannot read an LVM2 partition, so create /boot as its own RAID 1 partition. While we're at it, arguably the fastest Filesystem at the moment for such a setup is XFS. LVM allows you to make backups using a snapshot of the filesystem.
- Experience with Debian, and the Debian way: http://www.debian.org/doc/manuals/debian-reference/index.en.html and http://www.debian.org/doc/manuals/debian-faq/index.en.html
- The proper /etc/apt/sources.list lines for the Tryphon packages: http://debian.tryphon.org/
- A sound card
- Some understanding of JACK: http://jackaudio.org/
- If you want to push MP3 around, but have a FLAC back-end, consider an mp3 filesystem.
Procedure
Install your GNU/Debian system. Remember to use a large /var/snd partition (using LVM ideally). It will hold ALL of your sound assets for Rivendell (Music, Promos, PSAs, News, etc). If you choose "Desktop" under tasksel, then you shouldn't need much in the way of installing X11. Again, KDE is very nice. After completing the base installation, add the following lines to your /etc/apt/sources.list
deb http://debian.tryphon.org stable main contrib deb-src http://debian.tryphon.org stable main contrib
Then:
sudo aptitude update sudo aptitude install rivendell jackd jack-tools jack-init jackeq logrotate lzma qjackctl \ mysql-admin mysql-common mysql-query-browser mysql-client mysql-gui-tools-common \ mysql-server mysql-client-5.0 mysql-navigator mysql-server-5.0
You might also want:
sudo aptitude install libqt3-mt-mysql libqt4-sql-mysql
Note: The rivendell, jack-init debian packages are available in the Tryphon Debian archiver.
Create users
Create a dedicated user (like riven) which will be used to run the jack server and Rivendell applications.
Add it to the audio group :
sudo adduser riven sudo adduser riven audio
Install X
If you haven't X11 yet, install x-windows-system package and your favorite window manager You can install a light window manager like WindowMaker (package wmaker).
Minimum resolution of 1024x768. Modern X.org X11 systems will auto-configure based on your video hardware. You might need the appropriate X11 drivers--- but that is beyond the scope of this page. The basic VESA frame-buffer driver will support 1024x768.
Configure MySQL server
If you followed along, you will have already installed the mysql-server package and accompanying tools.
In the old days, you had to manually Create a Rivendell database and a MySQL user. You don't need to do this anymore. In fact, if you do, then rdadmin will Segfault. 1
For a basic install, no further configuration of MySQL is required.
Configure jack
If you followed along, you have already installed the jack-init package. It provides an init.d script which starts jack at startup. Uses the realtime-lsm package to use a realtime jack daemon.
Sample (working) /etc/default/jack:
Please put in a working sample... My current one follows: Note: riven is my user, not radio.
# # Defines the user which runs the jack daemon. # If not defined, the daemon won't be started. # # DAEMON_USER=jack DAEMON_USER="riven"
Sample (working) /etc/jackdrc:
Please put in a working sample... My current one follows: Note: my soundcard is only 48000, but I have also tried 44100 in this file.
realtime=true jackd=jackd driver=alsa jackh=jack.plumbing rate=48000
Note: I am asking for working samples becuase unless I have DAEMON_USER="root", jack will not start for me. (zotz) I can run everything as root but am not happy about it. Please remove these notes when working samples are in place. (or transfer to the discussion page.) Only root can run applications in real time but we can give the user this ablity to a limit by setting up realtime preemption. (zotz - I am leaving your comments so folks that have this problem can find the solution. frederickjh)
realtime startup problem solved - see new jack-init page - Phlash
Realtime Preemption
Most of the following is taken straight from: http://tapas.affenbande.org/wordpress/?page_id=6
If you are running jack you will want to install a realtime kernel for best performance.
After you've got the kernel you still need to set up real-time access for the audio group.
All you have to do for this is give your audio group permissions to access the rtprio, nice, and memlock limits. To do this, you just need to run these commands:
sudo su -c 'echo @audio - rtprio 99 >> /etc/security/limits.conf' sudo su -c 'echo @audio - memlock 250000 >> /etc/security/limits.conf' sudo su -c 'echo @audio - nice -10 >> /etc/security/limits.conf'
We can (albeit oversimplifying) say that the higher the priority of a task the more likely it is to run undisturbed. With -rt kernels we have the option of making IRQ handlers run with a lower priority than certain user space applications. It is, for example, possible to run jackd with a priority greater then all IRQ’s which might disturb audio operation (like disk or network). We need the jackd -P switch for that.
In a default -rt kernel all IRQ handler threads have default priorities in the range of 40-60, so making jackd run with a priority of 70 is a good choice here:
jackd -R -P 70 -d alsa …
But we also want the soundcard IRQ handler run at a higher prio than jack, as the soundcard irq is what ultimately drives jackd. Thus we can use the chrt utility to change this (my soundcard is on IRQ 4 in my system - make sure you check in /proc/interrupts what’s yours):
chrt -f -p 82 `pidof “IRQ-4″`
A priority of 82 is well above jackd. jackd also runs threads besides its main loop. Namely a watchdog at priority 10 above its main loop (80 in this example), and all clients’ process() threads will run with a priority 1 smaller than the main loop (69).
Configure Rivendell
If you have been following along, you have already installed the rivendell package. When configuring rivendell, do not choose a password containing punctuation (particularly quotes), it will fail if you do. The rivendell group is used, as is the default rivendell user "rduser" unless specified otherwise. These directions specified the user "riven" instead of "rduser."
Add our user (riven) to this group :
sudo adduser riven rivendell
If not using dpkg, edit Rivendell configuration
Create and edit the /etc/rd.conf file.
A minimalist version can be :
[Identity] Password=SomePasswordWithoutPunctuation AudioOwner=radio AudioGroup=rivendell
[mySQL] Hostname=localhost Loginname=radio Password= SomePasswordWithoutPunctuation Database=Rivendell
If using dpkg, edit Rivendell configuration
sudo dpkg-reconfigure rivendell
Start daemons
Start the daemons :
sudo invoke-rc.d jackd start sudo invoke-rc.d rivendell start
The Rivendell daemons must be run by the user defined in /etc/rd.conf or you will not have sound.
Start RDAdmin
Start RDAdmin and configure Rivendell :o)
It is necessary to use the root mysql login for the first rdadmin initialization run. Afterwards, change the MySQL user and password for rivendell, again, by using:
sudo dpkg-reconfigure rivendell
Log into Rivendell (using rdadmin) as admin or user. There is no password by default.
Troubleshooting
If there are problems you should activate the logfiles of the daemons in rd.conf.
Add this in the logfile:
[Caed] Logfile=/var/log/rivendell/caed.log
Caed takes commands from the TCP Port 5005 and plays the files from /var/snd. Only the daemons of rivendell write directly to /var/snd. A working caed should write something like this in the logfile:
05/15/2005 - 12:00:50.131 : cae started 05/15/2005 - 12:02:53.207 : LoadPlayback Card: 0 Stream: 0 Name: /var/snd/000001_001.wav Handle: 0 05/15/2005 - 12:02:53.213 : PlaybackPosition - Card: 0 Stream: 0 Pos: 0 05/15/2005 - 12:02:53.213 : Play - Card: 0 Stream: 0 Length: 160522 Speed: 1000 Pitch: 0
If you dont have sound with JACK:
1. Make sure the JACK Daemon runs as the same user like the rivendell daemons. For this to work, the Audio devices in /dev/snd/* and /dev/shm/* should have the right permissions. (what should these permissions be?)
2. Start XMMS with the jack plugin to check if jack is working properly.
3. If you followed along, you already installed qjackctl. With this programm you can check if caed connects the rivendell outputs to your correct jack audio outputs. If not, you have to edit /etc/rd.conf. Read the JACK.txt file which comes with your Rivendell distribution.
Tip: Jack has a fixed Samplerate. Normally it is set on 48000 or 44100. You should check with rdadmin that the rivendell programms work with the same sample rate, otherwise your sound will play faster or slower.
Links
See the Base Configuration.

