I wrote a step-by-step guide for creating a "pure" (headless, no GUI) Jamulus server for Ubuntu 18.4 (although earlier versions using systemd should also work).
THIS HOWTO HAS NOW BEEN MOVED TO THE PROJECT WIKI HERE:
The version I tested the HOWTO on was Ubuntu 18.04.4 LTS, so essentially the same.
I have no idea why apt wasn't able to find libqt4-dev the first time you ran the install, nor why it would find it when you installed libqtcore4 and libqtgui4 first!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
One thing I've noticed that I can't seem to get working, I tried creating a central server. This would be useful for a group of us who are trying to work collaboratively on a number of different rooms, so would be useful so not every musician keeps connecting to our rooms for our projects. (this is answering your use case question above for having another central server).
However, I can get the central server running fine and I've configured it on the default 22124 port. However, when i tried to create a second server to be listed on this new central server, although it runs and I can connect to it using the IP and port (in this case 22126), it is not listed on the serverlist dialog of the client when I've configured the client to use my new central server. I can see the main central server I created, but not any other servers (despite having --showallservers configured).
Ah, actually I found i had the name of the server too long! Once I made it below 20 chars it was all good - maybe worth putting as you get no error about it not working.
Still worth pointing out that ping information doesn't work between a server and a central server when they are on the same host.
Last edit: Simon Tomlinson 2020-03-23
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This systemd unit file avoids the need for a shell script, and sends all log output to journald so you don't need to worry about log file rotation.
[Unit]Description=Jamulus-ServerAfter=network.target[Service]Type=simpleUser=jamulusNoNewPrivileges=trueProtectSystem=trueProtectHome=trueNice=-20IOSchedulingClass=realtimeIOSchedulingPriority=0ExecStart=/usr/bin/jamulus --server --nogui \ --centralserver jamulus.fischvolk.de \ --serverinfo rebootrebels.co.uk;London;224 \ --welcomemessage "Welcome to the Reboot Rebels rehearsal room. All welcome while we are not here." \ --numchannels 12Restart=on-failureRestartSec=30StandardOutput=journalStandardError=inheritSyslogIdentifier=jamulus[Install]WantedBy=multi-user.target
Hope this is helpful
-David
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ah, Excellent! Somebody who actually knows something about systemd! :-) I'll update the HOWTO.
Does the Nice parameter also allow ionice (setting the io scheduling class) to be called? I don't know how important ionice is for Jamulus though really. EDIT: Oops just seen it's got IOSchedulingClass, sorry!
BTW the reason I had a separate shell script was that a) I can never remember where systemd puts things, and b) if you edit the unit file you also need to run a separate command to update systemd. I thnk it reminds you, but I'm not sure. Anway I'll point that out in the HOWTO so people can choose which they want to do.
Last edit: Gilgongo 2020-03-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The IOSchedulingClass and IOSchedulingPriority statements set the io scheduling class and io priority, i.e. the equivalent of 'ionice'.
More information on using systemd unit files to set scheduling priorities here, scroll down to the Scheduling section : https://www.freedesktop.org/software/systemd/man/systemd.exec.html
My Jamulus server instance is running on an Amazon AWS EC2 virtual server instance, so there is probably no point in trying to raise the IO priority. AWS may limit I/O anyway according to the 'size' of the EC2 instance I'm paying for. If my IO is not sufficient I will probably just have to pay a few more dollars and upgrade to a more powerful EC2 instance.
Process and IO Scheduling is probably only going to be important for folks who are using their own physical server, and are sharing it with other applications.
NB: If you edit the unit file, use sudo systemctl daemon-reload to pick up the changes and then sudo systemctl restart jamulus
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Cool - I put your stuff into the HOWTO and removed the separate script stuff in the end to keep it simple (along with removing some other stuff that wasn't needed like a separate log file).
Much more streamlined now. Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi David, thank you for this great guide.
I wanted to switch to serviced to drop the jamulus-startup.sh for ease of mind and I was not pleased to see 4 or 5 processes involved in jamulus (subshell etc...). Unfortunately, but I don't know if this is really important, the RT scheduling and priority set in the script by the sudo chrt 99 .... prefix were not applied when using the unit file. I followed the link you gave below and nearly fall in nervous breakdown reading mans of sched,ps and many others and in the end I dared to try this insersion in the file unit:
CPU scheduling is a complicated subject, and I am far from being an expert. But if you think about the problem at a high level, what you are trying to achieve is to make sure that your Jamulus server has sufficient cpu resources to keep up with demand from the audio traffic flows.
For a private server at home, the first and simplest thing to do is to shutdown and remove all unnecessary tasks. Ideally you should tell your server not to run any kind of graphical desktop. On Ubuntu, you can achieve that using systemctl set-default multi-user, then rebooting.
Then look through the list of tasks still running, and shutdown and disable anything you do not need. A default Ubuntu installation starts many services that are useful for a general purpose server, but are not necessary for a server that is only being used for Jamulus. For me, that meant shutting down smb, cups, modemmanager, wpa_supplicant, and nfs, because I do not need the server that is running Jamulus to also be a network file server. And I know that my server does not have a modem or a wifi card! But you will have to adapt this list to your circumstances.
Now that the server is only running the tasks you want it to, you can think about scheduling. The good folks at UbuntuStudio have already compiled a 'low latency' kernel with optimisations aimed at audio applications:
Eg. for Ubuntu 18.04: sudo apt-get install linux-lowlatency-hwe-18.04
More information here: https://help.ubuntu.com/community/UbuntuStudio/RealTimeKernel
Once you've worked through this, you will probably find there is no need to raise the 'nice' scheduling priorities for Jamulus server. On my server the latency reported by a Jamulus client on the same Ethernet segment as the server is around 2ms. That is tiny compared to the latency that the Internet will add for remote users, so no point in tuning the server any further.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for that nice HOWTO.
Regarding the -o option: The format is: [name];[city];[country as QLocale ID]. [name] is an arbitrary name (a string) [city] is the name of your city given as a string [country] is an integer number as given in the following list: https://doc.qt.io/qt-5/qlocale.html#Country-enum
👍
2
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hmm. The server is on a different network to the clients (and has a static Internet-routable IPv4 address, no NATing). I can't see my server listed though (I'm calling it jam.phreak.co.uk)
Last edit: Gilgongo 2020-03-21
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK - I saw a couple of client connection in the log now. Still can't see the server listed with my (Windows) client from my LAN though. Does the client only list servers with certain properties or something? I assume my ping time is OK.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I wrote a step-by-step guide for creating a "pure" (headless, no GUI) Jamulus server for Ubuntu 18.4 (although earlier versions using systemd should also work).
THIS HOWTO HAS NOW BEEN MOVED TO THE PROJECT WIKI HERE:
https://jamulus.io/wiki/Server-Linux
Let me know if you have comments/corrections etc.
Thanks!
Last edit: Gilgongo 2020-11-29
hi thanks for this, I'm using AWS Ubuntu and I get the error:
I've looked on the web and I see messages that this package is no longer available and you should use:
Would you agree with this?
[EDIT]
I finally got it working, i had to do the following in this order on AWS Ubuntu:
Last edit: Simon Tomlinson 2020-03-23
(sorry, SourceForge forums confused me - I'm not sure if you saw my earlier reply by email or not so I'm posting here too)
Can you tell me what version of Ubuntu you are using? (cat /etc/issue)
Ah interesting - what version of Ubuntu are you using?
Last edit: Gilgongo 2020-03-23
Version 18 i believe is what AWS ubuntu image is installed as default.
The version I tested the HOWTO on was Ubuntu 18.04.4 LTS, so essentially the same.
I have no idea why apt wasn't able to find libqt4-dev the first time you ran the install, nor why it would find it when you installed libqtcore4 and libqtgui4 first!
One thing I've noticed that I can't seem to get working, I tried creating a central server. This would be useful for a group of us who are trying to work collaboratively on a number of different rooms, so would be useful so not every musician keeps connecting to our rooms for our projects. (this is answering your use case question above for having another central server).
However, I can get the central server running fine and I've configured it on the default 22124 port. However, when i tried to create a second server to be listed on this new central server, although it runs and I can connect to it using the IP and port (in this case 22126), it is not listed on the serverlist dialog of the client when I've configured the client to use my new central server. I can see the main central server I created, but not any other servers (despite having --showallservers configured).
Here's the config of the child server:
Ah, actually I found i had the name of the server too long! Once I made it below 20 chars it was all good - maybe worth putting as you get no error about it not working.
Still worth pointing out that ping information doesn't work between a server and a central server when they are on the same host.
Last edit: Simon Tomlinson 2020-03-23
Nice catch on the 20 characters! Will add a note on that in the HOWTO.
Is the other issue related to this? https://sourceforge.net/p/llcon/bugs/12/
Last edit: Gilgongo 2020-03-23
This systemd unit file avoids the need for a shell script, and sends all log output to journald so you don't need to worry about log file rotation.
Hope this is helpful
-David
Ah, Excellent! Somebody who actually knows something about systemd! :-) I'll update the HOWTO.
Does the Nice parameter also allow ionice (setting the io scheduling class) to be called? I don't know how important ionice is for Jamulus though really. EDIT: Oops just seen it's got IOSchedulingClass, sorry!
BTW the reason I had a separate shell script was that a) I can never remember where systemd puts things, and b) if you edit the unit file you also need to run a separate command to update systemd. I thnk it reminds you, but I'm not sure. Anway I'll point that out in the HOWTO so people can choose which they want to do.
Last edit: Gilgongo 2020-03-26
The IOSchedulingClass and IOSchedulingPriority statements set the io scheduling class and io priority, i.e. the equivalent of 'ionice'.
More information on using systemd unit files to set scheduling priorities here, scroll down to the Scheduling section : https://www.freedesktop.org/software/systemd/man/systemd.exec.html
My Jamulus server instance is running on an Amazon AWS EC2 virtual server instance, so there is probably no point in trying to raise the IO priority. AWS may limit I/O anyway according to the 'size' of the EC2 instance I'm paying for. If my IO is not sufficient I will probably just have to pay a few more dollars and upgrade to a more powerful EC2 instance.
Process and IO Scheduling is probably only going to be important for folks who are using their own physical server, and are sharing it with other applications.
NB: If you edit the unit file, use
sudo systemctl daemon-reload
to pick up the changes and thensudo systemctl restart jamulus
Cool - I put your stuff into the HOWTO and removed the separate script stuff in the end to keep it simple (along with removing some other stuff that wasn't needed like a separate log file).
Much more streamlined now. Thanks!
All in the end before Test you server you could add a complete example
sudo service jamulus status
Thank you for this great guide Gilgongo & David
Last edit: Gronaz 2020-03-26
Hi David, thank you for this great guide.
I wanted to switch to serviced to drop the jamulus-startup.sh for ease of mind and I was not pleased to see 4 or 5 processes involved in jamulus (subshell etc...). Unfortunately, but I don't know if this is really important, the RT scheduling and priority set in the script by the
sudo chrt 99 ....
prefix were not applied when using the unit file. I followed the link you gave below and nearly fall in nervous breakdown reading mans ofsched
,ps
and many others and in the end I dared to try this insersion in the file unit:sudo systemctl daemon-reload
sudo service jamulus restart
Before
After
Do you think this is not usefull for a server at home ?
Last edit: Gronaz 2020-04-03
CPU scheduling is a complicated subject, and I am far from being an expert. But if you think about the problem at a high level, what you are trying to achieve is to make sure that your Jamulus server has sufficient cpu resources to keep up with demand from the audio traffic flows.
For a private server at home, the first and simplest thing to do is to shutdown and remove all unnecessary tasks. Ideally you should tell your server not to run any kind of graphical desktop. On Ubuntu, you can achieve that using
systemctl set-default multi-user
, then rebooting.Then look through the list of tasks still running, and shutdown and disable anything you do not need. A default Ubuntu installation starts many services that are useful for a general purpose server, but are not necessary for a server that is only being used for Jamulus. For me, that meant shutting down smb, cups, modemmanager, wpa_supplicant, and nfs, because I do not need the server that is running Jamulus to also be a network file server. And I know that my server does not have a modem or a wifi card! But you will have to adapt this list to your circumstances.
Now that the server is only running the tasks you want it to, you can think about scheduling. The good folks at UbuntuStudio have already compiled a 'low latency' kernel with optimisations aimed at audio applications:
Eg. for Ubuntu 18.04:
sudo apt-get install linux-lowlatency-hwe-18.04
More information here:
https://help.ubuntu.com/community/UbuntuStudio/RealTimeKernel
Once you've worked through this, you will probably find there is no need to raise the 'nice' scheduling priorities for Jamulus server. On my server the latency reported by a Jamulus client on the same Ethernet segment as the server is around 2ms. That is tiny compared to the latency that the Internet will add for remote users, so no point in tuning the server any further.
@gilgongojones
I just found this page. Could you please link the new website?
Thank you for that nice HOWTO.
Regarding the -o option: The format is: [name];[city];[country as QLocale ID].
[name] is an arbitrary name (a string)
[city] is the name of your city given as a string
[country] is an integer number as given in the following list: https://doc.qt.io/qt-5/qlocale.html#Country-enum
I've now put my server into what I call "public mode" - how long does it typically take to show up on the list?
It should show up instantly. But be aware of the known bug: https://sourceforge.net/p/llcon/bugs/12/
Hmm. The server is on a different network to the clients (and has a static Internet-routable IPv4 address, no NATing). I can't see my server listed though (I'm calling it jam.phreak.co.uk)
Last edit: Gilgongo 2020-03-21
jamulus.dyndns.org does not exist anymore. You have to use jamulus.fischvolk.de
Ah OK. So I'm now starting the server with:
Jamulus -s -n -g -l /var/log/jamulus/jam.log -e jamulus.fischvolk.de -o pHreak;London;224
I see no errors on my side (in fact there's nothing in jam.log at all - should there be?) but still not showing in the server list.
I can see your server now in the Connection Setup list.
OK - I saw a couple of client connection in the log now. Still can't see the server listed with my (Windows) client from my LAN though. Does the client only list servers with certain properties or something? I assume my ping time is OK.