wildyeast / sadiss

A socially aggregated distributed sound system.
GNU Affero General Public License v3.0
10 stars 2 forks source link

When devices join, there sometimes(?) is a long delay until sounds are audible on the devices (Fixed, need to upload new app version to stores) #81

Closed matbind closed 1 year ago

matbind commented 1 year ago

How to reproduce On live server:

Observations

Current hypothesis The last point above is a big hint I think. If the partial has already started when the client joins, playback never starts, even though something is being distributed to the client. This also explains why Goldklang doesn't work, as it also is a collection of a small number of very long partials. The stretched tracks work, because here partials start all the time. One might miss some but there are also a lot that are audible.

Cause & Solution The reason for this apparently was two-fold. On the one hand, joining after all partials have already started set the starting time of the oscillator too far in the future. We now start the oscillator immediately after creation, with gain set to 0. On the other hand, there was a bug in the partial distribution: Partials were added to the map of partials that were distributed in the last iteration, without them really having been distributed. Then, after a client joining, the joined client only got one partial where it should have gotten all. For the fix to work we need to upload a new version of the app to the stores. So I'll leave this issue open for now.