alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH alsa-ucm-conf 1/3] chtnau8824: Move DAC Channel Source selection to Speaker/Headphones EnableSeq
@ 2020-12-16 15:38 Hans de Goede
  2020-12-16 15:38 ` [PATCH alsa-ucm-conf 2/3] chtnau8824: Add a SST define/variable Hans de Goede
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Hans de Goede @ 2020-12-16 15:38 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: Hans de Goede, alsa-devel, Pierre-Louis Bossart

Move DAC Channel Source selection to Speaker/Headphones EnableSeq.

The main reason for doing this is to make it easier to allow using
variables, as the Speaker/Headphones conf files are evaluated after
the main HiFi.conf had a chance to set them.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 ucm2/codecs/nau8824/EnableSeq.conf   | 3 ---
 ucm2/codecs/nau8824/HeadPhones.conf  | 2 ++
 ucm2/codecs/nau8824/MonoSpeaker.conf | 2 ++
 ucm2/codecs/nau8824/Speaker.conf     | 2 ++
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/ucm2/codecs/nau8824/EnableSeq.conf b/ucm2/codecs/nau8824/EnableSeq.conf
index 3650d06..2595e5f 100644
--- a/ucm2/codecs/nau8824/EnableSeq.conf
+++ b/ucm2/codecs/nau8824/EnableSeq.conf
@@ -1,7 +1,4 @@
 EnableSequence [
-	# Playback TDM configuration
-	cset "name='DACL Channel Source' 0"
-	cset "name='DACR Channel Source' 1"
 	# Input Configuration
 	cset "name='DMIC1 Enable Switch' off"
 	cset "name='DMIC2 Enable Switch' off"
diff --git a/ucm2/codecs/nau8824/HeadPhones.conf b/ucm2/codecs/nau8824/HeadPhones.conf
index a807f84..46ec5d7 100644
--- a/ucm2/codecs/nau8824/HeadPhones.conf
+++ b/ucm2/codecs/nau8824/HeadPhones.conf
@@ -12,6 +12,8 @@ SectionDevice."Headphones" {
 	]
 
 	EnableSequence [
+		cset "name='DACL Channel Source' 0"
+		cset "name='DACR Channel Source' 1"
 		cset "name='Headphone Switch' on"
 	]
 
diff --git a/ucm2/codecs/nau8824/MonoSpeaker.conf b/ucm2/codecs/nau8824/MonoSpeaker.conf
index 6b4ef8a..09edea5 100644
--- a/ucm2/codecs/nau8824/MonoSpeaker.conf
+++ b/ucm2/codecs/nau8824/MonoSpeaker.conf
@@ -11,6 +11,8 @@ SectionDevice."Speaker" {
 	]
 
 	EnableSequence [
+		cset "name='DACL Channel Source' 0"
+		cset "name='DACR Channel Source' 1"
 		# nau8824 mono speaker boards have the speaker on the right chan
 		cset "name='Speaker Left DACL Volume' 0"
 		cset "name='Speaker Left DACR Volume' 0"
diff --git a/ucm2/codecs/nau8824/Speaker.conf b/ucm2/codecs/nau8824/Speaker.conf
index a995873..64d7eee 100644
--- a/ucm2/codecs/nau8824/Speaker.conf
+++ b/ucm2/codecs/nau8824/Speaker.conf
@@ -11,6 +11,8 @@ SectionDevice."Speaker" {
 	]
 
 	EnableSequence [
+		cset "name='DACL Channel Source' 0"
+		cset "name='DACR Channel Source' 1"
 		cset "name='Speaker Left DACL Volume' 1"
 		cset "name='Speaker Left DACR Volume' 0"
 		cset "name='Speaker Right DACL Volume' 0"
-- 
2.28.0


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

* [PATCH alsa-ucm-conf 2/3] chtnau8824: Add a SST define/variable
  2020-12-16 15:38 [PATCH alsa-ucm-conf 1/3] chtnau8824: Move DAC Channel Source selection to Speaker/Headphones EnableSeq Hans de Goede
@ 2020-12-16 15:38 ` Hans de Goede
  2020-12-16 15:38 ` [PATCH alsa-ucm-conf 3/3] chtnau8824: Add support for using the SOF driver Hans de Goede
  2021-01-17 16:09 ` [PATCH alsa-ucm-conf 1/3] chtnau8824: Move DAC Channel Source selection to Speaker/Headphones EnableSeq Hans de Goede
  2 siblings, 0 replies; 7+ messages in thread
From: Hans de Goede @ 2020-12-16 15:38 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: Hans de Goede, alsa-devel, Pierre-Louis Bossart

Add a SST define which gets set to "yes" when using the SST driver
and to "" when not using the SST driver;

And decide if platforms/bytcr/PlatformEnableSeq.conf should be included
or not based on this.

This is a preparation patch for adding SOF support.

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

diff --git a/ucm2/chtnau8824/HiFi.conf b/ucm2/chtnau8824/HiFi.conf
index 105f360..b36588f 100644
--- a/ucm2/chtnau8824/HiFi.conf
+++ b/ucm2/chtnau8824/HiFi.conf
@@ -1,5 +1,16 @@
 Define.Speaker "Speaker"
 Define.Mic "InternalMic"
+Define.SST "yes"
+
+If.Controls {
+	Condition {
+		Type ControlExists
+		Control "name='media0_in Gain 0 Switch'"
+	}
+	False {
+		Define.SST ""
+	}
+}
 
 If.cfg-mspk {
 	Condition {
@@ -33,12 +44,12 @@ SectionVerb {
 
 	Include.e.File "/codecs/nau8824/EnableSeq.conf"
 
-	If.Controls {
+	If.SST {
 		Condition {
-			Type ControlExists
-			Control "name='media0_in Gain 0 Switch'"
+			Type String
+			Empty "${var:SST}"
 		}
-		True {
+		False {
 			Include.pe {
 				File "/platforms/bytcr/PlatformEnableSeq.conf"
 				Before.EnableSequence "0"
-- 
2.28.0


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

* [PATCH alsa-ucm-conf 3/3] chtnau8824: Add support for using the SOF driver
  2020-12-16 15:38 [PATCH alsa-ucm-conf 1/3] chtnau8824: Move DAC Channel Source selection to Speaker/Headphones EnableSeq Hans de Goede
  2020-12-16 15:38 ` [PATCH alsa-ucm-conf 2/3] chtnau8824: Add a SST define/variable Hans de Goede
@ 2020-12-16 15:38 ` Hans de Goede
  2021-01-17 16:09 ` [PATCH alsa-ucm-conf 1/3] chtnau8824: Move DAC Channel Source selection to Speaker/Headphones EnableSeq Hans de Goede
  2 siblings, 0 replies; 7+ messages in thread
From: Hans de Goede @ 2020-12-16 15:38 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: Hans de Goede, alsa-devel, Pierre-Louis Bossart

The old (and currently the default) SST driver uses TDM 4 slots 24 bit
as wire format to the codec. Where as the new SOF driver uses standard
I2S 2 channel 24 bit.

Normally this should not impact the UCM settings, but on the NAU8824
the "DAC Right Channel Source" mixer setting must be set to 1 when
using TDM 4 slots and to 0 when using I2S 2 channel mode.

Getting this wrong (in either case) results in the right channel not
outputting any sound.

This commit introduces a RightOutputChannel variable which gets
set to 0/1 depending on the driver and then uses that for the
"DAC Right Channel Source" mixer setting so that we do the right
thing depending on the driver.

This has been tested on the following devices:

Medion E2215T:    Stereo speakers, analog mic
Medion E2228T:    Stereo speakers, stereo digital mics
Cube iWork 8 Air: Mono speaker, analog mic

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 ucm2/chtnau8824/HiFi.conf            | 2 ++
 ucm2/codecs/nau8824/HeadPhones.conf  | 2 +-
 ucm2/codecs/nau8824/MonoSpeaker.conf | 2 +-
 ucm2/codecs/nau8824/Speaker.conf     | 2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/ucm2/chtnau8824/HiFi.conf b/ucm2/chtnau8824/HiFi.conf
index b36588f..7e6669c 100644
--- a/ucm2/chtnau8824/HiFi.conf
+++ b/ucm2/chtnau8824/HiFi.conf
@@ -1,6 +1,7 @@
 Define.Speaker "Speaker"
 Define.Mic "InternalMic"
 Define.SST "yes"
+Define.RightOutputChannel "1"
 
 If.Controls {
 	Condition {
@@ -9,6 +10,7 @@ If.Controls {
 	}
 	False {
 		Define.SST ""
+		Define.RightOutputChannel "0"
 	}
 }
 
diff --git a/ucm2/codecs/nau8824/HeadPhones.conf b/ucm2/codecs/nau8824/HeadPhones.conf
index 46ec5d7..81e6f1e 100644
--- a/ucm2/codecs/nau8824/HeadPhones.conf
+++ b/ucm2/codecs/nau8824/HeadPhones.conf
@@ -13,7 +13,7 @@ SectionDevice."Headphones" {
 
 	EnableSequence [
 		cset "name='DACL Channel Source' 0"
-		cset "name='DACR Channel Source' 1"
+		cset "name='DACR Channel Source' ${var:RightOutputChannel}"
 		cset "name='Headphone Switch' on"
 	]
 
diff --git a/ucm2/codecs/nau8824/MonoSpeaker.conf b/ucm2/codecs/nau8824/MonoSpeaker.conf
index 09edea5..098bf03 100644
--- a/ucm2/codecs/nau8824/MonoSpeaker.conf
+++ b/ucm2/codecs/nau8824/MonoSpeaker.conf
@@ -12,7 +12,7 @@ SectionDevice."Speaker" {
 
 	EnableSequence [
 		cset "name='DACL Channel Source' 0"
-		cset "name='DACR Channel Source' 1"
+		cset "name='DACR Channel Source' ${var:RightOutputChannel}"
 		# nau8824 mono speaker boards have the speaker on the right chan
 		cset "name='Speaker Left DACL Volume' 0"
 		cset "name='Speaker Left DACR Volume' 0"
diff --git a/ucm2/codecs/nau8824/Speaker.conf b/ucm2/codecs/nau8824/Speaker.conf
index 64d7eee..065a577 100644
--- a/ucm2/codecs/nau8824/Speaker.conf
+++ b/ucm2/codecs/nau8824/Speaker.conf
@@ -12,7 +12,7 @@ SectionDevice."Speaker" {
 
 	EnableSequence [
 		cset "name='DACL Channel Source' 0"
-		cset "name='DACR Channel Source' 1"
+		cset "name='DACR Channel Source' ${var:RightOutputChannel}"
 		cset "name='Speaker Left DACL Volume' 1"
 		cset "name='Speaker Left DACR Volume' 0"
 		cset "name='Speaker Right DACL Volume' 0"
-- 
2.28.0


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

* Re: [PATCH alsa-ucm-conf 1/3] chtnau8824: Move DAC Channel Source selection to Speaker/Headphones EnableSeq
  2020-12-16 15:38 [PATCH alsa-ucm-conf 1/3] chtnau8824: Move DAC Channel Source selection to Speaker/Headphones EnableSeq Hans de Goede
  2020-12-16 15:38 ` [PATCH alsa-ucm-conf 2/3] chtnau8824: Add a SST define/variable Hans de Goede
  2020-12-16 15:38 ` [PATCH alsa-ucm-conf 3/3] chtnau8824: Add support for using the SOF driver Hans de Goede
@ 2021-01-17 16:09 ` Hans de Goede
  2021-01-17 16:52   ` Jaroslav Kysela
  2 siblings, 1 reply; 7+ messages in thread
From: Hans de Goede @ 2021-01-17 16:09 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel, Pierre-Louis Bossart

Hi,

On 12/16/20 4:38 PM, Hans de Goede wrote:
> Move DAC Channel Source selection to Speaker/Headphones EnableSeq.
> 
> The main reason for doing this is to make it easier to allow using
> variables, as the Speaker/Headphones conf files are evaluated after
> the main HiFi.conf had a chance to set them.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

ping? It would be nice to get this series merged for proper SOF
support.

Maybe this got confused with my other UCM chtnau8824 series which
I send 10 days before this one? That one did get merged, but this
is a different series.

Regards,

Hans



> ---
>  ucm2/codecs/nau8824/EnableSeq.conf   | 3 ---
>  ucm2/codecs/nau8824/HeadPhones.conf  | 2 ++
>  ucm2/codecs/nau8824/MonoSpeaker.conf | 2 ++
>  ucm2/codecs/nau8824/Speaker.conf     | 2 ++
>  4 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/ucm2/codecs/nau8824/EnableSeq.conf b/ucm2/codecs/nau8824/EnableSeq.conf
> index 3650d06..2595e5f 100644
> --- a/ucm2/codecs/nau8824/EnableSeq.conf
> +++ b/ucm2/codecs/nau8824/EnableSeq.conf
> @@ -1,7 +1,4 @@
>  EnableSequence [
> -	# Playback TDM configuration
> -	cset "name='DACL Channel Source' 0"
> -	cset "name='DACR Channel Source' 1"
>  	# Input Configuration
>  	cset "name='DMIC1 Enable Switch' off"
>  	cset "name='DMIC2 Enable Switch' off"
> diff --git a/ucm2/codecs/nau8824/HeadPhones.conf b/ucm2/codecs/nau8824/HeadPhones.conf
> index a807f84..46ec5d7 100644
> --- a/ucm2/codecs/nau8824/HeadPhones.conf
> +++ b/ucm2/codecs/nau8824/HeadPhones.conf
> @@ -12,6 +12,8 @@ SectionDevice."Headphones" {
>  	]
>  
>  	EnableSequence [
> +		cset "name='DACL Channel Source' 0"
> +		cset "name='DACR Channel Source' 1"
>  		cset "name='Headphone Switch' on"
>  	]
>  
> diff --git a/ucm2/codecs/nau8824/MonoSpeaker.conf b/ucm2/codecs/nau8824/MonoSpeaker.conf
> index 6b4ef8a..09edea5 100644
> --- a/ucm2/codecs/nau8824/MonoSpeaker.conf
> +++ b/ucm2/codecs/nau8824/MonoSpeaker.conf
> @@ -11,6 +11,8 @@ SectionDevice."Speaker" {
>  	]
>  
>  	EnableSequence [
> +		cset "name='DACL Channel Source' 0"
> +		cset "name='DACR Channel Source' 1"
>  		# nau8824 mono speaker boards have the speaker on the right chan
>  		cset "name='Speaker Left DACL Volume' 0"
>  		cset "name='Speaker Left DACR Volume' 0"
> diff --git a/ucm2/codecs/nau8824/Speaker.conf b/ucm2/codecs/nau8824/Speaker.conf
> index a995873..64d7eee 100644
> --- a/ucm2/codecs/nau8824/Speaker.conf
> +++ b/ucm2/codecs/nau8824/Speaker.conf
> @@ -11,6 +11,8 @@ SectionDevice."Speaker" {
>  	]
>  
>  	EnableSequence [
> +		cset "name='DACL Channel Source' 0"
> +		cset "name='DACR Channel Source' 1"
>  		cset "name='Speaker Left DACL Volume' 1"
>  		cset "name='Speaker Left DACR Volume' 0"
>  		cset "name='Speaker Right DACL Volume' 0"
> 


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

* Re: [PATCH alsa-ucm-conf 1/3] chtnau8824: Move DAC Channel Source selection to Speaker/Headphones EnableSeq
  2021-01-17 16:09 ` [PATCH alsa-ucm-conf 1/3] chtnau8824: Move DAC Channel Source selection to Speaker/Headphones EnableSeq Hans de Goede
@ 2021-01-17 16:52   ` Jaroslav Kysela
  2021-01-18 14:40     ` Jaroslav Kysela
  0 siblings, 1 reply; 7+ messages in thread
From: Jaroslav Kysela @ 2021-01-17 16:52 UTC (permalink / raw)
  To: Hans de Goede; +Cc: alsa-devel, Pierre-Louis Bossart

Dne 17. 01. 21 v 17:09 Hans de Goede napsal(a):
> Hi,
> 
> On 12/16/20 4:38 PM, Hans de Goede wrote:
>> Move DAC Channel Source selection to Speaker/Headphones EnableSeq.
>>
>> The main reason for doing this is to make it easier to allow using
>> variables, as the Speaker/Headphones conf files are evaluated after
>> the main HiFi.conf had a chance to set them.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> 
> ping? It would be nice to get this series merged for proper SOF
> support.
> 
> Maybe this got confused with my other UCM chtnau8824 series which
> I send 10 days before t

Hi,

Thanks for the reminder. I though that this one was resolved. I don't think
that we need the first change - the evaluation for If and Include sequences is
executed before SectionVerb {} parsing. So the If...Define.RightOutputChannel
should be valid for SectionVerb...Include...File
"/codecs/nau8824/EnableSeq.conf". The 'DACR Channel Source' control seems to
require a static settings so keeping it in the verb init sequence has sense.

I applied the second (SST variable) patch for now. It's nice cleanup. Thanks.

				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 alsa-ucm-conf 1/3] chtnau8824: Move DAC Channel Source selection to Speaker/Headphones EnableSeq
  2021-01-17 16:52   ` Jaroslav Kysela
@ 2021-01-18 14:40     ` Jaroslav Kysela
  2021-01-23 15:59       ` Hans de Goede
  0 siblings, 1 reply; 7+ messages in thread
From: Jaroslav Kysela @ 2021-01-18 14:40 UTC (permalink / raw)
  To: Hans de Goede; +Cc: alsa-devel, Pierre-Louis Bossart

Dne 17. 01. 21 v 17:52 Jaroslav Kysela napsal(a):
> Dne 17. 01. 21 v 17:09 Hans de Goede napsal(a):
>> Hi,
>>
>> On 12/16/20 4:38 PM, Hans de Goede wrote:
>>> Move DAC Channel Source selection to Speaker/Headphones EnableSeq.
>>>
>>> The main reason for doing this is to make it easier to allow using
>>> variables, as the Speaker/Headphones conf files are evaluated after
>>> the main HiFi.conf had a chance to set them.
>>>
>>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>>
>> ping? It would be nice to get this series merged for proper SOF
>> support.
>>
>> Maybe this got confused with my other UCM chtnau8824 series which
>> I send 10 days before t
> 
> Hi,
> 
> Thanks for the reminder. I though that this one was resolved. I don't think
> that we need the first change - the evaluation for If and Include sequences is
> executed before SectionVerb {} parsing. So the If...Define.RightOutputChannel
> should be valid for SectionVerb...Include...File
> "/codecs/nau8824/EnableSeq.conf". The 'DACR Channel Source' control seems to
> require a static settings so keeping it in the verb init sequence has sense.
> 
> I applied the second (SST variable) patch for now. It's nice cleanup. Thanks.

Hans,

	could you test https://github.com/alsa-project/alsa-ucm-conf/pull/74 ?

					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 alsa-ucm-conf 1/3] chtnau8824: Move DAC Channel Source selection to Speaker/Headphones EnableSeq
  2021-01-18 14:40     ` Jaroslav Kysela
@ 2021-01-23 15:59       ` Hans de Goede
  0 siblings, 0 replies; 7+ messages in thread
From: Hans de Goede @ 2021-01-23 15:59 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel, Pierre-Louis Bossart

Hi,

On 1/18/21 3:40 PM, Jaroslav Kysela wrote:
> Dne 17. 01. 21 v 17:52 Jaroslav Kysela napsal(a):
>> Dne 17. 01. 21 v 17:09 Hans de Goede napsal(a):
>>> Hi,
>>>
>>> On 12/16/20 4:38 PM, Hans de Goede wrote:
>>>> Move DAC Channel Source selection to Speaker/Headphones EnableSeq.
>>>>
>>>> The main reason for doing this is to make it easier to allow using
>>>> variables, as the Speaker/Headphones conf files are evaluated after
>>>> the main HiFi.conf had a chance to set them.
>>>>
>>>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>>>
>>> ping? It would be nice to get this series merged for proper SOF
>>> support.
>>>
>>> Maybe this got confused with my other UCM chtnau8824 series which
>>> I send 10 days before t
>>
>> Hi,
>>
>> Thanks for the reminder. I though that this one was resolved. I don't think
>> that we need the first change - the evaluation for If and Include sequences is
>> executed before SectionVerb {} parsing. So the If...Define.RightOutputChannel
>> should be valid for SectionVerb...Include...File
>> "/codecs/nau8824/EnableSeq.conf". The 'DACR Channel Source' control seems to
>> require a static settings so keeping it in the verb init sequence has sense.
>>
>> I applied the second (SST variable) patch for now. It's nice cleanup. Thanks.
> 
> Hans,
> 
> 	could you test https://github.com/alsa-project/alsa-ucm-conf/pull/74 ?

I can confirm that the simplified version from that pull-req works as it should, thanks.

Regards,

Hans


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

end of thread, other threads:[~2021-01-23 16:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 15:38 [PATCH alsa-ucm-conf 1/3] chtnau8824: Move DAC Channel Source selection to Speaker/Headphones EnableSeq Hans de Goede
2020-12-16 15:38 ` [PATCH alsa-ucm-conf 2/3] chtnau8824: Add a SST define/variable Hans de Goede
2020-12-16 15:38 ` [PATCH alsa-ucm-conf 3/3] chtnau8824: Add support for using the SOF driver Hans de Goede
2021-01-17 16:09 ` [PATCH alsa-ucm-conf 1/3] chtnau8824: Move DAC Channel Source selection to Speaker/Headphones EnableSeq Hans de Goede
2021-01-17 16:52   ` Jaroslav Kysela
2021-01-18 14:40     ` Jaroslav Kysela
2021-01-23 15:59       ` Hans de Goede

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