noelhibbard / node-airplayhub

AirPlay server which accepts streams and then streams the audio back out to multiple AirPlay devices with sync support.
51 stars 12 forks source link

Mitigating Audio Drops #11

Open jdtsmith opened 7 years ago

jdtsmith commented 7 years ago

Thanks for this great tool. I've been streaming music from an iPhone to two (or three) destinations: a shairport-sync service running on the same Raspberry PI 3 where airplayhub runs, a new airport express, and an old flip-plug style airport express. In general this works well, with great sync. Some extra delay to start/stop/skip, but that's understandable given the double-buffering. It does seems somewhat sensitive to audio drops and gaps. Interestingly, this seems to have plenty to do with the CPU load on my RPI3. I also run homebridge on the same pi, and in fact have just recently written a home bridge plugin to make individual accessories to control speaker volume and mute. This is working well (except Apple doesn't yet actually support it's "Speaker" accessory), but using homebridge to set volume really increases the rate of the audio drops. If airplayhub is using say 25-30% CPU, and homebridge jumps in with another 25%, that seems to do it. Sometimes drop come from nowhere though. I have some evidence that playing music from a 3rd device (e.g. my laptop) improves this. So possibly the phone is the limiting issue. Is there any way to increase or play with the buffer depth, i.e. incur an extra ~second of buffering to limit these drops?

Goeste commented 6 years ago

I am interested in this as well, my Node-airplayhub also has a vpnservrr Running and suddenly Audio Starts dropping