[PATCH alsa-ucm-conf 1/3] chtnau8824: Move DAC Channel Source selection to Speaker/Headphones EnableSeq
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"
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"
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"
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='Headphone Switch' on" ]cset "name='DACR Channel Source' 1"
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"
# 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"cset "name='DACR Channel Source' 1"
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='Speaker Left DACL Volume' 1" cset "name='Speaker Left DACR Volume' 0" cset "name='Speaker Right DACL Volume' 0"cset "name='DACR Channel Source' 1"
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
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
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
participants (2)
-
Hans de Goede
-
Jaroslav Kysela