AutoDJ (liquidsoap) will not start
Here are some common reasons and solutions for AutoDJ failing to start.
1. Liquidsoap installation or update might have failed
You can check if liquidsoap is installed and operating normally by running the following as root user via SSH:
You should see a result similar to below if it is installed correctly.
Liquidsoap 2.0.6 Copyright (c) 2003-2022 Savonet team Liquidsoap is open-source software, released under GNU General Public License. See <http://liquidsoap.info> for more information.
Should you see an error message then we recommend to first attempt reinstalling liquidsoap as described further down in this article.
2. AutoDJ ‘DJ Listen Port’ could be in use by another process
- Enable Liquidsoap logging output (image right)
- Attempt to start AutoDJ on the service
- A file called liquidsoap.log should be generated in the Log Manager
- Open this file and search for the term “Address already in use in bind”.
- If you find this term then the problem is due to the port being used already and you will need to change the DJ Listen Port to another. You can simply clear the DJ Listen Port field and press save, the MediaCP will automatically select another port to use,
- Be sure to disable Liquidsoap logging output after troubleshooting or it will use a lot of disk space
3. AutoDJ is started but not playing any audio
In some rare circumstances we find that the shoutcast or icecast process running on the port might be from a previously “deleted” service in the MediaCP. This can occur when the shutdown process for the service previously utilising this port was not successful. In this scenario, AutoDJ is online but is unable to connect because the password is not valid.
To resolve the problem involves terminating the process running on the shoutcast/icecast port, then restarting from the control panel.
In the example below, we’re using a service on port 8000; be sure to change port 8000 to the portbase that your service is utilizing.
- Install netstat on the system, it will be used to see which process is running on the port:
# CentOS / Almalinux yum install net-tools
# Debian / Ubuntu apt install net-tools
- Switch the service to Offline in the MediaCP
- Identify any processes still running on the port
netstat -tulpn | grep 8000
- In this example, i can see that there is a process for icecast running on port 8000
- Because we already stopped the service in the control panel, we should terminate the remaining processes.
kill -9 30199;
- Now restart the service from the MediaCP
4. Other issues
If you reach this step and the problem is still not solved, then there may be another error generated.
Sometimes a specific combination of settings, corrupted or incompatible mp3/aac track may cause failures to start.
You can review the end of the liquidsoap.log file (described in step 2 above) to locate any “Error” messages that may be relevant.
- Login as root user to SSH
- Run the following to start the MediaCP installation utility
- Select option  Admin Tools
- Select option  Liquidsoap – (Re)install
Install custom version of Liquidsoap
It is possible to install any branch/tag from liquidsoap using the following procedure. For example, the below procedure will install the latest rolling release for 2.0. You can replace “rolling-release-v2.1.x” with any branch/tag/version.
- Login to mediacp system account via SSH
- Change to mediacp home directory
- Install/Update liquidsoap by pinning the source code
opam pin -y liquidsoap 2.0.3-1
- Check installed version
- Restart liquidsoap services
pkill liquidsoap; sleep 5; pkill -9 liquidsoap; mediacp cron "bitrate=1 autodj_restart=1"