core icon indicating copy to clipboard operation
core copied to clipboard

Playing a Sonos radio channel (tune-in) has dropouts

Open maesern opened this issue 3 months ago • 5 comments

Hello,

There are sound output dropouts since I have installed Beta19 as soon as I play a tune-in radio channel. I've no problesms wvith playing Radio Paradise or a something from the library.

I've searched for a radio channel and added it to the favorites by using the search function within the Loxone audio player app. I can play the radio channel by clicking on the favorite, but unfortunately the music output has dropouts.

I've added the log and a music recording.

sonn-core-logs-2026-08-18T08-42-12-199Z_Dropouts.txt

Lox Audioserver Dropouts.mp3

I'm not sure if I've to consider somethine in the Lox-Audioserver ir if it is a software problem? Maybe you have an idea and can help me solve this problem.

maesern avatar Aug 18 '26 09:08 maesern

I'm seeing the same issue, but for me it doesn't affect all TuneIn stations — most play back fine. Hitradio Ö3 specifically is consistently choppy/stuttering, while other TuneIn stations I've tried play smoothly. I'm also on TuneIn, output to a Sonos speaker. Can't pinpoint exactly when it started, but it's been happening recently.

juergenarchan79 avatar Aug 19 '26 09:08 juergenarchan79

I have no problems playing radio stations with the original Sonos app. Hitradio Ö3 is just one example. I'm also experiencing these problems with other TuneIn radio stations, and only with this Beta 19 version. Everything works perfectly with Beta 18. Could it be that the TuneIn stream is no longer buffered?

maesern avatar Aug 19 '26 12:08 maesern

Same on my site

hme0354 avatar Aug 24 '26 04:08 hme0354

Found it — thanks for the log, it pinned this down exactly.

This is a regression I introduced in Beta 19. In that release the audio proxy started asking a stream host for a bounded 4 MB window instead of "everything from here on", because YouTube's CDN refuses the open-ended form. I assumed a live radio stream would refuse the window and fall back to the old path.

ORF's servers sit behind nginx, which happily serves that window: it answers 206 Partial Content and reports a made-up length of exactly 1 GB (that's the bogus Duration: 12:25:39 in your log). So it took the new path — and that path forgot to pass on the icy-metaint header.

That header tells the decoder where the station's metadata blocks (song title, etc.) sit inside the audio. Without it ffmpeg decodes those blocks as if they were music: a glitch every 16000 bytes, which at 192 kbps is one every two-thirds of a second. That's precisely the cadence of the Header missing errors in your log, and it's what you recorded in the MP3.

Why only some stations: it needs a host that both honours byte ranges and sends ICY metadata. All ORF streams (Ö3, Ö1, FM4) do. Radio Paradise and the NPO streams ignore the range and answer 200, so they never hit the new path — which matches @juergenarchan79's "most TuneIn stations play fine, Hitradio Ö3 is consistently choppy". Nothing to do with Sonos; the corruption happened before the audio ever reached the speaker.

Fixed. An icy-metaint in the reply now means "live stream", so the proxy drops the window and asks the way it used to. Measured on Ö3, 25 seconds through the fixed code: 64 decoder errors before, 0 after. As a bonus, the song title should reappear for these stations too — the same bug had been swallowing it.

This will be in the next beta. A regression test now covers it.

@maesern — you mentioned other TuneIn stations besides Ö3. If any still stutter after the next beta, could you post the stream URL of one? Then I can check whether it's the same shape or something else. @hme0354 same for you, if it's not an ORF station.

rudyberends avatar Aug 29 '26 08:08 rudyberends

I confirm that this problem has been solved. I couldn't find any other shuttering radio stations anymore.

Thank you very much for solving this problem.

maesern avatar Sep 01 '26 16:09 maesern