[alsa-devel] [RFC] compress: add support for gapless playback

Takashi Iwai tiwai at suse.de
Wed Feb 6 15:33:39 CET 2013


At Wed, 6 Feb 2013 06:02:29 -0800,
Vinod Koul wrote:
> 
> On Wed, Feb 06, 2013 at 03:14:22PM +0100, Takashi Iwai wrote:
> > At Tue, 05 Feb 2013 20:44:42 -0600,
> > Pierre-Louis Bossart wrote:
> > > 
> > > >   /**
> > > > + * struct snd_compr_metadata: compressed stream metadata
> > > > + * @encoder_delay: no of samples inserted by the encoder at the beginning
> > > > + * of the track
> > > > + * @encoder_padding: no of samples appended by the encoder at the end
> > > > + * of the track
> > > > + */
> > > > +struct snd_compr_metadata {
> > > > +	 __u32 encoder_delay;
> > > > +	 __u32 encoder_padding;
> > > > +};
> > > 
> > > You need to pad this structure with reserved bytes for future 
> > > evolutions. Things like ReplayGain, etc, might be of interest for some 
> > > implementations. Let's not be cheap here
> > 
> > Or, make it a single key/value.  User-space can call the ioctl
> > multiple times with different key/value pairs.
> Yes that would be smarter from ABI POV. But do we really have many params. And
> also in this case setting too many varible one by one can be time consuming....

Would it really matter?  The ioctl itself is cheap and fast.
And, with the fixed metadata key/value pair, you don't need a kmalloc.
It's known to be small to fit on stack.

Of course, if DSP's response to each parameter change is slow, it's a
problem.  Or if DSP requires the updates of multiple parameters at the
same time, the key/value model doesn't work, too.


Takashi


More information about the Alsa-devel mailing list