Airplay to Squeezebox Updated

An easier method for streaming to squeezebox using AirPlay

Requirements

Method:

Download shairplay. By Default, the example program delivered with shairplay dumps raw pcm 44100 2 channel audio to a file called audio.pcm. We need to make this file a fifo file so that it can be used to pipe data into Ices

%> mkfifo audio.pcm

Then start the example code

%> ./example

The example shairplay code is now running

Now, configure and start the icecast server. This will make the stream available for streaming to the Squeezebox.

After that, create an ices config file that points at the icecast server. Once you have done that, you can start the ices stream

%> ices config.xml <audio.pcm

This call will block until there is data in the fifo pipe (audio.pcm).

At this stage, the airplay server is running and the ices stream is blocking, waiting for content.

Streaming from iPhone

To stream from an iPhone, you just need to select the “AppleTV” device from the airplay list, and the stream will be created.

You can start the stream playing using a REST call to the Squeezeserver using CURL

%>curl -v -X POST -d ‘{“id”:1,”method”:”slim.request”,”params”:[“00:00:00:00:00:00”,[“playlist”,”play”,”http://<server&gt;:8000/stream.ogg”]]}’ http://<server&gt;:9001/jsonrpc.js

Where http://<server>:8000/stream.ogg is the icecast stream and http://<server>:9001/jsonrpc.js is the squeezeserver machine

This process can be automated using simple bash scripting.

Streaming from Mac

To stream all audio from a Mac, you can use Soundflower. Soundflower has built in support for Airplay servers, and therefore you can select one of these as an output device.  When you do this, the audio will be sent to the airplay server and then forwarded to the icecast server using ices. From there, the content can be streamed to the squeezebox device.

To stream from the mac, you can just change the audio output device to be the new airplay speaker in System Preferences->Sound, or by holding down the alt key and clicking on the Speaker icon in the menu bar

There will be a delay in the audio, but you can use VLC to compensate

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a comment