On the 65k limit: why do speakers index music? It just seems incredibly poor design!

  • 28 January 2019
  • 46 replies
  • 2718 views

Badge
I understand there is a limit of 65k tracks, or fewer, depending on metadata. I understand Sonos is extremely unlikely to ever overcome this, that the users who are annoyed by this are a small minority, etc.

My question is just curiosity (with little practical implication as the limit is unlikely to change): why? I understand the limit has to do with speakers indexing the music collection, but why on Earth do speakers need to index my music? Shouldn't that index reside only on the devices which control the music being played (computer, phone, tablet), rather than on the speakers, too? I see many downsides in storing a copy on the speakers, this limit being one, but I can't see many upsides. Indeed, AFAIK Sonos' competitors do not use this system and do not have this limit.

This topic has been closed for further comments. You can use the search bar to find a similar topic, or create a new one by clicking Create Topic at the top of the page.

46 replies

So, when I open the Sonos Android app to play, I don't know, Adele's Hello which is on my NAS, what the app is really doing is telling the speakers: this song corresponds to the unique id 123 in your library, go and play song 123, and the speakers will automatically connect to song 123 on my NAS?

This answers "how", but doesn't answer "why": what are the advantages of this kind of set up?

The speakers do not have and do not need to store an index for online streaming content (Spotify, Tidal, etc) - why do they need it for local files?



No, it is telling Sonos to put song 123 in a queue. Then it may tell it to put song 244 in the queue. Then another device may tell it to put song 64 in a queue. Then the first device might be turned off and the second leaves the building. How is Sonos supposed to know what songs to play without access to the index?

Online content uses a server to serve up tracks to the clients. Would you want to keep a PC running a server or set up a server on an NAS ala Squeezebox to get what you wish? If so, Plex is supported by Sonos, with all the limitations of that type of setup.


Again, it's just a curiosity with no practical implications, but to my non-technical, non-developer eyes, it just seems like extremely poor design


It is actually a great design, with the limitation of not being optimum for the small subset of users who have over 65K of tracks.
Userlevel 7
Badge +26
Good question to ask. A big part of this design is to keep consistency across all controllers. The music index is only built the one time by players (until it's re-indexed), and then all controllers in the house show the same index. If it were stored on the controllers, they'd either have to index individually, one controller at a time, or possibly the players could make an index and then push it to the controllers, but currently, that whole process is read-only, no writing.

In part, the answer to the question "why" really is going to come down to "when we designed it, this seemed like the best option." There are certainly going to be lots of reasons involved and I don't know all of them. Lately, Sonos devices are more Internet-connected than ever, so there's always a chance that you'll see some change in the future to indexing and local libraries.

I can't speak to future plans that haven't been announced, but you never know what might happen. There was a time Sonos technicians manually created and curated the list of Internet radio stations that players displayed, now that's done by a music service.
The number of people with over 65,000 tracks is minimal

It simply doesn’t matter - Sonos support loads of third party services where the take-up is minimal - if it’s supported, support it well. The fact is:

1) SMB 1.0 is horrendously outdated
2) index file is not required

The real business reason behind the decision is to push people towards streaming services to please those vendors, out of fear that those with large libraries attained those libraries by illegally pirating.

None of which matters. The indexed SMB 1.0 file share sucks big time. Most IT environments have SMB 1.0 disabled due to vulnerabilities. It is simply crap, and trying to defend it to tell users how they should be using the product .... sounds more like Bose than Sonos.


Clever theory, except the limit existed long before streaming services even existed, and was actually increased after Sonos added the first streaming service, not decreased. Nice try, though.


Again, your logic doesn’t matter, the decision is a business one to not upgrade the 2003 SMB 1 stack, which every other device has surpassed. They don’t want users having better file share capabilities - it’s simply not on their agenda - but they sell it as supporting this, even though it only scrapes the bare minimum compared to every other vendor. It is an appalling implementation, whether you like it or not, accept it or not, or write it off as ‘meh very few people use it’

Literally all the controller needs to do is browse the directory, create a json playlist and pass this tiny tiny text file to the speaker. The speaker then establishes a SMB session to the server to source those files. It’s that simple, easy to develop and requires no speaker stored index. It has nothing to do with speed - that is a lie. It is bad software, plain and simple.
It has nothing to do with speed - that is a lie. It is bad software, plain and simple.Perhaps you'd care to hail a passing DeLorean and transport yourself back to 2002. I suspect you'd find that the 'truths' which pertained then were rather different.
This is a really easy problem to solve. Not sure why Sonos doesn't address. Network share paths can be stored on the controller app (rather than full library metadata). An active playlist , can also be stored on teh speaker, with the necessary metadata, to ensure a controller app going offline doesn't interrupt playback.

IF there is issues with controllers accessing secure network shares, The Sonos speaker(s) can act as pass through servers (ie call a share for the listing of a given share and pass the data through to the controller app.)

To address a few of the issues/limitations called out in this thread:

- Richer metadata benefits streaming services, not just music stored on a network share. Artist art, release year/date, copyright/publisher info, etc. is all metadata that most streaming services already make available.

- A "last updated" timestamp stored on the speaker(s) would ensure that every time a controller connects/checks in it is as current as possible

- I expect more people have more speakers than controller apps so it would less effort/network traffic to keep the controllers in sync

- if Sonos insists on storing library data on the speakers a richer set of metadata could also be stored on the controller(s)

- metadata on the controller has no limitations other than the device. This would allow Sonos to keep up with richer native apps and, theoretically, deliver metadata as rich as roon, without the need for hardware upgrades.

- caching metadata/art on the controller would make browsing libraries a WAY better experience. In line with accessing a native library.

- If Sonos is going to stay ahead of the pack keeping their app best in class is probably a good idea to ensure metadata is as rich as possible. Apps that provide a richer experience and download missing art/tags is the norm these days, even the better free apps do this.

Hey, another idea - open source the non-proprietary code for the app. This would allow the community to contribute rather than just complain...

Cheers

Hey, another idea - open source the non-proprietary code for the app. This would allow the community to contribute rather than just complain...


Right, and become another Squeezebox "success story". :8

You do know they have an API that the "community" can and does use, right?
FYI, the OP is correct - this is a fundementally poor and very flawed implementation.
I think that's a bit unfair. I can't say that I'm happy about the problems with handling large local libraries, but there seem to be quite understandable historic reasons for it. I would imagine that such large local libraries weren't considered that likely, and that it was considered important not to write the index onto user storage, with all the potential pitfalls that entailed. For speed purposes as well, the chosen approach was considered the most suitable back in the early 2000s. Time moves on.
I have been very critical of some of the solutions offered (e.g. the implementation of Plex on Sonos) but some of the solutions offered above are now very good. I can use the Hifi cast app to cast music from my NAS to my Sonos players, with none of the restrictions of the Sonos provided software - this gets me around the limit on store that was stopping me adding more music to my library. Even if the Sonos kit goes totally belly up, I have now tried using Chromecast Audio devices, either as a line input to a Play 5 or as a direct input to an AV amp - and they work fine. Google have now discontinued these devices, presumably because they undermine their speaker range, but other similar devices are probably available.
Things are much better now than they were a couple of years ago, IMHO.
Userlevel 7
Badge +20
Would it not have been a better use of everyone's time to just ignore this thread?
Done.
Userlevel 7
Badge +21
To the OP. But it's not just curiosity is it? You are taking a pop at what you see is a "flawed design" because it does not fit your use case. The number of people with over 65,000 tracks is minimal, and yes there are workarounds now.

The system, for me and I suggest the majority of users, is perfect for most as a wireless home music service. I can move between rooms and controllers at ease and add or remove tracks to queues, have different music in different rooms and move queues between rooms, whilst others can also so the same and the queue will show the same for every controller linked to that Sonos system. I can take calls on my phone without it interrupting the music for me or others. I can use an tablet or pc to make changes too. It's this functionality that is so popular for the Sonos system as well as making it work with 3rd party dumb controllers such as Scenic Nuimo and iport express, to name but a few. Nobody can leave the house and destroy the queue, nor can a flat phone or tablet battery stop the music. These are massive plusses. Add that all speakers Sonos have produced since their first model, can still be used as part of a system over 15 years later. and you see why we like this "flawed" system. 🙂
There is also a big contradiction in your line of reasoning: the advantage of setting a playlist and let it play even if the phone dies applies to local content only.
100% incorrect. Controllers instruct players. Players fetch the music data. Controllers, assuming they're still around, periodically check in with the players otherwise they only react to event notifications.


The real business reason behind the decision is to push people towards streaming services to please those vendors, out of fear that those with large libraries attained those libraries by illegally pirating.


Clever theory, except the limit existed long before streaming services even existed, and was actually increased after Sonos added the first streaming service, not decreased. Nice try, though.
[quote=YetAnotherLondonder]
Such as? What pitfalls?

Pretty obvious, surely - if it's written locally then the developer has complete control - if it's written remotely then the developer has all the problems of whether the index is available, whether the remote stroage allows access - all sorts of things that directly affect the potential reliability of the system - and therefore the support effort needed.


For speed purposes as well, the chosen approach was considered the most suitable back in the early 2000s.

How so? The index is stored on the Sonos device; only at the very beginning did a Sonos device (the ipod-like CR100) control the speakers....

It takes time to develop systems - it seems likely that the design criteria, limitations and the way around those limitations was decided two or three years before launch. Years after that, technology changed immensely and Sonos have had to balance supporting newer tech (phones, tablets, etc) with backwards compatibility. I've criticised many things about their software decisions in the past, but their attempts to keep older kit working should receive some praise, IMHO.
1) SMB 1.0 is horrendously outdated
2) index file is not required

So don't use them.... Use a NAS that supports SMB 2.0 and above, run an audio server on it and then use (e.g.) Hifi Cast to cast the music to the Sonos player. IIRC Hifi Cast costs about £1.70 to remove the ads.
I'm not happy about Sonos software, either, but workable alternatives are now available - so surely it's time to move on.
Badge
There is also a big contradiction in your line of reasoning: the advantage of setting a playlist and let it play even if the phone dies applies to local content only.
100% incorrect. Controllers instruct players. Players fetch the music data. Controllers, assuming they're still around, periodically check in with the players otherwise they only react to event notifications.


I'll admit I am confused now.

If I set a playlist of local content on my phone, then my phone dies, goes out of range, is destroyed by aliens or whatever, the Sonos speakers will still play that playlist even after losing connection to the phone. Is this correct?

How about a playlist from Tidal or Spotify? If I make one on the go, or load one I had previously saved, will Sonos continue to play it even after the phone dies or goes out of range?
Badge
[quote=amun]
Pretty obvious, surely - if it's written locally then the developer has complete control - if it's written remotely then the developer has all the problems of whether the index is available, whether the remote stroage allows access - all sorts of things that directly affect the potential reliability of the system - and therefore the support effort needed.

I'm not sure I am following. "It" is the index? By 'remotely' you mean on the phone or PC controlling Sonos?
How do all the competitors that do not store indices on the speakers manage it, then?
If I set a playlist of local content on my phone, then my phone dies, goes out of range, is destroyed by aliens or whatever, the Sonos speakers will still play that playlist even after losing connection to the phone. Is this correct?Yes.

How about a playlist from Tidal or Spotify? If I make one on the go, or load one I had previously saved, will Sonos continue to play it even after the phone dies or goes out of range?
Yes.

You have somehow yet to grasp the fact that controllers are in effect entirely optional. They store next to nothing, other than the identity of the system. They can come, they can go. When an alarm fires, for example, it's a player which is initiating the action. When someone shouts at Alexa, the instruction is processed in the cloud and comes back to the player for execution.

As to the original query "why do speakers index music?", the origins of this architecture have already been explained by a Sonos representative. Speed -- time to music -- was a key driver. There's a major difference in response time between fetching a few kB or MB of index from RAM, and having to potentially retrieve, collate and sort metadata from up to 16 separate network storage locations (Sonos supports up to 16 shares), many of which could have spun disks down when idle.
Badge

As to the original query "why do speakers index music?", the origins of this architecture have already been explained by a Sonos representative. Speed -- time to music -- was a key driver. There's a major difference in response time between fetching a few kB or MB of index from RAM, and having to potentially retrieve, collate and sort metadata from up to 16 separate network storage locations (Sonos supports up to 16 shares), many of which could have spun disks down when idle.


But come one, how many people have music across 16 shares, but not enough to breach the 65k limit?

It seems it mostly comes down to Sonos' decision of having a player-based, rather than server-based (like Roon) or controller-based (like Chromecast) solution. In fairness, a solution like Roon is very resource-heavy and works best when run from an SSD drive - all things which weren't available when Sonos was first being developed.

I understand there are ways around the limit, or the requirement for SMB v1 (which Microsoft deprecated about 5 years ago), by using Roon or a DLNA solution. But the fact that these are not supported officially is annoying to say the least.
But come one, how many people have music across 16 shares, but not enough to breach the 65k limit?No idea, but that's a fundamental part of the design. (I only use 5 shares at present.)

It seems it mostly comes down to Sonos' decision of having a player-based, rather than server-based (like Roon) or controller-based (like Chromecast) solution.
And in that Sonos was reassuringly forward looking. A player-centric architecture is far more scalable and robust. Players can be independent. Controllers can control any player(s) or none.

Consider all the frustrations expressed about Apple's Airplay, which requires a stream to loop out and back via a live user device.

By the way, although Chromecast is also able to accept a 'cast' stream via a user device its success is probably owed to the fact that a stream can be 'cast off' and retrieved directly from the source by the Chromecast itself.

Blah, blah, blah, stuff about SMB.


This thread isn't even about SMB, it's about the track limit. Please try to stay on topic.

And as far as my logic not mattering, it certainly matters when you claim the track limit is used to push people towards streaming when the track limit existed long before streaming services were in existence. As I said, your theory is flawed.

Blah, blah, blah, stuff about SMB.


This thread isn't even about SMB, it's about the track limit. Please try to stay on topic.


Yes, it is, because SMB is what they use to access external file shares and doesn’t require an index to function. The limit is 100% artificial and intentional - the client side index is not required and does not offer any speed improvements. I have worked on an enterprise grade embedded Linux NAS product and I know this.

The fact is access to file shares is sold as a prime feature, that is MISS-SELLING plain and simple. I don’t care if you agree or respond, it is simply true. Sonos is not a NAS supporting product. If it was, they would have also supported afp and nfs.
Userlevel 7
Badge +26
Please remember to stay courteous everyone. I've removed a few comments that are inappropriate via our community code of conduct. There is no need to attack other users or call them names. I know you can all have a polite discussion while disagreeing.
The app contacts the players, and pulls the index every time. It's a small html file that's text only.


I'm gonna venture a guess that it's an XML file, not html. Today, of course, it would be done using JSON, but in 2002, XML was the thing...
I'm not sure I am following. "It" is the index? By 'remotely' you mean on the phone or PC controlling Sonos?
How do all the competitors that do not store indices on the speakers manage it, then?

I'd point you to ratty's posts on the subject, who is far more knowledgeable than I...
Userlevel 7
Badge +22
The SMB 1.0 issue keeps getting less and less important, when you can implement an SMB 1.0 gateway to any network file system for under $50 and 20 minutes using a Raspberry Pi 3A+. It just isn't worth the massive effort and possible functionality loss to upgrade Sonos to SMB 2 for the few folks it would impact.

Same with thew 65K limit, so may work-arounds are available that Sonos just doesn't see the need to change it. And as said above the number of folks needing it is continually dropping.

Plenty of other issues impact more folks, and cause more unhappiness that Sonos is going to make priorities. I see no reasonable hope that these two are ever going away unless they get tacked onto a massive firmware revision that Sonos does for another reason.