From: Takashi Iwai Subject: Re: dB gain Date: Wed, 31 May 2006 13:18:37 +0200 Message-ID: References: <4478A290.80702@superbug.co.uk> <447B0A19.2050408@superbug.co.uk> <447B308E.2050502@superbug.co.uk> 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 (ns2.suse.de [195.135.220.15]) by alsa.jcu.cz (ALSA's E-mail Delivery System) with ESMTP id 9929F14E for ; Wed, 31 May 2006 13:18:38 +0200 (MEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: Jaroslav Kysela Cc: ALSA development , James Courtier-Dutton List-Id: alsa-devel@alsa-project.org At Mon, 29 May 2006 20:27:50 +0200 (CEST), Jaroslav Kysela wrote: > > On Mon, 29 May 2006, Takashi Iwai wrote: > > > For example, in order to get a numid, you have to extract three > > levels down. The version + length, the type + length, again type + > > length, then finally you reach to numid value. Each extraction > > requires a function call to convert from a byte-stream to an integer > > and a check of the length. I feel it's a bit too much abstraction. > > Note that such complex things reminds me - why we can't transfer all > "extra" data in one big binary array and let alsa-lib parse them? > Doing selection at the driver level seems too complex to me. TLV > structure seems good. It might also reduce the driver code, because only > a pointer to TLV data might be passed to control.c. We can create two > ioctls: > > 1) for "global" not element specific data > > u32 data_length > .... TLV data .... > u32 tlv_item_length > u32 tlv_item_type > > 2) for element specific data > > u32 data_length > u32 numid > .... TLV data .... > u32 tlv_item_length > u32 tlv_item_type > > Also, I would handle all data in the host endian type to save parsing > time. That sounds reasonable. And, yes, passing u32 array looks good to me (except for "TLV" order :) Alternatively, we can define a special numid (e.g. -1) indicating the global/unknown element. Takashi