Discussion:
[pulseaudio-discuss] [PATCH] alsa-mixer: Prefer moving "Capture" before moving boosts
David Henningsson
2013-08-02 13:19:01 UTC
Permalink
Some HD-audio codecs (at least ALC269VB and ALC283) become quite noisy on
high Mic Boost levels. So e g, if there is a "Mic Boost" and a "Capture"
control, both ranging from 0 dB to +30 dB, you get better quality if
"Mic Boost" is 0 dB and "Capture" is +30 dB, than the other way around.

By changing the order in the configuration files, this patch makes us prefer
leaving "Mic Boost" low and "Capture" high if the user selects a medium gain.

(This is based on limited experience, and there is no guarantee that there are
no sound cards that work the other way around, and therefore this patch could
potentially regress quality on those machines. Hopefully those are fewer, so
this is what we should default to.)

BugLink: https://bugs.launchpad.net/1085402
Signed-off-by: David Henningsson <david.henningsson at canonical.com>
---
.../alsa/mixer/paths/analog-input-dock-mic.conf | 12 ++++++------
.../alsa/mixer/paths/analog-input-front-mic.conf | 12 ++++++------
.../mixer/paths/analog-input-headphone-mic.conf | 12 ++++++------
.../alsa/mixer/paths/analog-input-headset-mic.conf | 12 ++++++------
.../paths/analog-input-internal-mic-always.conf | 13 ++++++-------
.../mixer/paths/analog-input-internal-mic.conf | 13 ++++++-------
src/modules/alsa/mixer/paths/analog-input-mic.conf | 12 ++++++------
.../alsa/mixer/paths/analog-input-rear-mic.conf | 12 ++++++------
8 files changed, 48 insertions(+), 50 deletions(-)

diff --git a/src/modules/alsa/mixer/paths/analog-input-dock-mic.conf b/src/modules/alsa/mixer/paths/analog-input-dock-mic.conf
index 9334d45..85a8658 100644
--- a/src/modules/alsa/mixer/paths/analog-input-dock-mic.conf
+++ b/src/modules/alsa/mixer/paths/analog-input-dock-mic.conf
@@ -30,6 +30,12 @@ state.plugged = unknown
state.unplugged = unknown
required-any = any

+[Element Capture]
+switch = mute
+volume = merge
+override-map.1 = all
+override-map.2 = all-left,all-right
+
[Element Dock Mic Boost]
required-any = any
switch = select
@@ -50,12 +56,6 @@ volume = merge
override-map.1 = all
override-map.2 = all-left,all-right

-[Element Capture]
-switch = mute
-volume = merge
-override-map.1 = all
-override-map.2 = all-left,all-right
-
[Element Input Source]
enumeration = select

diff --git a/src/modules/alsa/mixer/paths/analog-input-front-mic.conf b/src/modules/alsa/mixer/paths/analog-input-front-mic.conf
index 3fb5f5e..5265e5b 100644
--- a/src/modules/alsa/mixer/paths/analog-input-front-mic.conf
+++ b/src/modules/alsa/mixer/paths/analog-input-front-mic.conf
@@ -30,6 +30,12 @@ required-any = any
state.plugged = unknown
state.unplugged = unknown

+[Element Capture]
+switch = mute
+volume = merge
+override-map.1 = all
+override-map.2 = all-left,all-right
+
[Element Front Mic Boost]
required-any = any
switch = select
@@ -50,12 +56,6 @@ volume = merge
override-map.1 = all
override-map.2 = all-left,all-right

-[Element Capture]
-switch = mute
-volume = merge
-override-map.1 = all
-override-map.2 = all-left,all-right
-
[Element Input Source]
enumeration = select

diff --git a/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf b/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf
index 688b8ac..3a19e01 100644
--- a/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf
+++ b/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf
@@ -27,21 +27,21 @@ description-key = analog-input-microphone
required-any = any
state.plugged = unknown

-[Element Headphone Mic Boost]
-required-any = any
-switch = select
+[Element Capture]
+switch = mute
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right

-[Element Headphone Mic]
+[Element Headphone Mic Boost]
required-any = any
-switch = mute
+switch = select
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right

-[Element Capture]
+[Element Headphone Mic]
+required-any = any
switch = mute
volume = merge
override-map.1 = all
diff --git a/src/modules/alsa/mixer/paths/analog-input-headset-mic.conf b/src/modules/alsa/mixer/paths/analog-input-headset-mic.conf
index 0a3d661..aeb2cec 100644
--- a/src/modules/alsa/mixer/paths/analog-input-headset-mic.conf
+++ b/src/modules/alsa/mixer/paths/analog-input-headset-mic.conf
@@ -36,6 +36,12 @@ state.plugged = unknown
[Jack Headphone Mic]
state.plugged = unknown

+[Element Capture]
+switch = mute
+volume = merge
+override-map.1 = all
+override-map.2 = all-left,all-right
+
[Element Headset Mic Boost]
required-any = any
switch = select
@@ -57,12 +63,6 @@ volume = merge
override-map.1 = all
override-map.2 = all-left,all-right

-[Element Capture]
-switch = mute
-volume = merge
-override-map.1 = all
-override-map.2 = all-left,all-right
-
[Element Input Source]
enumeration = select

diff --git a/src/modules/alsa/mixer/paths/analog-input-internal-mic-always.conf b/src/modules/alsa/mixer/paths/analog-input-internal-mic-always.conf
index cd08531..e9c288e 100644
--- a/src/modules/alsa/mixer/paths/analog-input-internal-mic-always.conf
+++ b/src/modules/alsa/mixer/paths/analog-input-internal-mic-always.conf
@@ -39,6 +39,12 @@ state.unplugged = unknown
state.plugged = no
state.unplugged = unknown

+[Element Capture]
+switch = mute
+volume = merge
+override-map.1 = all
+override-map.2 = all-left,all-right
+
[Element Internal Mic Boost]
switch = select
volume = merge
@@ -63,7 +69,6 @@ name = input-boost-on
[Option Int Mic Boost:off]
name = input-boost-off

-
[Element Internal Mic]
switch = mute
volume = merge
@@ -76,12 +81,6 @@ volume = merge
override-map.1 = all
override-map.2 = all-left,all-right

-[Element Capture]
-switch = mute
-volume = merge
-override-map.1 = all
-override-map.2 = all-left,all-right
-
[Element Input Source]
enumeration = select

diff --git a/src/modules/alsa/mixer/paths/analog-input-internal-mic.conf b/src/modules/alsa/mixer/paths/analog-input-internal-mic.conf
index ae3e9a8..5424a1b 100644
--- a/src/modules/alsa/mixer/paths/analog-input-internal-mic.conf
+++ b/src/modules/alsa/mixer/paths/analog-input-internal-mic.conf
@@ -44,6 +44,12 @@ state.plugged = unknown
state.unplugged = unknown
required-any = any

+[Element Capture]
+switch = mute
+volume = merge
+override-map.1 = all
+override-map.2 = all-left,all-right
+
[Element Internal Mic Boost]
required-any = any
switch = select
@@ -70,7 +76,6 @@ name = input-boost-on
[Option Int Mic Boost:off]
name = input-boost-off

-
[Element Internal Mic]
required-any = any
switch = mute
@@ -85,12 +90,6 @@ volume = merge
override-map.1 = all
override-map.2 = all-left,all-right

-[Element Capture]
-switch = mute
-volume = merge
-override-map.1 = all
-override-map.2 = all-left,all-right
-
[Element Input Source]
enumeration = select

diff --git a/src/modules/alsa/mixer/paths/analog-input-mic.conf b/src/modules/alsa/mixer/paths/analog-input-mic.conf
index 17f3988..2ce6dd3 100644
--- a/src/modules/alsa/mixer/paths/analog-input-mic.conf
+++ b/src/modules/alsa/mixer/paths/analog-input-mic.conf
@@ -30,6 +30,12 @@ required-any = any
state.plugged = unknown
state.unplugged = unknown

+[Element Capture]
+switch = mute
+volume = merge
+override-map.1 = all
+override-map.2 = all-left,all-right
+
[Element Mic Boost]
required-any = any
switch = select
@@ -50,12 +56,6 @@ volume = merge
override-map.1 = all
override-map.2 = all-left,all-right

-[Element Capture]
-switch = mute
-volume = merge
-override-map.1 = all
-override-map.2 = all-left,all-right
-
[Element Input Source]
enumeration = select

diff --git a/src/modules/alsa/mixer/paths/analog-input-rear-mic.conf b/src/modules/alsa/mixer/paths/analog-input-rear-mic.conf
index ac78b5b..eed4f83 100644
--- a/src/modules/alsa/mixer/paths/analog-input-rear-mic.conf
+++ b/src/modules/alsa/mixer/paths/analog-input-rear-mic.conf
@@ -30,6 +30,12 @@ required-any = any
state.plugged = unknown
state.unplugged = unknown

+[Element Capture]
+switch = mute
+volume = merge
+override-map.1 = all
+override-map.2 = all-left,all-right
+
[Element Rear Mic Boost]
required-any = any
switch = select
@@ -50,12 +56,6 @@ volume = merge
override-map.1 = all
override-map.2 = all-left,all-right

-[Element Capture]
-switch = mute
-volume = merge
-override-map.1 = all
-override-map.2 = all-left,all-right
-
[Element Input Source]
enumeration = select
--
1.7.9.5
Arun Raghavan
2013-08-02 13:34:15 UTC
Permalink
Post by David Henningsson
Some HD-audio codecs (at least ALC269VB and ALC283) become quite noisy on
high Mic Boost levels. So e g, if there is a "Mic Boost" and a "Capture"
control, both ranging from 0 dB to +30 dB, you get better quality if
"Mic Boost" is 0 dB and "Capture" is +30 dB, than the other way around.
By changing the order in the configuration files, this patch makes us prefer
leaving "Mic Boost" low and "Capture" high if the user selects a medium gain.
(This is based on limited experience, and there is no guarantee that there are
no sound cards that work the other way around, and therefore this patch could
potentially regress quality on those machines. Hopefully those are fewer, so
this is what we should default to.)
[...]
Post by David Henningsson
diff --git a/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf b/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf
index 688b8ac..3a19e01 100644
--- a/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf
+++ b/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf
@@ -27,21 +27,21 @@ description-key = analog-input-microphone
required-any = any
state.plugged = unknown
-[Element Headphone Mic Boost]
-required-any = any
-switch = select
+[Element Capture]
+switch = mute
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
-[Element Headphone Mic]
+[Element Headphone Mic Boost]
If we're doing this, might as well prefer Headphone Mic over Headphone
Mic Boost?
Post by David Henningsson
required-any = any
-switch = mute
+switch = select
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
-[Element Capture]
+[Element Headphone Mic]
+required-any = any
switch = mute
volume = merge
override-map.1 = all
[...]
Post by David Henningsson
diff --git a/src/modules/alsa/mixer/paths/analog-input-internal-mic-always.conf b/src/modules/alsa/mixer/paths/analog-input-internal-mic-always.conf
index cd08531..e9c288e 100644
--- a/src/modules/alsa/mixer/paths/analog-input-internal-mic-always.conf
+++ b/src/modules/alsa/mixer/paths/analog-input-internal-mic-always.conf
@@ -39,6 +39,12 @@ state.unplugged = unknown
state.plugged = no
state.unplugged = unknown
+[Element Capture]
+switch = mute
+volume = merge
+override-map.1 = all
+override-map.2 = all-left,all-right
+
[Element Internal Mic Boost]
switch = select
volume = merge
@@ -63,7 +69,6 @@ name = input-boost-on
[Option Int Mic Boost:off]
name = input-boost-off
Again, maybe Boost should be after both Internal Mic?
Post by David Henningsson
-
[Element Internal Mic]
switch = mute
volume = merge
@@ -76,12 +81,6 @@ volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
-[Element Capture]
-switch = mute
-volume = merge
-override-map.1 = all
-override-map.2 = all-left,all-right
-
[Element Input Source]
enumeration = select
diff --git a/src/modules/alsa/mixer/paths/analog-input-internal-mic.conf b/src/modules/alsa/mixer/paths/analog-input-internal-mic.conf
index ae3e9a8..5424a1b 100644
--- a/src/modules/alsa/mixer/paths/analog-input-internal-mic.conf
+++ b/src/modules/alsa/mixer/paths/analog-input-internal-mic.conf
@@ -44,6 +44,12 @@ state.plugged = unknown
state.unplugged = unknown
required-any = any
+[Element Capture]
+switch = mute
+volume = merge
+override-map.1 = all
+override-map.2 = all-left,all-right
+
[Element Internal Mic Boost]
required-any = any
switch = select
@@ -70,7 +76,6 @@ name = input-boost-on
[Option Int Mic Boost:off]
name = input-boost-off
Same comment here.

Rest looks good to me.

Cheers,
Arun
David Henningsson
2013-08-02 13:43:40 UTC
Permalink
Post by Arun Raghavan
Post by David Henningsson
Some HD-audio codecs (at least ALC269VB and ALC283) become quite noisy on
high Mic Boost levels. So e g, if there is a "Mic Boost" and a "Capture"
control, both ranging from 0 dB to +30 dB, you get better quality if
"Mic Boost" is 0 dB and "Capture" is +30 dB, than the other way around.
By changing the order in the configuration files, this patch makes us prefer
leaving "Mic Boost" low and "Capture" high if the user selects a medium gain.
(This is based on limited experience, and there is no guarantee that there are
no sound cards that work the other way around, and therefore this patch could
potentially regress quality on those machines. Hopefully those are fewer, so
this is what we should default to.)
[...]
Post by David Henningsson
diff --git a/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf b/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf
index 688b8ac..3a19e01 100644
--- a/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf
+++ b/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf
@@ -27,21 +27,21 @@ description-key = analog-input-microphone
required-any = any
state.plugged = unknown
-[Element Headphone Mic Boost]
-required-any = any
-switch = select
+[Element Capture]
+switch = mute
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
-[Element Headphone Mic]
+[Element Headphone Mic Boost]
If we're doing this, might as well prefer Headphone Mic over Headphone
Mic Boost?
We could, but I'd rather have some sort of evidence/indication that this
will actually make a difference first. For starters, it's unusual to
have both "Headphone Mic" and "Headphone Mic Boost" on the same sound card.

Also, we're moving this around because we have empirical experience that
hardware behaves this way, not because it is logical for hardware to do
so. Hence I'd refrain from extending the same logic to other controls.

Btw, the reason I'm moving "Capture" rather than the Mic Boosts is that
I remember sometimes boosts are labelled "xx Mic" instead "xx Mic
Boost", even though they are boosts and could potentially work the same
way (become noisy at high levels).
Post by Arun Raghavan
Post by David Henningsson
required-any = any
-switch = mute
+switch = select
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
-[Element Capture]
+[Element Headphone Mic]
+required-any = any
switch = mute
volume = merge
override-map.1 = all
[...]
Post by David Henningsson
diff --git a/src/modules/alsa/mixer/paths/analog-input-internal-mic-always.conf b/src/modules/alsa/mixer/paths/analog-input-internal-mic-always.conf
index cd08531..e9c288e 100644
--- a/src/modules/alsa/mixer/paths/analog-input-internal-mic-always.conf
+++ b/src/modules/alsa/mixer/paths/analog-input-internal-mic-always.conf
@@ -39,6 +39,12 @@ state.unplugged = unknown
state.plugged = no
state.unplugged = unknown
+[Element Capture]
+switch = mute
+volume = merge
+override-map.1 = all
+override-map.2 = all-left,all-right
+
[Element Internal Mic Boost]
switch = select
volume = merge
@@ -63,7 +69,6 @@ name = input-boost-on
[Option Int Mic Boost:off]
name = input-boost-off
Again, maybe Boost should be after both Internal Mic?
Post by David Henningsson
-
[Element Internal Mic]
switch = mute
volume = merge
@@ -76,12 +81,6 @@ volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
-[Element Capture]
-switch = mute
-volume = merge
-override-map.1 = all
-override-map.2 = all-left,all-right
-
[Element Input Source]
enumeration = select
diff --git a/src/modules/alsa/mixer/paths/analog-input-internal-mic.conf b/src/modules/alsa/mixer/paths/analog-input-internal-mic.conf
index ae3e9a8..5424a1b 100644
--- a/src/modules/alsa/mixer/paths/analog-input-internal-mic.conf
+++ b/src/modules/alsa/mixer/paths/analog-input-internal-mic.conf
@@ -44,6 +44,12 @@ state.plugged = unknown
state.unplugged = unknown
required-any = any
+[Element Capture]
+switch = mute
+volume = merge
+override-map.1 = all
+override-map.2 = all-left,all-right
+
[Element Internal Mic Boost]
required-any = any
switch = select
@@ -70,7 +76,6 @@ name = input-boost-on
[Option Int Mic Boost:off]
name = input-boost-off
Same comment here.
Rest looks good to me.
Ok, can I push this one as it is then? There's nothing stopping us from
switching "Headphone Mic" and "Headphone Mic Boost" too, if we want to
do so later.
--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic
Arun Raghavan
2013-08-02 13:49:16 UTC
Permalink
Post by David Henningsson
Post by Arun Raghavan
Post by David Henningsson
Some HD-audio codecs (at least ALC269VB and ALC283) become quite noisy on
high Mic Boost levels. So e g, if there is a "Mic Boost" and a "Capture"
control, both ranging from 0 dB to +30 dB, you get better quality if
"Mic Boost" is 0 dB and "Capture" is +30 dB, than the other way around.
By changing the order in the configuration files, this patch makes us prefer
leaving "Mic Boost" low and "Capture" high if the user selects a medium gain.
(This is based on limited experience, and there is no guarantee that there are
no sound cards that work the other way around, and therefore this patch could
potentially regress quality on those machines. Hopefully those are fewer, so
this is what we should default to.)
[...]
Post by David Henningsson
diff --git a/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf b/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf
index 688b8ac..3a19e01 100644
--- a/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf
+++ b/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf
@@ -27,21 +27,21 @@ description-key = analog-input-microphone
required-any = any
state.plugged = unknown
-[Element Headphone Mic Boost]
-required-any = any
-switch = select
+[Element Capture]
+switch = mute
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
-[Element Headphone Mic]
+[Element Headphone Mic Boost]
If we're doing this, might as well prefer Headphone Mic over Headphone
Mic Boost?
We could, but I'd rather have some sort of evidence/indication that this
will actually make a difference first. For starters, it's unusual to
have both "Headphone Mic" and "Headphone Mic Boost" on the same sound card.
Also, we're moving this around because we have empirical experience that
hardware behaves this way, not because it is logical for hardware to do
so. Hence I'd refrain from extending the same logic to other controls.
Btw, the reason I'm moving "Capture" rather than the Mic Boosts is that
I remember sometimes boosts are labelled "xx Mic" instead "xx Mic
Boost", even though they are boosts and could potentially work the same
way (become noisy at high levels).
Fair enough.

[...]
Post by David Henningsson
Post by Arun Raghavan
Rest looks good to me.
Ok, can I push this one as it is then? There's nothing stopping us from
switching "Headphone Mic" and "Headphone Mic Boost" too, if we want to
do so later.
Yes, please go ahead.

-- Arun

Loading...