[PATCH alsa-ucm-conf 3/3] chtnau8824: Add support for using the SOF driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux