dmsynth: Calculate latency and the derive latency clock from the master clock. This improves the clock granularity and fixes uneven playback of some tracks.
dmsynth: Factor out waiting for the buffer event.