Hacking Sonos
medium.com
medium.com
I love Sonos, their devices are way ahead of the competition. But their app just plain sucks. What is the most important function of a remote control app? Adjusting volume — and yet the useful range for the volume control occupies less than a percent of the entire touchscreen. It is very difficult to adjust the volume. And Sonos gives you no way to set the useful range, so you often end up blasting your ears with monstrously loud music, because you didn't tap the control just right.
This has been reported to Sonos numerous times and yet we still have to suffer with the crippled volume control.
Here is hoping that there will be an alternative.
I just don't get it: volume control is the #1 task for any remote control. If it were up to me, I'd dedicate 25% of screen space to it and tweak it endlessly to get it just right.
Further, it is not very granular at all. If you have a playbar, you may have noticed that the difference between mute and the very next volume up from mute is pretty high.
Sonos is not going to fix any of this. They do not care about your complaints about the app. People have been complaining and filing bug reports and pointing out simple UI improvements for years and it does nothing. They have made it clear that they do not care.
I am an early adopter (2005) and own about 12 of these devices and I have been disappointed and dismayed by the UI and the capability of their apps since day one.
Good luck with your project!
Actually, that solution was horrible for people like myself. I have a player connected to an external amp with no volume control. The amp is big. Which means that the useful volume range on the sonos is up to about 20% (perhaps), at which point the music becomes really loud.
Accidentally tapping the volume slider (and setting the volume to 85%) is a recipe for disaster in that case.
After initial UPnP search, you get a URL for a descriptive xml file. Sonos operates over the SOAP protocol.
If you want your client to be notified of changes, you have to subscribe to each event type with a max of 3600 second timeout, then resubscribe. It's not necessary but the system supports unsubscribing too.
One specific thing you have to hack is this. If you want to switch to a different music service, you have to include the user id used to sign into that service (Pandora, Rdio, etc). This data is returned in a base64 encoded, encrypted blob. There's no way to decrypt it unless you can figure out how to crack the key out of the device.
Fortunately you only need the user id. There's another undocumented endpoint that returns some info that includes all the usernames, just no passwords. But it doesn't match the them to their services. You then have to send requests with all combinations of usernames and services and get the responses. Once these are returned, just store the relationships.
I'm writing this from memory, sorry for the specific details. If anyone is interested, contact me through my email in my profile and I'll get the info from some code I wrote recently.
If you (or anyone) notice an excellent-for-HN post that has fallen through the cracks, please let us know at hn@ycombinator.com. We're thinking of starting a search-and-rescue program for the tragically overlooked.
I bought a Play:3 a few months back and was also dissatisfied with the given OS X/iOS apps - I'm currently working on enabling AirPlay support for Sonos devices. (http://stephen.github.io/airsonos/)
Would love feedback from any Sonos users!
Would be awesome if it worked though! I would want it as a menubar app though.
Does audio play at all even when the error happens, or completely doesn't work? I've noticed that sometimes it occurs but the streaming still works fine.
"strange error flushing buffer" is emitted from one of the dependencies, the lame encoder - I'm currently looking into the issue..
Would love to diagnose this further, via github or stephen at stephenwan.net.
The code is still very much 'alpha-stage' at the moment; functional but not completely consistent yet. I'm planning on doing a writeup with further progress!
Looks like a cool project, I just find it hard to believe he used wireshark to figure out the API on his own, given that he acknowledges:
I took a few bits from @n1mda's project: https://github.com/n1mda/sonos-objc
Sorry to be cynical, my BS meter just went through the roof.Also, the author used his own Sonos library written in ObjectiveC rather than Python: https://github.com/nathanborror/SonosKit
It looks like the author used SoCo for the Raspberry Pi project mentioned at the bottom of the article.
https://github.com/NathanHowell/Sonority https://github.com/NathanHowell/upd2 <-- update image extractor
A few of us went a bit further, found some telnet backdoors and cracked the root password.
Perhaps I could continue developing a Sonos API for SonosKit (I have a few improvements on a local repo)
I created an app using some of nathanborrors work that let's you browse through all of the Sonos Music services (Like Rdio, Spotify, Pandora, iHearRadio, etc). Setup your account, browse through your collections and play them on your system. I should submit a pull request to see if I can get this integrated into this project!
You can see the project here: https://github.com/drewying/Sonos-Music-Services-Browser
I also have an app on the App Store that turns your Sonos System into a wireless PA system. The current version is a little buggy but an update is coming shortly that makes it much more stable. You can check it out here:
https://itunes.apple.com/us/app/sonos-voice/id689673100?mt=8
[1] https://www.npmjs.org/package/sonos_cli [2] https://www.npmjs.org/package/sonos
Essentially - hook into the Phone's location services and perform actions based on either entering or leaving a certain location/radius.
[1]http://www.raspberrypi.org/meet-jasper-open-source-voice-com...
Works great - cool to see the Sonos web interface for the zones.
Sonos really does not like if components get different IPs after you had them powerless for some time while other components stayed active. I had the same issues you describe until I configured static leases for my sonos components and the smartphones we use to control them.
I've been using their equipment since 2005 and they have never reliably interconnected over the wireless.
Just spare yourself the trouble and wire them physically - they will be flawless.
My router is a hop up the chain and does not interact with the sonos system at all ...