blaa / WaveSync

Multi-room synchronised audio playback over shaky network connections and cheap (rasbperry pi) hardware.
MIT License
64 stars 13 forks source link

Stuttering audio on Pi Zero W #12

Open kuangmk11 opened 3 years ago

kuangmk11 commented 3 years ago

I'm running WaveSync tx unicast from my media server (4.1 Ghz quad core) to a pi zero W with a pimoroni pirate audio line out hat and to a raspi3b with the on board audio out. The pi3 plays fine but the pi zero is having trouble. It will play fine for a bit and then start stuttering then return to normal. This can happen every few minutes or every few seconds. Total cpu usage is under 50%. NTP is working at about 100ms.

blaa commented 3 years ago

You could try increasing the buffer-size. If it's over wifi, then try unicast initially, unsure how you sent the data there. Power management of wifi can cause some troubles and unicast was always easier.

Similar problem with cubie board made me try to code another approach. It's currently unfinished on audio-callback branch of wavesync. After some tweaking I made it run ok on cubie board but haven't sorted out all synchro problems with new approach.

If increasing the buffer don't help I guess I should find some time to finish the branch. :S

cheers,

kuangmk11 @.***> writes:

I'm running WaveSync tx unicast from my media server (4.1 Ghz quad core) to a pi zero W with a pimoroni pirate audio line out hat and to a raspi3b with the on board audio out. The pi3 plays fine but the pi zero is having trouble. It will play fine for a bit and then start stuttering then return to normal. This can happen every few minutes or every few seconds. Total cpu usage is under 50%. NTP is working at about 100ms.

-- Tomasz bla Fortuna pgp: C009FC9BD59B22FE @ pgp.mit.edu www: http://bla.thera.be

kuangmk11 commented 3 years ago

I switched everything over to chrony from ntp and am getting better sync. running the W at --tolerance 100. Might be usable now it has made it through a few songs without a hiccup after initial sync, Ill give it a few hours more. I have problems since our only internet is flaky LTE hotspot.

I have big plans for this, I have 3 more piW/pirate audio combos on my desk. I am replacing the 10 watt FM transmitter on our farm with these. Thanks for putting this together!

Still getting a lot of time drops but not audibly noticeable. Is this wifi vs wired? edit: nope, changed the pi3 to wifi and it still hasn't dropped.

piW

STAT: chunks: q_len=250 ch/s=120.8 net lat: 51.5 ms avg_delay=-40.73 drops: time=95 net=10 out_delay=386711 STAT: chunks: q_len=247 ch/s=120.2 net lat: 33.3 ms avg_delay=-40.73 drops: time=95 net=10 out_delay=387287 STAT: chunks: q_len=247 ch/s=120.2 net lat: 52.7 ms avg_delay=-40.74 drops: time=95 net=10 out_delay=387854 STAT: chunks: q_len=247 ch/s=120.1 net lat: 53.6 ms avg_delay=-40.74 drops: time=95 net=10 out_delay=388427 STAT: chunks: q_len=250 ch/s=120.3 net lat: 37.9 ms avg_delay=-40.75 drops: time=95 net=10 out_delay=388998 STAT: chunks: q_len=251 ch/s=120.1 net lat: 36.6 ms avg_delay=-40.76 drops: time=95 net=10 out_delay=389575 Drop chunk: q_len=234 delay=-54.1ms < 0. tolerance=100.0ms: P=0.08 STAT: chunks: q_len=246 ch/s=120.8 net lat: 69.6 ms avg_delay=-40.77 drops: time=96 net=10 out_delay=390151 STAT: chunks: q_len=246 ch/s=120.2 net lat: 33.4 ms avg_delay=-40.77 drops: time=96 net=10 out_delay=390728 STAT: chunks: q_len=246 ch/s=120.2 net lat: 37.8 ms avg_delay=-40.78 drops: time=96 net=10 out_delay=391305 STAT: chunks: q_len=254 ch/s=120.2 net lat: 57.0 ms avg_delay=-40.78 drops: time=96 net=10 out_delay=391867 STAT: chunks: q_len=254 ch/s=120.1 net lat: 61.1 ms avg_delay=-40.79 drops: time=96 net=10 out_delay=392442 Drop chunk: q_len=236 delay=-54.6ms < 0. tolerance=100.0ms: P=0.09 STAT: chunks: q_len=246 ch/s=120.9 net lat: 53.4 ms avg_delay=-40.80 drops: time=97 net=10 out_delay=393012 STAT: chunks: q_len=246 ch/s=120.0 net lat: 49.0 ms avg_delay=-40.80 drops: time=97 net=10 out_delay=393590

pi3

STAT: chunks: q_len=223 ch/s=120.2 net lat: 16.7 ms avg_delay=8.02 drops: time=0 net=0 out_delay=15003 STAT: chunks: q_len=228 ch/s=120.2 net lat: 13.4 ms avg_delay=8.02 drops: time=0 net=0 out_delay=15012 STAT: chunks: q_len=242 ch/s=120.1 net lat: 16.4 ms avg_delay=8.02 drops: time=0 net=0 out_delay=15022 STAT: chunks: q_len=240 ch/s=120.3 net lat: 15.8 ms avg_delay=8.02 drops: time=0 net=0 out_delay=15030 STAT: chunks: q_len=231 ch/s=120.2 net lat: 14.7 ms avg_delay=8.02 drops: time=0 net=0 out_delay=15041 STAT: chunks: q_len=223 ch/s=120.2 net lat: 14.0 ms avg_delay=8.02 drops: time=0 net=0 out_delay=15051 STAT: chunks: q_len=230 ch/s=120.1 net lat: 16.6 ms avg_delay=8.02 drops: time=0 net=0 out_delay=15060 STAT: chunks: q_len=241 ch/s=120.2 net lat: 13.9 ms avg_delay=8.02 drops: time=0 net=0 out_delay=15072 STAT: chunks: q_len=240 ch/s=120.2 net lat: 14.8 ms avg_delay=8.02 drops: time=0 net=0 out_delay=15082 STAT: chunks: q_len=232 ch/s=120.0 net lat: 15.8 ms avg_delay=8.02 drops: time=0 net=0 out_delay=15091 STAT: chunks: q_len=224 ch/s=120.3 net lat: 15.7 ms avg_delay=8.02 drops: time=0 net=0 out_delay=15100 STAT: chunks: q_len=227 ch/s=120.2 net lat: 19.0 ms avg_delay=8.02 drops: time=0 net=0 out_delay=15113

blaa commented 3 years ago

You can keep me posted. ;) I need some motivation to get back to it. I have small apartement and it works good enough for me on my hw, but would love to fix some bugs.

There's also snapserver you can try - unsure how will it handle 0pi w.

kuangmk11 @.***> writes:

I switched everything over to chrony from ntp and am getting better sync. running the W at --tolerance 100. Might be usable now it has made it through a few songs without a hiccup after initial sync, Ill give it a few hours more. I have problems since our only internet is flaky LTE hotspot.

I have big plans for this, I have 3 more piW/pirate audio combos on my desk. I am replacing the 10 watt FM transmitter on our farm with these. Thanks for putting this together!

-- Tomasz bla Fortuna pgp: C009FC9BD59B22FE @ pgp.mit.edu www: http://bla.thera.be