alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH alsa-ucm-conf 1/2] codecs/rt5672: Move +12dB input boost from 'STO1 ADC Boost Gain' to 'ADC Capture Volume'
@ 2021-02-17 14:34 Hans de Goede
  2021-02-17 14:34 ` [PATCH alsa-ucm-conf 2/2] codecs/rt5672: Add hardware volume-control support Hans de Goede
  2021-03-13 15:47 ` [PATCH alsa-ucm-conf 1/2] codecs/rt5672: Move +12dB input boost from 'STO1 ADC Boost Gain' to 'ADC Capture Volume' Hans de Goede
  0 siblings, 2 replies; 4+ messages in thread
From: Hans de Goede @ 2021-02-17 14:34 UTC (permalink / raw)
  To: Jaroslav Kysela
  Cc: Hans de Goede, alsa-devel, Pierre-Louis Bossart, Bard Liao

Both the 'STO1 ADC Boost Gain' and the 'ADC Capture Volume' controls are
digital and the 'ADC Capture Volume' control goes up to +30dB.

When adding hw-volume-control support adding the +12dB boost gain on to of
the max +30dB of 'ADC Capture Volume' is a bit too much.

So move the +12dB from the 'STO1 ADC Boost Gain' control to the
'ADC Capture Volume' control.

This way we keep the same setting for userspace which does not support
hw-volume-control, while getting a better range when we start using
'ADC Capture Volume' as hw-volume-control.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 ucm2/codecs/rt5672/EnableSeq.conf | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/ucm2/codecs/rt5672/EnableSeq.conf b/ucm2/codecs/rt5672/EnableSeq.conf
index ddfb1c7..e373275 100644
--- a/ucm2/codecs/rt5672/EnableSeq.conf
+++ b/ucm2/codecs/rt5672/EnableSeq.conf
@@ -26,14 +26,13 @@ EnableSequence [
 	# cset "name='LOUT MIX OUTMIX L Switch' on"
 	# cset "name='LOUT MIX OUTMIX R Switch' on"
 
-	# 47=0dB, 0.375 dB/step
-	cset "name='ADC Capture Volume' 47"
+	# Both the DMICs and the headset mic (even with the 20dB boost below)
+	# are quite soft, set the default capture volume to +12dB
+	# 47=0dB, 0.375dB/step, 79=+12dB
+	cset "name='ADC Capture Volume' 79"
 	cset "name='ADC Capture Switch' on"
-
-	# Both the DMICs and the headset mic (even with the 20 dB boost below)
-	# are quite soft, set the ADC Boost gain (range 0-3) to 1 = 12 dB the
-	# next step is 24 dB which is a bit too much
-	cset "name='STO1 ADC Boost Gain Volume' 1"
+	# 0=0dB
+	cset "name='STO1 ADC Boost Gain Volume' 0"
 
 	# Headset mic is quite soft, boost it a bit, 1 = 20dB which is the first
 	# available boost step
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH alsa-ucm-conf 2/2] codecs/rt5672: Add hardware volume-control support
  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
  2021-03-13 15:47 ` [PATCH alsa-ucm-conf 1/2] codecs/rt5672: Move +12dB input boost from 'STO1 ADC Boost Gain' to 'ADC Capture Volume' Hans de Goede
  1 sibling, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2021-02-17 14:34 UTC (permalink / raw)
  To: Jaroslav Kysela
  Cc: Hans de Goede, alsa-devel, Pierre-Louis Bossart, Bard Liao

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH alsa-ucm-conf 1/2] codecs/rt5672: Move +12dB input boost from 'STO1 ADC Boost Gain' to 'ADC Capture Volume'
  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 ` [PATCH alsa-ucm-conf 2/2] codecs/rt5672: Add hardware volume-control support Hans de Goede
@ 2021-03-13 15:47 ` Hans de Goede
  2021-03-13 15:56   ` Jaroslav Kysela
  1 sibling, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2021-03-13 15:47 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel, Pierre-Louis Bossart, Bard Liao

Hi,

On 2/17/21 3:34 PM, Hans de Goede wrote:
> Both the 'STO1 ADC Boost Gain' and the 'ADC Capture Volume' controls are
> digital and the 'ADC Capture Volume' control goes up to +30dB.
> 
> When adding hw-volume-control support adding the +12dB boost gain on to of
> the max +30dB of 'ADC Capture Volume' is a bit too much.
> 
> So move the +12dB from the 'STO1 ADC Boost Gain' control to the
> 'ADC Capture Volume' control.
> 
> This way we keep the same setting for userspace which does not support
> hw-volume-control, while getting a better range when we start using
> 'ADC Capture Volume' as hw-volume-control.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Ping? This series seems to have fallen through the cracks, AFAIK
there is nothing blocking this series from getting merged.

If you want a resend let me know and I'll resubmit.

Regards,

Hans


> ---
>  ucm2/codecs/rt5672/EnableSeq.conf | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/ucm2/codecs/rt5672/EnableSeq.conf b/ucm2/codecs/rt5672/EnableSeq.conf
> index ddfb1c7..e373275 100644
> --- a/ucm2/codecs/rt5672/EnableSeq.conf
> +++ b/ucm2/codecs/rt5672/EnableSeq.conf
> @@ -26,14 +26,13 @@ EnableSequence [
>  	# cset "name='LOUT MIX OUTMIX L Switch' on"
>  	# cset "name='LOUT MIX OUTMIX R Switch' on"
>  
> -	# 47=0dB, 0.375 dB/step
> -	cset "name='ADC Capture Volume' 47"
> +	# Both the DMICs and the headset mic (even with the 20dB boost below)
> +	# are quite soft, set the default capture volume to +12dB
> +	# 47=0dB, 0.375dB/step, 79=+12dB
> +	cset "name='ADC Capture Volume' 79"
>  	cset "name='ADC Capture Switch' on"
> -
> -	# Both the DMICs and the headset mic (even with the 20 dB boost below)
> -	# are quite soft, set the ADC Boost gain (range 0-3) to 1 = 12 dB the
> -	# next step is 24 dB which is a bit too much
> -	cset "name='STO1 ADC Boost Gain Volume' 1"
> +	# 0=0dB
> +	cset "name='STO1 ADC Boost Gain Volume' 0"
>  
>  	# Headset mic is quite soft, boost it a bit, 1 = 20dB which is the first
>  	# available boost step
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH alsa-ucm-conf 1/2] codecs/rt5672: Move +12dB input boost from 'STO1 ADC Boost Gain' to 'ADC Capture Volume'
  2021-03-13 15:47 ` [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-03-13 15:56   ` Jaroslav Kysela
  0 siblings, 0 replies; 4+ messages in thread
From: Jaroslav Kysela @ 2021-03-13 15:56 UTC (permalink / raw)
  To: Hans de Goede; +Cc: alsa-devel, Pierre-Louis Bossart, Bard Liao

Dne 13. 03. 21 v 16:47 Hans de Goede napsal(a):
> Hi,
> 
> On 2/17/21 3:34 PM, Hans de Goede wrote:
>> Both the 'STO1 ADC Boost Gain' and the 'ADC Capture Volume' controls are
>> digital and the 'ADC Capture Volume' control goes up to +30dB.
>>
>> When adding hw-volume-control support adding the +12dB boost gain on to of
>> the max +30dB of 'ADC Capture Volume' is a bit too much.
>>
>> So move the +12dB from the 'STO1 ADC Boost Gain' control to the
>> 'ADC Capture Volume' control.
>>
>> This way we keep the same setting for userspace which does not support
>> hw-volume-control, while getting a better range when we start using
>> 'ADC Capture Volume' as hw-volume-control.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> 
> Ping? This series seems to have fallen through the cracks, AFAIK
> there is nothing blocking this series from getting merged.

Yep, it was somehow lost on my side. It's merged now. Thank you.

				Jaroslav

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-13 15:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH alsa-ucm-conf 2/2] codecs/rt5672: Add hardware volume-control support Hans de Goede
2021-03-13 15:47 ` [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-03-13 15:56   ` Jaroslav Kysela

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).