alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Jaroslav Kysela <perex@perex.cz>
Cc: Hans de Goede <hdegoede@redhat.com>,
	alsa-devel@alsa-project.org,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Bard Liao <bard.liao@intel.com>
Subject: [PATCH alsa-ucm-conf 2/2] codecs/rt5672: Add hardware volume-control support
Date: Wed, 17 Feb 2021 15:34:36 +0100	[thread overview]
Message-ID: <20210217143436.74209-2-hdegoede@redhat.com> (raw)
In-Reply-To: <20210217143436.74209-1-hdegoede@redhat.com>

For the speaker and DMICs configs this uses "DAC1 Playback Volume"
resp. "ADC Capture Volume" as main mixer elements, since there are
no other volume-controls in their paths.

For the (analog) headset-mic and headphones this used the analog
"IN1 Boost" resp. "HP Playback Volume" controls as main mixer elements
while using the  "ADC Capture Volume" resp. "DAC1 Playback Volume"
(which have the mute switches) as master mixer elements.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 ucm2/codecs/rt5672/DMIC1.conf       | 5 +++++
 ucm2/codecs/rt5672/DMIC2.conf       | 5 +++++
 ucm2/codecs/rt5672/HeadPhones.conf  | 3 +++
 ucm2/codecs/rt5672/HeadsetMic.conf  | 3 +++
 ucm2/codecs/rt5672/MonoSpeaker.conf | 5 +++++
 ucm2/codecs/rt5672/Speaker.conf     | 5 +++++
 6 files changed, 26 insertions(+)

diff --git a/ucm2/codecs/rt5672/DMIC1.conf b/ucm2/codecs/rt5672/DMIC1.conf
index 2018283..ca65d28 100644
--- a/ucm2/codecs/rt5672/DMIC1.conf
+++ b/ucm2/codecs/rt5672/DMIC1.conf
@@ -23,5 +23,10 @@ SectionDevice."Mic1" {
 	Value {
 		CapturePriority 100
 		CapturePCM "hw:${CardId}"
+		# The DMIC ofcourse has no analog volume controls
+		# Use the digital ADC master control as MixerElem
+		CaptureMixerElem "ADC"
+		CaptureVolume "ADC Capture Volume"
+		CaptureSwitch "ADC Capture Switch"
 	}
 }
diff --git a/ucm2/codecs/rt5672/DMIC2.conf b/ucm2/codecs/rt5672/DMIC2.conf
index 48e6170..2a2f9fe 100644
--- a/ucm2/codecs/rt5672/DMIC2.conf
+++ b/ucm2/codecs/rt5672/DMIC2.conf
@@ -23,5 +23,10 @@ SectionDevice."Mic2" {
 	Value {
 		CapturePriority 200
 		CapturePCM "hw:${CardId}"
+		# The DMIC ofcourse has no analog volume controls
+		# Use the digital ADC master control as MixerElem
+		CaptureMixerElem "ADC"
+		CaptureVolume "ADC Capture Volume"
+		CaptureSwitch "ADC Capture Switch"
 	}
 }
diff --git a/ucm2/codecs/rt5672/HeadPhones.conf b/ucm2/codecs/rt5672/HeadPhones.conf
index 2c8d6e8..e22d499 100644
--- a/ucm2/codecs/rt5672/HeadPhones.conf
+++ b/ucm2/codecs/rt5672/HeadPhones.conf
@@ -18,5 +18,8 @@ SectionDevice."Headphones" {
 		PlaybackPriority 300
 		PlaybackPCM "hw:${CardId}"
 		JackControl "Headphone Jack"
+		PlaybackMixerElem "HP"
+		PlaybackMasterElem "DAC1"
+		PlaybackVolume "HP Playback Volume"
 	}
 }
diff --git a/ucm2/codecs/rt5672/HeadsetMic.conf b/ucm2/codecs/rt5672/HeadsetMic.conf
index fc061b0..103e93d 100644
--- a/ucm2/codecs/rt5672/HeadsetMic.conf
+++ b/ucm2/codecs/rt5672/HeadsetMic.conf
@@ -26,5 +26,8 @@ SectionDevice."Headset" {
 		CapturePriority 300
 		CapturePCM "hw:${CardId}"
 		JackControl "Headset Mic Jack"
+		CaptureMixerElem "IN1 Boost"
+		CaptureMasterElem "ADC"
+		CaptureVolume "IN1 Boost Volume"
 	}
 }
diff --git a/ucm2/codecs/rt5672/MonoSpeaker.conf b/ucm2/codecs/rt5672/MonoSpeaker.conf
index f08c9c6..e4addf4 100644
--- a/ucm2/codecs/rt5672/MonoSpeaker.conf
+++ b/ucm2/codecs/rt5672/MonoSpeaker.conf
@@ -21,5 +21,10 @@ SectionDevice."Speaker2" {
 	Value {
 		PlaybackPriority 100
 		PlaybackPCM "hw:${CardId}"
+		# The speaker ampl. path on the 5672 has no speaker vol control
+		# Use the digital DAC1 master control as MixerElem
+		PlaybackMixerElem "DAC1"
+		PlaybackVolume "DAC1 Playback Volume"
+		PlaybackSwitch "DAC1 Playback Switch"
 	}
 }
diff --git a/ucm2/codecs/rt5672/Speaker.conf b/ucm2/codecs/rt5672/Speaker.conf
index 8b7bcf8..9674c6b 100644
--- a/ucm2/codecs/rt5672/Speaker.conf
+++ b/ucm2/codecs/rt5672/Speaker.conf
@@ -17,5 +17,10 @@ SectionDevice."Speaker1" {
 	Value {
 		PlaybackPriority 200
 		PlaybackPCM "hw:${CardId}"
+		# The speaker ampl. path on the 5672 has no speaker vol control
+		# Use the digital DAC1 master control as MixerElem
+		PlaybackMixerElem "DAC1"
+		PlaybackVolume "DAC1 Playback Volume"
+		PlaybackSwitch "DAC1 Playback Switch"
 	}
 }
-- 
2.30.1


  reply	other threads:[~2021-02-17 14:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17 14:34 [PATCH alsa-ucm-conf 1/2] codecs/rt5672: Move +12dB input boost from 'STO1 ADC Boost Gain' to 'ADC Capture Volume' Hans de Goede
2021-02-17 14:34 ` Hans de Goede [this message]
2021-03-13 15:47 ` Hans de Goede
2021-03-13 15:56   ` Jaroslav Kysela

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=20210217143436.74209-2-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bard.liao@intel.com \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).