(Sonos) Number of concurrent connections?

Is there some arbitrary limit to the number of active connections allowed to a Sonos System? Things seem to be working great when using 1 or maybe even 2 devices running THR, but when more are added, the Sonos amps stop responding and start throwing error messages, or preventing mediacontrol elements from properly updating with values.

Not that I’m aware of. I just worked on a system the other day that had 11 Sonos devices which worked fine without any issues. I think there might be something specific to your setup that might be causing this.

Bill,
The issue did not appear to be linked to the number of Sonos devices (in this case, 2) - but rather the number of THR instances trying to communicate with those devices.

We were fine when having just the 2 wall-mounted ipads, but once we started getting people’s phones connected too we started seeing connectivity issues on all instances of THR.

Have you tried cycling power on the entire setup, sonos & WiFi router included? Sometimes the UPnP comms get into a funky state which can cause delays in discovery & event packets.

I’m just not sure that’s the issue either. I suppose it’s possible that when you add a bunch of phones to the mix that could impact it a little. But even if that is the case, connections are closed once the screen turns off. You may have a few tablets where the screen stays on 24-7 but phones are generally only used for short periods of time.

Bill,
I did power-cycle the entire rack and didn’t see any improvement.
We seemed to have some success by navigating away from any Sonos-related screens on every device except the one we were trying to utilize. It wasn’t really a long-term solution. The ipads are basically there to display the current album art and make available audio controls at all times. So the ipads would always have an “active” connection to the Sonos device. I’m not up on all things UPnP, but I think it drives back to my original inquiry of if Sonos has some limitation with multiple concurrent connections.

Another “interesting” bit I just thought of while typing the paragraph above - sometimes I noticed that when the Album art was displayed on the screen it was very small (about 1in square). And this seemed to be when we’d have problems using the MediaBrowser controls. What’s interesting about this is that the “default” size of the WebImage (how it is displayed on the designer) which controls the album art is also about 1" wide. The WebImage is set to Stretch:UniformToFill, but if it doesn’t yet have something to stretch… it’s going to size itself to it’s default dimensions. So my theory is that at the time of page load, Sonos hasn’t yet provided the necessary information - so the page elements don’t yet have any data.

  • WebImage loads nothing and so doesn’t stretch.
  • MediaBrowser loads nothing and so no options are available.

THEN some amount of time later (likley measured in ms), Sonos data arrives, but by now the controls are already initialized - so the WebImage does it’s best by at least displaying the artwork - but doesn’t stretch it, and the MediaBrowser tries and fails because it didn’t init properly.

I’m pretty far out of my depth on this, but it at least sounds feasible and would result like I’ve been experiencing.

Thoughts?

Do you have 2 MediaBrowser controls on that page? What might help would be be to use a single MediaBrowser like the MediaPlayerDetails.xaml template.

Having that Queue constantly open is also probably going to cause more strain on the system too because that’ll refresh after every track change I believe.

Sorry, yeah, I don’t really have a good answer for you.

What I would be curious to know is whether all of your problems directly related to those MediaBrowser controls. As a test, I’d say try removing all of the MediaBrowser controls from your project. Run it for a day or 2 & see if you still have issues.

I do have 2 MediaBrowser controls on the page. But, so does the MediaPlayerDetails.xaml. We’re both using slightly different visibility tricks to display them, but I believe both default & customized templates are only capable of displaying 1 MediaBrowser at a time. (Where IsVisible == True)
image
image

Version 2 from last year might have had 2 controls. Version 3 templates only use 1.

How many tracks are in this Queue on average? Are we talking just a standard album of 15 tracks or so?

Again, I don’t think I’m going to be able to fix this. I’m just trying to think about what you can do to improve performance. I suspect it’s directly linked to those controls. That’s why I suggested, at least temporarily removing them entirely from your project.

What I would be curious to know is whether all of your problems directly related to those MediaBrowser controls. As a test, I’d say try removing all of the MediaBrowser controls from your project. Run it for a day or 2 & see if you still have issues.

I would love to ditch the MediaBrowser entirely for source selection. It is a source of confusion for people because there are just too many options displayed there. But, that is currently the only way to start playing music without navigating outside THR.

Oh nice, I didn’t know there was V3, I’ve probably just been copying from one .hrp to another. I’ll give that a shot and see if there is an improvement. Is there any way (without a VPN) to get THR to talk with Sonos over the WAN? Since it doesn’t seem to be using a normal IP address I assume normal port-forwarding is a no-go.

Yeah, try using that page instead.

The other thing too, I still would like to know whether this even has anything to do with MediaBrowser controls. I’d be curious if the connections for standard playback & volume controls work fine when MediaBrowser is removed from the project. Doesn’t even have to be a whole day. Test it for 15 minutes & see if there’s an improvement. If there is, then at least you know what the culprit is.

No. It won’t be possible to connect using port forwarding. That’s not possible for UPnP devices like Sonos.

Ok excellent - appreciate the assistance thus far. You’ve given me a lot to consider on the issue.
I’ll find some time to drop by the installation site and try to do some more troubleshooting using your suggestions and report back.

Thanks!