From: Takashi Iwai Subject: Re: amixer: convert percentage into db wrongly Date: Fri, 09 Mar 2012 13:50:51 +0100 Message-ID: References: <20120308123632.GA8920@adam-laptop> <20120309100617.GH2130@adam-station.nay.redhat.com> <201203091219.03179.gineera@aspect135.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 (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 3FD7B10BCA6 for ; Fri, 9 Mar 2012 13:50:52 +0100 (CET) In-Reply-To: <201203091219.03179.gineera@aspect135.co.uk> 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: Alan Horstmann Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Fri, 9 Mar 2012 12:19:03 +0000, Alan Horstmann wrote: > > On Friday 09 March 2012 11:33, Takashi Iwai wrote: > > The implementation isn't too hard. I wrote a quick patch now as below. > > It became bigger than I thought since it contains many clean-ups that > > are needed to adapt the mapped volume. > > > > With the patch, amixer shows and reads the percent value with -M > > option just like in alsamixer. > > > > > > > --- a/amixer/amixer.c > > +++ b/amixer/amixer.c > > @@ -29,7 +29,9 @@ > > #include > > #include > > #include > > +#include > > #include "amixer.h" > > +#include "../alsamixer/volume_mapping.h" > > > > #define LEVEL_BASIC (1<<0) > > #define LEVEL_INACTIVE (1<<1) > > @@ -68,6 +70,8 @@ static int help(void) > > printf(" -i,--inactive show also inactive controls\n"); > > printf(" -a,--abstract L select abstraction level (none or basic)\n"); > > printf(" -s,--stdin Read and execute commands from stdin > > sequentially\n"); > > + printf(" -R,--raw-volume Use the raw value > > (default)\n"); > > + printf(" -M,--mapped-volume Use the mapped volume\n"); > > A small comment... > What if both -R and -M are used? Isn't -R equivalent to the absence of -M? The option set later wins. Takashi