Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dino Puller <dino@e4a.it>
To: alsa-devel@lists.sourceforge.net
Subject: Re: Decibel]
Date: Tue, 15 Nov 2005 18:59:07 +0100	[thread overview]
Message-ID: <437A21EB.4030107@e4a.it> (raw)

James Courtier-Dutton wrote:

>On 14/11/05, Dino Puller <dino@e4a.it> wrote:
>  
>
>>Hi all,
>>  only a simple  question:  How to obtain min_dB value for my device or
>>pcm channel? I found the api snd_mixer_selem_get_playback_dB_range but i
>>didn't understand how to use it. Is it the right api? I've found also
>>sndo_mixer_io_get_dB i'm a bit confused.
>>
>>thanks,
>>  Dino Puller
>>
>>    
>>
>
>Those api commands are not supported yet. The alsa-lib to user
>application api is there and fixed. The support needs to be added to
>alsa-driver and some modifications to alsa-lib to make it work. I am
>working on it.
>
>James
>
>  
>
Ok. Any way i'm doing something very similar to pcm_softvol plugin and i 
want to make a conversion from linear to dB scale

here is the point:
(taken from pcm_soft_vol.c)
...
       svol->min_dB = min_dB;
       for (i = 1; i < svol->max_val; i++) {
           double db = svol->min_dB - ((i - 1) * svol->min_dB) / 
(svol->max_val - 1);
           double v = (pow(10.0, db / 20.0) * (double)(1 << 
VOL_SCALE_SHIFT));
           svol->dB_value[i] = (unsigned short)v;
       }
...

in this plugin the default min_dB value is -48 but the volume is too 
low, now witch value should i use? Is there a default value for a pcm 
channel?

thanks,
  Dino Puller








-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click

                 reply	other threads:[~2005-11-15 17:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=437A21EB.4030107@e4a.it \
    --to=dino@e4a.it \
    --cc=alsa-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox