Menu:


 

Rivendell install from source on Linux Mint 19 / Ubuntu 18.04 with Jack audio.

These instructions will allow you to install Rivendell 2.19.2 from source on Linux Mint 19 or Ubuntu 18.04 64bit and derivatives (tested on Linux Mint 19 XFCE 64bit). One of the challenges installing Rivendell on Ubuntu is that Rivendell version 2 uses QT3 and no packages for this exist as part of the standard Ubuntu repositories. Recently, Luigino Bracci posted .deb files for a pre-compiled version of Rivendell to the mailing list. These included pre-compiled .debs for QT3 and HPI support, however there were some minor issues with the Rivendell install (mission icons and shortcuts for "Panel" etc). Therefore it seemed logical to use these excellent QT3 and HPI deb files and compile Rivendell from source. This has the advantage of a clearer and more straightforward upgrade path in future.

Begin the install:

Note:
These instructions assume you're logged in as user "broadcast" (without quotes).
If this is not the case then change this to your userid.

Open a terminal and run:

sudo apt-get -y install build-essential dpkg-dev fakeroot g++ g++-7 gcc gcc-7 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4 libatomic1 libaudio-dev libcilkrts5 libcups2-dev libcupsfilters-dev libcupsimage2-dev libdrm-dev libexpat1-dev libfakeroot libfontconfig1-dev libfreetype6-dev libgcc-7-dev libgl1-mesa-dev libgles1 libglu1-mesa-dev libglvnd-core-dev libglvnd-dev libice-dev libiodbc2 libitm1 libjbig-dev libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev liblcms2-dev liblsan0 liblzma-dev libmng-dev libmng2 libmpx2 libmysqlclient20 libopengl0 libpq5 libpthread-stubs0-dev libquadmath0 libsm-dev libstdc++-7-dev libtiff-dev libtiff5-dev libtiffxx5 libtsan0 libubsan0 libx11-dev libx11-doc libx11-xcb-dev libxau-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb1-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxinerama-dev libxmu-dev libxmu-headers libxrandr-dev libxrender-dev libxshmfence-dev libxt-dev libxxf86vm-dev make mesa-common-dev pkg-config x11proto-core-dev x11proto-damage-dev x11proto-dev x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev x11proto-input-dev x11proto-randr-dev x11proto-xext-dev x11proto-xf86vidmode-dev x11proto-xinerama-dev xorg-sgml-doctools xtrans-dev libflac++6v5 libid3-3.8.3v5

sudo apt-get -y install apache2 mysql-server

sudo mysql_secure_installation
When prompted, select "N" to "VALIDATE PASSWORD PLUGIN".
Set a password.
Remove anonymous: Y
Disallow root login remotely: N
Remove test database: Y
Reload tables: Y

Fix root MySQL login issues (change from socket to password auth):
sudo mysql -uroot -p
SELECT User,Host FROM mysql.user;
DROP USER 'root'@'localhost';
CREATE USER 'root'@'%' IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
IMPORTANT: CHANGE THE NEXT LINE TO INCLUDE YOUR MYSQL PASSWORD.
ALTER USER 'root'@'%' IDENTIFIED BY 'yourpassword';
quit;

Rivendell uses some old libraries that are in 16.04 but not 18.04 so we need to add them:
sudo vi /etc/apt/sources.list
Paste in:
deb http://security.ubuntu.com/ubuntu xenial-security main
deb-src http://security.ubuntu.com/ubuntu xenial-security main

sudo apt-get update
sudo apt-get -y install libpng12-0 libpng12-dev libmng2

Download the .deb tarball to the Downloads directory:
Click here to download.

Install QT3 and HPI support:

cd /tmp
tar -zxvf /home/broadcast/Downloads/rivendell-2.19.2-amd64.tar.gz
sudo dpkg -i qt3/*.deb
sudo dpkg -i hpi/*.deb

Setup JACK audio:

sudo apt-get -y install jack screen samba patchage vlc-plugin-jack jackd libcdparanoia-dev libflac++-dev libsamplerate0-dev libid3tag0-dev libid3-3.8.3-dev libcurl4-gnutls-dev libsndfile-dev libpam0g-dev libsoundtouch1-dev libasound2-dev libtwolame-dev libmp3lame-dev libmp4v2-dev libfaad-dev libmad0-dev libjack-jackd2-dev libice-dev libsm-dev libxt-dev libxi-dev libssl-dev build-essential libx11-dev libxext-dev xsltproc evince

Do not enable "realtime" if prompted.

Make JACK run on login:
cd
mkdir rdscripts
cd rdscripts
vi on_startup.sh

Paste in the following:
#!/bin/bash
screen -DmS jack jackd -dalsa -dhw:0 -r44100 -p1024 -n3 -s &
IMPORTANT:
The -dhw:0 line may need to be changed to your ALSA adaptor number.
aplay -l and aplay -L will show these.
The sample rate is set to 44100 in the script above. You might want to change this to 48000.

chmod +x on_startup.sh

Make the script run at login:
On the Linux desktop, run "Session and Startup".
Click "Application Autostart". Click "Add":
Name: Broadcast Startup
Path: /home/broadcast/rdscripts/on_startup.sh
Add and Close.

Download the Rivendell source file to the Downloads directory.
Click here to download rivendell-2.19.2.tar.gz

cd
tar -zxvf /home/broadcast/Downloads/rivendell-2.19.2.tar.gz
cd rivendell-2.19.2

Fixes for 2.19.2: (https://github.com/ElvishArtisan/rivendell/issues/210):
Before compiling replace pow10() with pow() in cae/cae_jack.cpp and cae/cae_alsa.cpp.

vi cae/cae_jack.cpp

Change line 1065 from:
(jack_default_audio_sample_t)pow10((double)level/2000.0);
to:
(jack_default_audio_sample_t)pow(10.0,(double)level/2000.0);

Change line 1088 from:
(jack_default_audio_sample_t)pow10((double)level/2000.0);
to
(jack_default_audio_sample_t)pow(10.0,(double)level/2000.0);

Change line 1309 from:
(jack_default_audio_sample_t)pow10((double)level/2000.0);
to:
(jack_default_audio_sample_t)pow(10.0,(double)level/2000.0);


vi cae/cae_alsa.cpp

Change line 1143 from:
alsa_input_volume[card][stream]=pow10((double)level/2000.0);
to:
alsa_input_volume[card][stream]=pow(10.0,(double)level/2000.0);

Change line 1161 from:
alsa_output_volume[card][port][stream]=pow10((double)level/2000.0);
to:
alsa_output_volume[card][port][stream]=pow(10.0,(double)level/2000.0);

Change line 1369 from:
pow10((double)level/2000.0);
to:
pow(10.0,(double)level/2000.0);

Now we can compile the source:
./configure --disable-docbook --libexecdir=/usr/local/libexec
make
sudo make install

Make a cup of tea while the code compiles.
Ignore any "warning" messages. They're normal!

Stop RDmonitor running at boot (the green dot panel at the top of the screen):
sudo rm /etc/X11/xinit/xinitrc.d/start-rdmonitor.sh

sudo addgroup rivendell
sudo adduser broadcast rivendell
sudo adduser broadcast audio
sudo adduser broadcast www-data

Configure Apache:

vi ~/rivendell-2.19.2/conf/rd-bin.conf
Around line 24 you will see:
  
  Options ExecCGI FollowSymLinks
  AllowOverride None
  Order allow,deny
  Allow from all
Delete these two lines:
  Order allow,deny
  Allow from all
...and replace with the new way of doing things:
  Require all granted
sudo cp ~/rivendell-2.19.2/conf/rd-bin.conf /etc/apache2/sites-available/

Now make the site active:
sudo a2ensite rd-bin
sudo service apache2 reload

We also need to enable the CGI module otherwise your audio won't import
(because CGI is now disabled by default):
sudo a2dismod mpm_event
sudo a2enmod mpm_prefork
sudo service apache2 restart
sudo a2enmod cgi
sudo service apache2 restart

Creating /var/snd:
sudo mkdir -p /var/snd
sudo chown broadcast:broadcast /var/snd
sudo chmod ug+rwx /var/snd

With that done you no longer need the rivendell source folder:
cd
rm -rf rivendell-2.19.2

Cleanup and set some permissions:
sudo rdcleandirs
sudo mkdir /var/run/rivendell
(might give "file exists" error).

cd /usr/local/bin
sudo chmod -s caed ripcd rdcatchd
sudo chmod 777 /var/run/rivendell
sudo chown broadcast /var/run/rivendell

Note: The Ubuntu developers are on crack and make Ubuntu delete the /var/run enteries on boot.
Therefore we need a systemd script to fix this.

sudo vi /etc/systemd/system/rivendell-helper.service
Paste in everything between the two ### lines:
########################################################
[Unit]
Description=Rivendell Helper Service
After=network.target

[Service]
Type=simple
ExecStartPre=-/bin/mkdir /var/run/rivendell
ExecStart=/bin/chown broadcast:broadcast /var/run/rivendell
Restart=on-abort

[Install]
WantedBy=multi-user.target
########################################################
sudo systemctl start rivendell-helper
sudo systemctl status rivendell-helper
sudo systemctl enable rivendell-helper

The Rivendell services (caed etc) will now run automatically when a Rivendell application is run.

Some MySQL tweaks:
sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
In the mysqld section (under [mysqld] at around line 31) add the following line:
default_storage_engine = MyISAM
Also change bind-address to 0.0.0.0

sudo service mysql restart

Run:
sudo rdalsaconfig
Ensure no sound cards are set as active or JACK won't work.

sudo cp ~/rivendell-2.19.2/conf/rd.conf-sample /etc/rd.conf

Configure Rivendell:
sudo vi /etc/rd.conf
Change:
AudioOwner=broadcast
Password=yourpassword
[mySQL]
Loginname=root
Password=yourpassword
;[AudioStore]
;MountSource=
;MountType=
;MountOptions=defaults
;CaeHostname=
;XportHostname=
Add the following section to the end of the file:
[JackSession]
Source1=rivendell_0:playout_0L
Destination1=system:playback_1
Source2=rivendell_0:playout_0R
Destination2=system:playback_2
Source3=system:capture_1
Destination3=rivendell_0:record_0L
Source4=system:capture_2
Destination4=rivendell_0:record_0R
Run RDadmin to create the inital database.
IMPORTANT: In RDadmin click "System Settings" and set the sample rate
to match the JACK config above (44100 in the example).

reboot
(Rebooting at this stage is important.)

The system is now ready to use.

We can now make some cosmetic improvements to Rivendell:

Make the Rivendell interface look a bit nicer:
sudo qtconfig-qt3
Select GUI Style: CDE
Tune Palette:
Active Palette \ Tune Palette \ Background \ Select Color \ Change 239.239.239 to 64.64.64
Active Palette \ Tune Palette \ Forground \ Select Color \ Change 0.0.0 to 255.255.255
Active Palette \ Tune Palette \ Button \ Select Color \ Change 221.223.228 to 181.183.188
Active Palette \ Tune Palette \ Base \ Select Color \ Change 255.255.255 to 250.250.250

Run RDadmin:
Click "Manage Hosts" and "Edit" the current hostname.
Click "RDairplay".
Click "Display Settings", "Background Image".
Select: /home/broadcast/pixmap-background/rdairplay_skin.png.
Click "Ok" and close all the windows.


Additional Notes:

"patchage" can be used to check JACK patching.

In 2.19.2 there appears to be an issue with RDpanel not opening with a new database.
This can be fixed by manually editing the MySQL "RDPANEL" table to remove the "Instance" column.

To adjust the system volume if it's too quiet or loud, run "alsamixer" from a terminal.
Ensure the "Master" output on the soundcard is enabled if no audio.

Troubleshooting JACK.
Both JACK and Rivendell must run as the same user. If there are issues this can be checked with:
ps -C caed -C jackd -o pid,user,group,cmd

For a studio playout system, set the screen resolution of the RDairplay window to 1024x768.
This can be done by running the "Display" utility.
This will ensure RDairplay fills the screen.

Modification to allow JACK and Pulse audio at the same time!

The Rivendell setup above takes full control of the system audio via JACK, so sounds from other applications should not by default be broadcast. This is desired in a radio environment.

However for home or production use you might need to have other applications on the system provide audio. To allow this you can install the Pulse to JACK audio bridge as follows:

sudo apt-get install pulseaudio-module-jack
sudo vi /etc/pulse/default.pa
Add the following lines, underneath the #'ed out line that says #load-module module-alsa-sink
load-module module-jack-sink
load-module module-jack-source

Ensure Pulseaudio is disabled at startup (if not done already):
sudo vi /etc/pulse/client.conf
(uncomment the autospawn=yes line, and set it to no)

Install some apps known to work well with this configuration:
sudo apt-get install linphone chromium-browser

Make Pulseaudio start AFTER Jack:
cd
cd rdscripts
vi on_startup.sh
Add as last lines in file:
sleep 5
pulseaudio &

reboot

Once installed you can do some other cool things using the "patchage" utility, such as connecting the output of non-JACK desktop apps to the JACK input of Audacity to allow their audio to be directly recorded, or you can connect Rivendell to Pulse, allowing the use of cleanfeed.net in the Chromium browser so remote users can hear real-time high quality audio for remote voicetracking.