Icecast on linode

tl;dr …I’m going to regret not taking notes.

I can’t justify the cost of Rogue Amoeba’s audio tools, but I wanted to get back into streaming music to myself over the web — when I was a Windows user, Shoutcast was a fun thing to install. In the morning I’d set musicMonkey (or whatever) playing mp3s into Shoutcast, which would then serve it up online. Poke a hole in my home cable-modem and I could listen at my desk @ work.

Dumb, totally superseded by the iPod, but still fun.

When I switched to Macs, it wasn’t as easy, but R.A.’s Nicecast could do the trick — it just needed to be rebooted every hour (they’re willing to let you use their apps for free, without feature-locks, but all their apps have time-limits or other clever tricks to encourage you to buy in. I would, if money were no object!) iTunes into Nicecast, same hole poked in the home modem/router combo… done. (At one point I had a USB TV-tuner thingie running on the network, and I vaguely recall going for a long walk one Saturday and using my Blackberry Curve to listen to the audio of CBS college football, being piped from USB dingus to Nicecast to Blackberry. I don’t remember how I overcame the restart thing. Maybe I got T to do it?)

Aaaaaanyway there are open source solutions and they are finicky of course, but I got them working today. I put an app called butt (“broadcast using this tool”) on the iMac and started Tunes. Butt couldn’t see the audio outputs on my new Macbook (a known problem); fortunately the iMac had an old R.A. freebie called Soundflower already installed, and butt could see Soundflower. (Title.)

so that’s music into a broadcaster. where to broadcast to? I started by breaking out an old Raspberry Pi. I knew Icecast was the open source version of Shoutcast, so I checked the repos and pulled down Icecast. Figured out where the config was and got it started. After some minor network hiccups, the whole thing was working. Fun.

But I didn’t want to have it running locally; poking a firewall hole in the Eero network dealies is do-able, but c’mon. That can’t be safe. I want to have an Icecast instance in the klôüd… So I got into my Linode box and yum install icecasted. “This will be easy.”

This was not easy.

I spent too much time messing with Apache, trying to get it to bind to a port that was the same port Icecast wanted to operate on. This was dumb. At the end of the day, I

  • got the music server on one port and told both semanage and firewalld to make way for that port (necessary, because the simple broadcasting software on the iMac (butt) couldn’t deal with server-redirect responses Apache was giving it when I tried it the other way — butt needed an IP address and a port, not a human-readable URL)
  • wrote an Apache config file to make a VirtualHost for one port over, and wrote a couple of ProxyPass lines to go from the one port to the other. (IOW, you go to a human URL, the DNS server turns that into numbers, and the Apache config redirects the numbers from port N to port N+1, where Icecast is running on port N+1 and if you figure out the IP address of my domain you can go to port N+1 like a nerd, or port N like a gentleman)
  • listened to my ‘fours and fives’ playlist over the internet for a while.

There was also a whole roundabout getting the domain sorted, but that was just general dummyosity, nothing worth writing down. (You might’ve moved your site’s nameservers to Netlify even though you bought the domain at Hover. I feel like I’ve even noted that here, before.)

N.B.: This solution still stinks, even though it works, because (a) I have to redirect the audio of my iMac to Soundflower, which means remembering to turn off Apple notifications so that messages and calendar and reminder dings don’t play, and (b) the ‘Now Playing’ metadata doesn’t get routed to butt this way. Soundflower just flows raw audio in; no artist/album/etc. A paid solution would just pop all of that out of iTunes or Spotify and feed it to the cloud server along with the audio.

Anyway radio.porknachos.com/stream is sometimes live. I’m not expecting traffic.

Advertisements