From: Clemens Ladisch <clemens@ladisch.de>
To: ALSA Development Mailing List <alsa-devel@alsa-project.org>,
Jon Smirl <jonsmirl@gmail.com>,
Liam Girdwood <lrg@slimlogic.co.uk>,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: Re: Mixer volume/decibel mapping
Date: Tue, 25 May 2010 10:38:33 +0200 [thread overview]
Message-ID: <4BFB8C89.3010207@ladisch.de> (raw)
In-Reply-To: <AANLkTikXWtp87B0Gq_B-vQZXZlBl_MEBqbuHt6N5cTbi@mail.gmail.com>
Raymond Yau wrote:
> 2010/5/21 Clemens Ladisch <clemens@ladisch.de>
> > Peter Ujfalusi wrote:
> > > The DB_SCALE also provides linear mapping:
> > > For example, if the HW volume control has a range 0 .. 100
> > > In HW these means:
> > > 0 == -10dB, 1 == -9.8dB, 2 == -9.6dB .. 99 = 9.8dB, 100 = 10dB
> > > So it is linear.
> >
> > This is not what is meant by "linear", because dB values are not linear.
> >
> > DB_LINEAR means that the mixer control value is a multiplier for the
> > PCM sample value, as James wrote. A DB_LINEAR mapping has
... in practice ...
> > 0 == -infinity dB, full scale == 0 dB, and the mapping between mixer
> > control values and corresponding dB values it _not_ linear.
> >
> > TLV_DB_LINEAR_ITEM is a quite misleading name, but it actually means
> > "dB mapping for a mixer control whose value has a linear effect on the
> > sound output", _not_ a linear value <-> dB mapping.
>
> seem max(full scale) is more then 0dB for some codecs , only three drivers
> have 0dB as max and TLV_DB_GAIN_MUTE (-99999.99dB) as min
And these three are for hardware that use it as a plain multiplier.
All the others seem to be mistakes:
> soc/codecs/stac9766.c:static const DECLARE_TLV_DB_LINEAR(master_tlv, -4600, 0);
> soc/codecs/stac9766.c:static const DECLARE_TLV_DB_LINEAR(record_tlv, 0, 2250);
> soc/codecs/stac9766.c:static const DECLARE_TLV_DB_LINEAR(beep_tlv, -4500, 0);
> soc/codecs/stac9766.c:static const DECLARE_TLV_DB_LINEAR(mix_tlv, -3450, 1200);
These are wrong, both the AC'97 spec and the STAC9766 datasheet say
that there is a linear register value/dB mapping; these should all use
DECLARE_TLV_DB_SCALE.
> soc/codecs/wm8350.c:static DECLARE_TLV_DB_LINEAR(pre_amp_tlv, -1200, 3525);
> soc/codecs/wm8350.c:static DECLARE_TLV_DB_LINEAR(out_pga_tlv, -5700, 600);
According to the datasheet, these should use DECLARE_TLV_DB_SCALE (like
all the others in this file).
> soc/codecs/wm8400.c:static const DECLARE_TLV_DB_LINEAR(rec_mix_tlv, -1500, 600);
> soc/codecs/wm8400.c:static const DECLARE_TLV_DB_LINEAR(in_pga_tlv, -1650, 3000);
> soc/codecs/wm8400.c:static const DECLARE_TLV_DB_LINEAR(out_mix_tlv, -2100, 0);
> soc/codecs/wm8400.c:static const DECLARE_TLV_DB_LINEAR(out_pga_tlv, -7300, 600);
> soc/codecs/wm8400.c:static const DECLARE_TLV_DB_LINEAR(out_omix_tlv, -600, 0);
> soc/codecs/wm8400.c:static const DECLARE_TLV_DB_LINEAR(out_dac_tlv, -7163, 0);
> soc/codecs/wm8400.c:static const DECLARE_TLV_DB_LINEAR(in_adc_tlv, -7163, 1763);
> soc/codecs/wm8400.c:static const DECLARE_TLV_DB_LINEAR(out_sidetone_tlv, -3600, 0);
> soc/codecs/wm8400.c: 0,7, TLV_DB_LINEAR_ITEM(-1200, 600),
> soc/codecs/wm8990.c:static const DECLARE_TLV_DB_LINEAR(rec_mix_tlv, -1500, 600);
> soc/codecs/wm8990.c:static const DECLARE_TLV_DB_LINEAR(in_pga_tlv, -1650, 3000);
> soc/codecs/wm8990.c:static const DECLARE_TLV_DB_LINEAR(out_mix_tlv, 0, -2100);
> soc/codecs/wm8990.c:static const DECLARE_TLV_DB_LINEAR(out_pga_tlv, -7300, 600);
> soc/codecs/wm8990.c:static const DECLARE_TLV_DB_LINEAR(out_omix_tlv, -600, 0);
> soc/codecs/wm8990.c:static const DECLARE_TLV_DB_LINEAR(out_dac_tlv, -7163, 0);
> soc/codecs/wm8990.c:static const DECLARE_TLV_DB_LINEAR(in_adc_tlv, -7163, 1763);
> soc/codecs/wm8990.c:static const DECLARE_TLV_DB_LINEAR(out_sidetone_tlv, -3600, 0);
> soc/codecs/wm8990.c: 0, 7, TLV_DB_LINEAR_ITEM(-1200, 600),
Same here.
Regards,
Clemens
next prev parent reply other threads:[~2010-05-25 8:38 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-19 16:34 Mixer volume/decibel mapping Sebastian H.
2010-05-20 7:34 ` Clemens Ladisch
2010-05-20 8:01 ` James Courtier-Dutton
2010-05-20 8:53 ` Raymond Yau
2010-05-20 9:41 ` Sebastian H.
2010-05-20 16:13 ` James Courtier-Dutton
2010-05-21 0:35 ` Raymond Yau
2010-05-21 1:30 ` Raymond Yau
2010-05-21 8:18 ` Sebastian H.
2010-06-07 3:37 ` Raymond Yau
2010-06-07 9:19 ` Sebastian H.
2010-06-08 1:03 ` Raymond Yau
2010-06-08 6:02 ` Sebastian Holtermann
2010-06-08 15:31 ` Raymond Yau
2010-06-09 10:26 ` Sebastian H.
2010-06-08 6:08 ` Sebastian H.
2010-06-09 5:39 ` Raymond Yau
2010-06-09 7:34 ` Sebastian H.
2010-06-10 0:08 ` Raymond Yau
2010-06-09 5:55 ` Raymond Yau
2010-06-08 2:23 ` Raymond Yau
2010-05-21 6:35 ` Clemens Ladisch
2010-05-21 6:51 ` Peter Ujfalusi
2010-05-21 9:56 ` Clemens Ladisch
2010-05-24 2:52 ` Raymond Yau
2010-05-25 8:38 ` Clemens Ladisch [this message]
2010-05-25 8:43 ` James Courtier-Dutton
2010-05-25 8:49 ` Clemens Ladisch
2010-05-25 23:24 ` Raymond Yau
2010-05-27 13:32 ` Colin Guthrie
2010-05-29 3:54 ` Raymond Yau
2010-05-29 1:57 ` Raymond Yau
2010-05-29 18:46 ` Colin Guthrie
2010-06-04 23:46 ` Raymond Yau
[not found] ` <AANLkTik7mD1DAVWkOwM7sNu0EfgGApvzX9WRXWBOO4PI@mail.gmail.com>
2010-05-25 8:45 ` Clemens Ladisch
2010-05-25 13:51 ` Raymond Yau
2010-05-25 14:36 ` Clemens Ladisch
2010-05-25 23:00 ` Raymond Yau
2010-05-27 0:20 ` Raymond Yau
2010-05-28 13:04 ` Raymond Yau
2010-05-28 14:10 ` Clemens Ladisch
2010-05-29 1:31 ` Raymond Yau
2010-05-21 13:16 ` James Courtier-Dutton
2010-05-25 8:21 ` Clemens Ladisch
2010-06-09 6:19 ` Raymond Yau
2010-05-22 9:24 ` Raymond Yau
2010-05-20 9:20 ` Sebastian H.
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=4BFB8C89.3010207@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=jonsmirl@gmail.com \
--cc=lrg@slimlogic.co.uk \
/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.