Music stops (Sonos) when Roon control device is closed or loses connectivty [fix in for next build]

Hi @support

This is my setup:

Roon Core -> QNAP
Around 6 Sonos speakers (Sonos-1 / 3 / 5)
Roon Control -> Laptop / phone / tablet

So the situation is that my laptop is having some issues with its WIFI card (not related) but it seems is affecting the Roon system. For example, if I’m searching for a artist and music is going to speaker 1 and 2 and my laptop freezes or looses connectivity causing the app to reset the music stops.
Another example, I switched to an Android tablet to control Roon. Everything was running fine and i had the app also opened in my laptop. Once I started some music from my tablet and confirmed everything was working fine I closed the app in my laptop and that caused the music to stop and got the msg: lost connectivity with the audio device. If I re-start the music all is good.

Is this expected? For example in Sonos or Plex … if something happens with the device controlling the music the music continues with no issues.

I think this is a bug we can fix, although I’m having a weirdly hard time reproducing the problem here. It’s certainly not what we want to have happen.

Can you put the log files from both your laptop and the QNAP into a zip file and upload them somewhere for me? If you don’t have a convenient place to upload them just let me know and I can PM you some instructions with a server you can upload to.

They’re in the database folder, here’s a KB article on finding that: https://kb.roonlabs.com/Database_Location

1 Like

Thanks for the quick update. I have the logs ready please let me know where I can upload them.

Done. Logs uploaded.

I’ve been doing some monitoring and this is what i found in the logs, couldn’t find any obvious errors:

02/10 14:50:14 Trace: [zoneplayer/sonos] request matches current stream
02/10 14:50:15 Trace: [zoneplayer/sonos] State transition WaitForStatus => Playing
02/10 14:50:17 Info: [zoneplayer/sonos] GOT REQUEST Get /b01e5c0844574f4a99c4d543d67e0cea/Roon.wav
02/10 14:50:19 Trace: [prebuffer] status 441000/441000 (100%) @ 57/259 sec
02/10 14:50:22 Info: [stats] 1763mb Virtual, 425mb Physical, 179mb Managed, 0 Handles, 157 Threads

–> MUSIC PLAYING AND CONTROL IN WIN IS CLOSED
–> MUSIC STOPS.

02/10 14:50:26 Info: [brokerserver] Client disconnected: 192.168.194.15:60513
02/10 14:50:29 Trace: [zoneplayer/sonos] position timer, stopping stream due to 0 positions
02/10 14:50:29 Trace: [zoneplayer/sonos] State transition Playing => Disconnected
02/10 14:50:29 Warn: Track Stopped Due to LostEndpoint
02/10 14:50:29 Trace: [zone] [Office] Suspend
02/10 14:50:29 Trace: [zoneplayer/sonos] endstream
02/10 14:50:29 Info: [audio/env] [zoneplayer -> stream] All streams were disposed
02/10 14:50:29 Trace: [zoneplayer/sonos] endstream

–> RESUME MUSIC IN ANDROID TABLET.

02/10 14:50:35 Trace: [zone] [Office] PlayPause
02/10 14:50:35 Trace: [zone] [Office] Unpause
02/10 14:50:35 Trace: [zone] [Office] Selecting Source
02/10 14:50:35 Trace: [zone] [Office] Unsuspend

I have a fix for this in for our next build, whenever that is.

The reason you don’t see this in the logs is because the log that matters is the one on the Windows laptop.

The problem was that, because the Windows machine is running full Roon, and because that copy of Roon was used as the core with control over the Sonos system once, it still had the Sonos zone configured. That meant that when you closed the laptop, Roon was turned off by the OS, and it sent an “endstream” command to my code that manages the Sonos devices. I then sent a “Stop” command to the hardware, even though no music was playing and there was no reason to stop, and Roon on the server that was actually playing music saw the Sonos stop playing and reported an error.

While you’re waiting for the next build, I think setting up the laptop as the control in your system and disabling the Sonos zones will cause this to go away as a work around. I know it’s a pretty tedious work around, my apologies for the bug.

1 Like

I don’t have this problem, but I must comment on how refreshing it is to have such quick response to this issue. You guys/girls are doing a fantastic jobs

Thanks. Yesterday was testing few things and uninstall the initial install I did in my laptop. After that I installed again and choose just the controller. Things going much better now.

Thanks for the update again.

Thanks!

I think my expectations must be warped from the long Alpha period and then the last couple weeks of working on just support issues, but I actually feel like this was a relatively slow response and am slightly annoyed with myself over it.

1 Like

lol. If you call this “slow response” let me introduce you to the process at my company! Anyway I’m pretty new here, but what you folks are doing is impressive. I can’t wait to see what you have upcoming in future releases.