2 ms·
The different clocks is a real hurdle. I have to give credit to Apple on this one, as they had the genius idea to make the buffer >1s, and send control message
by joshspankit 6y ago
The different clocks is a real hurdle.
I have to give credit to Apple on this one, as they had the genius idea to make the buffer >1s, and send control messages independent of the audio stream.
There’s gotta be a way to do it with PTP and the same ideas but clearly it’s either an extremely difficult problem, too niche, or both.
- MisterAV 6y agoWhat is the requirement for synched audio? milliseconds, microseconds, nanoseconds,... I'm currently working on devices that synchronises themselves wirelessly indoor over a large area and I'm now wondering if music could be an application I haven't though about...
- londons_explore 6y ago10 ms is fine. 100ms works but you get odd echoes like a speaker system in a big building. You need some way to compensate for clock drift between different playback devices. Even good clocks will drift 10ms in a few hours.
- loxias 6y ago1ms is barely "ok". with 1ms you'll still hear ugly comb filter effects. (see my other comments)
- joshspankit 6y agoAt most 10ms. Sub 1ms would be awesome. And yes, definitely. If you can build in a “chromecast receiver” so that a user could cast to multiple synced speakers (at full quality), you’d definitely have my attention
- Dylan16807 6y agoIt's worth noting that for two speakers playing the same audio, a 5ms offset will move the point of perfect sync by less than a meter. Going below a millisecond is definitely overkill territory.
- magnetised 6y agoIn 1ms sound travels just over 30cms - so just moving around a reasonable room affects the offsets between two well spaced speakers by 5-10ms. I use my own multi room audio system at home - http://strobe.audio http://strobe.audio - and although the sync isn’t perfect by any means the effect of moving around your house usually the problem. Eg if you have the volume in another room loud enough that it’s louder than the music from the room you’re in you get the weird echo effect. Otherwise nothing. Turns out our brains are really good at compensating for relatively large offsets
- loxias 6y agoI beg to differ: a good rule of thumb is that an (audio) sample takes about 8mm (44.1k). By the time you're a full 1ms late, that's a 44 sample difference between the two (or that's as though the speakers were about a third a meter apart. And that distance, you're gonna hear some uncomfortable comb filtering. A third of a meter corresponds to a frequency of about 1khz, which is right smack dab in the middle of a critical band, so you WILL hear the constructive and destructive interference around ~1khz. (and _5ms_? That means the speakers are now ~220 samples out of sync, so I'd expect any lows around 200hz to have some destructive interference, making the music sound hollow.) 1ms of sync is FAR less than adequate. It took effort, but I was able to get a distributed set of raspis to within about 5 samples at 44.1k, and I think I can do better. Why do I know this or care? :) I've done (and still do) a lot of research (and inventions) in the field of microphone array processing and audio source localization -- tracking objects purely by their sound. With cheap commodity equipment I can generally get a resolution of 5cm, and with lots of fine tuning I was able to do sub-cm tracking.
- Dylan16807 6y agoAll those problems happen even if your speakers are perfectly in sync. These aren't headphones. If you have a couch for listening, the difference between sitting on the left and sitting on the right is just as big or bigger. You get the same interference, yet it isn't a problem.
- 6y ago
- loxias 6y agoCorrect. You use PTP+NTP, the RT_PREEMPT patches, and then you have to deal with a constantly varying resampling ratio (!!) And not only that, but if you don't want nasty artifacts, the a LOT of thought also has to go into your filter design. It's hazy, but I remember using a pair of orthonormal time-varying allpass IIR QMF filters, with extra black magic I'm blanking on that allowed me to reduce the complexity of finding the coefficients for, and computing the filters by at least a factor of 4. Fun stuff. I think half the coefficients in the EQMF were zero, and of the other half, half were the reciprocal of another, which led to a fast implementation. But yeah! I've done that. Kept audio streams to within a few samples of alignment for more than 24 hours. It was fun, and yes, somewhat hard. "will more than happily do it again for money". :)
- tinus_hn 6y agoWhy would you send samples? If you do any kind of compression you’re going to convert to frequencies anyway and it isn’t that much of a hassle to expand that.
- m463 6y agoThat sounds like a better solution - I'd guess most a/v systems are used for pre-recorded video that could deal with more delay during stop/start/pause but giving you more synchronization. To really do it right though I think it would be cool to tune everything somehow. So have a microphone + photodiode sensor you put in your chair, then run a test and have it synchronize all audio and video sources together. (maybe it could even be pointed to your bluetooth headset and do that delay too) I think with that setup, you could not only get good synchronization, you could probably tune the delay to the minimal value (maybe you could still do stuff like something live)