All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Decibel]
@ 2005-11-15 17:59 Dino Puller
  0 siblings, 0 replies; only message in thread
From: Dino Puller @ 2005-11-15 17:59 UTC (permalink / raw)
  To: alsa-devel

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-11-15 17:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-15 17:59 Decibel] Dino Puller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.