Closed plbossart closed 1 month ago
I'd like to borrow one device to make sure why dmic1 is used but not dmic3, because per my understanding, rt714 is configured to use dmic3 in schematics
@plbossart Do you know how can we get "PCI ID(SVID/SSID)" on the device (Dell_XPS_17_9720) ? Our hardware engineer team would like to check the schematics first, and they'd like to know the corresponding "PCI ID(SVID/SSID)", because for DELL-9720 device, there are many versions of schematics, but it can be classfied by "PCI ID(SVID/SSID)".
@plbossart Do you know how can we get "PCI ID(SVID/SSID)" on the device (Dell_XPS_17_9720) ? Our hardware engineer team would like to check the schematics first, and they'd like to know the corresponding "PCI ID(SVID/SSID)", because for DELL-9720 device, there are many versions of schematics, but it can be classfied by "PCI ID(SVID/SSID)".
We've got these ID info.
@plbossart @eighthave Could you help dump registers while recording with DMIC1, and another register dump while DMIC3 recording? Thanks.
Yes, sure, as long as you walk me through how. I'm a Debian Developer and former audio programmer, so I know my way around, but I have only high level understanding of kernel-level stuff.
@eighthave Please use "cat /sys/kernel/debug/regmap/sdw-addr/registers" to dump registers while recording with DMIC1 and DMIC3. And for "sdw-addr", there are "sdw:xxxxxx" and "sdw:xxxxxx-sdw-mbq", we need both dump. Thanks.
Here's how I did it:
for f in /sys/kernel/debug/regmap/sdw*/name ; do
cat $(dirname $f)/registers > "/tmp/rt714 ADC 22 Mux [DMIC3] $(basename $(dirname $f)) $(cat $f).bin"&
done
sleep 10
killall cat
And here are the resulting files: rt714 ADC 22 Mux.zip
Also, I hadn't tried DMIC3 before, only DMIC1. It seems that DMIC3 works fine.
@eighthave You can record with DMIC3 !? I thought @plbossart added this issue because you failed to record with DMIC3? Did I miss any information or I misunderstand this issue?
With the defaults that I got with Debian/bookworm, I could not record from either the built-in microphone, nor the headset jack. I went through the steps in https://wiki.archlinux.org/title/Dell_XPS_17_(9720)#Microphone and that allowed recording on both the built-in microphone and the headset jack. I could be wrong, but I think "rt714 ADC 22 Mux" was not set to DMIC3 when I made the changes.
Looks like an UCM issue, you can double check your UCM (/usr/share/alsa/ucm2) and compare with https://github.com/alsa-project/alsa-ucm-conf/blob/master/ucm2/codecs/rt715-sdca/init.conf https://github.com/alsa-project/alsa-ucm-conf/blob/master/ucm2/sof-soundwire/rt715-sdca.conf https://github.com/alsa-project/alsa-ucm-conf/blob/master/ucm2/sof-soundwire/sof-soundwire.conf
check if there are differences related to rt715.
It is a plain upstream v1.2.8 (Debian/stable), except for three patches related to Pine* and Librem:
https://salsa.debian.org/alsa-team/alsa-ucm-conf/-/tree/debian/1.2.8-1
Should I upgrade to 1.2.11?
This is the diff:
$ diff -uw /usr/share/alsa/ucm2/codecs/rt715-sdca/init.conf ucm2/codecs/rt715-sdca/init.conf
$ diff -uw /usr/share/alsa/ucm2/sof-soundwire/rt715-sdca.conf ucm2/sof-soundwire/rt715-sdca.conf
--- /usr/share/alsa/ucm2/sof-soundwire/rt715-sdca.conf 2022-10-24 10:17:39.000000000 +0200
+++ ucm2/sof-soundwire/rt715-sdca.conf 2024-06-07 10:44:38.932859077 +0200
@@ -17,5 +17,6 @@
CaptureSwitch "rt714 FU02 Capture Switch"
CaptureVolume "rt714 FU02 Capture Volume"
CaptureMixerElem "rt714 FU02"
+ CaptureMicInfoFile "${var:LibDir}/dmics-nhlt.json"
}
}
$ diff -uw /usr/share/alsa/ucm2/sof-soundwire/sof-soundwire.conf ucm2/sof-soundwire/sof-soundwire.conf
--- /usr/share/alsa/ucm2/sof-soundwire/sof-soundwire.conf 2022-10-24 10:17:39.000000000 +0200
+++ ucm2/sof-soundwire/sof-soundwire.conf 2024-06-07 10:44:38.932859077 +0200
@@ -15,6 +15,7 @@
HeadsetCodec1 ""
MicCodec1 ""
Mics1 "0"
+ Iec61937Pcms1 ""
}
DefineRegex {
@@ -35,19 +36,76 @@
String "${CardComponents}"
}
MicCodec {
- Regex " mic:([a-z0-9]+(-sdca)?)"
+ Regex " mic:([a-z0-9]+(-dmic)?+(-sdca)?)"
String "${CardComponents}"
}
Mics {
Regex " cfg-mics:([1-9][0-9]*)"
String "${CardComponents}"
}
+ Iec61937Pcms {
+ Regex "iec61937-pcm:(([0-9]+(,))*[0-9]+)"
+ String "${CardComponents}"
+ }
}
+DefineRegex.MultiCodec {
+ Regex "(rt722(-sdca)?)"
+ String "${var:SpeakerCodec1} ${var:HeadsetCodec1} ${var:MicCodec1}"
+}
+
+If.multi_init {
+ Condition {
+ Type String
+ Empty "${var:MultiCodec1} "
+ }
+ False {
+ Define {
+ MultiSpeakerShadow "${var:SpeakerCodec1}"
+ MultiMicShadow "${var:MicCodec1}"
+ }
+ Include.multi_init.File "/codecs/${var:MultiCodec1}/init.conf"
+ }
+}
+
+If.multi_speaker {
+ Condition {
+ Type RegexMatch
+ Regex "${var:SpeakerCodec1}"
+ String "${var:MultiCodec1}"
+ }
+ True {
+ Define.SpeakerCodec1 ""
+ }
+}
+
+If.multi_mic {
+ Condition {
+ Type RegexMatch
+ Regex "${var:MicCodec1}"
+ String "${var:MultiCodec1}"
+ }
+ True {
+ Define.MicCodec1 ""
+ }
+}
+
+If.multi_headset {
+ Condition {
+ Type RegexMatch
+ Regex "${var:HeadsetCodec1}"
+ String "${var:MultiCodec1}"
+ }
+ True {
+ Define.HeadsetCodec1 ""
+ }
+}
+
+
If.hs_init {
Condition {
Type RegexMatch
- Regex "(rt5682|rt700|rt711(-sdca)?)"
+ Regex "(cs42l43|rt5682|rt700|rt711|rt713(-sdca)?)"
String "${var:HeadsetCodec1}"
}
True.Include.hs_init.File "/codecs/${var:HeadsetCodec1}/init.conf"
@@ -56,8 +114,88 @@
If.mic_init {
Condition {
Type RegexMatch
- Regex "(rt715(-sdca)?)"
+ Regex "(rt713-dmic|rt715(-sdca)?)"
String "${var:MicCodec1}"
}
True.Include.mic_init.File "/codecs/${var:MicCodec1}/init.conf"
}
+
+If.mic_init_rt715 {
+ Condition {
+ Type String
+ Needle "rt715"
+ Haystack "${var:MicCodec1}"
+ }
+ True.BootSequence [
+ sysw "-/class/sound/ctl-led/mic/card${CardNumber}/detach:PGA5.0 5 Master Capture Switch"
+ ]
+}
+
+If.pga_init_pga2 {
+ Condition {
+ Type ControlExists
+ Control "name='PGA2.0 2 Master Capture Switch'"
+ }
+ True.BootSequence [
+ cset "name='PGA2.0 2 Master Capture Switch' 1"
+ ]
+}
+
+If.pga_init_pga5 {
+ Condition {
+ Type ControlExists
+ Control "name='PGA5.0 5 Master Capture Switch'"
+ }
+ True.BootSequence [
+ cset "name='PGA5.0 5 Master Capture Switch' 1"
+ ]
+}
+
+If.mics-array {
+ Condition {
+ Type String
+ Empty "${var:Mics1}"
+ }
+ False.FixedBootSequence {
+ # dmic array info
+ exec "-nhlt-dmic-info -o ${var:LibDir}/dmics-nhlt.json"
+ }
+}
+
+Include.hdmi-pcm.File "/common/pcm/hdmi.conf"
+
+If.Hdmi5-iec61937 {
+ Condition {
+ Type RegexMatch
+ Regex "((^|,)[5](,|$))"
+ String "${var:Iec61937Pcms1}"
+ }
+ True.Macro.hdmi5.HdmiPCM { Device 5 Index 0 }
+}
+
+If.Hdmi6-iec61937 {
+ Condition {
+ Type RegexMatch
+ Regex "((^|,)[6](,|$))"
+ String "${var:Iec61937Pcms1}"
+ }
+ True.Macro.hdmi6.HdmiPCM { Device 6 Index 1 }
+}
+
+If.Hdmi7-iec61937 {
+ Condition {
+ Type RegexMatch
+ Regex "((^|,)[7](,|$))"
+ String "${var:Iec61937Pcms1}"
+ }
+ True.Macro.hdmi7.HdmiPCM { Device 7 Index 2 }
+}
+
+If.HdmiIec61937 {
+ Condition {
+ Type RegexMatch
+ Regex "((^|,)[567](,|$))"
+ String "${var:Iec61937Pcms1}"
+ }
+ True.Macro.save_hdmi_cfg.HdmiPCMSave { Name "42-sof-hdmi" }
+}
Is there any error message related to UCM in dmesg? It seems that rt715 is already included in your original UCM, I don't know why UCM doesn't take effect. @plbossart Do you have any comment?
Looks like lots in syslog, but none currently in dmesg:
# grep -i ucm /var/log/syslog
[snip]
2024-06-06T21:35:49.142956+02:00 monolith pipewire[2632]: I spa.alsa [alsa-pcm.c:1010:spa_alsa_open]: 0x55d9a9271948: ALSA device open '_ucm0001.hw:sofsoundwire,2' playback
2024-06-06T21:35:49.227485+02:00 monolith pipewire[2632]: I spa.alsa [alsa-pcm.c:934:probe_pitch_ctl]: _ucm0001.hw:sofsoundwire,2 could not find ctl device: No such file or directory
2024-06-06T22:45:09.095723+02:00 monolith pipewire[2632]: I spa.alsa [alsa-pcm.c:1010:spa_alsa_open]: 0x55d9a9271948: ALSA device open '_ucm0001.hw:sofsoundwire,2' playback
2024-06-06T22:45:09.184266+02:00 monolith pipewire[2632]: I spa.alsa [alsa-pcm.c:934:probe_pitch_ctl]: _ucm0001.hw:sofsoundwire,2 could not find ctl device: No such file or directory
2024-06-06T23:06:10.222229+02:00 monolith pipewire[2632]: I spa.alsa [alsa-pcm.c:1010:spa_alsa_open]: 0x55d9a9271948: ALSA device open '_ucm0001.hw:sofsoundwire,2' playback
2024-06-06T23:06:10.313301+02:00 monolith pipewire[2632]: I spa.alsa [alsa-pcm.c:934:probe_pitch_ctl]: _ucm0001.hw:sofsoundwire,2 could not find ctl device: No such file or directory
2024-06-07T09:38:19.342526+02:00 monolith pipewire[2632]: I spa.alsa [alsa-pcm.c:1010:spa_alsa_open]: 0x55d9a9271948: ALSA device open '_ucm0001.hw:sofsoundwire,2' playback
2024-06-07T09:38:19.342759+02:00 monolith pipewire[2632]: I spa.alsa [alsa-pcm.c:934:probe_pitch_ctl]: _ucm0001.hw:sofsoundwire,2 could not find ctl device: No such file or directory
2024-06-07T09:39:28.193831+02:00 monolith pipewire[2632]: I spa.alsa [alsa-pcm.c:1010:spa_alsa_open]: 0x55d9a92433e8: ALSA device open '_ucm0001.hw:sofsoundwire' playback
2024-06-07T09:39:28.441495+02:00 monolith pipewire[2632]: D spa.alsa [alsa-pcm.c:951:probe_pitch_ctl]: _ucm0001.hw:sofsoundwire: did not find ctl Playback Pitch 1000000: No such file or directory
2024-06-07T10:08:46.886419+02:00 monolith pipewire[2632]: I spa.alsa [alsa-pcm.c:1010:spa_alsa_open]: 0x55d9a92ce408: ALSA device open '_ucm0001.hw:sofsoundwire,4' capture
2024-06-07T10:08:46.900599+02:00 monolith pipewire[2632]: I spa.alsa [alsa-pcm.c:934:probe_pitch_ctl]: _ucm0001.hw:sofsoundwire,4 could not find ctl device: No such file or directory
2024-06-07T10:43:22.562231+02:00 monolith pipewire[2632]: I spa.alsa [alsa-pcm.c:1010:spa_alsa_open]: 0x55d9a92433e8: ALSA device open '_ucm0001.hw:sofsoundwire' playback
2024-06-07T10:43:22.930199+02:00 monolith pipewire[2632]: D spa.alsa [alsa-pcm.c:951:probe_pitch_ctl]: _ucm0001.hw:sofsoundwire: did not find ctl Playback Pitch 1000000: No such file or directory
2024-06-07T11:11:24.296492+02:00 monolith pipewire[2632]: I spa.alsa [alsa-pcm.c:1010:spa_alsa_open]: 0x55d9a92433e8: ALSA device open '_ucm0001.hw:sofsoundwire' playback
2024-06-07T11:11:24.668388+02:00 monolith pipewire[2632]: D spa.alsa [alsa-pcm.c:951:probe_pitch_ctl]: _ucm0001.hw:sofsoundwire: did not find ctl Playback Pitch 1000000: No such file or directory
not clear if this bug is current, please open a new issue with data if this persists.
UCM relies on this setting
But as noted in https://wiki.archlinux.org/title/Dell_XPS_17_(9720)#Microphone and https://github.com/thesofproject/sof/issues/7799#issuecomment-2151551316 the working setting is DMIC1
The question is: can this be detected from ACPI, or do we have to quirk the component string to make UCM aware of the DMIC hardware layout.
@jack-cy-yu @shumingfan @bardliao @eighthave FYI