All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Courtier-Dutton <James@superbug.co.uk>
To: Jaroslav Kysela <perex@suse.cz>
Cc: Takashi Iwai <tiwai@suse.de>,
	ALSA development <alsa-devel@alsa-project.org>
Subject: Re: dB gain
Date: Mon, 29 May 2006 16:12:34 +0100	[thread overview]
Message-ID: <447B0F62.6010802@superbug.co.uk> (raw)
In-Reply-To: <Pine.LNX.4.61.0605291630000.11164@tm8103-a.perex-int.cz>

Jaroslav Kysela wrote:
> On Mon, 29 May 2006, Takashi Iwai wrote:
> 
>> What we'll get by this compression is only the reduction of ioctl
>> size.  But, these ioctls are called not so often and no time-critical
>> task.
> 
> Nope. I'm talking about saving code in alsa-lib. Having a special case in 
> alsa-lib for all hints is not really good. If you can store all necessary 
> ranges to 32-bit value (which is allocated anyway) is a win. Of course, 
> all mechanisms as James proposed will not be changed. I see only one 
> problem why my proposal is not acceptable - we must store also the 
> identifier type to the 32-bit value in the kernel side. Also, having both 
> min and max values is not necessary (it can be evaluated from step).
> 
I don't understand where you think you are making a win with these
32-bit values? None of the information is stored in alsa-lib after the
function has returned to the user app. It is all temporary use.

I don't have min and max values.
I have:
int32_t db_per_devision; /* Use db per devision * 100 */
int32_t db_offset; /* Use dB offset * 100. This identifies the 0dB point */
int32_t db_mute; /* The value, before conversion, that is equivalent to
MUTE */

Now, not all controls have a mute at the minimum value.
If the minimum % is a mute, then the db_mute == this minimum % value.
If the minimum % is not mute, then the db_mute equals a value outside
the % range, so the comparison to db_mute is always false for that control.

The current type implemented is:
For simple  dB*100 = (X * db_per_devision) - db_offset
with a special case for detecting the mute value.

More complex conversion functions will have a different equation, and
therefore possibly a different amount of parameters, so one would just
implement a new type, and parse as many parameters from it as we need.

James

  reply	other threads:[~2006-05-29 15:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-27 19:03 dB gain James Courtier-Dutton
2006-05-29 13:08 ` Takashi Iwai
2006-05-29 13:47   ` Jaroslav Kysela
2006-05-29 14:17     ` Jaroslav Kysela
2006-05-29 14:28       ` Takashi Iwai
2006-05-29 14:55         ` Jaroslav Kysela
2006-05-29 15:12           ` James Courtier-Dutton [this message]
2006-05-29 15:41             ` Takashi Iwai
2006-05-29 18:34               ` Jaroslav Kysela
2006-05-29 19:21                 ` James Courtier-Dutton
2006-05-29 14:50   ` James Courtier-Dutton
2006-05-29 15:54     ` Takashi Iwai
2006-05-29 17:34       ` James Courtier-Dutton
2006-05-29 18:11         ` Takashi Iwai
2006-05-29 18:27           ` Jaroslav Kysela
2006-05-30 18:59             ` James Courtier-Dutton
2006-05-30 19:49               ` Jaroslav Kysela
2006-05-31 10:47               ` Takashi Iwai
2006-05-31 11:04                 ` James Courtier-Dutton
2006-05-31 11:31                   ` Takashi Iwai
2006-05-31 11:18             ` Takashi Iwai

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=447B0F62.6010802@superbug.co.uk \
    --to=james@superbug.co.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=perex@suse.cz \
    --cc=tiwai@suse.de \
    /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 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.