blaa / WaveSync

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

Streams are synchronized based on "chunk receival time", and not "stream time" #2

Closed blaa closed 5 years ago

blaa commented 5 years ago

With rate, sample and channels defined, each incoming sample of data has a precise moment when it should be played.

Instead, it would be better to track the STREAM TIME. This creates a problem with input underflow which will have to be handled.

This is mostly fine when the source is streaming audio in it's natural time. If the pulseaudio sends as a bigger chunk od data "to be played later" - weird things can happen. This wasn't problem when I used it with spotify/mopidy though.

blaa commented 5 years ago

I've implemented this approach in the "2.0" release. It seems to work in my environment, but I tested with only one client (which had huge problems before implementation and now it's certainly better in some ways)