Re: [LAD] announcing envy24control, mudita (*) edition.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Niels Mayer <nielsmayer@...>
Cc: <linux-audio-dev@...>
Date: Tuesday, July 27, 2010 - 5:37 am

On July 26, 2010 09:07:35 pm you wrote:

Sure, NP I'll take a look.

Good news!
As I mentioned in a follow-up to another thread, I found a bunch
more dB related functions.

I tested replacing the code in volume.c:dac_volume_to_db() and
adc_volume_to_db() with a call to ALSA's snd_ctl_convert_to_dB().

The results are identical! And better for ADC compatibility, right?

Now comes the fun part. Coming up with an Al-Gore-rithm to
handle the scale markings using these ALSA functions -
how many 6dB steps we have, which ones to display, the range, etc.

It occurred to me 'dynamic markings': If the user expands
more, or less, vertically, then more, or less, markings should appear.
But it's still tricky - we want it to look the way I suggested above,
with more markings concentrated around the 0dB point, whenever
we are forced to compromise by removing marks.
Ultimately, at minimum height it must look like that - it's a compromise,
until a (better) solution comes up.

Also I see there is something called TLV based dB conversion where
I think it's a table or can be an arbitrary function. Must study more.

------------
For now here's the code, throw it inside
dac_volume_to_db() and
adc_volume_to_db() but *replace* DAC_VOLUME_NAME with ADC_VOLUME_NAME,
and I believe mixer_volume_to_db() and wherever else required.
Do you need a patch?

Hope this is OK, not sure how many members to set in struct snd_ctl_elem_id.
List members, does it look OK?

char* dac_volume_to_db(int ival) {
if (ival != 0) {

// Use ALSA functions to get dB values.
long db_gain = 0;
float fval;
snd_ctl_elem_id_t *elem_id;
snd_ctl_elem_id_alloca(&elem_id);
snd_ctl_elem_id_clear(elem_id);
snd_ctl_elem_id_set_interface(elem_id, SND_CTL_ELEM_IFACE_MIXER);
snd_ctl_elem_id_set_name(elem_id, DAC_VOLUME_NAME);
snd_ctl_convert_to_dB(ctl, elem_id, ival, &db_gain);
fval = ((float)db_gain / 100.0);
sprintf(temp_label, "%+2.1f", fval);
return (temp_label) ;

}
else
{
// Rest of function ('off' part). ]
...

Tim.

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAD] announcing envy24control, mudita (*) edition., Niels Mayer, (Sun Jul 25, 7:10 pm)
Re: [LAD] announcing envy24control, mudita (*) edition., Ralf Mardorf, (Mon Jul 26, 10:13 am)
Re: [LAD] announcing envy24control, mudita (*) edition., James Morris, (Mon Jul 26, 10:52 am)
Re: [LAD] announcing envy24control, mudita (*) edition., Ralf Mardorf, (Mon Jul 26, 11:00 am)
Re: [LAD] announcing envy24control, mudita (*) edition., Ralf Mardorf, (Mon Jul 26, 10:34 am)
Re: [LAD] announcing envy24control, mudita (*) edition., Takashi Iwai, (Mon Jul 26, 8:47 am)
Re: [LAD] announcing envy24control, mudita (*) edition., Tim E. Real, (Sun Jul 25, 11:10 pm)
Re: [LAD] announcing envy24control, mudita (*) edition., Niels Mayer, (Mon Jul 26, 12:00 am)
Re: [LAD] announcing envy24control, mudita (*) edition., Tim E. Real, (Tue Jul 27, 5:37 am)
Re: [LAD] announcing envy24control, mudita (*) edition., Tim E. Real, (Sun Jul 25, 11:22 pm)
Re: [LAD] announcing envy24control, mudita (*) edition., Niels Mayer, (Sun Jul 25, 11:55 pm)
Re: [LAD] announcing envy24control, mudita (*) edition., Tim E. Real, (Tue Jul 27, 11:09 pm)
Re: [LAD] announcing envy24control, mudita (*) edition., Niels Mayer, (Wed Jul 28, 12:04 am)
Re: [LAD] announcing envy24control, mudita (*) edition., Tim E. Real, (Thu Jul 29, 12:25 am)
[LAD] detention :), Jörn Nettingsmeier, (Wed Jul 28, 10:39 am)
Re: [LAD] detention :), Dominic Sacré, (Wed Jul 28, 12:05 pm)
Re: [LAD] detention :), Jörn Nettingsmeier, (Tue Aug 3, 6:41 pm)
Re: [LAD] detention :), Niels Mayer, (Tue Aug 3, 8:58 pm)
Re: [LAD] announcing envy24control, mudita (*) edition., James Morris, (Sun Jul 25, 9:16 pm)
Re: [LAD] announcing envy24control, mudita (*) edition., Niels Mayer, (Sun Jul 25, 11:16 pm)
Re: [LAD] announcing envy24control, mudita (*) edition., James Morris, (Mon Jul 26, 7:51 am)