Open rodrigovivi opened 5 months ago
@rodrigovivi if you have 2 DMICs and no HDaudio external codec, then chances are the configuration is similar to the HP SoundWire versions.
Can you add this file sof-dyndbg.conf.txt as /etc/modprobe.d/sof-dyndbg.conf, reboot then attach the dmesg log.
Also provide the result of
cat /sys/bus/acpi/devices/*/adr | grep 025d
$ cat /sys/bus/acpi/devices/*/adr | grep 025d 0x000030025d071201
Thanks @rodrigovivi, so you have one RT712 on SoundWire link0, 2 DMICs and HDMI support with iDISP.
[ 14.813241] soundwire_intel:sdw_intel_probe_controller: acpi PRP00001:00: Creating 4 SDW Link devices
[ 14.813350] soundwire_bus:sdw_extract_slave_id: soundwire sdw-master-0-0: SDW Slave Addr: 30025d071201
[ 14.813352] soundwire_bus:sdw_extract_slave_id: soundwire sdw-master-0-0: SDW Slave class_id 0x01, mfg_id 0x025d, part_id 0x0712, unique_id 0x0, version 0x3
[ 14.813487] snd_sof_intel_hda:hda_codec_probe: sof-audio-pci-intel-mtl 0000:00:1f.3: HDA codec thesofproject/sof#2 probed OK: response: 8086281d
of course we don't support this configuration...
Usually we have a RT712 for jack/amp and the RT1712 for the DMIC. Here the latter seems replaced by the PCH-attached DMIC.
wow. I'll start cooking up a patch shortly.
@rodrigovivi can you try the patch in PR thesofproject/sof#4925 and also unzip/copy this file sof-mtl-rt712-l0-2ch.tplg.gz in /lib/firmware/intel/sof-ipc4-tplg/
Reboot and attach the results. You should see a sound card if I didn't screw up the indices.
Thanks!
dmesg-audio-with-patch-take-1.txt It goes further, then it fails... [ 16.204785] snd_sof:sof_route_load: sof-audio-pci-intel-mtl 0000:00:1f.3: sink module-copier.101.2 control none source eqiir.101.1 [ 16.204786] sof_sdw sof_sdw: ASoC: physical link dmic01 (id 4) not exist [ 16.204787] sof_sdw sof_sdw: ASoC: topology: could not load header: -22 [ 16.204832] sof-audio-pci-intel-mtl 0000:00:1f.3: error: tplg component load failed -22 [ 16.204834] sof-audio-pci-intel-mtl 0000:00:1f.3: error: failed to load DSP topology -22 [ 16.204835] sof-audio-pci-intel-mtl 0000:00:1f.3: ASoC: error at snd_soc_component_probe on 0000:00:1f.3: -22 [ 16.204845] sof_sdw sof_sdw: ASoC: failed to instantiate card -22 [ 16.204882] sof_sdw sof_sdw: error -EINVAL: snd_soc_register_card failed -22 [ 16.204888] sof_sdw sof_sdw: probe with driver sof_sdw failed with error -22
Ok that's probably the topology file, I don't really understand how the indices are handled. @bardliao can you take a look?
one important information here: the sound over USB works pretty well even without this patch. USB speaker and USB headset works well. only the native laptop speakers and mic doesn't work. I was surprised by that over the weekend. So, I really can do meetings on this laptop and sound works for my regular case. But I'm still up to test any patch here and get this product really working out of the box. There might be users out there who really depend on the native speakers/mic.
@rodrigovivi Can you try sof-mtl-rt712-l0-2ch.zip?
[ 16.204349] snd_soc_sof_sdw:sof_card_dai_links_create: sof_sdw sof_sdw: sdw 3, ssp 0, dmic 2, hdmi 3, bt: 0
[ 16.204350] snd_soc_sof_sdw:init_dai_link: sof_sdw sof_sdw: create dai link SDW0-Playback-SimpleJack, id 0
[ 16.204371] snd_soc_sof_sdw:init_dai_link: sof_sdw sof_sdw: create dai link SDW0-Capture-SimpleJack, id 1
[ 16.204372] snd_soc_sof_sdw:init_dai_link: sof_sdw sof_sdw: create dai link SDW0-Playback-SmartAmp, id 2
[ 16.204372] snd_soc_sof_sdw:init_dai_link: sof_sdw sof_sdw: create dai link dmic01, id 3
[ 16.204373] snd_soc_sof_sdw:init_dai_link: sof_sdw sof_sdw: create dai link dmic16k, id 4
[ 16.204375] snd_soc_sof_sdw:init_dai_link: sof_sdw sof_sdw: create dai link iDisp1, id 5
[ 16.204376] snd_soc_sof_sdw:init_dai_link: sof_sdw sof_sdw: create dai link iDisp2, id 6
[ 16.204377] snd_soc_sof_sdw:init_dai_link: sof_sdw sof_sdw: create dai link iDisp3, id 7
The dmic01 id is 3. I modified the indices in the topology.
The dmic01 id is 3. I modified the indices in the topology.
@bardliao is this because we don't have the amp feedback on rt712?
one important information here: the sound over USB works pretty well even without this patch. USB speaker and USB headset works well. only the native laptop speakers and mic doesn't work. I was surprised by that over the weekend. So, I really can do meetings on this laptop and sound works for my regular case. But I'm still up to test any patch here and get this product really working out of the box. There might be users out there who really depend on the native speakers/mic.
Yes, BT and USB are orthogonal to the Intel IP for audio, so they might work even if the DSP doesn't. Still there's no reason why this configuration wouldn't work with minor tweaks, as you said there will be lots of others who need jack/speaker/mic.
The dmic01 id is 3. I modified the indices in the topology.
@bardliao is this because we don't have the amp feedback on rt712?
Yes.
with dmic01 id 3 it goes further, and then it fails: [ 18.577436] sof_sdw sof_sdw: ASoC: physical link dmic16k (id 5) not exist
with dmic01 id 3 it goes further, and then it fails: [ 18.577436] sof_sdw sof_sdw: ASoC: physical link dmic16k (id 5) not exist
@rodrigovivi Thanks for testing. Could you try sof-mtl-rt712-l0-2ch.zip?
@rodrigovivi Do you have a chance to test sof-mtl-rt712-l0-2ch.zip? We will merge https://github.com/thesofproject/sof/pull/9041 if the test result is positive.
@rodrigovivi Do you have a chance to test sof-mtl-rt712-l0-2ch.zip? We will merge thesofproject/sof#9041 if the test result is positive.
Hello everyone! I'm also having this issue in a Swift SFG14-72 running latest Ubuntu 24.04. I tried the linked topology and it didn't work for me. Is this ticket going to be continued in issue 9085? Is there something I can help to debug this?
@rodrigovivi Do you have a chance to test sof-mtl-rt712-l0-2ch.zip? We will merge thesofproject/sof#9041 if the test result is positive.
Hello everyone! I'm also having this issue in a Swift SFG14-72 running latest Ubuntu 24.04. I tried the linked topology and it didn't work for me. Is this ticket going to be continued in issue 9085? Is there something I can help to debug this?
@franc5 You need to apply https://github.com/thesofproject/linux/pull/4925 to your kernel. And from https://github.com/thesofproject/linux/issues/4970, https://github.com/thesofproject/sof/pull/9041 should be good. The DSP panic looks like a different issue.
I'm sorry for the late reply here. With the latest sof-mtl-rt712-l0-2ch.zip I do can see the output audio enumerated, but no sound is audible when testing the speakers. also no microfone enumerated. dmesg-apr-29.txt
@rodrigovivi I don't know what's going on with GitHub but your attached dmesg-apr-29 didn't go through.
@rodrigovivi I don't see anything wrong in the dmesg log. The speakers probably miss a mixer config. For the dmics, I don't really understand what you meant by "no microphone enumerated". what is the output of 'arecord -l' ?
The Gnome Settings shows the output device, but even with tuning the volume, nothing is audible. But for the input devices it just shows: "No Input device"
$ arecord -l List of CAPTURE Hardware Devices card 1: sofsoundwire [sof-soundwire], device 1: Jack In () [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: sofsoundwire [sof-soundwire], device 10: DMIC Raw () [] Subdevices: 1/1 Subdevice #0: subdevice #0
$ amixer Simple mixer control 'Master',0 Capabilities: pvolume pswitch pswitch-joined Playback channels: Front Left - Front Right Limits: Playback 0 - 65536 Mono: Front Left: Playback 49806 [76%] [on] Front Right: Playback 49806 [76%] [on] Simple mixer control 'Capture',0 Capabilities: cvolume cswitch cswitch-joined Capture channels: Front Left - Front Right Limits: Capture 0 - 65536 Front Left: Capture 49806 [76%] [on] Front Right: Capture 49806 [76%] [on]
that's because you don't have a UCM file.
Try capturing something with "arecord -Dhw:0,10 -c2 -r48000 -fS32_LE -d10 test.wav" and see if there's any sound coming in.
I couldn't hear anything... then I plugged the usb-audio, where I can hear stuff and I played it again and still couldn't hear anything. so, still output is listed, but it doesn't work. input is not listed and even arecord directly didn't worked.
"arecord directly didn't work" Did you mean that the recorded file is silent, or that some sort of error happened. It could be that we are using the 'wrong' set of channels, the interface supports 4 channels so if the OEM picks 2 we have a chance on using the pdm1 instead of classic pdm0.
silent! I couldn't listen to anything...
ok, so we need to try the 4ch setup and see if the channels 2-3 are used
Can you add this in a .conf file in /etc/modprobe.d/
options snd_sof_intel_hda_common dmic_num=4
and unzip/add this topology file sof-mtl-rt712-l0-4ch.tplg.gz
if you can record something and share the wav file that would be great.
Oh and the number of channels needs to change of course:
arecord -Dhw:0,10 -c4 -r48000 -fS32_LE -d10 test.wav
$ find /lib/firmware/intel/sof-ipc4-tplg/ | grep sof-mtl-rt712-l0-4ch /lib/firmware/intel/sof-ipc4-tplg/sof-mtl-rt712-l0-4ch.tplg
$ cat /proc/cmdline BOOT_IMAGE=(hd0,gpt3)/vmlinuz-6.9.0-rc3+ root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/root rd.luks.uuid=luks-7ba20335-722d-4a79-9c82-451033b7ceb4 snd_sof_intel_hda_common.dmic_num=4 rhgb quiet
$ arecord -Dhw:0,10 -c4 -r48000 -fS32_LE -d10 test-4ch.wav arecord: set_params:1398: Channels count non available
Not following what goes sideways, we do add the 4ch count
"cavs-sdw\;sof-mtl-rt712-l0-4ch\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=1,\
SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,\
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\
NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_ID=3,DMIC1_ID=4,\
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-rt712-l0-4ch.bin,\
HDMI1_ID=5,HDMI2_ID=6,HDMI3_ID=7"
It's possible though that somehow we use the NHLT blob coming from ACPI tables.
But at the same time, I see
[ 483.498873] snd_sof:sof_ipc4_prepare_copier_module: sof-audio-pci-intel-mtl 0000:00:1f.3: copier host-copier.10.capture: reference output rate 48000, channels 2
so not sure what's going on. @bardliao @ranj063 any ideas?
Maybe try "options snd_sof_intel_hda_common sof_use_tplg_nhlt=1" to use the nhlt in the topology first?
options snd_sof_intel_hda_common sof_use_tplg_nhlt=1 and options snd_sof_intel_hda_common dmic_num=4 ?
yes both options @rodrigovivi
Using both: $ cat /proc/cmdline [snip] snd_sof_intel_hda_common.sof_use_tplg_nhlt=1 snd_sof_intel_hda_common.dmic_num=4
$ arecord -Dhw:0,10 -c4 -r48000 -fS32_LE -d10 test-4ch-may-13.wav arecord: set_params:1398: Channels count non available
mic still not listed in the gnome sound configuration.
for some reason, even with the 4ch option the kernel selects the 2ch topology
[ 15.253637] sof-audio-pci-intel-mtl 0000:00:1f.3: DMICs detected in NHLT tables: 2
[ 15.253639] snd_sof_intel_hda_generic:hda_sdw_machine_select: sof-audio-pci-intel-mtl 0000:00:1f.3: SoundWire machine driver sof_sdw topology sof-mtl-rt712-l0-2ch.tplg
Not sure why that is the case.
My money is on the option not being selected, if you enable dynamic debug you should see this, but it's not in your log...
/* allow for module parameter override */
if (dmic_num_override != -1) {
dev_dbg(sdev->dev,
"overriding DMICs detected in NHLT tables %d by kernel param %d\n",
dmic_num, dmic_num_override);
dmic_num = dmic_num_override;
}
what debug config and/or levels do you need? But what to do to allow the override and not end up in this place.
just make sure the sof-dyndbg.conf file exists in /etc/modprobe.d/ as described earlier in https://github.com/thesofproject/linux/issues/4923#issuecomment-2052436089
I have the latest vanilla kernel for fedora: uname -a Linux fedora 6.11.0-0.rc0.20240724gt786c8248.311.vanilla.fc40.x86_64
I installed sof-bin v2024.06:
sudo find / | grep sof-mtl-rt712-l0 /usr/lib/firmware/intel/sof-ipc4-tplg/sof-mtl-rt712-l0-rt1712-l3.tplg.xz /usr/lib/firmware/intel/sof-ipc4-tplg/sof-mtl-rt712-l0-rt1712-l3.tplg /usr/lib/firmware/intel/sof-ipc4-tplg/sof-mtl-rt712-l0.tplg
my laptop needs sof-mtl-rt712-l0-2ch.tplg: lip 24 16:28:20 fedora kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: enabling device (0000 -> 0002) lip 24 16:28:20 fedora kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100 lip 24 16:28:20 fedora kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915]) lip 24 16:28:20 fedora kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: use msi interrupt mode lip 24 16:28:20 fedora kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: DMICs detected in NHLT tables: 2 lip 24 16:28:20 fedora kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: hda codecs found, mask 4 lip 24 16:28:20 fedora kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: SOF firmware and/or topology file not found. lip 24 16:28:20 fedora kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Supported default profiles lip 24 16:28:20 fedora kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: - ipc type 1 (Requested): lip 24 16:28:20 fedora kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Firmware file: intel/sof-ipc4/mtl/sof-mtl.ri lip 24 16:28:20 fedora kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Topology file: intel/sof-ace-tplg/sof-mtl-rt712-l0-2ch.tplg lip 24 16:28:20 fedora kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Check if you have 'sof-firmware' package installed. lip 24 16:28:20 fedora kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Optionally it can be manually downloaded from: lip 24 16:28:20 fedora kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: https://github.com/thesofproject/sof-bin/ lip 24 16:28:20 fedora kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: error: sof_probe_work failed err: -2 lip 24 16:28:21 fedora bluetoothd[1109]: profiles/audio/micp.c:micp_init() D-Bus experimental not enabled
Where can I find sof-mtl-rt712-l0-2ch.tplg?
@marplusz see https://github.com/thesofproject/linux/issues/4923#issuecomment-2054591643
I am not sure what the status is, we never had any test results on the files suggested in https://github.com/thesofproject/sof/pull/9041 and there are comments from @ujfalusi that were not addressed either.
Bottom line we need to reopen this for the 2ch case.
I went through the entire thread and I have the same thing as @rodrigovivi
In the https://github.com/thesofproject/linux/files/14987476/sof-mtl-rt712-l0-2ch.zip version there was sound but only in the headphones jack. No microphone.
sudo find / | grep sof-mtl-rt712-l0 /usr/lib/firmware/intel/sof-ipc4-tplg/sof-mtl-rt712-l0-rt1712-l3.tplg.xz /usr/lib/firmware/intel/sof-ipc4-tplg/sof-mtl-rt712-l0-rt1712-l3.tplg /usr/lib/firmware/intel/sof-ipc4-tplg/sof-mtl-rt712-l0.tplg /usr/lib/firmware/intel/sof-ipc4-tplg/sof-mtl-rt712-l0-2ch.tplg /usr/lib/firmware/intel/sof-ipc4-tplg/sof-mtl-rt712-l0-4ch.tplg
arecord -Dhw:0,10 -c4 -r48000 -fS32_LE -d10 test.wav arecord: set_params:1398: Channels count non available
sudo find / | grep sof-dyndbg.conf /etc/modprobe.d/sof-dyndbg.conf
Let me know how I can help you with your tests.
@marplusz @rodrigovivi @plbossart The dmic_num=4 belongs to the snd_sof_intel_hda_generic module not snd_sof_intel_hda_common. So, the options should be
options snd_sof_intel_hda_common sof_use_tplg_nhlt=1 options snd_sof_intel_hda_generic dmic_num=4
And the tplg file will be sof-mtl-rt712-l0-4ch.tplg
I set the options: options snd_sof_intel_hda_common sof_use_tplg_nhlt=1 options snd_sof_intel_hda_generic dmic_num=4
I recorded a wav file: arecord -Dhw:0,10 -c4 -r48000 -fS32_LE -d10 test.wav
No sound was recorded. I checked the file in Audacity and nothing was recorded on any channel.
@marplusz can you add this file sof-dyndbg.conf.txt as /etc/modprobe.d/sof-dyndbg.conf, reboot and attach the dmesg log. Thanks!
@marplusz can you add this file sof-dyndbg.conf.txt as /etc/modprobe.d/sof-dyndbg.conf, reboot and attach the dmesg log. Thanks!
Log file from dmesg dmesg_log.txt
the log is missing all the initial parts that can help us see what the configuration is @marplusz
@plbossart Please write what I should insert. Above I made the usual ones dmesg > dmesg_log.txt
I updated the system and did it again. I can see the difference in the log. I have a vanilla kernel so it may be unstable. dmesg_log2.txt
@marplusz Can you share the output of "amixer contents" command while you are running the arecord command?
@bardliao To do this, I restored the parameters: options snd_sof_intel_hda_common sof_use_tplg_nhlt=1 options snd_sof_intel_hda_generic dmic_num=4 I rebooted journalctl | grep audio -> journalctl.txt dmesg -> dmesg_log
_terminal1 -> arecord -Dhw:0,10 -c4 -r48000 -fS32_LE -d10 test.wav
_terminal2 -> amixer contents numid=4,iface=MIXER,name='Master Playback Switch' ; type=BOOLEAN,access=rw------,values=1 : values=on numid=3,iface=MIXER,name='Master Playback Volume' ; type=INTEGER,access=rw------,values=2,min=0,max=655
36,step=1 : values=45212,45212 numid=2,iface=MIXER,name='Capture Switch' ; type=BOOLEAN,access=rw------,values=1 : values=on numid=1,iface=MIXER,name='Capture Volume' ; type=INTEGER,access=rw------,values=2,min=0,max=65536,step=1 : values=45212,45212 journalctl.txt dmesg_log.txt
@marplusz Sorry, you need to specify the card number. Please redo this with amixer -c0 contents
.
Describe the bug No sound card detected on a laptop - Acer Swift Go 14
System : Fedora 40
Packages : Fedora: alsa-sof-firmware-2024.03-2.fc40.noarch alsa-firmware-1.2.4-12.fc40.noarch
And even with manually installing: sof-bin-2024.03.tar.gz
To Reproduce Install Linux on this Acer laptop.
sudo modprobe -r snd_sof_pci_intel_mtl sudo modprobe snd_sof_pci_intel_mtl
Reproduction Rate All the time
Expected behavior The sound card should be detected.
Impact showstopper It is necessary for meeting.
Environment
Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver). Kernel: : vmlinuz-6.8.5-300.fc40.x86_64 or Linus 6.9.0-rc3+ SOF: sof-bin-2024.03 Name of the topology file Topology file: intel/sof-ace-tplg/sof-hda-generic-idisp-2ch.tplg Name of the platform(s) on which the bug is observed. Platform: Acer Swift Go 14 Screenshots or console output
No SoundWire machine driver found
alsa-info.txt