All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Jaroslav Kysela <perex@perex.cz>, alsa-devel@alsa-project.org
Cc: Hans de Goede <hdegoede@redhat.com>
Subject: [PATCH alsa-lib v3 3/5] mixer: simple - Add exceptions for non " Volume" suffixed capture vol-ctls used in ASoC realtek codec drivers
Date: Sun,  7 Mar 2021 14:30:03 +0100	[thread overview]
Message-ID: <20210307133005.30801-4-hdegoede@redhat.com> (raw)
In-Reply-To: <20210307133005.30801-1-hdegoede@redhat.com>

The following ASoC codec drivers:

sound/soc/codecs/rt5640.c
sound/soc/codecs/rt5645.c
sound/soc/codecs/rt5651.c
sound/soc/codecs/rt5677.c

Use capture-volume-control names like: "IN1 Boost", note the missing
" Volume" suffix. This causes the mixer code to not identify these as
volume-controls, which causes some of the dB related sm_elem_ops to
return -EINVAL.

This in turn causes alsamixer to not show dB info and causes UCM profile
HW volume control support in pulseaudio to not work properly due to the
lacking dB scale info.

This cannot be fixed on the kernel side because the non " Volume" suffixed
names are used in UCM profiles currently shipping in alsa-ucm-conf.

Add these to the exceptions table, so that these correctly get identified
as CTL_CAPTURE_VOLUME controls.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 src/mixer/simple_none.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/mixer/simple_none.c b/src/mixer/simple_none.c
index b29554cb..8f964959 100644
--- a/src/mixer/simple_none.c
+++ b/src/mixer/simple_none.c
@@ -926,6 +926,11 @@ static const struct excep {
 	{"3D Control - Depth", 18, CTL_PLAYBACK_VOLUME},
 	{"3D Control Sigmatel - Depth", 27, CTL_PLAYBACK_VOLUME},
 	{"3D Control Sigmatel - Rear Depth", 32, CTL_PLAYBACK_VOLUME},
+	/* Capture Volume/Switch controls without a " Capture ..." suffix */
+	{"ADC Boost Gain", 14, CTL_CAPTURE_VOLUME},
+	{"IN1 Boost", 9, CTL_CAPTURE_VOLUME},
+	{"IN2 Boost", 9, CTL_CAPTURE_VOLUME},
+	{"IN3 Boost", 9, CTL_CAPTURE_VOLUME},
 	{NULL,}
 };
 #endif
-- 
2.30.1


  parent reply	other threads:[~2021-03-07 13:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-07 13:30 [PATCH alsa-lib v3 0/5] mixer: simple - Volume control fixes Hans de Goede
2021-03-07 13:30 ` [PATCH alsa-lib v3 1/5] mixer: simple - Add generic exception mechanism for non-standard control-names Hans de Goede
2021-03-07 13:30 ` [PATCH alsa-lib v3 2/5] mixer: simple - Move handling of 3D Control - Depth controls to the exceptions list Hans de Goede
2021-03-07 13:30 ` Hans de Goede [this message]
2021-03-07 13:30 ` [PATCH alsa-lib v3 4/5] mixer: simple - Add exceptions for some capture-vol-ctls which have a " Volume" suffix Hans de Goede
2021-03-07 13:30 ` [PATCH alsa-lib v3 5/5] mixer: simple - Add exceptions for some Playback Switches with a " Channel Switch" suffix Hans de Goede

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=20210307133005.30801-4-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=perex@perex.cz \
    /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.