From Rivendell Wiki
How to install Rivendell 3.4.1 on Ubuntu 18.04. It has been reported that these instructions also work on Linux Mint 19.3.
This guide assumes you have the 64 bit build of Ubuntu 18.04 (or a variation such as LUbuntu 18.04) installed and running. Note that these instructions are based on a variety of sources including the folks at Radiotools.uk, the Raspberry PI build, and notes on the email list.
Note that these instructions do not include support for ASI cards, I do not have an ASI card to test with.
- 1 Install and Update your OS
- 2 Install Apache, MySQL, and GIT
- 3 Set up your users and groups
- 4 Install Dependencies
- 5 Clone the Rivendell source with GIT and compile source
- 6 Disable PulseAudio
- 7 Getting MySQL to work and creating the Rivendell user and database
- 8 Configure Apache
- 9 Make /var/snd
- 10 Configure Rivendell
- 11 Create your new database and generate audio
- 12 Configure audio cards for ALSA access
- 13 Start the Rivendell services
- 14 Optional - Disable rdmonitor
- 15 Jack Audio
- 16 Tweak the upper margin of your display
- 17 Don't delete your source!
Install and Update your OS
These instructions are for Ubuntu 18.04 and various distributions based on Ubuntu 18.04. It has been tested with the 64 bit release. I have not tested with the 32 bit build.
If you are looking for a build of Ubuntu 18.04, you might want to consider LUbuntu. It is a lighter weight distribution that works well.
I highly suggest using a static IP address for Rivendell. This can either be set up when installing or later once the OS is installed.
Once installed make sure that Ubuntu is fully updated. From a shell:
sudo apt-get -y update sudo apt-get -y upgrade
Install Apache, MySQL, and GIT
If you are doing a full stand alone install you'll need MySQL, Apache, and GIT. If you have a central audio store and / or MySQL server then you may not need Apache and MySQL.
sudo apt-get -y install apache2 sudo apt-get -y install mysql-server sudo apt-get -y install git
Set up your users and groups
Create a Rivendell group
sudo addgroup rivendell sudo adduser pypad
Add your logged in user to the rivendell group
sudo usermod -a -G rivendell %username% <-- Substitute your logged in user account
Add your logged in user to the Audio group
sudo usermod -a -G audio %username% <-- Substitute your logged in user account
If you want this user to be able to access the serial port from Rivendell (useful for GPIO's)
sudo usermod -a -G dialout %username% <-- Substitute your logged in user account
Log out and log back in so your logged in user picks up all the new groups it is a member of.
Note, some of these dependencies may not be needed, but as of writing Rivendell 3.4.1int6 successfully compiles with these installed.
Note, if it asks about enabling Realtime for Jack, I normally say "yes" but this does not work on all systems.
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 \ lame jackd2 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 qt4* \ libtag1-dev libmysqlclient-dev libqt4-sql-mysql libqt5sql5-mysql qtcreator curl python3-mysqldb python3-pyqt4 \ python3-pip build-essential libssl-dev libffi-dev python3-dev python3-pyqt4* python3.7 docbook5* autotools-dev \ libtooli* automake libcoverart1 libcoverart-dev libcoverart-doc libdiscid-dev libdiscid-doc libdiscid0 libmusicbrainz5-2 \ libmusicbrainz5-dev fop docbook-xsl-ns
Clone the Rivendell source with GIT and compile source
git clone -b master https://github.com/ElvishArtisan/rivendell.git
Alternatively visit the releases to download an archived version of the source. As of writing this the current release is 3.4.1int6.
If you want to compile the documentation, set up your Docbooks style sheet location:
Change to your Rivendell source folder
cd rivendell ./autogen.sh
If compiling with documentation:
./configure MUSICBRAINZ_LIBS="-L/usr/local/lib -ldiscid -lmusicbrainz5cc -lcoverartcc" --libexecdir=/var/www/rd-bin --sysconfdir=/etc/apache2/conf-available
If compiling without documentation:
./configure MUSICBRAINZ_LIBS="-L/usr/local/lib -ldiscid -lmusicbrainz5cc -lcoverartcc" --libexecdir=/var/www/rd-bin --sysconfdir=/etc/apache2/conf-available --disable-docbook
If configure is successful then compile the source:
make sudo make install sudo ldconfig -v
With any luck the first "make" will complete. It will take a long time. You may see some warnings during the compile, this is normal.
This is not always necessary, but sometimes it is required to get audio to work properly. As root edit the file:
Uncomment the autospawn and make it no:
autospawn = no
Save the configuration file.
Getting MySQL to work and creating the Rivendell user and database
Ubuntu 18.04 by default will only allow a user with elevated root access to log into the root MySQL user account. In other words you'll have to use sudo to log into the MySQL root account.
sudo mysql -uroot CREATE USER 'rduser'@'%' IDENTIFIED BY 'letmein'; CREATE DATABASE Rivendell; GRANT ALL PRIVILEGES ON Rivendell.* TO 'rduser'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES; quit;
Of course it is a good idea to change the "letmein" password above to something else. Just make sure that you remember this password, you will need to put it into your /etc/rd.conf file.
MySQL 5.7 needs Strict mode turned off to avoid errors with Rivendell. Create the following file:
sudo nano /etc/mysql/conf.d/disable_strict_mode.cnf
Copy / paste into the file that is created:
CTRL-O to write the file, CTRL-X to exit.
If you want others Rivendell workstations to be able to connect to this machine's MySQL across the network then change the Bind in Mysql.
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
Look for the bind-address= line and update it:
bind-address = 0.0.0.0
Restart your MySQL service
sudo systemctl restart mysql
Turn on the cgid module:
sudo a2enmod cgid
Copy the Apache configuration
sudo cp ~/rivendell/conf/rd-bin.conf /etc/apache2/conf-available/ sudo ln -s /etc/apache2/conf-available/rd-bin.conf /etc/apache2/conf-enabled/rd-bin.conf sudo systemctl restart apache2
Create /var/snd where your audio files will get stored
sudo mkdir /var/snd sudo chown username:rivendell /var/snd <-- Note substitute your logged in user name and group` sudo chmod ug+rwx /var/snd
Copy the sample configuration file to /etc/rd.conf
sudo cp ~/rivendell/conf/rd.conf-sample /etc/rd.conf
Edit the file and update with any relevant user names, groups, etc.
sudo nano /etc/rd.conf
Create your new database and generate audio
If you are setting up a new install, populate your Rivendell database:
sudo rddbmgr --create --generate-audio
If you are updating from a previous version of Rivendell, then restore and / or update your database with rddbconfig:
Note, when updating from a previous 2.x version of Rivendell, I found that I had to start with an empty Rivendell database and use the Restore option in rddbconfig for the database to properly import and update to the latest schema.
Configure audio cards for ALSA access
If you want to use your audio cards through ALSA, then configure them for access:
Select the card(s) you want to use and hit Save.
Start the Rivendell services
Use systemd to start the Rivendell services:
sudo systemctl start rivendell
Then start up rdadmin:
Check your hosts, audio resources and other settings. If all looks okay start up rdairplay and see if you can play the test file.
Optional - Disable rdmonitor
RDMonitor is a little monitor that sits on your screen to tell you what Rivendell configuration you are using. This is helpful if you are running a setup with a hot standby server and have configured rdselect to allow you to to easily switch from one server to another. If you are only running with a single server setup, or are running as a stand alone workstation with MySQL and /var/snd on the same workstation then there is little point in having rdmonitor running. In this case it just takes up space on the screen. Here is how to disable it.
The easiest is to just make it no longer executable. From a shell:
sudo chmod -x /usr/local/bin/rdmonitor
Then if you reboot you'll find that rdmonitor does not pop up. If you later decide you want to re-enable it, just make it executable again:
sudo chmod +x /usr/local/bin/rdmonitor
Getting Jack to work takes a few extra steps. Jack and the Rivendell services all need to run under the same user ID in order for them to all see each other. In the official CentOS distribution this is accomplished by having the Rivendell services start up jackd, this can be set up in rdadmin --> Manage hosts. However for some reason this does not always work in Ubuntu. The way to make this work is to start Jack with the logged in user, and then have systemd start the Rivendell services under the same logged in user.
First, stop the Rivendell services:
sudo systemctl stop rivendell
Next remove all audio cards from being selected in rdalsaconfig. If a sound card is selected in rdalsaconfig then sometimes Rivendell will grab the card instead of Jack.
To have Systemd start up the Rivendell services under the logged in user, we have to edit the following file:
sudo nano /lib/systemd/system/rivendell.service
In the [Service] section, add a line User=%username% where %username% is the logged in user, the same one that you are having start Jack. So if the logged in user is rd, then the [Service] section of the file should look like this:
[Service] Type=simple ExecStart=/usr/local/sbin/rdservice PrivateTmp=false Restart=always RestartSec=2 StartLimitInterval=120 StartLimitBurst=50 User=rd <--- Update the 'rd' with your logged in user - the one you want the daemons and Jack to run under!
- Note, the "U" in User needs to be a capital U or it won't work!
Once that file is updated with the needed user name, save the file and then reload the daemons for systemd (this loads up your changes)
sudo systemctl daemon-reload
Now start Jack audio. You can do this with qjackctl or with a command line.
Once Jack is started, start up your Rivendell services. From a command prompt:
sudo systemctl start rivendell
you should find that Rivendell now sees Jack. Jack connections can now be made with Rivendell's Jack Connect [JC] macro or via Patchage or QJackCTL
If this works, then what you can do is disable the Rivendell service from starting up, have the operating system start up Jack with the desktop, and use Cron to start up the Rivendell service. Be sure that you have your user set up for auto-login (no password required) upon reboot.
Disable Rivendell service from systemd:
sudo systemctl disable rivendell
Find where your system allows you to add items to its autostart. In LUbuntu it is found in the
Preferences --> Default Applications for LX Session --> Autostart option
Under manually started applications, add in the command to start Jackd. I normally put this into a detached screen session.
Once that is done, modify your root crontab:
sudo crontab -e
And add in a line for a delay and a start of the Rivendell services:
@reboot sleep 60 && systemctl start rivendell
If done correctly this will allow Jack to start, then after a brief delay will start up the Rivendell services which will see Jack as it is already running.
Tweak the upper margin of your display
I've found that on Lubuntu 18.04 for some reason the top border of some of the windows displays above the top of the screen, making it difficult to move those windows around the desktop. This is especially bad with RDAirplay and RDAdmin. The way to fix this is to add a slight desktop margin on the top of the screen. In Lubuntu:
Click the Menu button --> Preferences --> Openbox Configuration Manager On the left menu, click on the Margins tab and in the "Top" dialog box put 20 so it will read 20 px. Click the Close button
Now when you start up rdairplay or rdadmin you'll see the top border of the window and will be able to move it around the screen.
Don't delete your source!
A final note about the source that you have just compiled from. If in the future you are updating to a new version of the source code, you will first need to uninstall the current version. If you don't do this then the code remains linked to various existing libraries and the newer updated source will give you errors when you try and compile it.
The easist way to uninstall from source is to go to your original source folder and do a make uninstall:
cd ~/rivendell/ sudo systemctl stop rivendell sudo make uninstall
Once uninstalled, I recommend renaming the folder. I usually use reference to the version of the source that the folder contains. As an example:
cd mv ~/rivendell/ ~/rivendell-341/
Once you've done this you can then safely pull down the new source code from github and compile it.