From: Takashi Iwai Subject: Re: [PATCH] Implement support for display of dB gain in alsamixer. Date: Mon, 19 Sep 2005 17:20:59 +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: James Courtier-Dutton , alsa-devel List-Id: alsa-devel@alsa-project.org At Mon, 19 Sep 2005 15:36:21 +0200 (CEST), Jaroslav wrote: > > On Sun, 18 Sep 2005, James Courtier-Dutton wrote: > > > Hi, > > > > Here is a first draft of one possible way to implement dB gain display in > > alsamixer. > > I would reject it. My comments: > > 1) breaks backward compatibility > 2) I don't like to have this information in the sndrv_ctl_elem_value > struct I appreciate James' work, but I must agree with Jaroslav on both points. 1 can be fixed relatively easily, but still it will end up with adding more messes in other parts referring this struct (e.g. 32/64bit compat layer). Also, this information doesn't have to be passed at each time. It would be necessary only once at initialization, assuming that the dB table is constant during the operation. (BTW, we should remove the comment /* RO */ there...) > My idea is to create an optional path between driver and user space to > give any additional information about controls and perhaps global mixer > view. > > - per control information (new ioctl) > > struct sndrv_ctl_elem_addon { > struct sndrv_ctl_elem_id id; /* W: element ID */ > unsigned int size; > void *ptr; > }; > > I would propose to have this information in a text form parsed in the user > space (alsa-lib). It will be quite flexible (the old user space binary > will skip new tokens). That sounds fine. > So the addon should return something like (for ADDON_DB): > > dB_table -9600,-8000,-6400 > > (explanation: index to table is the value written to driver, dB in * 100 > form) > > or > > dB_min -9600 > dB_max -6400 > dB_step 1600 > > or > > dB_range -9600,-6400,1600 > > (explanation: min,max,step) > > And some complex addon description (with routing description): > > mixer_block > dB_range -9600,0,2000 > rt_in "PCM Plaback Volume",0 > rt_out "Master Playback Volume",0 > rt_cond_out xy > /mixer_block > > etc. we need to define the syntax for signal routing description... 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? 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