Advertisement
MezzFA0

INSTALL INFO for icecast, jack, liquidsoap and rotter

Sep 19th, 2012
926
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.78 KB | None | 0 0
  1. Ubuntu Server 12.04 Compressor/Streamer setup
  2.  
  3. sudo apt-get update
  4. sudo apt-get upgrade
  5. sudo apt-get install jackd1 icecast2 ntp rotter alsa-utils liquidsoap liquidsoap-plugin-jack liquidsoap-plugin-alsa
  6.  
  7. Set the icecast passwords when dpkg prompts you:
  8.  
  9. Source: whatever source password you want
  10. Relay: whatever relay password
  11. Admin: whatever web admin password
  12.  
  13. 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.
  14.  
  15. 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.
  16.  
  17. Anyone with ideas how to work around this would be a big help.
  18.  
  19. 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:
  20.  
  21. sudo apt-get remove liquidsoap-plugin-pulseaudio
  22.  
  23. (optional) Setup your time servers to any local NTP servers you have:
  24.  
  25. sudo nano /etc/ntp.conf
  26.  
  27. server local.ip iburst
  28.  
  29. Check to see if your icecast page is being served (port given inside /etc/icecast2/icecast.xml):
  30.  
  31. http://ipaddressofmachine:port
  32.  
  33. Add user to audio group:
  34.  
  35. sudo adduser `whoami` audio
  36.  
  37. Reboot for permissions to take effect.
  38.  
  39. 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.
  40.  
  41. Assuming all scripts are in your home directory
  42.  
  43. 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):
  44.  
  45. sudo cp ~/jackd.conf /etc/init/
  46.  
  47. Reboot and check to see if jack is running as the user you want.
  48.  
  49. sudo reboot
  50. ps -o pid,user,group,cmd -C jackd
  51.  
  52. Check user settings in script if jackd is not running.
  53.  
  54. Copy upstart script for liquidsoap:
  55.  
  56. sudo cp ~/liquidsoap.conf /etc/init/
  57.  
  58. Copy liquidsoap liq script:
  59.  
  60. sudo cp ~/liveradio.liq /usr/local/
  61. sudo chown `whoami`:`whoami` /usr/local/liveradio.liq
  62.  
  63. Copy Jack Connect scripts for liquidsoap:
  64.  
  65. sudo cp ~/jackConnect.conf /etc/init/
  66. sudo cp ~/jackConnect.sh /usr/local/jackConnect.sh
  67. sudo chown `whoami`:`whoami` /usr/local/jackConnect.sh
  68.  
  69. Make directory for emergency audio (used when theres a silence detected):
  70.  
  71. sudo mkdir -p /var/audio/emergency
  72. sudo chown `whoami`:`whoami` /var/audio
  73. sudo chown `whoami`:`whoami` /var/audio/emergency
  74.  
  75. 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.
  76.  
  77. Reboot and see if things are running
  78.  
  79. sudo reboot
  80. ps -o pid,user,group,cmd -C jackd -C liquidsoap
  81.  
  82. 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).
  83.  
  84. Finally lets get rotter going:
  85.  
  86. Remove the init.d script:
  87. sudo rm /etc/init.d/rotter
  88. sudo update-rc.d rotter remove
  89.  
  90. Copy the upstart script:
  91. sudo cp ~/rotter.conf /etc/init/
  92.  
  93. Reboot and see how its looking:
  94.  
  95. sudo reboot
  96. ps -o pid,user,group,cmd -C jackd -C liquidsoap -C rotter
  97.  
  98. Check to see you have mp3s being made inside /var/audio/whateverdate/time.mp3
  99.  
  100. All done.
  101.  
  102. 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