From: Takashi Iwai Subject: Re: [PATCH 3/3] ALSA: core: set kcontrol's count field correctly Date: Wed, 24 Aug 2011 15:06:41 +0200 Message-ID: References: <20110824031234.5279.46501.stgit@localhost6.localdomain6> <20110824031243.5279.93859.stgit@localhost6.localdomain6> <20110824061757.GF3551@guanqun-laptop.sh.intel.com> <20110824114613.GA1811@guanqun-laptop.ccr.corp.intel.com> <20110824124638.GC1811@guanqun-laptop.ccr.corp.intel.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 569A6103910 for ; Wed, 24 Aug 2011 15:06:44 +0200 (CEST) In-Reply-To: <20110824124638.GC1811@guanqun-laptop.ccr.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Lu Guanqun Cc: ALSA , "clemens@ladisch.de" List-Id: alsa-devel@alsa-project.org 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