[alsa-devel] [PATCH 3/3] ALSA: core: set kcontrol's count field correctly

Takashi Iwai tiwai at suse.de
Wed Aug 24 15:06:41 CEST 2011


At Wed, 24 Aug 2011 20:46:38 +0800,
Lu Guanqun wrote:
> 
> On Wed, Aug 24, 2011 at 08:05:56PM +0800, Takashi Iwai wrote:
> > > Hi Takashi,
> > > 
> > > I don't how this approach can solve this problem.
> > 
> > There is no problem.  You can't copy the data from ELEM_INFO for
> > ELEM_ADD/REPLACE.  It was a wrong assumption to reuse the data.
> > Instead, you had to set up the struct field manually.
> > That is, the test procedure was simply wrong.
> > 
> > > There's still an
> > > implicit assumption here that user space application will clear
> > > info->elem_count to zero before it issues the REPLACE ioctl, right?
> > 
> > Yes, the point is that it's no longer same structure.  So, you can't
> > copy from the result from ELEM_INFO ioctl any more.  Instead, you need
> > to set up the struct field manually.
> 
> Thanks Takashi, that's the info I'm looking for. We need to state this
> requirements explicitly, it seems we lack these kind of documentation and
> thus it results in poorly written test cases in user space.

Yep.

> Is there any man pages or documentation we can state this clearly?

No.  Partly because the user-space apps are supposed to use alsa-lib.

> I can
> help to contribute some documentation or even add some sample programs
> there.

Yes, please, that'll be helpful.


thanks,

Takashi


More information about the Alsa-devel mailing list