Airsonos - airplay to Sonos devices

Posted on
Mon Nov 23, 2015 3:46 pm
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Airsonos - airplay to Sonos devices

I ran across this today and wanted to tell everyone about it. It's a node.js package that you install on an always-running machine (like your Indigo server). It finds the Sonos devices on your network and enables them as individual Airplay devices. I installed airsonos through npm -which took all of 2 minutes...
Code: Select all
sudo npm install airsonos -g
...then ran it. Now the only problem I had with Sonos is gone. It works seamlessly and is highly recommended to anyone with an Sonos system but still needs Airplay functionality.

The only downside is that I needed elevated permissions (sudo) to install it (but not to run it), and a terminal window needs to stay open while it runs. As my Indigo server runs headless and is dedicated; it isn't a problem for me, but I thought I'd throw it out there...

Download/Instructions:
https://github.com/stephen/airsonos

Blog/writeup:
https://medium.com/@stephencwan/hacking-airplay-into-sonos-93a41a1fcfbb#.unjw5lsap

airsonos running in a terminal window:
Screen Shot 2015-11-23 at 3.28.36 PM.png
Screen Shot 2015-11-23 at 3.28.36 PM.png (60.99 KiB) Viewed 3514 times


Exposed airplay devices:
Screen Shot 2015-11-23 at 3.39.29 PM.png
Screen Shot 2015-11-23 at 3.39.29 PM.png (69.1 KiB) Viewed 3514 times

IMG_2185.PNG
IMG_2185.PNG (115.83 KiB) Viewed 3514 times


Have fun!
Terry

Posted on
Mon Nov 23, 2015 4:44 pm
dsds offline
Posts: 8
Joined: Mar 01, 2015

Re: Airsonos - airplay to Sonos devices

Hey could you do me a favor and verify what version of the Sonos software you're currently running?

I had been using this for awhile, but the iOS 9 update broke connections from iOS devices. It was recently updated to fix the problem, but some people are having issues. I'm curious whether your Sonos setup is on version 6.

Thanks!

Posted on
Mon Nov 23, 2015 5:39 pm
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Re: Airsonos - airplay to Sonos devices

I'm running the latest version of the Sonos software - 6.0 and iOS 9.1


Sent from my iPhone using Tapatalk

Posted on
Wed Nov 25, 2015 4:18 pm
virgahyatt offline
Posts: 132
Joined: Jan 11, 2014

Re: Airsonos - airplay to Sonos devices

you should be able to set it up as a daemon so that you don't need to leave the terminal window open. I will see if I can't find the instructions on how to do it. If I remember right mac ports showed how to do it for their myth tv server.

Posted on
Wed Nov 25, 2015 7:26 pm
pvrfan offline
Posts: 53
Joined: Apr 19, 2011
Location: Near Toronto, Canada

Re: Airsonos - airplay to Sonos devices

virgahyatt wrote:
you should be able to set it up as a daemon so that you don't need to leave the terminal window open. I will see if I can't find the instructions on how to do it. If I remember right mac ports showed how to do it for their myth tv server.

Hey, that would be me!

Briefly, OS X runs all sorts of stuff in the background via "launchd". We create a standard file ("plist") that contains directives to launchd such as:
=the program to execute,
=command line parameters to feed to that program,
=what to do if the program quits (restart, ignore, ...)
=where to store logging and error messages ("stdout", "stderr")

The plist must be stored in a certain place depending on the 'class' of background process ("daemon") you want it to be. System daemons can run as soon as the system starts up and run whether a user is logged in or not. In this case the plist file is stored in '/system/library/launchdaemons'. (You can also just create a soft link into that directory and store the actual file elsewhere.) MythTV's backend runs as a system daemon. A template for the plist file is at:

https://trac.macports.org/browser/trunk/dports/multimedia/mythtv-core.27/files/org.mythtv.mythbackend.plist

(At the bottom, under Download in other formats, click the Original format text and it will be done by the time you lift your finger off the mouse button!)

Finally, you have to use the program 'launchctl' to tell launchd that you want to do something with it

Code: Select all
sudo launchctl load -w /system/library/launchdaemons/org.you.AirSonos.plist

If all is well, the daemon will start up and just work. To make launchd NOT run the daemon:
Code: Select all
sudo launchctl unload  /system/library/launchdaemons/org.you.AirSonos.plist

There are also user agents/daemons that only run when the associated userid is logged in. Those plist files are stored in '~/library/LaunchAgents' and you don't need to add the 'sudo' to the launchctl commands.

HTH,

Craig

Posted on
Fri Feb 09, 2018 2:49 pm
noel1983 offline
Posts: 446
Joined: Oct 17, 2014

Re: Airsonos - airplay to Sonos devices

If I’m understanding this right does this mean I can use airsonos to give me announcement capability to sonos devices that don’t have aux in? If that’s the case then that is awesome and may be the trigger of some more sonos to come into the house (unless anyone can tell me they have indigo talking effectively to echo devices over Bluetooth?)

Posted on
Fri Feb 09, 2018 3:27 pm
mlooss offline
Posts: 184
Joined: Sep 05, 2013

Re: Airsonos - airplay to Sonos devices

I gave up on Airsonos, never got it to work on my system. But then I came across Audiobridge http://audiobridge.site, which is a simple app and very recently priced and all of my Sonos speakers are now Airplay enabled. It basically does what Airsonos is supposed to do, but whithout all the hassle of installing different components and spending hours trying to get Airsonos working. I highly recommend it

Posted on
Fri Feb 09, 2018 3:51 pm
noel1983 offline
Posts: 446
Joined: Oct 17, 2014

Re: Airsonos - airplay to Sonos devices

Thanks for the tip I will take a look.
I assume these will then appear in airfoil so letting me use them for annuncements?

Posted on
Fri Feb 09, 2018 3:54 pm
mlooss offline
Posts: 184
Joined: Sep 05, 2013

Re: Airsonos - airplay to Sonos devices

Yes, it will show up in Airfoil, that is how I use it.

Posted on
Sat Feb 10, 2018 7:34 am
Japple55 offline
Posts: 224
Joined: Sep 26, 2015
Location: NE Tennessee

Re: Airsonos - airplay to Sonos devices

Just tried this. Does everyone else get a severe lag relative to other non-Sonos speakers in Airfoil? My Sonos starts playing about 8-9 seconds after the non-sonos speakers.

Jim

Posted on
Sat Feb 10, 2018 3:05 pm
mlooss offline
Posts: 184
Joined: Sep 05, 2013

Re: Airsonos - airplay to Sonos devices

I only ever used it with all of my Sonos speakers and never with other speakers and yes there is short delay but never that long.


Sent from my iPhone using Tapatalk

Posted on
Wed Feb 28, 2018 9:06 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Airsonos - airplay to Sonos devices

Are you using it for announcements? If so, any problems?


Sent from my iPhone using Tapatalk

Posted on
Wed Feb 28, 2018 9:17 pm
mlooss offline
Posts: 184
Joined: Sep 05, 2013

Re: Airsonos - airplay to Sonos devices

No, only for music.


Sent from my iPhone using Tapatalk

Posted on
Fri Mar 02, 2018 3:20 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Airsonos - airplay to Sonos devices

Just to follow up, I’m experimenting with audiobridge, airfoil, and Sonos for announcements. There is a 5–8 second delay or spoken announcements (indigo.server.speak()), and i am not sure how dependable it will be yet.


Sent from my iPhone using Tapatalk

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 14 guests