From: Takashi Iwai Subject: Re: [PATCH] Implement support for display of dB gain in alsamixer. Date: Mon, 19 Sep 2005 17:58:35 +0200 Message-ID: References: <432D6C3A.4000001@superbug.co.uk> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Jaroslav Kysela Cc: Takashi Iwai , James Courtier-Dutton , alsa-devel List-Id: alsa-devel@alsa-project.org At Mon, 19 Sep 2005 17:36:22 +0200 (CEST), Jaroslav wrote: > > On Mon, 19 Sep 2005, Takashi Iwai wrote: > > > Or, how about to define a struct like > > { > > snd_ctl_elem_id_t id; > > char key[KEY_SIZE]; > > unsigned int size; > > char *value; > > } > > so that the caller always asks with the certain key? > > It's also quite good method, but it avoids having multiple blocks with > same keys. For example: > > block1-mixer > key1 > key2 > /block1-mixer > block2-pcm > key1 > key2 > /block2-pcm > > Maybe adding 'char group[GROUP_SIZE]' to the structure will help us. I feel a group field would be overcomplex. The beauty of this record is its simplicity. Maybe the principle question is whether we really need a structural data or not. My proposal above assumes that the data area all simple attributes, mapped 1-1. If the requested data isn't so easy, the above has rare merits. > Also, we should consider to give a possibility to obtain the full list of > groups/keys to applications / alsa-lib. If we give the full contents the > applications can do rest otherwise the driver must implement an arbiter > which collects this information. In the case of the explicity key-value record, it's easy. We can define a special key, e.g. "list", to return the list of keys, so no API extension is needed. > I would vote to keep the kernel space as simple as possible and give the > whole contents to apps. They can implement reading/caching/filtering > themselves. Agreed. Takashi ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php