Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ubuntu Server 12.04 Compressor/Streamer setup
- sudo apt-get update
- sudo apt-get upgrade
- sudo apt-get install jackd1 icecast2 ntp rotter alsa-utils liquidsoap liquidsoap-plugin-jack liquidsoap-plugin-alsa
- Set the icecast passwords when dpkg prompts you:
- Source: whatever source password you want
- Relay: whatever relay password
- Admin: whatever web admin password
- All these passwords should be different and strong. These are not daily use passwords. Consider using fail2ban to help prevent bot password cracking. You can also set to authorise only certain IP addresses which is a good idea.
- Set JACK to realtime when asked. This will set the limits file correctly however due to a quirk in init/upstart we won't actually be able to run it in real time mode due to permission problems.
- Anyone with ideas how to work around this would be a big help.
- Liquidsoap tries to connect to pulse audio by default and obviously fails as our server has no pulse. I couldn't find a way to disable this behaviour so I just removed the liquidsoap pulse audio plugin:
- sudo apt-get remove liquidsoap-plugin-pulseaudio
- (optional) Setup your time servers to any local NTP servers you have:
- sudo nano /etc/ntp.conf
- server local.ip iburst
- Check to see if your icecast page is being served (port given inside /etc/icecast2/icecast.xml):
- http://ipaddressofmachine:port
- Add user to audio group:
- sudo adduser `whoami` audio
- Reboot for permissions to take effect.
- Edit each script with the user you want to run as and any other settings you need to change. Now we need to copy our upstart scripts around.
- Assuming all scripts are in your home directory
- Copy upstart script for jack (remember to change the JACKDEVICE variable to whatever sound card you have, the scripts are defaulted to hw:1 as I had a usb sound card I was using and an internal motherboard card which was hw:0):
- sudo cp ~/jackd.conf /etc/init/
- Reboot and check to see if jack is running as the user you want.
- sudo reboot
- ps -o pid,user,group,cmd -C jackd
- Check user settings in script if jackd is not running.
- Copy upstart script for liquidsoap:
- sudo cp ~/liquidsoap.conf /etc/init/
- Copy liquidsoap liq script:
- sudo cp ~/liveradio.liq /usr/local/
- sudo chown `whoami`:`whoami` /usr/local/liveradio.liq
- Copy Jack Connect scripts for liquidsoap:
- sudo cp ~/jackConnect.conf /etc/init/
- sudo cp ~/jackConnect.sh /usr/local/jackConnect.sh
- sudo chown `whoami`:`whoami` /usr/local/jackConnect.sh
- Make directory for emergency audio (used when theres a silence detected):
- sudo mkdir -p /var/audio/emergency
- sudo chown `whoami`:`whoami` /var/audio
- sudo chown `whoami`:`whoami` /var/audio/emergency
- Copy any songs you want to play when its silent into the emergency directory. Amend the liveradio.liq script if you want a playlist. At the moment it defaults to a single mp3 called song.mp3.
- Reboot and see if things are running
- sudo reboot
- ps -o pid,user,group,cmd -C jackd -C liquidsoap
- You should have audio on your icecast page at this stage. If not check that jack doesn't have any errors and has connected properly (consider installing something like lxde-core with qjackctl to monitor what is happening, you can temporarily start lxde via tightvncserver which is handy).
- Finally lets get rotter going:
- Remove the init.d script:
- sudo rm /etc/init.d/rotter
- sudo update-rc.d rotter remove
- Copy the upstart script:
- sudo cp ~/rotter.conf /etc/init/
- Reboot and see how its looking:
- sudo reboot
- ps -o pid,user,group,cmd -C jackd -C liquidsoap -C rotter
- Check to see you have mp3s being made inside /var/audio/whateverdate/time.mp3
- All done.
- I tested this setup on an old Core 2 Duo from 2007 with 2GB of RAM. Average processor use was about 15% (10 - 12% liquidsoap) with about 40MB RAM used.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement