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 5/5] mixer: simple - Add exceptions for some Playback Switches with a " Channel Switch" suffix
Date: Mon,  3 May 2021 22:52:31 +0200	[thread overview]
Message-ID: <20210503205231.167346-6-hdegoede@redhat.com> (raw)
In-Reply-To: <20210503205231.167346-1-hdegoede@redhat.com>

The following ASoC codec drivers:
sound/soc/codecs/rt5640.c
sound/soc/codecs/rt5645.c

Use the following troublesome playback-switch-control names:

"Headphone Channel Switch"
"HP Channel Switch"
"Speaker Channel Switch"

There are 2 problems with these names:

1. They are the mute controls for the matching:
"Headphone Playback Volume"
"HP Playback Volume"
"Speaker Playback Volume"
controls, to be properly paired, which is necessary for HW volume-control
support, the simple mixer code needs to recognize that the base-name for
these is e.g. "Headphone" not "Headphone Channel".

2. They are playback-switches, yet they get recognized as global-switches.

Add these to the exceptions table so that they get the proper basename
and type set.

Note we can NOT fix this by adding " Channel Switch" as a suffix to the
suffixes table, because the line-out output on these codecs has the
following controls:

"OUT Playback Switch"
"OUT Channel Switch"
"OUT Playback Volume"

Where the 2 switches describe mutes in 2 different places in the graph.

So if we were to add a " Channel Switch" suffix map to CTL_PLAYBACK_SWITCH
then we would get 2 CTL_PLAYBACK_SWITCH controls for the "OUT" mixer
element, which is not allowed.

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

diff --git a/src/mixer/simple_none.c b/src/mixer/simple_none.c
index de81966f..d5025f68 100644
--- a/src/mixer/simple_none.c
+++ b/src/mixer/simple_none.c
@@ -933,6 +933,9 @@ 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},
+	{"Headphone Channel Switch", 9, CTL_PLAYBACK_SWITCH},
+	{"HP Channel Switch", 2, CTL_PLAYBACK_SWITCH},
+	{"Speaker Channel Switch", 7, CTL_PLAYBACK_SWITCH},
 	/* Capture Volume/Switch controls without a " Capture ..." suffix */
 	{"ADC Boost Gain", 14, CTL_CAPTURE_VOLUME},
 	{"IN1 Boost", 9, CTL_CAPTURE_VOLUME},
-- 
2.31.1


  parent reply	other threads:[~2021-05-03 20:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03 20:52 [PATCH alsa-lib 0/5] Add generic exception mechanism for non-standard control-names Hans de Goede
2021-05-03 20:52 ` [PATCH alsa-lib 1/5] mixer: simple - " Hans de Goede
2021-05-03 20:52 ` [PATCH alsa-lib 2/5] mixer: simple - Move handling of 3D Control - Depth controls to the exceptions list Hans de Goede
2021-05-03 20:52 ` [PATCH alsa-lib 3/5] mixer: simple - Add exceptions for non " Volume" suffixed capture vol-ctls used in ASoC realtek codec drivers Hans de Goede
2021-05-03 20:52 ` [PATCH alsa-lib 4/5] mixer: simple - Add exceptions for some capture-vol-ctls which have a " Volume" suffix Hans de Goede
2021-05-03 20:52 ` Hans de Goede [this message]
2021-05-04  8:53 ` [PATCH alsa-lib 0/5] Add generic exception mechanism for non-standard control-names Jaroslav Kysela
2021-05-04 15:47   ` Hans de Goede
2021-05-18 16:16     ` Jaroslav Kysela
2021-06-23 18:59       ` Hans de Goede
2021-06-23 19:27         ` Jaroslav Kysela
2021-06-25 13:05           ` Hans de Goede
2021-05-04 15:51   ` 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=20210503205231.167346-6-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.