Forum » Help Radio Rivendell! » New server – Streaming help needed!

New Server – Streaming Help Needed!

Help Radio Rivendell!
Elrond
Rank (male) – Lvl 1

44714 XP

Hi all! As all of you have noticed, the old main server died and it resulted in total radio silence, since I hadn't gotten the new server online. I have a Ubuntu machine up and running, however... the software I was thinking of using (Shoutcast transcode SC_TRANS) has been discontinued, so I had a look at Liquid Soap, but they suck at installation instructions. So if anyone could be helpful in getting me back online I'd be more than happy I have a fully functional Shoutcast instance (I think) on Ubuntu 15.10, so all I need is to feed the Shoutcast server with an MP3 stream. Anyone? I'm willing to look into Icecast if that would be better.

Updated 3 January 2016 (14:51)

Friggin Lord Elrond!
Daften
Citizen – Lvl 8

843 XP

Je suis désoler je n'ai aucun moyen de vous aider car je connais rien informatique. Mais j’espère un retour de cette superbe radio. Bonne année et meilleur vœux.
Tyler Max
Rank (male) – Lvl 1

732 XP

ok, so what is the new server running? Ubuntu 15.10? i guess i can get an instance up and see about installing it....
Who Am I? No one! Everyone! I am ME! I am You!
    #idontloginoften
Pinwheel
Rank (male) – Lvl 1

12182 XP

It doesn't look like the community is being much help here. That's embarrassing. But I'm no better. I have zero Linux experience. I'm hoping you find the information you need somewhere and get this problem sorted. I'm looking forward to you getting back online soon.
Mekkis
Serf – Lvl 4

195 XP

Hi. I've a fair amount of linux experience (I created an account to post here). I'll look into the process of setting something up (possibly icecast) in the next few days, when I have a moment to get a VM set up with ubuntu. I'm surprised that you've using 15.10 (they seem to recommend 14.04.3 server for anything you plan to keep up for the long term). I'll keep you posted.
Mekkis
Serf – Lvl 4

195 XP

Turns out that (depending on how sophisticated the source is) getting liquidsoap set up to act as a source on ubuntu is pretty easy. Including the ubuntu install I managed to get it to play nicely with an icecast and a shoutcast server in about an hour. Actual installation of liquidsoap can be done using apt-get. Then it's just a matter of creating liq files. Throw me a message if you need help.
Underhill
Freeman – Lvl 6

438 XP

Sorry, Can't help with server issues Basic Linux skills only - on my 2 laptops, one of which was around when Elrond was a youngster
Arclayn
Rank (male) – Lvl 1

923 XP

Hello there,

It's been very quiet in my office without Radio Rivendell, and since you've asked for IT advice -- I created an account to help out.

Where I work (as a software engineer and programmer) is primarily served by Ubuntu Linux. First advice I have is please do not use Ubuntu 15.10. That is one of Canonical's short term releases that are abandoned after 9 months. These aren't meant to be put online for great lengths of time.

The most recent "long term release" (supported for five years) is 14.04, which came out in April 2014. The next will be 16.04, due out this April. But even 14.04 has three more years of official support left.

I took a quick look and saw that Icecast is easily available and installable to Ubuntu 14.04 via apt-get.

sudo apt-get install icecast2

Unfortunately, my knowledge of hosting streams (in and of itself) is nearly non-existent. But I'd be happy to provide knowledge where I can.

Best of Luck (and eagerly awaiting Radio Rivendell's return),

Arclayn

Updated 5 January 2016 (00:13)

"What if everything you see is more than what you see — the person next to you is a warrior and the space that appears empty is a secret door to another world? What if something appears that shouldn't? You either dismiss it, or you accept that there is mu
Not_Rich
Militia – Lvl 11

1722 XP

I'm curious (with my minimal linux skills) if it would be prudent to run 15.10 until April then migrate to 16.04LTS ? It'snot like he's hosting a bank or governmental agency here XD but then again, I have no clue about how much of a P.I.T.A that would actually be
Arclayn
Rank (male) – Lvl 1

923 XP

Posted by Alanar RaskinnI'm curious (with my minimal linux skills) if it would be prudent to run 15.10 until April then migrate to 16.04LTS ?It'snot like he's hosting a bank or governmental agency here XDbut then again, I have no clue about how much of a P.I.T.A that would actually be

Where I work isn't a bank or government agency, either.

I asked my office-mate, who is primary sysadmin. He suggested that migrating from one Ubuntu to the next is not always straightforward. It just depends on what's been done on the server. e.g. Lots of customization (maybe grabbing applications from non-canonical repositories) makes direct migration inefficient. In our ecosystem, he's actually found it faster to backup data, format/install new version, reload data (as this also usually involves migration to new hardware as well, and he has his own custom scripts).

However, office-mate/sysadmin also said that directly migrating from 15.10 to 16.04 would likely be less potential trouble than migrating from 14.04 to 16.04. So that question would partly entail whether Elrond would be willing to attempt a migration in a few months or not.

But whether it's a bank or a hobby server -- unpatched servers (of any kind and platform) usually lack the immune-system needed to prevent becoming an involuntary vector to spreading Internet sadness. I imagine we all want Radio Rivendell to spread happiness, not sadness.

Updated 5 January 2016 (23:45)

"What if everything you see is more than what you see — the person next to you is a warrior and the space that appears empty is a secret door to another world? What if something appears that shouldn't? You either dismiss it, or you accept that there is mu
Elrond
Rank (male) – Lvl 1

44714 XP

It seems like Icecast could be the way to go. I like it being "included in the apt-get" I'm not a Linux pro either, but migrating from 15.10 to 16.04 shouldn't be much of trouble I think. The servers is spanking clean. I have more or less just installed it. No sheit is installed and I will probably keep it that way. I will only use it to stream radio, and push and pull some statistics to the website. So I can just upgrade to 16.04 when that one comes out rather than rolling back to 14.04 or whatever we preferable need. And true, it's not a bank, and I just hope Ubuntu is safer than Windows XP SP1 that I ran on the old server. It never got hacked (that I know of) for the 10 years it was running. Always on a static IP. So it should have been destroyed if it was unsafe I shouldn't jinx it though
Friggin Lord Elrond!
Tyler Max
Rank (male) – Lvl 1

732 XP

Posted by ElrondIt seems like Icecast could be the way to go. I like it being "included in the apt-get" I'm not a Linux pro either, but migrating from 15.10 to 16.04 shouldn't be much of trouble I think. The servers is spanking clean. I have more or less just installed it. No sheit is installed and I will probably keep it that way. I will only use it to stream radio, and push and pull some statistics to the website. So I can just upgrade to 16.04 when that one comes out rather than rolling back to 14.04 or whatever we preferable need. And true, it's not a bank, and I just hope Ubuntu is safer than Windows XP SP1 that I ran on the old server. It never got hacked (that I know of) for the 10 years it was running. Always on a static IP. So it should have been destroyed if it was unsafe I shouldn't jinx it though

I would say that Linux is much more secure than windows. for one thing, almost no one makes any virus for it... and its open source, so if there is a problem, it will get fixed really quick, unlike windows, where the bureaucracy of Microsoft does not get a fix until its old news....

Who Am I? No one! Everyone! I am ME! I am You!
    #idontloginoften
Arclayn
Rank (male) – Lvl 1

923 XP

Posted by ElrondIt seems like Icecast could be the way to go. I like it being "included in the apt-get" I'm not a Linux pro either, but migrating from 15.10 to 16.04 shouldn't be much of trouble I think. The servers is spanking clean. I have more or less just installed it. No sheit is installed and I will probably keep it that way. I will only use it to stream radio, and push and pull some statistics to the website. So I can just upgrade to 16.04 when that one comes out rather than rolling back to 14.04 or whatever we preferable need. And true, it's not a bank, and I just hope Ubuntu is safer than Windows XP SP1 that I ran on the old server. It never got hacked (that I know of) for the 10 years it was running. Always on a static IP. So it should have been destroyed if it was unsafe I shouldn't jinx it though

These days -- which platform is safest is less relevant than which platform gets timeliest and most reliable security patches. That means, anything unsupported is no good, which today includes Windows XP. Ubuntu has been pretty good about providing updates. e.g. When news of the heartbleed exploit hit in 2014, Canonical had a patch out really quick, and office-mate/sysadmin had that patch installed into our ecosystem right away.

When you installed Ubuntu, you may have been given the option to have the system automatically download updates -- and that is a good thing to have turned on. But if you need to get updates manually, it's just another pair of apt-get commands.

sudo apt-get update

sudo apt-get upgrade

And then you need to reboot the server. But because of the modern era of rapid exploits and patches (a cat and mouse game, to be sure), server uptime isn't as much valued anymore. Since you have usage statistics, another idea would be to have the server automatically retrieve updates followed by an automatic reboot, done regularly once a week ( maybe as a cron job ) at a time when demand is consistently at a low point. Maybe even post that time on the website as a "maintenance window" (and it really is).

Something to consider about hacks is that an effective hack appears silent. That goes for desktop viruses too. The goal is not to destroy the server, but turn it into something like a "double agent" that additionally serves the badguys in some nefarious way. Therefore, never being hacked "as far as you know" is not a good indicator of safety. Keeping up with security updates and best practices, is. And I'm not saying that your old server had been hacked. It's nearly impossible to know at this point, and there is no need to dwell on it.

Got any more questions along the way -- let me know. I think (maybe) office-mate/sysadmin might be missing the music a little, too. Although I'm the one who plays it.

Updated 6 January 2016 (18:47)

"What if everything you see is more than what you see — the person next to you is a warrior and the space that appears empty is a secret door to another world? What if something appears that shouldn't? You either dismiss it, or you accept that there is mu
Sork
Hobo – Lvl 1

14 XP

First time poster, long time linux nerd. Once you're set up will someone still be able to donate bandwidth? Has anyone set up AWS to do that before?
Mekkis
Serf – Lvl 4

195 XP

Sorry about not getting back sooner.

As I understand it, you already have a working shoutcast instance (which I'm assuming is similar to those created by people who are donating bandwidth (myself included)).

So all you need to do is setup a source to point at it.

As I see it, what you need to do is use liquidsoap in order to get Things To Work.

Fortunately, setting up liquidsoap on a ubuntu box is simple:

sudo apt-get install liquidsoap

Now you need to create a liquidsoap script. This can be complicated, depending on how you're defining your stream, but for something simple like just playing back a playlist of audio files (I've run this with a combination of mp3s and oggs), the following works:

    #!/usr/bin/liquidsoap

    # set log path - default will be /var/log/ - which causes permissions issues

set("log.file.path","/tmp/radio.log" )

    # Generate the radio stream

radio = mksafe(playlist("ccmusic.pls" ))

    # output to a shoutcast server

output.shoutcast(%mp3, host = "myserver.net", port = 8000, password = "streampassword", radio)

Outputting to icecast is just as easy:

    #!/usr/bin/liquidsoap

    # set log path - default will be /var/log/ - which causes permissions issues

set("log.file.path","/tmp/icecastradio.log" )

    # Generate the radio stream

radio = mksafe(playlist("ccmusic.pls" ))

    # output to an icecast server

output.icecast(%vorbis, host = "server.ip", port = 8000, password = "radio", mount = "/stream", radio)

Then it's just a matter of running it:

liquidsoap _filename_.liq

It should connect and start streaming.

For further, funky things, Airtime (https://www.sourcefabric.org/en/airtime/) can be used to help with the whole management side of things.

Updated 8 January 2016 (14:14)

Arclayn
Rank (male) – Lvl 1

923 XP

In regards to Mekkis's Instructions:

I've run this by office-mate/sysadmin, and we both agree that pointing the streaming logs to /tmp is ill advised if Elrond wants to retain the logs. Anything stored in /tmp will be automatically deleted on reboot, and if Elrond follows my advice on keeping up on security patches, regularly scheduled reboots will be necessary.

I am curious as to the nature of the permissions problem with /var/log. Permission problems are both a boon and bane of Linux. Maybe a suitable alternative can be discussed... But then if the logs don't matter in the slightest -- then placing them into /tmp is no problem.

-- OR -- if someone wants to send logs far away into oblivion, point them to /dev/null. It won't even bother the hard drive. Please use /dev/null with care. I've heard it called a "Black Hole" for a reason.

Updated 8 January 2016 (22:21)

"What if everything you see is more than what you see — the person next to you is a warrior and the space that appears empty is a secret door to another world? What if something appears that shouldn't? You either dismiss it, or you accept that there is mu
Mekkis
Serf – Lvl 4

195 XP

It isn't really much of a permissions problem, more a few extra hoops you need to jump through: ideally, you'd run it as a service under a separate user and chown /var/log/liquidsoap to that user (and set selinux contexts accordingly).

Then use something like logrotate to ensure that the logs don't take up too much space.

That being said, something like liquidsoap, that only makes outgoing connections (rather than accepting connections from the internet) has a much narrower threat profile than most online services.

Elrond
Rank (male) – Lvl 1

44714 XP

Yay! I've got a first test up and running! Now I need to get the tags/meta to work and be sent properly and then add the proper streams Thanks so far, I wonder why I got stuck, it wasn't that tricky in the first place. I guess I bonked my head against the wall with the old Shoutcast things
Friggin Lord Elrond!
Elrond
Rank (male) – Lvl 1

44714 XP

Yay, I think it's running fine now. I have made it public on the site and we should be able to tune in and listen. Any help on Liquidsoap script on how to post what's playing to an external server (i.e. radiorivendell.com)? Any script should do.
Friggin Lord Elrond!
Mekkis
Serf – Lvl 4

195 XP

Firstly, Thanks for getting everything up. It's good to have music again.

As far as I can tell, you're already sending metadata to the icecast server: you can view it in parseable json at http://server-ip:8000/status-json.xsl However, polling something like that seems very inelegant.

A more correct way would be using store_metadata/on_metadata and defining a function, like the following:

    #!/usr/bin/liquidsoap

    # set log path - default will be /var/log/ - which causes permissions issues

set("log.file.path","/tmp/radio.log" )

    # Here's what we do to the currently playing track: currently writing it to a file, but

    # we could be doing whatever: using system() lets us run any linux command, or we could

    # be safer and use http.post

def history_func(h)

    # in this case, just write it to a file.

system("echo #{quote(h'filename')} > /tmp/currentplay" ) # That's supposed to be 'filename' in square brackets (with quotes)

end

radio = mksafe(playlist( "ccmusic.pls" ))

radio = store_metadata(size=20, id="history", radio)

radio = on_metadata(history_func, radio)

output.shoutcast(%mp3, host = "myshoutcastserver.info", port = 8000, password = "mupassword", radio)

output.icecast(%vorbis, host = "myicecastserver", port = 8000, password = "password", mount = "/stream", radio)

(Edited to try and remove smilies)

Updated 11 January 2016 (14:54)