All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] bytcr-rt5640: Fix DMIC1 not working when connected over AIF2
@ 2020-06-08 20:21 Hans de Goede
  2020-06-08 20:21 ` [PATCH 2/3] bytcr-rt5651: Fix high noise level + soft input on DMIC Hans de Goede
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Hans de Goede @ 2020-06-08 20:21 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: Hans de Goede, alsa-devel

The RT5640 codec has 2 ADC-s which are caled the Stereo ADC and the
Mono ADC (even though the mono ADC seems to be stereo too?). The Stereo
ADC is connected to the AIF1 interface of the codec and the Mono ADC
to the AIF2 interface.

Almost all X86 BYT/CHT design use the AIF1 interface, but a few models
use the AIF2 interface. For this reason the IN?-InternalMic.conf bits
not only select/enable the microphone input on the Stereo ADC, but
also on the Mono ADC, so that the analog mic. inputs also work in devices
using the AIF2 interface.

Before this commit DigitalMics.conf was only setting up the DMIC input
on the Stereo ADC and not on the Mono ADC, causing DMIC1 to not work
when connected over AIF2.

This commit adds selecting / enabling DMIC1 on the Mono ADC.
This fixes the internal microphone not working on the Toshiba Encore WT10A.

Note that for devices which use the AIF1 interface this is a no-op since
the AIF1 interface is not connected to anything, there is no complete
chain so DAPM will not enable any of the elements in the chain.

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

diff --git a/ucm2/codecs/rt5640/DigitalMics.conf b/ucm2/codecs/rt5640/DigitalMics.conf
index 503c4a9..fdd412f 100644
--- a/ucm2/codecs/rt5640/DigitalMics.conf
+++ b/ucm2/codecs/rt5640/DigitalMics.conf
@@ -6,6 +6,9 @@ SectionDevice."Mic" {
 	]
 
 	EnableSequence [
+		cset "name='Mono ADC MIXL ADC2 Switch' on"
+		cset "name='Mono ADC MIXR ADC2 Switch' on"
+		cset "name='Mono ADC Capture Switch' on"
 		cset "name='Stereo ADC MIXL ADC2 Switch' on"
 		cset "name='Stereo ADC MIXR ADC2 Switch' on"
 		cset "name='Internal Mic Switch' on"
@@ -13,6 +16,9 @@ SectionDevice."Mic" {
 	]
 
 	DisableSequence [
+		cset "name='Mono ADC MIXL ADC2 Switch' off"
+		cset "name='Mono ADC MIXR ADC2 Switch' off"
+		cset "name='Mono ADC Capture Switch' off"
 		cset "name='Stereo ADC MIXL ADC2 Switch' off"
 		cset "name='Stereo ADC MIXR ADC2 Switch' off"
 		cset "name='Internal Mic Switch' off"
-- 
2.26.2


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

* [PATCH 2/3] bytcr-rt5651: Fix high noise level + soft input on DMIC
  2020-06-08 20:21 [PATCH 1/3] bytcr-rt5640: Fix DMIC1 not working when connected over AIF2 Hans de Goede
@ 2020-06-08 20:21 ` Hans de Goede
  2020-06-09  8:50   ` Jaroslav Kysela
  2020-06-08 20:21 ` [PATCH 3/3] chtrt5645: Add ASUSTeKCOMPUTERINC.-T101HA-1.0.conf symlink to chtrt5645-dmic1.conf Hans de Goede
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Hans de Goede @ 2020-06-08 20:21 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: Hans de Goede, alsa-devel

The DMIC needs to have the DMIC ASRC enabled, otherwise capturing audio
from it results in mostly capturing noise + the actual recorded voice
very soft in the background of the noise.

This has been tested on a Point of View P1006W v1.0 tablet, which is the
only RT5651 X86 device using a DMIC that I am aware of.

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

diff --git a/ucm2/codecs/rt5651/DigitalMic.conf b/ucm2/codecs/rt5651/DigitalMic.conf
index aa40c1c..d21b21d 100644
--- a/ucm2/codecs/rt5651/DigitalMic.conf
+++ b/ucm2/codecs/rt5651/DigitalMic.conf
@@ -4,12 +4,14 @@ SectionDevice."Mic" {
 	EnableSequence [
 		cset "name='Stereo1 ADC MIXL ADC2 Switch' on"
 		cset "name='Stereo1 ADC MIXR ADC2 Switch' on"
+		cset "name='DMIC ASRC Switch' on"
 		cset "name='Internal Mic Switch' on"
 	]
 
 	DisableSequence [
 		cset "name='Stereo1 ADC MIXL ADC2 Switch' off"
 		cset "name='Stereo1 ADC MIXR ADC2 Switch' off"
+		cset "name='DMIC ASRC Switch' off"
 		cset "name='Internal Mic Switch' off"
 	]
 
-- 
2.26.2


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

* [PATCH 3/3] chtrt5645: Add ASUSTeKCOMPUTERINC.-T101HA-1.0.conf symlink to chtrt5645-dmic1.conf
  2020-06-08 20:21 [PATCH 1/3] bytcr-rt5640: Fix DMIC1 not working when connected over AIF2 Hans de Goede
  2020-06-08 20:21 ` [PATCH 2/3] bytcr-rt5651: Fix high noise level + soft input on DMIC Hans de Goede
@ 2020-06-08 20:21 ` Hans de Goede
  2020-06-09  8:50   ` Jaroslav Kysela
  2020-06-08 21:44 ` [PATCH 1/3] bytcr-rt5640: Fix DMIC1 not working when connected over AIF2 Pierre-Louis Bossart
  2020-06-09  8:50 ` Jaroslav Kysela
  3 siblings, 1 reply; 7+ messages in thread
From: Hans de Goede @ 2020-06-08 20:21 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: Hans de Goede, alsa-devel

The Asus T101HA uses a digital mic connected to the dmic1 pin, rather then
the default analog mic on in2 (just like the Asus T100HA).

Add a long name symlink to chtrt5645-dmic1.conf for this, so that
the right config is used.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 ucm2/chtrt5645/ASUSTeKCOMPUTERINC.-T101HA-1.0.conf | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 ucm2/chtrt5645/ASUSTeKCOMPUTERINC.-T101HA-1.0.conf

diff --git a/ucm2/chtrt5645/ASUSTeKCOMPUTERINC.-T101HA-1.0.conf b/ucm2/chtrt5645/ASUSTeKCOMPUTERINC.-T101HA-1.0.conf
new file mode 120000
index 0000000..b4d2816
--- /dev/null
+++ b/ucm2/chtrt5645/ASUSTeKCOMPUTERINC.-T101HA-1.0.conf
@@ -0,0 +1 @@
+chtrt5645-dmic1.conf
\ No newline at end of file
-- 
2.26.2


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

* Re: [PATCH 1/3] bytcr-rt5640: Fix DMIC1 not working when connected over AIF2
  2020-06-08 20:21 [PATCH 1/3] bytcr-rt5640: Fix DMIC1 not working when connected over AIF2 Hans de Goede
  2020-06-08 20:21 ` [PATCH 2/3] bytcr-rt5651: Fix high noise level + soft input on DMIC Hans de Goede
  2020-06-08 20:21 ` [PATCH 3/3] chtrt5645: Add ASUSTeKCOMPUTERINC.-T101HA-1.0.conf symlink to chtrt5645-dmic1.conf Hans de Goede
@ 2020-06-08 21:44 ` Pierre-Louis Bossart
  2020-06-09  8:50 ` Jaroslav Kysela
  3 siblings, 0 replies; 7+ messages in thread
From: Pierre-Louis Bossart @ 2020-06-08 21:44 UTC (permalink / raw)
  To: Hans de Goede, Jaroslav Kysela; +Cc: alsa-devel



On 6/8/20 3:21 PM, Hans de Goede wrote:
> The RT5640 codec has 2 ADC-s which are caled the Stereo ADC and the
> Mono ADC (even though the mono ADC seems to be stereo too?). The Stereo
> ADC is connected to the AIF1 interface of the codec and the Mono ADC
> to the AIF2 interface.
> 
> Almost all X86 BYT/CHT design use the AIF1 interface, but a few models
> use the AIF2 interface. For this reason the IN?-InternalMic.conf bits
> not only select/enable the microphone input on the Stereo ADC, but
> also on the Mono ADC, so that the analog mic. inputs also work in devices
> using the AIF2 interface.
> 
> Before this commit DigitalMics.conf was only setting up the DMIC input
> on the Stereo ADC and not on the Mono ADC, causing DMIC1 to not work
> when connected over AIF2.
> 
> This commit adds selecting / enabling DMIC1 on the Mono ADC.
> This fixes the internal microphone not working on the Toshiba Encore WT10A.
> 
> Note that for devices which use the AIF1 interface this is a no-op since
> the AIF1 interface is not connected to anything, there is no complete
> chain so DAPM will not enable any of the elements in the chain.

Sounds good to me.

For the series

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>   ucm2/codecs/rt5640/DigitalMics.conf | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/ucm2/codecs/rt5640/DigitalMics.conf b/ucm2/codecs/rt5640/DigitalMics.conf
> index 503c4a9..fdd412f 100644
> --- a/ucm2/codecs/rt5640/DigitalMics.conf
> +++ b/ucm2/codecs/rt5640/DigitalMics.conf
> @@ -6,6 +6,9 @@ SectionDevice."Mic" {
>   	]
>   
>   	EnableSequence [
> +		cset "name='Mono ADC MIXL ADC2 Switch' on"
> +		cset "name='Mono ADC MIXR ADC2 Switch' on"
> +		cset "name='Mono ADC Capture Switch' on"
>   		cset "name='Stereo ADC MIXL ADC2 Switch' on"
>   		cset "name='Stereo ADC MIXR ADC2 Switch' on"
>   		cset "name='Internal Mic Switch' on"
> @@ -13,6 +16,9 @@ SectionDevice."Mic" {
>   	]
>   
>   	DisableSequence [
> +		cset "name='Mono ADC MIXL ADC2 Switch' off"
> +		cset "name='Mono ADC MIXR ADC2 Switch' off"
> +		cset "name='Mono ADC Capture Switch' off"
>   		cset "name='Stereo ADC MIXL ADC2 Switch' off"
>   		cset "name='Stereo ADC MIXR ADC2 Switch' off"
>   		cset "name='Internal Mic Switch' off"
> 

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

* Re: [PATCH 1/3] bytcr-rt5640: Fix DMIC1 not working when connected over AIF2
  2020-06-08 20:21 [PATCH 1/3] bytcr-rt5640: Fix DMIC1 not working when connected over AIF2 Hans de Goede
                   ` (2 preceding siblings ...)
  2020-06-08 21:44 ` [PATCH 1/3] bytcr-rt5640: Fix DMIC1 not working when connected over AIF2 Pierre-Louis Bossart
@ 2020-06-09  8:50 ` Jaroslav Kysela
  3 siblings, 0 replies; 7+ messages in thread
From: Jaroslav Kysela @ 2020-06-09  8:50 UTC (permalink / raw)
  To: Hans de Goede; +Cc: alsa-devel

Dne 08. 06. 20 v 22:21 Hans de Goede napsal(a):
> The RT5640 codec has 2 ADC-s which are caled the Stereo ADC and the
> Mono ADC (even though the mono ADC seems to be stereo too?). The Stereo
> ADC is connected to the AIF1 interface of the codec and the Mono ADC
> to the AIF2 interface.
> 
> Almost all X86 BYT/CHT design use the AIF1 interface, but a few models
> use the AIF2 interface. For this reason the IN?-InternalMic.conf bits
> not only select/enable the microphone input on the Stereo ADC, but
> also on the Mono ADC, so that the analog mic. inputs also work in devices
> using the AIF2 interface.
> 
> Before this commit DigitalMics.conf was only setting up the DMIC input
> on the Stereo ADC and not on the Mono ADC, causing DMIC1 to not work
> when connected over AIF2.
> 
> This commit adds selecting / enabling DMIC1 on the Mono ADC.
> This fixes the internal microphone not working on the Toshiba Encore WT10A.
> 
> Note that for devices which use the AIF1 interface this is a no-op since
> the AIF1 interface is not connected to anything, there is no complete
> chain so DAPM will not enable any of the elements in the chain.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---

Applied to the alsa-ucm-conf repo. Thank you.

						Jaroslav

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

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

* Re: [PATCH 3/3] chtrt5645: Add ASUSTeKCOMPUTERINC.-T101HA-1.0.conf symlink to chtrt5645-dmic1.conf
  2020-06-08 20:21 ` [PATCH 3/3] chtrt5645: Add ASUSTeKCOMPUTERINC.-T101HA-1.0.conf symlink to chtrt5645-dmic1.conf Hans de Goede
@ 2020-06-09  8:50   ` Jaroslav Kysela
  0 siblings, 0 replies; 7+ messages in thread
From: Jaroslav Kysela @ 2020-06-09  8:50 UTC (permalink / raw)
  To: Hans de Goede; +Cc: alsa-devel

Dne 08. 06. 20 v 22:21 Hans de Goede napsal(a):
> The Asus T101HA uses a digital mic connected to the dmic1 pin, rather then
> the default analog mic on in2 (just like the Asus T100HA).
> 
> Add a long name symlink to chtrt5645-dmic1.conf for this, so that
> the right config is used.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>   ucm2/chtrt5645/ASUSTeKCOMPUTERINC.-T101HA-1.0.conf | 1 +
>   1 file changed, 1 insertion(+)
>   create mode 120000 ucm2/chtrt5645/ASUSTeKCOMPUTERINC.-T101HA-1.0.conf
> 
> diff --git a/ucm2/chtrt5645/ASUSTeKCOMPUTERINC.-T101HA-1.0.conf b/ucm2/chtrt5645/ASUSTeKCOMPUTERINC.-T101HA-1.0.conf
> new file mode 120000
> index 0000000..b4d2816
> --- /dev/null
> +++ b/ucm2/chtrt5645/ASUSTeKCOMPUTERINC.-T101HA-1.0.conf
> @@ -0,0 +1 @@
> +chtrt5645-dmic1.conf
> \ No newline at end of file
> 

Applied to the alsa-ucm-conf repo. Thank you.

						Jaroslav

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

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

* Re: [PATCH 2/3] bytcr-rt5651: Fix high noise level + soft input on DMIC
  2020-06-08 20:21 ` [PATCH 2/3] bytcr-rt5651: Fix high noise level + soft input on DMIC Hans de Goede
@ 2020-06-09  8:50   ` Jaroslav Kysela
  0 siblings, 0 replies; 7+ messages in thread
From: Jaroslav Kysela @ 2020-06-09  8:50 UTC (permalink / raw)
  To: Hans de Goede; +Cc: alsa-devel

Dne 08. 06. 20 v 22:21 Hans de Goede napsal(a):
> The DMIC needs to have the DMIC ASRC enabled, otherwise capturing audio
> from it results in mostly capturing noise + the actual recorded voice
> very soft in the background of the noise.
> 
> This has been tested on a Point of View P1006W v1.0 tablet, which is the
> only RT5651 X86 device using a DMIC that I am aware of.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>   ucm2/codecs/rt5651/DigitalMic.conf | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/ucm2/codecs/rt5651/DigitalMic.conf b/ucm2/codecs/rt5651/DigitalMic.conf
> index aa40c1c..d21b21d 100644
> --- a/ucm2/codecs/rt5651/DigitalMic.conf
> +++ b/ucm2/codecs/rt5651/DigitalMic.conf
> @@ -4,12 +4,14 @@ SectionDevice."Mic" {
>   	EnableSequence [
>   		cset "name='Stereo1 ADC MIXL ADC2 Switch' on"
>   		cset "name='Stereo1 ADC MIXR ADC2 Switch' on"
> +		cset "name='DMIC ASRC Switch' on"
>   		cset "name='Internal Mic Switch' on"
>   	]
>   
>   	DisableSequence [
>   		cset "name='Stereo1 ADC MIXL ADC2 Switch' off"
>   		cset "name='Stereo1 ADC MIXR ADC2 Switch' off"
> +		cset "name='DMIC ASRC Switch' off"
>   		cset "name='Internal Mic Switch' off"
>   	]
>   
> 

Applied to the alsa-ucm-conf repo. Thank you.

						Jaroslav

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

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

end of thread, other threads:[~2020-06-09  8:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-08 20:21 [PATCH 1/3] bytcr-rt5640: Fix DMIC1 not working when connected over AIF2 Hans de Goede
2020-06-08 20:21 ` [PATCH 2/3] bytcr-rt5651: Fix high noise level + soft input on DMIC Hans de Goede
2020-06-09  8:50   ` Jaroslav Kysela
2020-06-08 20:21 ` [PATCH 3/3] chtrt5645: Add ASUSTeKCOMPUTERINC.-T101HA-1.0.conf symlink to chtrt5645-dmic1.conf Hans de Goede
2020-06-09  8:50   ` Jaroslav Kysela
2020-06-08 21:44 ` [PATCH 1/3] bytcr-rt5640: Fix DMIC1 not working when connected over AIF2 Pierre-Louis Bossart
2020-06-09  8:50 ` 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.