stijnvdb88 / Snap.Net

A cross-platform control client and player for https://github.com/badaix/snapcast
GNU General Public License v3.0
119 stars 11 forks source link

[iOS] heavy audio stuttering after running a few hours #46

Open hunnzgribbe opened 1 year ago

hunnzgribbe commented 1 year ago

Hello,

I'm experiencing heavy audio stuttering with the iOS-App running on old iPhones (5s, SE, 6s) after a few hours.

When the audio starts to stutter, you have to close the app completely and launch again, then the audiostream is again stutter-free until it starts to stutter again after a few hours. So you can also use the stop and start function in the app, it will continue to stutter until you close the app completely and start over.

Before it starts to stutter, the streaming is without any stutter in the audio for about 2-3 hours. At first I thought the cause is the config of Snapserver, but its the iOS Client.

What I have tried in the Snapserver config:

On the iOS-Devices:

Did someone else also experience this? Its a pitty, because this way I can't build a Multiroom-Audio-System :-(

hunnzgribbe commented 1 year ago

Even if trying different values for the codec, even on stock settings, it has the same result after a few hours. I'm surprised no one else seems to have this problem. When you leave the client running with the stuttering sound, it also crashes the app after a while. I would like to give logs, but I don't know how to do this on iOS.

The best setting is to let it running with PCM. With it you have the longest time stuttering free, but also here this issue exists.

This is my Snapserver config, very basic. I'm just serving four Airplay streams, in use is just one:

HTTP RPC

# [http]

enable HTTP Json RPC (HTTP POST and websockets)

enabled = true

which port the server should listen to

port = 1780

serve a website from the doc_root location

disabled if commented or empty

doc_root = /usr/share/snapserver/snapweb

[tcp]

enable TCP Json RPC

enabled = true

which port the server should listen to

port = 1705

which port the server should listen to

port = 1704

source = airplay:///shairport-sync?name=Snapcast1&devicename=Snapcast1&port=5000 source = airplay:///shairport-sync?name=Snapcast2&devicename=Snapcast2&port=5001 source = airplay:///shairport-sync?name=Snapcast3&devicename=Snapcast3&port=5002 source = airplay:///shairport-sync?name=Snapcast4&devicename=Snapcast4&port=5003

Default transport codec

(flac|ogg|opus|pcm)[:options]

Start Snapserver with "--stream:codec=:?" to get codec specific options

codec = pcm

Default source stream read chunk size [ms].

The server will continously read this number of milliseconds from the source into buffer and pass this buffer to the encoder.

The encoded buffer is sent to the clients. Some codecs have a higher latency and will need more data, e.g. Flac will need ~26ms chunks

chunk_ms = 60

Buffer [ms]

The end-to-end latency, from capturing a sample on the server until the sample is played-out on the client

buffer = 2000

Send audio to muted clients

send_to_muted = false # ###############################################################################