[alsa-devel] proposal: snd_pcm_start_at()

Tim Cussins timcussins at eml.cc
Thu Oct 2 16:34:20 CEST 2014


Hi all,

I'm Tim: I work at Linn Products Ltd - we make Network Music Players,
amongst other things.

As you might imagine, synchronised-start is important when multiple
devices on the network are rendering the same audio. We'd be interested
in contributing a small expansion of the alsa-lib API to support
synchronised start.

Assuming we can synchronise the audio clocks (I'm aware this is not
trivial - It's not the topic of this post), we'd propose something like:

    int snd_pcm_start_at(snd_pcm_t* pcm, snd_htimestamp_t* tstamp);

and playback would begin as close to tstamp as possible. If tstamp is in
the past, it would should return an error.

Recent work by Takashi Iwai enables client code to set the clock type of
timestamps using snd_pcm_sw_params_set_tstamp_type(). This context could
quite naturally extend to tstamp argument of snd_pcm_start_at().

Before I get stuck into working up the details under the hood, it'd be
good to get some feedback/objections regarding this approach.

Thanks in advance!
Tim


More information about the Alsa-devel mailing list