Skip to content

Installation for Linux

Engelbert Niehaus edited this page Sep 20, 2020 · 117 revisions

( en | es )

Home > Using Jamulus > Linux installation

Right now, we don't provide official packages for Jamulus, but compiling the sources is quite easy. You can also have a look at issue #223 to see if your distribution provides a package.

Installation Script

The following installation commands are aggregate in an installation script (see section "Bash Script for Download and Compile")

Get Jamulus

Open up a terminal window (command line - CTRL+ALT+t on Ubuntu and related distros), and download and unzip the sources for the latest release.

If you wish to use git (sudo apt install git), use this to get the latest release instead:

R=`curl -s https://api.github.com/repos/corrados/jamulus/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")'` && wget https://github.com/corrados/jamulus/archive/$R.tar.gz && tar -xvf $R.tar.gz

Install the dependent packages

On Ubuntu-based distributions 18.04+, and on Debian 9 or 10, use this:

First, sudo apt-get update (or you may get "not found" messages)

sudo apt-get install build-essential qt5-qmake qtdeclarative5-dev qt5-default qttools5-dev-tools libjack-jackd2-dev

On Debian 11 (bullseye) or later, and Raspberry Pi Raspbian Buster release or later, use:

sudo apt-get install build-essential qtdeclarative5-dev qt5-default qttools5-dev-tools libjack-jackd2-dev

On Fedora use:

sudo dnf install qt5-qtdeclarative-devel jack-audio-connection-kit-dbus jack-audio-connection-kit-devel

Optional, but recommended

QjackCtl is a utility to help you set up Jack (installed as part of the dependencies above):

sudo apt-get install qjackctl

You may also wish to consider using a low-latency kernel (eg. for Ubuntu 18.04: sudo apt-get install linux-lowlatency-hwe-18.04).

Compile this bad boy

Now cd into the jamulus sources directory you downloaded (either with git or after downloading the .zip file):

cd jamulus

and compile the sources with the following commands (the last make may take several minutes to run):

qmake Jamulus.pro
make clean
make
sudo make install

Bash Script for Download and Compile

A bash script combine all the commands above into one script and instead of copy and paste the commands above into the Linux shell and execute them step by step, you would just run one script e.g. install4ubuntu.sh for the combining scripts for Ubuntu. If the command are different on Ubuntu releases the script name might append a postfix for the release e.g. install4ubuntu18_4.sh

Installation dependent on Linux Distribution

The following script call different installation commands dependent on the Linux distribution. The variable DISTRO defines which commands are executed. Set the variable dependent on your Linux distribution you are using.

  • DISTRO="Ubuntu for a Ubuntu or Linux Mint
  • DISTRO="Debian for a Debian or Raspian Linux
  • DISTRO="Fedora for a Fedora Linux Furthermore if the installation is dependent of the release the variable LINVERSION is introduced but is currently not used. In the Ubuntu if statement there is an example how version dependent installation calls can be performed.
if [ "$LINVERSION"  = "18.4" ]
then
    echo "Perform Installation Specifics for $DISTRO Version $DISTRO" 
fi  

The variable LINVERSION is currently not used in the following script but it is just a demo how to use the version specific installation commands.

Adaptation of the Installation Script

If you want to create an installation script for debian just copy the script install4ubuntu18_4.sh to install4debian10_6.sh and modify the distro variables to

#!/bin/sh
# set DISTRO either to "Ubuntu", "Debian" or "Fedora"
DISTRO="Debian"
LINVERSION="10.6"

After that test the installation on debian and modify the commands so that the installation script works on Debian. Please share working installation scripts in this Wiki. The maintainer of this repository might add a folder in this repository /install_scripts for working installation scripts. Create a pull request for new installation scripts or create an issue with a request to ask a documented and tested installation script to this repository.

The Installation Script

Copy the following installation script into a file and save it to the filename install4ubuntu18_4.sh. After saving the file e.g. in your Download directory change to the directory and call the following script with sh install4ubuntu18_4.sh.

#!/bin/sh
# set DISTRO either to "Ubuntu", "Debian" or "Fedora"
DISTRO="Ubuntu"
LINVERSION="18.04"

# Get Jamulus Release Name with "curl" and "grep"  
R=`curl -s https://api.github.com/repos/corrados/jamulus/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")'` 
echo "Jamulus Installation Script for $DISTRO $LINVERSION"
echo "Release: $R"
INSTALLJAMULUS="no"
while true; do
    read -p "Do you wish to install Jamulus on $DISTRO $LINVERSION? (y/n) " yn
    case $yn in
        [Yy]* ) 
           echo "Start Installation $DISTRO $LINVERSION"
           echo "(1) Fetch Release $R from GitHub"
           wget https://github.com/corrados/jamulus/archive/$R.tar.gz 
           echo "(2) Extract Source Code for Jamulus Release $R from GitHub"
           tar -xvf $R.tar.gz
           echo "(3) Delete ${R}.tar.gz from GitHub"
           rm $R.tar.gz
           echo "(4) Update Repository"
           sudo apt-get update
           INSTALLJAMULUS="yes" 
           break;;
        [Nn]* ) 
           echo "Cancelled Jamulus Installation on $DISTRO $LINVERSION"
           exit;;
        * ) echo "Please answer yes or no.";;
    esac
done

# echo "Check Variable: $INSTALLJAMULUS"
	
if [ "$INSTALLJAMULUS" = "yes" ]; then     
	echo "(5) Install Build Essentials for $DISTRO"
	
	if [ "$DISTRO"  = "Ubuntu" ]
	then  
		      echo "Installation for $DISTRO" 
		      sudo apt-get install cmake qmake gcc g++ 
		      sudo apt-get install build-essential qt5-qmake qtdeclarative5-dev qt5-default qttools5-dev-tools libjack-jackd2-dev 
		      sudo apt-get install qjackctl
                      if [ "$LINVERSION"  = "18.4" ]
                      then
                          echo "Perform Installation Specifics for $DISTRO Version $DISTRO" 
                      fi  
	
  	elif [ "$DISTRO" = "Debian" ]
	then    
			  sudo apt-get install build-essential qtdeclarative5-dev qt5-default qttools5-dev-tools libjack-jackd2-dev 
			  sudo apt-get install qjackctl
	elif [ "$DISTRO" = "Fedora" ]
	then    
			  sudo dnf install qt5-qtdeclarative-devel jack-audio-connection-kit-dbus jack-audio-connection-kit-devel 
			  sudo dnf install qjackctl
	fi
           
	echo "(6) Compile Jamulus $R"
	echo "Change to Directory jamulus-$R" 
	cd "jamulus-$R"
	# ls
	qmake Jamulus.pro
    make clean
    make
    sudo make install
    cd ..
    rm -R "jamulus-$R"
           
else

	echo "Installation cancelled"

fi

Next, set up your sound card to work with Jamulus

Configure Jack with QJackCtl

Jamulus clients need Jack to run, but you need to configure that first. The recommended method is to use QjackCtl.

  • Open the command shell e.g. with Crtl-Alt-T and
  • execute the command qjackctl you will see the Jack Audio Connection Kit
  • Start Jack You can Stop Jack after Quitting Jamulus)

The exact settings for Jack will depend on what your audio interface/sound card is capable of.

Configure Jack in qjackctl in Settings and do the following:

  1. Set the audio Interface to the one you want (there may be several in the list)
  2. Set the Sample Rate to 48000
  3. Set the Frames/Period to 128 and Periods/Buffer at 2 at first
  4. Restart Jack to take any new settings

Start Jamulus

  • Open the command shell e.g. with Crtl-Alt-T and
  • execute the command Jamulus you will start the Jamulus Client

Remark: To run Jamulus, type Jamulus (with a capital J) on the command line. You should see the Jamulus client in a window.

Jamulus puts itself into /usr/local/bin. You can now delete the sources directory you compiled from.

If you get problems with sound breaking up (in particular XRUN errors reported by Jack/QJackCtl) try setting bigger values (eg 256 frames or 3 periods) in step 3 above, or lower ones (eg 64 frames) for better performance. See the troubleshooting page otherwise.

Have a look also at Hardware Setup.

To update your installation to a new release

Download the new sources as per Get Jamulus and repeat just the compilation instructions as if for a new installation above.

Notes for geeks

  • The "make clean" is essential to remove the automatically generated Qt files which are present in the .tar.gz file and may not match the Qt version you are using.

  • To use an external shared OPUS library instead of the built-in use qmake "CONFIG+=opus_shared_lib" Jamulus.pro.

  • To use this file configure the software with qmake "CONFIG+=noupcasename" Jamulus.pro to make sure the output target name of this software is jamulus instead of Jamulus.

  • Users of Raspberry Pi: You may want to compile the client on another machine and run the binary on the Raspberry Pi. In which case, the only libraries you need to run it are those for a headless server build, but with the Jack sound packages.

  • As of version 3.5.3, Jamulus is no longer compatible with Qt4.

Possible Improvements of the Installation Script for Jamulus

The script can ask in the very beginning for which linux distribution the installation script should be called. This can be tested with the command lsb_release

With the lsb_release command the command returns the distribution specific information about a Linux distro. With a grep command with regular expression the variable DISTRO and LINVERSION. E.g. the Ubuntu based systems return with the command the following information.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 11.04
Release:        11.04
Codename:       natty

The challenge is, that lsb_release command must be available on Linux system. On CentOS/Fedora based systems lsb_release command is only available, if the lsb core packages are installed. So the automated Linux version detected might no work.

So reading the DISTRO and LINVERION with the read command might be the better distribution dependent improvement than an automated setting with lsb_release.