dheijl / swyh-rs

Stream What You Hear written in rust, inspired by SWYH.
MIT License
363 stars 15 forks source link

audio stutters after several minutes of streaming #133

Open CHNtentes opened 6 months ago

CHNtentes commented 6 months ago

Hi, First of all, I want to thank you for your great work. I only expected it would be suitable for music, but it turns out that the latency is enough for video/gaming. However, there is an issue: Every time I start streaming the audio is fine, but after some time (I would say about 10-20 minutes) , the audio begins to stutter and crack a lot. Then if I restart streaming it would work well again. Is there any tip you could show me about this issue? I stream to a Sonos Era 100 btw.

dheijl commented 6 months ago

Is your Sonos wired or is it a WiFi connection? Also, if you're gaming I can imagine that swyh-rs does not get enough CPU to keep up with the audio capturing. You can always try to give it a higher priority in the task manager.

CHNtentes commented 6 months ago

Thanks for your reply. There's no wired connection, I just connect my Sonos and PC to same Wi-Fi. I tried to set swyh program to realtime priority in task manager, but the issue remains. Even when I'm gaming, the CPU usage usually is less than 30%. Could my network connection quality have something to do with this?

dheijl commented 6 months ago

This leaves 2 possibilities that I can see:

Edit: from 1.10.5 on you can also let swyh-rs do some buffering, what happens if you enable let's say a 100 msec buffer? Does the time before stuttering begins increase?