Chromecast and gapless playback not always working

I believe ROON aims to provide gapless playback via Chromecast, as suggested here: Chromecast support in Roon - Roon Labs

With audio-only devices (like Google Home, Google Home Mini, Google Home Max, and Chromecast Audio) you can now enjoy gapless high-resolution music (up to 96kHz/24-bit) from Roon.

I find this is erratic, however. It’s gapless for a while, then there is an update and it’s not. Then it is. Then not. I rely on a NAD amp with Chromecast built in for streaming and when it’s not gapless, it’s annoying. Does anyone else struggle with this? It is currently not working.

I haven’t posted this in Support because doing so in the past has not been productive. I’m asked for details, which I provide. Once, the problem was replicated, I was told, and someone would get back to me. Never happened. Then, gapless playback via Chromecast was working again. Then it wasn’t. I posted on Support again, etc. Can this just work, please? It has worked in the past.

I’ve used CCA in the past and yes, they can play gapless, as per your quote from the Roon article (which doesn’t mention NAD amps, only Google devIces).

I’m pretty sure that CC devices need to be added to your Google Home first, not sure if you have done that or not?

IIRC if you play a gapless album then all is good, but if you were to send the album tracks as individual files then not so much. My solution was to migrate from CCA to RPI4.

@Dafydd_Waters, tell me about your network setup. If you’ve posted that elsewhere already, I ask you bear with me and tell me what’s going on at the network infrastructure in detail.

I ask this because we had an issue with Chromecast gapless playback that was caused by adding the sleep timer fadeout feature (we had to reduce buffer size). This would only happen on slower networks. We fixed it by changing our buffering strategy to start large and end small, but we fear there is no way around this if your network degrades to a point where the buffers are exhausted. You may be feeling that as gaps. If its a sporadic issue on the network, you’d feel inconsistency in the gapless behavior.

Let’s figure out what’s going on with your network. Maybe there is something obvious or simple to fix.

Hi there. Thank you for your message. I use Virgin Media broadband, which is cable broadband. Tested speeds for download/ upload are 108.3/ 9.5 Mbps as of now. Router is connected to Roon ROCK with Ethernet cable. Main listening zone is Linn Sneaky Music DS, with Ethernet cable connection. Two other rooms have Bluesound devices with Ethernet cable connections. There are no issues with any of these that suggest a network issue. Virtually never have drop-outs/ issues and there is often different music playing in different zones. Sources are either Qobuz or lossless files stored in external SSD cabled to ROCK. The issue with gapless is only to Chromecast, which is integrated in this NAD C 338 amp. Connection to Chromecast/ NAD is wireless but tracks play immediately with no drop-outs ever. There is no Ethernet cable option to the amp.The amp is in fact placed in the room above the router, directly above it. I replicated the Gapless playback problem, using the Chromecast hooked to the back of my TV, which I don’t normally have set up as a Roon zone – but I enabled it temporarily to check. This led me to believe the problem is about Chromecast, rather than the NAD amp per se. Here’s a pic of my router and ROCK, though I’m not sure how that will be helpful but everyone likes to share a picture of their ROCK, right? I think it is gen 8 NUC, i5 with super-zippy SSD drive.

Here is a signal path shot. This is a live album. When the transition between I Zimbra and the next track (Drugs) occurs, it will not be gapless and I will be mildly sad :wink:

My feeling is that the gapless functionality has come and gone in relation to updates, rather than being an intermittent problem that fluctuates day-to-day. I will now post in support, because I’ve been asked nicely, though it is the third time! I am a fan of Roon, obviously. It’s just not working for me in this one aspect and getting it looked at has been difficult.

Thanks again for your attention!

Let me explain the situation and where the issue most likely resides. There is a lot of guessing about updates and gapless support, so let me clarify with certainty:

We always have a gapless stream to the Chromecast audio engine. The audio engine of the Chromecast does not know about song boundaries when we play to it. Many other products will play a stream, and then terminate the connection to the audio engine, and then reconnect to it to play another stream. We do not do that because the Roon Core delivers a constant stream of audio packets, and not “files” or “URLs” or anything else that is broken up at the track boundary. Metadata updates are handled out of band, and have nothing to do with the audio. There is some complexity with internet radio streams and with sample rate switches, but that’s not super relevant here.

So what’s going on? Why would there be gaps, especially at track boundaries?

Well, the way the engine works, is that there is a buffer of audio data between the audio packet processor and Chromecast audio engine. That way, if network traffic hiccups or is in some way slowed, that buffer can fill the “gap”. For everything but internet radio, the buffer can be filled faster than real-time from the source, so this buffer stays full. Even after a small hiccup, where the buffer may drain a bit, it will fill back up quickly due to this faster-than-real-time buffering that occurs from playing files or streaming content.

If that buffer empties because there is such a large network hiccup, there will be no audio data to play, so we play silence. Some devices will just loop the buffer so you will hear the buffer over and over (think about when CD players get “stuck”, same idea). We don’t loop, we just play silence, and after a while, we deem the connection as broken and stop playback completely.

In one of the Roon builds (I forget which build number it was. It was the one that introduced sleep timers.), for various reasons, we had to make this buffer smaller. A smaller buffer, for less-than-perfect networks, means that less network trouble is required to empty the buffer. This caused many people to have Chromecast skips with less great networks. However, there is one time at which the buffer will usually drain a bit: the transition between tracks. There is just more work to do here, so there will always be a small delay in those first audio packets. If that buffer drains, you WILL hear a gap. If the buffer does not fully drain, you will hear no gap. We made a “fix” for this by increasing the buffer size every so slightly (but we can’t take it back up to the previous levels because that caused other issues), and by changing the initial buffering strategy for a new track: It more rapidly tries to make up for the drainage when a new song starts and it does it earlier. You can see some people have already figured it out.

Most people are having gapless playback on Chromecast just fine. Those using WiFi instead of ethernet will always have more trouble here, but WiFi does not mean guaranteed failure. For example, I personally have many Chromecast zones, of which 1 is WiFi, the rest are ethernet. I don’t have gaps or any instability in any of them.

At this point, we feel like we do not have a systemic problem. The rate of reported failures (from our analytics, not from user complaints), is at the % we would expect for network issues. Previously, the rate was higher than we would have expected from just network issues, which is why we made a shift in strategy.

This has nothing to do with any recent updates, as we haven’t touched anything related to the audio, and I doubt we’ll be making any changes in this system any time soon.

So, looking at the other complaints, I’m going to ask everyone having issues to try to eliminate network variables. Try ethernet if possible (I realize there are some Chromecast devices that only have WiFi). If you must WiFi, try 5ghz vs 2.4ghz.

To achieve gapless playback, you must have a reliable real-time capable network. What might work for many others systems may not be enough. Roon has higher demands on your network because it tries to achieve more. Most Chromecast integrations are not gapless, and it’s because it’s not an easy thing to get stable.