Balena audio stuttering randomly over network

HI, I’m a relatively new user to Balena and I’ve been having problems when playing audio from Spotify over a wireless network to Balena. It will play fine for a few mins but then it starts pausing/stuttering for a bit and then it will be ok for a while. There seems to be no pattern to when it does it.

I’ve tried over two different wifi networks (Google Mesh and internet provider’s hub).

Could this be a network or Pi hardware issue?

Hardware : Rpi 3 1Gb
PSU: Rpi

Logs at point of failure:
snapcast-server 2022-05-23 12-28-27 [Info] (onResync) onResync (default): 441 ms
snapcast-client 2022-05-23 12-28-27 [Info] (Stream) abs(age > 500): 527660
snapcast-client 2022-05-23 12-28-27 [Info] (Alsa) Failed to get chunk
snapcast-client 2022-05-23 12-28-28 [Info] (Stream) Chunk: 0 0

Hi there,

In cases like this, its worth taking a look at this page: Support - Home

It details several potential “workarounds” for stuttering audio, that may or may not be helpful depending on the source of the problem.

Other than that, it could be worth trying multiple tests to try and marrow down what piece of the system is at fault, if any:

  • Does the sound stutter if you use a wired ethernet connection
  • Do you get stuttering if streaming over bluetooth?
  • is multi-room disabled (I know this feature has been related to stuttering in the past)

Thanks for the reply.

When I try over bluetooth, the stuttering is worse and I get the log errors mentioned on the page you referenced.
I think I’ve disabled multi-room: I added a variable ‘SOUND_MODE’ to ‘STANDALONE’. Is this correct?

It hasn’t made a difference to the stuttering though., nor has using a wired connection only.

Hi,

If you’re using ethernet connection + wired headphones and still experiencing stuttering, the issue could be with SD card, or RAM. What’s the brand and model of SD card you’re using? How much RAM is being used when playing back music? Also, can you check the internet speed? If you want, you can use an internet speed test code we developed: GitHub - balenalabs-incubator/internetspeedtest: Log your internet download, upload and ping metrics ti influxDB, and Grafana it. Grafana all the things!

We recommend Sandisk Extreme Pro SD cards as they have shown consistent speed and reliability in our testing.
If you’re running out of ram, there isn’t much you can do other than increase the swapfile size, but that will wear out your SD card faster.