Music Library Synchronization, Sonos Tips

I love Windows Home Server.   I’ve been using Windows Home Server for years, and just purchased a Windows Home Server 2011(WHS) box from Newegg (great deal on a HP Proliant micro server).  Many have asked me why I like WHS so much – it’s NAS, it’s a media server, it’s backup.   It’s a step up from a simple NAS device (although, admittedly, not as plug and play), offers more flexibility and is more cost effective than a Drobo.  A small backup agent can take snapshots of your PC, typically on a daily basis, so they can be restored to a given point in time.  I keep snapshots of my initial installation, for example.  Restoring to those backups is a simple process.  I’m also a big fan of Sonos, a whole-home music solution that works amazingly well.  What Sonos has done exceedingly well is blend quality hardware, quality software, and reasonable (but not cheap) price points.  I have an extensive music collection, and I point Sonos to a share on my WHS box to index and stream music.  However, I consider my laptop my “database of record” for my music.  It’s where I download stuff, and I take it with me because I’m often on the road.  The problem I run into is keeping my WHS library in sync with my laptop.   In my case, I want to mirror my library on the WHS exactly as it is on my local collection – and because I’m often reorganizing my collection, adding tags, etc., I need a simple way to do this.  Enter Robocopy.   Robocopy (Robust file copy) is now built into Windows, and it’s a simple command line tool with a number of options to make this a snap.   For example, if I want to mirror a folder on my laptop with my WHS, this command will do it: c:\>robocopy "D:\Music" "\\BEAST\Sonos\music" /mir /r:10 /MT:8 D:\Music is my local folder, my server is \\Beast.  The /mir command is for mirror – it’s the same as using /purge and /e:  /purge is to delete files at the target folder that no longer exist in the source, and /e is to copy all subdirectories, including empty ones.   The /r:10 will tell it to retry up to 10 times, in case of some network glitch, and the /MT:8 will have Robocopy use 8 threads to speed things along.   (If you’re familiar with Robocopy, I don’t recommend using /z (restartable) mode as it adds overhead, not needed given the size of files we’re dealing with.) Now, what if you don’t keep all your music local, and just want to copy it over?   You don’t want to use /mir since it will remove files you otherwise want to keep!   The rest of the command will work fine, but if you move/rename files locally that were previously copied, you’ll have to remember to do that manually on the server.  Once Robocopy does its thing, you’ll get a nice summary:             Total    Copied   Skipped  Mismatch    FAILED    Extras Dirs :      1384        29      1355          0         0         0 Files :     15078       381     14697         0         0         0 Bytes : 117.188 g   3.212 g 113.975 g         0         0         0 Times :   0:16:40   0:02:52                       0:00:00   0:00:48 Here, it copied about 30 new folders.  It took about 16 minutes to run, but that’s largely due to new content, having copied some 3.2gb of new files.   Assuming minor changes only, the process typically runs in about 30 seconds. If you want to get fancy, you could even have Robocopy monitor your folders for changes.  The next challenge is to have Sonos update its music index once new files are copied over.   Sonos can update its index on a daily basis (or manually via the control software), but I want it done automatically after new files are copied over.  This one is a bit trickier, but thanks to some gurus in the Sonos forums, it’s not impossible.   I’m including the .exe file here for you to use.  Obviously, trusting an exe from someone on the web is not something I’d do, but it’s a .NET assembly which means you can use a tool like JustDecompile to crack it open and look at the source yourself.   Having said that, I’m not responsible if this code causes your computer to blow up, your music collection to vanish, or kills any puppies. The source code looks like so, and it sends an SOAP packet to a specified Sonos unit to trigger an index rebuild: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;using System.Net;namespace SonosIndexUpdater{ class Program { static void Main(string[] args) { string ip; if (args != null && args.Length > 0) { ip = args[0].Trim(); } else { Console.WriteLine("Missing IP Address. Please add IP address for any Sonos unit."); return; } string header1 = @"SOAPACTION: ""urn:schemas-upnp-org:service :ContentDirectory:1#RefreshShareIndex"""; string postData = @"<s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/"" s:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/""> <s:Body> <u:RefreshShareIndex xmlns:u=""urn:schemas-upnp-org:service:ContentDirectory:1""> <AlbumArtistDisplayOption></AlbumArtistDisplayOption></u:RefreshShareIndex> </s:Body> </s:Envelope>"; string url = string.Format("http://{0}:1400/MediaServer/ContentDirectory/Control", ip); byte[] byteArray = Encoding.UTF8.GetBytes(postData); try { System.Net.WebRequest req = System.Net.WebRequest.Create(url); req.Headers.Add(header1); req.ContentType = "text/xml"; req.Method = "POST"; req.ContentType = "application/x-www-form-urlencoded"; req.ContentLength = byteArray.Length; req.Timeout = 5000; Stream dataStream = req.GetRequestStream(); dataStream.Write(byteArray, 0, byteArray.Length); dataStream.Close(); using (WebResponse response = req.GetResponse()) { Console.WriteLine("Response from Sonos: {0}", ((HttpWebResponse)response).StatusDescription); using (dataStream = response.GetResponseStream()) { using (StreamReader reader = new StreamReader(dataStream)) { string responseFromServer = reader.ReadToEnd(); Console.WriteLine("Data: {0}", responseFromServer); } } } } catch (Exception ex) { Console.WriteLine("Exception occured: {0}", ex.Message); } } }}   To use it, you’d just pass in the IP address of any Sonos unit:   c:\>SonosIndexUpdater 192.168.1.100 If you stumbled on this and aren’t a developer but want to try it out, you can build this for free using Visual Studio Express.    Here are some files:   EXE file only: DownloadVS2010 Solution: Download

Summer of Sound

Once or twice a year, I try to take on a project around the house and bring it to a full 80% completion before abandoning for a few years.  In this case, I decided to install some sound around the home.  It was frustrating me to not be able to listen to my favorite music around the home (without dragging around gear), particularly when experiencing nice whole-home audio solutions at some friends’ homes.  The big problem is that there are very few good audio systems for retrofit installations.  For anyone building a new home, my advice is this:  run wire.  Run wire like copper is on the path of incandescent light bulbs.   I’m not one to run 8 or 12 CAT6 drops to every wall, but at least 2, plus speaker wire, RG6, etc., would make sense.  Think about wall outlets, think about in wall/ceiling speakers, think about wall panel controls.  Even if you don’t complete the build out, having the cable in the wall makes life so much easier down the road. I ruled out Logitech Squeezebox and any AirPlay devices (few that there are) pretty quickly.  (And yes, I get that Airplay is Apple and I work for Microsoft).   AirPlay is really too limited, and Squeezebox just not exactly what I was looking for and in many reviews I read, seemed to come up short with limitations. And then after reviewing a few systems, I decided to try the Sonos solution.   Sonos is retrofit friendly (wireless) but also hardwire capable.    They have a variety of units: all-in-one speakers, amplified units to drive your own speakers, and unamplified units to provide line in/out into an existing AV receiver.   While the devices aren’t cheap ($300/$400 for their all-in-one speakers, $500 for an amplified controller) it’s certainly cheaper than most big names in whole-home audio, like NuVo.  So first up:  the Office.  In the office I decided on a pair of Play:3 units, configured in a stereo configuration: I purposefully left some items like a deck of cards, picture frame, and my C9 guy in the shot to give some contrast as to their size.  While pricey as a pair, the sound is among the best in class and, by the time you price out decent bookshelf speakers, an amp, etc., you’re certainly not any cheaper.  Of course, what’s missing from this configuration is a controller, which can be their stand-alone control, tablet/iPod controller, or desktop computer. This setup is similar to what I did in the living room, except because it’s a big larger of a space, I used a pair of Play:5 units which are slightly larger than the Play:3. The Play:5 have a bit richer bass and can fill even a large room fairly easily. While I’m impressed with the Play:3, the Play:5 really shines in larger spaces. Rounding out the install was a Sonos ZP90 feeding the home theater system (a Pioneer 1018-AH-K receiver). The ZP90 has a line-in, as well, so the output of the system is fed back into the ZP90. The idea here is that you can take programming – like a football game – and stream it to any other zone. I also had 2 problem areas to solve, both of them outdoors.  The screened-in porch is a nice, confined area, but needed all-weather speakers and creative wiring.  I needed 12 gauge cable due to the length (wiring it to a Sonos ZP120 inside), and the cable had to be in-wall rated, yet outdoor (UV) resistant, and direct burial rated.  That’s a tall order, but I found some at OSD.   Typically I’d buy most of my cable from Monoprice, but their cable is in-wall rated only.  The cable is dauntingly large as you’d expect with 12 gauge.  I punched a hole near my previous projects (low voltage lighting and outdoor power in the other conduit), and started snaking the cable under the house to the living room. Outside, the best place to run the cable was behind the gutter (pictures on right).  You can’t really see it unless close, and it blends nicely.  The rest of the wire was easily concealed under some trim, so I brought it inside the porch to a pair of Definitive Technology AW550.    (I had auditioned some Klipsch speakers as well, and while I love Klipsch, I felt the Definitive were a better buy. There’s one more problem, though, and that’s the outdoor patio.  I struggled with this area for some time because it’s not acoustically friendly (no area outside is, really, but this was particularly challenging).  There is no location for a set of speakers that would give a good sound stage (even considering rock speakers), and even all-weather speakers would get hammered in the elements.   I wasn’t sure what to do, and then I stumbled on the Soundcast Outcast.    As one reviewer wrote, the design reminded them of a diaper genie so it won’t win cool-looking design awards, but on the other hand, understated is refreshing.  The Outcast is a wireless speaker and has received some fantastic reviews.  I wasn’t sure I wanted to plunk down the relatively high price tag without trying it to see if it would work with Sonos (primary concern was wifi interference).   I decided to reach out to the company, and ended up on the phone with Mal Hollombe, Soundcast President (small company or not, it’s pretty impressive to land on the phone with the president).   Because the CEDIA conference was imminent (though it was last week as I write this), I got a chance to hear what the company was planning and their excitement around the conference.   I don’t recall exactly how Mal put it, but essentially he remarked how there are a lot of companies that haven’t done wireless well, leading to a perception that wireless audio was second class.    I explained my setup and concerns, and was hoping there’d be a dealer that had a unit I could audition or possibly receive a review unit.   Unfortunately not, but he offered a unit I could buy (full disclaimer: at a discount) and return it if I wasn’t happy.  He promised I’d be impressed.  The Friday before Labor Day weekend, I received the massive box containing the Outcast (this thing is huge) and began to unpack.  I love the fact that it’s weather resistant, has a battery, and is wireless (optionally).  Most important, though, was how it sounded.  I’m an enthusiast but no audiophile.  I have money invested in gear that would make some consumers gasp but most audiophiles laugh.   I can’t tell the difference between FLAC and good MP3s, but can’t bear to listen to built-in TV speakers, if that gives you a frame of reference as to my expectations. So how does the Outcast sound?  Really, really good.  The 8” woofer provides great bass outdoors, and the circular design sounds great as it creates a very open soundstage.   As another reviewer pointed out, it provides great range despite not having tweeters. I do have a problem, though, and that’s with the wireless range.   Virtually every review I’ve read lauds the Outcast sound quality and wireless range, but the latter eludes me.   Up to 150’ inside and 300’ outside according to spec, I was initially finding more like 15’ inside and 25’ through the window to the patio before I started experiencing breakup.  Something wasn’t right. I ‘get’ all this wireless stuff of course, so began reconfiguring my access points and Sonos system to try to be as separate as possible and leave some channels clear for the Outcast.   My Sonos is, except for 1 unit, hard wired.  Most of these devices all live in the 2.4ghz spectrum, and unfortunately, most channels overlap quite a bit.    After some fiddling and relocation, I was able to find a sweet spot for the Outcast transmitter (called the iCast), but this has two problems:  the Sonos ZP90 that was feeding it can no longer do so because it was located in another room (which means another ZP90 is needed), and the range, while better than my first attempt, isn’t great. I’m continuing to try and diagnose.   As far as I know, I’ve removed all possible sources of interference.  I don’t blame Soundcast – I believe it can likely work GREAT but in my case, I can’t quite get the range I’d like.   Whether it’s the Sonos creating ambient RF noise, AC ducts in the ceiling, or just the environment being less than ideal, I’m not sure. This is ultimately the bane of wireless – companies like Soundcast and Sonos have solved the quality issue.  Wireless continues to be hit or miss for streaming and there’s only so much unregulated spectrum, and while I can solidly recommend the Outcast as a great sounding speaker, I’d encourage anyone considering it to audition or buy from a place with a return policy in the event the wireless doesn’t work out. As for Sonos, I have no problem recommending it – although I have had no problems with the wireless, most of my units are hardwired so I’d recommend, for wireless users, an evaluation before committing.  One unique feature of Sonos is Sonosnet, a proprietary mesh protocol.  While it operates over the same wireless frequencies, the mesh means each device becomes a repeater, able to overcome most interference issues.

My Apps

Dark Skies Astrophotography Journal Vol 1 Explore The Moon
Mars Explorer Moons of Jupiter Messier Object Explorer
Brew Finder Earthquake Explorer Venus Explorer  

My Worldmap

Month List