All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH alsa-lib 1/3] chtnau8824: Fix mono speaker config not working
@ 2020-12-06 12:47 Hans de Goede
  2020-12-06 12:47 ` [PATCH alsa-lib 2/3] chtnau8824: Add support for laptops using stereo DMICs Hans de Goede
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Hans de Goede @ 2020-12-06 12:47 UTC (permalink / raw)
  To: Jaroslav Kysela, alsa-devel; +Cc: Hans de Goede

Fix the Speaker define / var being changed from "Speaker" to "MonoSpeaker"
not having any effect because the variable gets expanded before the if
making the change is interpreted.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 ucm2/chtnau8824/HiFi.conf | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/ucm2/chtnau8824/HiFi.conf b/ucm2/chtnau8824/HiFi.conf
index 3ccd6b1..d7a5f63 100644
--- a/ucm2/chtnau8824/HiFi.conf
+++ b/ucm2/chtnau8824/HiFi.conf
@@ -34,8 +34,15 @@ SectionVerb {
 	}
 }
 
-Include.spk.File "/codecs/nau8824/${var:Speaker}.conf"
-Include.hp.File "/codecs/nau8824/HeadPhones.conf"
+# The includes using $vars in there path must be conditional otherwise the
+# $var gets expanded before the other If-s above can change the vars.
+If.cfg-includes {
+	Condition { Type String Empty "" }
+	True {
+		Include.spk.File "/codecs/nau8824/${var:Speaker}.conf"
+		Include.hp.File "/codecs/nau8824/HeadPhones.conf"
 
-Include.mic.File "/codecs/nau8824/InternalMic.conf"
-Include.hsmic.File "/codecs/nau8824/HeadsetMic.conf"
+		Include.mic.File "/codecs/nau8824/InternalMic.conf"
+		Include.hsmic.File "/codecs/nau8824/HeadsetMic.conf"
+	}
+}
-- 
2.28.0


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

* [PATCH alsa-lib 2/3] chtnau8824: Add support for laptops using stereo DMICs
  2020-12-06 12:47 [PATCH alsa-lib 1/3] chtnau8824: Fix mono speaker config not working Hans de Goede
@ 2020-12-06 12:47 ` Hans de Goede
  2020-12-06 12:47 ` [PATCH alsa-lib 3/3] chtnau8824: Boost analog mic volumes a bit Hans de Goede
  2020-12-06 12:50 ` [PATCH alsa-lib 1/3] chtnau8824: Fix mono speaker config not working Hans de Goede
  2 siblings, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2020-12-06 12:47 UTC (permalink / raw)
  To: Jaroslav Kysela, alsa-devel; +Cc: Hans de Goede

The Medion E2228T uses a NAU8824 codec combined with stereo
DMICs, add support for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 ucm2/chtnau8824/HiFi.conf        | 16 +++++++++++++++-
 ucm2/codecs/nau8824/DMIC1_2.conf | 30 ++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 ucm2/codecs/nau8824/DMIC1_2.conf

diff --git a/ucm2/chtnau8824/HiFi.conf b/ucm2/chtnau8824/HiFi.conf
index d7a5f63..105f360 100644
--- a/ucm2/chtnau8824/HiFi.conf
+++ b/ucm2/chtnau8824/HiFi.conf
@@ -1,4 +1,5 @@
 Define.Speaker "Speaker"
+Define.Mic "InternalMic"
 
 If.cfg-mspk {
 	Condition {
@@ -11,6 +12,19 @@ If.cfg-mspk {
 	}
 }
 
+If.cfg-mic {
+	Condition {
+		Type RegexMatch
+		String "${CardLongName}"
+		# Medion E22??T models put DMIC in their product version
+		# when using DMICs
+		Regex "(MEDION-E22..T.*-DMIC-)"
+	}
+	True {
+		Define.Mic "DMIC1_2"
+	}
+}
+
 SectionVerb {
 
 	Value {
@@ -42,7 +56,7 @@ If.cfg-includes {
 		Include.spk.File "/codecs/nau8824/${var:Speaker}.conf"
 		Include.hp.File "/codecs/nau8824/HeadPhones.conf"
 
-		Include.mic.File "/codecs/nau8824/InternalMic.conf"
+		Include.mic.File "/codecs/nau8824/${var:Mic}.conf"
 		Include.hsmic.File "/codecs/nau8824/HeadsetMic.conf"
 	}
 }
diff --git a/ucm2/codecs/nau8824/DMIC1_2.conf b/ucm2/codecs/nau8824/DMIC1_2.conf
new file mode 100644
index 0000000..f54f671
--- /dev/null
+++ b/ucm2/codecs/nau8824/DMIC1_2.conf
@@ -0,0 +1,30 @@
+# Stereo DMICs on the DMIC1 and DMIC2 inputs
+
+SectionDevice."Mic" {
+	Comment "Internal Digital Microphones"
+
+	Value {
+		CapturePriority 200
+		CapturePCM "hw:${CardId}"
+	}
+
+	ConflictingDevice [
+		"Headset"
+	]
+
+	EnableSequence [
+		# Note needs to be swapped / swap is deliberate!
+		cset "name='ADC CH0 Select' 1"
+		cset "name='ADC CH1 Select' 0"
+
+		cset "name='Int Mic Switch' on"
+		cset "name='DMIC1 Enable Switch' on"
+		cset "name='DMIC2 Enable Switch' on"
+	]
+
+	DisableSequence [
+		cset "name='Int Mic Switch' off"
+		cset "name='DMIC1 Enable Switch' off"
+		cset "name='DMIC2 Enable Switch' off"
+	]
+}
-- 
2.28.0


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

* [PATCH alsa-lib 3/3] chtnau8824: Boost analog mic volumes a bit
  2020-12-06 12:47 [PATCH alsa-lib 1/3] chtnau8824: Fix mono speaker config not working Hans de Goede
  2020-12-06 12:47 ` [PATCH alsa-lib 2/3] chtnau8824: Add support for laptops using stereo DMICs Hans de Goede
@ 2020-12-06 12:47 ` Hans de Goede
  2020-12-06 12:50 ` [PATCH alsa-lib 1/3] chtnau8824: Fix mono speaker config not working Hans de Goede
  2 siblings, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2020-12-06 12:47 UTC (permalink / raw)
  To: Jaroslav Kysela, alsa-devel; +Cc: Hans de Goede

Both Mic1 (internal analog mic) and Mic2 (headset mic) are a bit soft
with the current settings, boost their volumes a bit.

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

diff --git a/ucm2/codecs/nau8824/EnableSeq.conf b/ucm2/codecs/nau8824/EnableSeq.conf
index 433e8e2..3650d06 100644
--- a/ucm2/codecs/nau8824/EnableSeq.conf
+++ b/ucm2/codecs/nau8824/EnableSeq.conf
@@ -7,8 +7,8 @@ EnableSequence [
 	cset "name='DMIC2 Enable Switch' off"
 	cset "name='DMIC3 Enable Switch' off"
 	cset "name='DMIC4 Enable Switch' off"
-	cset "name='MIC1 Volume' 10"
-	cset "name='MIC2 Volume' 10"
+	cset "name='MIC1 Volume' 14"
+	cset "name='MIC2 Volume' 14"
 	# Button Configuration
 	cset "name='THD for key media' 10"
 	cset "name='THD for key voice command' 16"
-- 
2.28.0


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

* Re: [PATCH alsa-lib 1/3] chtnau8824: Fix mono speaker config not working
  2020-12-06 12:47 [PATCH alsa-lib 1/3] chtnau8824: Fix mono speaker config not working Hans de Goede
  2020-12-06 12:47 ` [PATCH alsa-lib 2/3] chtnau8824: Add support for laptops using stereo DMICs Hans de Goede
  2020-12-06 12:47 ` [PATCH alsa-lib 3/3] chtnau8824: Boost analog mic volumes a bit Hans de Goede
@ 2020-12-06 12:50 ` Hans de Goede
  2020-12-14  8:23   ` Jaroslav Kysela
  2 siblings, 1 reply; 5+ messages in thread
From: Hans de Goede @ 2020-12-06 12:50 UTC (permalink / raw)
  To: Jaroslav Kysela, alsa-devel

Hi,

Patch prefix should have been "PATCH alsa-ucm-conf", I have fixed this in
my git config now, sorry about that.

Regards,

Hans

On 12/6/20 1:47 PM, Hans de Goede wrote:
> Fix the Speaker define / var being changed from "Speaker" to "MonoSpeaker"
> not having any effect because the variable gets expanded before the if
> making the change is interpreted.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  ucm2/chtnau8824/HiFi.conf | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/ucm2/chtnau8824/HiFi.conf b/ucm2/chtnau8824/HiFi.conf
> index 3ccd6b1..d7a5f63 100644
> --- a/ucm2/chtnau8824/HiFi.conf
> +++ b/ucm2/chtnau8824/HiFi.conf
> @@ -34,8 +34,15 @@ SectionVerb {
>  	}
>  }
>  
> -Include.spk.File "/codecs/nau8824/${var:Speaker}.conf"
> -Include.hp.File "/codecs/nau8824/HeadPhones.conf"
> +# The includes using $vars in there path must be conditional otherwise the
> +# $var gets expanded before the other If-s above can change the vars.
> +If.cfg-includes {
> +	Condition { Type String Empty "" }
> +	True {
> +		Include.spk.File "/codecs/nau8824/${var:Speaker}.conf"
> +		Include.hp.File "/codecs/nau8824/HeadPhones.conf"
>  
> -Include.mic.File "/codecs/nau8824/InternalMic.conf"
> -Include.hsmic.File "/codecs/nau8824/HeadsetMic.conf"
> +		Include.mic.File "/codecs/nau8824/InternalMic.conf"
> +		Include.hsmic.File "/codecs/nau8824/HeadsetMic.conf"
> +	}
> +}
> 


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

* Re: [PATCH alsa-lib 1/3] chtnau8824: Fix mono speaker config not working
  2020-12-06 12:50 ` [PATCH alsa-lib 1/3] chtnau8824: Fix mono speaker config not working Hans de Goede
@ 2020-12-14  8:23   ` Jaroslav Kysela
  0 siblings, 0 replies; 5+ messages in thread
From: Jaroslav Kysela @ 2020-12-14  8:23 UTC (permalink / raw)
  To: Hans de Goede, alsa-devel

Dne 06. 12. 20 v 13:50 Hans de Goede napsal(a):
> Hi,
> 
> Patch prefix should have been "PATCH alsa-ucm-conf", I have fixed this in
> my git config now, sorry about that.

Thanks for your patches. I applied them all to the alsa-ucm-conf repo.

				Jaroslav

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

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

end of thread, other threads:[~2020-12-14  8:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-06 12:47 [PATCH alsa-lib 1/3] chtnau8824: Fix mono speaker config not working Hans de Goede
2020-12-06 12:47 ` [PATCH alsa-lib 2/3] chtnau8824: Add support for laptops using stereo DMICs Hans de Goede
2020-12-06 12:47 ` [PATCH alsa-lib 3/3] chtnau8824: Boost analog mic volumes a bit Hans de Goede
2020-12-06 12:50 ` [PATCH alsa-lib 1/3] chtnau8824: Fix mono speaker config not working Hans de Goede
2020-12-14  8:23   ` Jaroslav Kysela

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.