Skip to main content

After spending almost an hour in a Chat and then a virtual session with Sonos support, I was left with the resolution of “I have no idea why your playlists are not coming in from your Apple music app.” This even after the tech in the virtual session re-pointed the Sonos app to the folder where everything was located, re-indexed and there were no imported playlists. I have my music on a networked drive that I have used for years with no problems, but the last time I made changes to the drive, I had to reformat and create my library from scratch.

After the first indexing, all the music was there, organized the way the Apple Music app sets things up but no playlists showed up. After searching these forums and finding info about exporting an .xml file, I did that. I put that file in the folder searched by Sonos, re-indexed but still no playlists. That’s when I turned to the Sonos tech folks.

A day after not having a solution from Sonos tech support, I had an idea that I tried and it worked.

Apparently, the Sonos software engineers haven’t kept up with Apple with regard to the file that is created when you export the library from the Apple app. That file gets the default name Library.xml. I searched back through some old files and found a previous music library .xml file that had the name iTunes Library.xml. I renamed the new file exported from the new Apple app (that replaced iTunes) from Library.xml to iTunes Library.xml. After re-indexing all the playlists were there in the Sonos app.

Bottom line is that the library file has to be named iTunes Library.xml or the Sonos app won’t read the file. Hopefully, this will save a lot of folks the frustration I went through.

Suggestion for the Sonos folks—how about coding the Sonos app to just directly read the library file that the Apple Music app uses and not require exporting that to an .xml file? That way, any changes to the music library made in the Apple Music app will automatically reflect in the Sonos app with nothing more than a re-index. If that is not possible for technical reasons, then at least update your support articles to reflect that the .xml file requires a specific name. Or update the Sonos app to read the file that Apple creates without having to change the filename. And, tell your tech support folks about the filename requirement until/unless the Sonos app is changed as suggested.

Hi @rodeknyt 

Welcome to the Sonos Community!

Thanks for sharing your findings! A few points, however:

When iTunes changed its name to “Apple Music”, Apple also depreciated use of the xml file. As a result, the Sonos app now creates this file if one is not found on indexing, but only when the files are stored locally on your computer. You can also export playlists to an xml file in the Apple Music app.  When you store the music files on a network drive, however, you must create/copy this file over manually each time a playlist is changed.

I am not aware of this file ever being called “Library.xml” by default (at least, not in my 5 years of working for Sonos), so that certainly explains why your Sonos system was not reading it.

This is no excuse, though - the agent you spoke to should ideally have noticed this, so I’ll see what I can do so things are improved for the next person calling in with this issue.

As for why the Sonos app will write the missing xml file to a local folder but not to a remote one, I am not sure why this is - I have tagged this thread as a feature request. 

I hope this helps.


Thanks for the reply.

The file Apple Music creates to export the library is absolutely named Library.xml. I have identical libraries on my computer and on the NAS drive. I didn’t matter which library I was using in the Apple Music app, the file was output to that name.

Also, when I pointed the Sonos app to the library on my computer and re-indexed, there still were no playlists imported. Also, there was no other file, .xml or otherwise, that was created by that indexing in that path. Whatever is supposed to be happening according to what you and your support pages say isn’t happening. Since you say the Sonos app creates the .xml file from the Apple library file, those playlists should have shown up but didn’t.

Unless the Sonos app is changed to read the default library export file from Apple Music app then your support pages and tech support folks should be very clear and explicit that the file must be named iTunes Library.xml and placed in the path the Sonos app is pointed to.

While writing this reply, I did some checking and found a file named iTunes Music Library.xml that was created about the time I remember doing a re-indexing following some changes to the library on the NAS drive. That file was indeed on the local drive, but not within the path where the library I use resides (which is on an external local drive). That .xml file does show paths for its entries residing on the NAS drive.

Yes, it would be great if the Sonos app did create an .xml file in the same path where the active library resides.

It shouldn’t be this confusing.


Hi @rodeknyt 

I was referring to my own experiences in supporting cases such as yours in the past - I personally have only seen the file called “iTunes Library.xml” and “iTunes Music Library.xml”. As to why different file names are used, I can only guess, and my guess is that older versions of iTunes used “iTunes Library.xml” and “Library.xml”, that newer versions of the application would use the old file if it found one and that your “Library.xml” file has been in existence for some time. Why Apple did this, I have no idea (if that’s even what’s happening here).

The only reference to the xml files I can find in our public documentation is here: https://support.sonos.com/en-gb/article/itunes-playlists-missing-from-sonos-library-on-usb-drive. It calls the file “iTunes Music Library.xml”. Our internal documentation references the same filename.

I notice you mention that the library is on an external drive - that makes the above link even more relevant. As far as I am aware, writing to a USB drive requires special permissions on macOS, which goes some way to explain why perhaps the Sonos app does not do it, though this is just a guess on my part - there may be other considerations. There’s a chance that it was decided that having many more users who do not need these permissions being suspicious of why Sonos is asking for them than those who actually need them wasn’t ideal, though again, this is just supposition on my part - I don’t know.

I hope this helps.


MacOS only asks for permissions for things the first time a particular OK is needed, so minimal handholding would be involved.

Anyway, the method I finally decided to use is more straightforward—to me anyway. Since the Sonos library only needs updating when changes are made in the Apple music app, I simply have the .xml file Apple creates saved directly in the same folder Sonos shares. When the dialog box opens in the Apple app to export the library, I append iTunes to the front of the default name Apple uses and then direct that file to be saved in the folder shared with Sonos.

Then when I update the Sonos library, I don’t have to go looking around for that .xml file—the updated one is already there. No hunting, no copying and the Sonos .xml file can live happily ignored and unmolested wherever it was deposited.


Man, I cant believe I didnt find this before. Pretty much the same situation as you. I just posted this after a few hours of testing. Not sure if you can add to it or not.

 


All I can say is that when the Sonos app creates the .xml file, it puts it in the the ITunes folder inside the Music folder in your User account regardless of where your music library is actually located. If your music library is someplace else, move the .xml file to the same folder where the Music Library file is located and all will be fine.