linux icon indicating copy to clipboard operation
linux copied to clipboard

[BUG] No sound on Acer Swift SFG14-72-735T (Intel Ultra 7 155H)

Open liquidev opened this issue 1 year ago • 52 comments

There seems to be missing firmware for the DSP chip used in this particular laptop. Journalctl mentions a missing topology file:

Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: SoundWire enabled on CannonLake+ platform, using SOF driver
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: enabling device (0000 -> 0002)
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: use msi interrupt mode
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: No SoundWire machine driver found
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: hda codecs found, mask 4
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: DMICs detected in NHLT tables: 2
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: SOF firmware and/or topology file not found.
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Supported default profiles
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: - ipc type 1 (Requested):
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3:  Firmware file: intel/sof-ipc4/mtl/sof-mtl.ri
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3:  Topology file: intel/sof-ace-tplg/sof-hda-generic-idisp-2ch.tplg
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Check if you have 'sof-firmware' package installed.
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Optionally it can be manually downloaded from:
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3:    https://github.com/thesofproject/sof-bin/
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: error: sof_probe_work failed err: -2

I've looked for this topology file but it doesn't seem to exist anywhere. There's only sof-tplg/sof-hda-generic-idisp-2ch.tplg, but not sof-ace-tplg/sof-hda-generic-idisp-2ch.tplg.

The following audio chip is reported in lspci:

0000:00:1f.3 Multimedia audio controller [0401]: Intel Corporation Meteor Lake-P HD Audio Controller [8086:7e28] (rev 20)
        Subsystem: Acer Incorporated [ALI] Device [1025:171f]

Environment

  • Arch Linux 6.8.7-zen1-1-zen thesofproject/sof#1 ZEN SMP PREEMPT_DYNAMIC Wed, 17 Apr 2024 15:20:00 +0000 x86_64 GNU/Linux
  • extra/sof-firmware 2024.03-1

liquidev avatar Apr 26 '24 11:04 liquidev

@liquidev can you try installing v2.9 https://github.com/thesofproject/sof-bin/releases/tag/v2024.03

lgirdwood avatar Apr 26 '24 12:04 lgirdwood

@lgirdwood I did try installing the latest release there before submitting this issue but to no avail. (Tried uninstalling the Arch-provided package and then using install.sh from the tarball, the effect was the same.)

I believe the Arch-provided package may simply be the same as the v2024.03 tag in sof-bin. Unless you're saying I should try cloning the repo and installing from there instead of using the tarball.

liquidev avatar Apr 26 '24 12:04 liquidev

Just tried installing v2.9 from the git cloned repo, no luck either. Same systemd journal logs as before.

liquidev avatar Apr 26 '24 12:04 liquidev

I've looked for this topology file but it doesn't seem to exist anywhere. There's only sof-tplg/sof-hda-generic-idisp-2ch.tplg, but not sof-ace-tplg/sof-hda-generic-idisp-2ch.tplg.

Can you try a soft link here so the kernel will find a similar file.

@ujfalusi @plbossart fyi - could the arch kernel be missing a kernel patch ?

lgirdwood avatar Apr 26 '24 13:04 lgirdwood

It is a SDW device:

Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: SoundWire enabled on CannonLake+ platform, using SOF driver
..
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: No SoundWire machine driver found
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: hda codecs found, mask 4
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
Apr 26 11:28:17 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: DMICs detected in NHLT tables: 2

Since no SDW machine driver was found the stack falls back to HDMI only topology, but indeed we only have the basic sof-hda-generic-idisp.tplg which does not support DMIC (and this machine has SDW+DMIC+HDMI).

The root cause is that we don't know this setup, so we fail to get the correct machine driver and the fallback to HDMI+DMIC does not work due to missing tplg.

@kv2019i, FYI

ujfalusi avatar Apr 26 '24 13:04 ujfalusi

$ pacman -Qi sof-firmware | grep Version
Version         : 2024.03-1

$ pacman -Ql sof-firmware| grep idisp 
sof-firmware /usr/lib/firmware/intel/sof-ipc4-tplg/sof-hda-generic-idisp.tplg
sof-firmware /usr/lib/firmware/intel/sof-tplg/sof-hda-generic-idisp-2ch.tplg
sof-firmware /usr/lib/firmware/intel/sof-tplg/sof-hda-generic-idisp-4ch.tplg
sof-firmware /usr/lib/firmware/intel/sof-tplg/sof-hda-generic-idisp.tplg

ujfalusi avatar Apr 26 '24 13:04 ujfalusi

Is there anything I can do to fix this (or help fix this?)

@lgirdwood I tried making the symlink but it's failing with a different error now:

Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: SoundWire enabled on CannonLake+ platform, using SOF driver
Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: enabling device (0000 -> 0002)
Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: use msi interrupt mode
Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: No SoundWire machine driver found
Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: hda codecs found, mask 4
Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: DMICs detected in NHLT tables: 2
Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Firmware paths/files for ipc type 1:
Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3:  Firmware file:     intel/sof-ipc4/mtl/sof-mtl.ri
Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3:  Firmware lib path: intel/sof-ipc4-lib/mtl
Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3:  Topology file:     intel/sof-ace-tplg/sof-hda-generic-idisp-2ch.tplg
Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Loaded firmware library: ADSPFW, version: 2.9.0.1
Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Booted firmware version: 2.9.0.1
Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: sof_ipc4_parse_manifest: Invalid topology ABI size: 3
Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: error: tplg component load failed -22
Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: error: failed to load DSP topology -22
Apr 26 15:41:41 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ASoC: error at snd_soc_component_probe on 0000:00:1f.3: -22

liquidev avatar Apr 26 '24 13:04 liquidev

@liquidev, can this help you: https://github.com/thesofproject/linux/issues/4923

ujfalusi avatar Apr 26 '24 14:04 ujfalusi

@ujfalusi It looks promising but I have no idea where to begin testing out the patches. Do I need to compile the thesofproject/linux kernel with the patches, and then put the tplg file wherever the kernel module will tell me to? Or does this only involve recompiling the sof-specific kernel modules and then installing them somehow?

Any pointers or instructions would be appreciated :smile:

liquidev avatar Apr 26 '24 15:04 liquidev

https://thesofproject.github.io/latest/getting_started/setup_linux/install_locally.html

plbossart avatar Apr 26 '24 15:04 plbossart

Can you attach the results of this updated script (bash alsa-info.sh.txt), i'll help us check if this is really a SoundWire topology.

alsa-info.sh.txt

plbossart avatar Apr 26 '24 15:04 plbossart

Sure, here it is:

alsa-info.txt

I'll get to setting up a local kernel for testing in the meantime.

liquidev avatar Apr 26 '24 15:04 liquidev

I'm afraid I can't set up a custom kernel by myself, it's beyond my technical ability at the moment. After a couple hours I managed to compile it successfully but then Arch's mkinitcpio fails to produce me a usable initramfs, which causes my root partition to not be loaded properly.

I just want my audio to work :confused:

liquidev avatar Apr 26 '24 18:04 liquidev

I just want my audio to work 😕

From https://www.acer.com/us-en/laptops/swift/swift-go/pdp/NX.KR0AA.001

Operating System: Windows 11

I'm afraid I can't set up a custom kernel by myself, it's beyond my technical ability at the moment.

The only way not to have to go through all this pain is to buy a device that officially supports Linux. This is especially true with audio where there is a lot of hardware "creativity".

I hope you can find someone who can help you with this sort of kernel hacking.

marc-hb avatar Apr 26 '24 21:04 marc-hb

@liquidev, you can try to follow this official Arch documentation: https://wiki.archlinux.org/title/Kernel/Traditional_compilation#Installation So, something along these lines:

make modules
sudo make modules_install
make bzImage
sudo cp -v arch/x86/boot/bzImage /boot/vmlinuz-linuxSOF 
sudo cp /etc/mkinitcpio.d/linux.preset /etc/mkinitcpio.d/linuxSOF.preset
sudo vim /etc/mkinitcpio.d/linuxSOF.preset
# Append SOF to the linux name as described in 4.3.1
sudo mkinitcpio -p linuxSOF
# if you use GRUB, then:
sudo grub-mkconfig -o /boot/grub/grub.cfg

grub-mkconfig can break booting (been there several times myself, but 'easy' to recover) on a system where the grub install was done with older version of GRUB, if in doubt you might want to run grub-install prior mkconfig, see https://wiki.archlinux.org/title/GRUB#Installation https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Bootloader#Install

Reboot, then select Advanced/Additional options or something and select linuxSOF to boot (keep fingers crossed).

ujfalusi avatar Apr 27 '24 09:04 ujfalusi

@marc-hb Sorry if my comment came off as urging for this to get solved, that was not my intention. I too would like Linux to support more hardware configurations :)

I'm having another stab at it today and will probably make slow progress over the week with some support from a friend that's more savvy with using custom kernels on Arch. No hard promises, but fingers crossed I can get it to work and report something back here.

@ujfalusi I mostly followed the instructions described on that Arch wiki page, but when running mkinitcpio -p linux-sof (that's the name I assigned to the custom kernel) I'm getting an ominous warning:

==> Building image from preset: /etc/mkinitcpio.d/linux-sof.preset: 'default'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-linux-sof -g /boot/initramfs-linux-sof.img
==> Starting build: '6.9.0-rc3-sof-ga2a39cb962fa'
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [microcode]
  -> Running build hook: [modconf]
  -> Running build hook: [kms]
  -> Running build hook: [keyboard]
==> WARNING: Possibly missing firmware for module: 'xhci_pci'
  -> Running build hook: [keymap]
  -> Running build hook: [consolefont]
==> WARNING: consolefont: no font found in configuration
  -> Running build hook: [block]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: '/boot/initramfs-linux-sof.img'
==> WARNING: errors were encountered during the build. The image may not be complete.
==> Building image from preset: /etc/mkinitcpio.d/linux-sof.preset: 'fallback'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-linux-sof -g /boot/initramfs-linux-sof-fallback.img -S autodetect
==> Starting build: '6.9.0-rc3-sof-ga2a39cb962fa'
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [microcode]
  -> Running build hook: [modconf]
  -> Running build hook: [kms]
  -> Running build hook: [keyboard]
==> WARNING: Possibly missing firmware for module: 'xhci_pci'
  -> Running build hook: [keymap]
  -> Running build hook: [consolefont]
==> WARNING: consolefont: no font found in configuration
  -> Running build hook: [block]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: '/boot/initramfs-linux-sof-fallback.img'
==> WARNING: errors were encountered during the build. The image may not be complete.

and then the image fails to boot.

The way I set up my kernel was:

  1. Cloned thesofproject/kconfig and thesofproject/linux
  2. cd linux
  3. zcat /proc/config.gz > .config
  4. ../kconfig/kconfig-distro-sof-update.sh, which prompted me for whether I'd like to install some drivers - I said no to all of them, because they seemed irrelevant to my hardware:
    BT8XX GPIO abuser (GPIO_BT8XX) [N/m/y/?] (NEW) n
    Analog Devices ADM1021 and compatibles (SENSORS_ADM1021) [N/m/y/?] (NEW) n
    Maxim MAX6642 sensor chip (SENSORS_MAX6642) [N/m/y/?] (NEW) n
    Studio Evolution SE6X (SND_SE6X) [N/m/?] (NEW) n
    
    It then proceeded to generate the config successfully (zero exit code.)
  5. make -j22
  6. doas make modules_install
  7. make bzImage
  8. doas cp -v arch/x86/boot/bzImage /boot/vmlinuz-linux-sof
  9. doas cp /etc/mkinitcpio.d/linux.preset /etc/mkinitcpio.d/linux-sof.preset
  10. Changed the kernel name in the mkinitcpio config just copied
  11. doas mkinitcpio -p linux-sof - this step produced the logs above with that ominous "errors were encountered during the build" warning
  12. Rebooted and chose the linux-sof kernel in rEF, which failed to boot due to not being able to find /dev/nvme0n1p2 (my root partition) - it waited 20 seconds for the device to become available, but it never did.

Which leads me to believe the kernel may be missing some modules to mount my disk/partitions. I would debug further whether it's the drive or partitions, but the laptop keyboard is not working in the emergency shell. I might try an external keyboard later.

liquidev avatar Apr 27 '24 17:04 liquidev

Sorry if my comment came off as urging for this to get solved, that was not my intention.

It didn't :-)

I too would like Linux to support more hardware configurations :)

The only way for this to happen at scale is for customers to buy more Linux. Volunteering can only go so far. AND it saves all these hassles from a more "selfish" perspective.

with some support from a friend that's more savvy with using custom kernels on Arch.

Good idea.

I said no to all of them, because they seemed irrelevant to my hardware

In doubt just say "yes". It won't take much more time and unused Linux drivers cannot cause any harm. Optimize only after you have something working.

Which leads me to believe the kernel may be missing some modules to mount my disk/partitions.

Yes, looks like something missing in initramfs. Try lsinitrd, lsinitramfs or lsinitcpio and compare with a working image.

Have you considered the user-friendlier https://wiki.archlinux.org/title/Dracut ?

Also:

https://wiki.archlinux.org/title/Kernel/Traditional_compilation#Installation This can be, depending on your background, more complicated than using the Kernel/Arch build system. Consider the Arch build system tools are developed and maintained to make repeatable compilation tasks efficient and safe.

(all this seems much easier on Ubuntu or Fedora)

marc-hb avatar Apr 27 '24 18:04 marc-hb

@liquidev, the issue is at step 4

../kconfig/kconfig-distro-sof-update.sh
...
#
# configuration written to .config
#
using config: '.config'
*
* Restart config...

So kconfig is starting from a blank config, lacking vital drivers. This might work better (not boot tested/built the kernel):

rm .config*
zcat /proc/config.gz > .config
make olddefconfig
scripts/kconfig/merge_config.sh .config ../kconfig/sof-defconfig
scripts/kconfig/merge_config.sh .config ../kconfig/soundwire-defconfig
make -j22
...

Check the sizes of the initrd images (ls -al /boot/), try to boot the linux-sof fallback if that is bigger.

ujfalusi avatar Apr 27 '24 19:04 ujfalusi

The only way for this to happen at scale is for customers to buy more Linux. Volunteering can only go so far. AND it saves all these hassles from a more "selfish" perspective.

That's what would happen in an ideal world, but from my own selfish perspective I really wanted to have a laptop with a nice, HiDPI OLED display in a fairly thin and light 14" form factor. I'm not aware of any Linux-friendly manufacturers offer that yet, not to mention living in Poland further limits my choices.

But let's cut that thread here to not go too offtopic, insted let's focus on getting audio to work on this darn thing :^)


I managed to get the kernel running. Turns out it's just that rEFInd's default heuristics for assigning initrds to kernels ended up confused and loaded the vanilla linux initrd into the linux-sof kernel. But now that the kernel booted, and with the topology from https://github.com/thesofproject/linux/issues/4923#issuecomment-2076802894 loaded into my /lib/firmware/intel/sof-ace-tplg, PipeWire actually sees an output - so that's a success \o/

In the journal, I get this, which includes a couple warnings, and then a whole slew of errors:

Apr 28 22:09:22 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
Apr 28 22:09:22 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: SoundWire enabled on CannonLake+ platform, using SOF driver
Apr 28 22:09:22 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: enabling device (0000 -> 0002)
Apr 28 22:09:22 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
Apr 28 22:09:22 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
Apr 28 22:09:22 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: use msi interrupt mode
Apr 28 22:09:22 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: DMICs detected in NHLT tables: 2
Apr 28 22:09:22 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: hda codecs found, mask 4
Apr 28 22:09:22 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Firmware paths/files for ipc type 1:
Apr 28 22:09:22 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3:  Firmware file:     intel/sof-ipc4/mtl/sof-mtl.ri
Apr 28 22:09:22 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3:  Firmware lib path: intel/sof-ipc4-lib/mtl
Apr 28 22:09:22 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3:  Topology file:     intel/sof-ace-tplg/sof-mtl-rt712-l0-2ch.tplg
Apr 28 22:09:22 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Loaded firmware library: ADSPFW, version: 2.9.0.1
Apr 28 22:09:22 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Booted firmware version: 2.9.0.1
Apr 28 22:09:22 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Topology: ABI 3:29:0 Kernel ABI 3:23:0
Apr 28 22:09:22 construct kernel: sof_sdw sof_sdw: ASoC: Parent card not yet available, widget card binding deferred
Apr 28 22:09:22 construct kernel: sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 3
Apr 28 22:09:22 construct kernel: input: sof-soundwire Headset Jack as /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0/input18
Apr 28 22:09:22 construct kernel: input: sof-soundwire HDMI/DP,pcm=5 as /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0/input19
Apr 28 22:09:22 construct kernel: input: sof-soundwire HDMI/DP,pcm=6 as /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0/input20
Apr 28 22:09:22 construct kernel: input: sof-soundwire HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0/input21
Apr 28 22:09:32 construct alsactl[706]: alsa-lib utils.c:364:(uc_mgr_config_load_into) could not open configuration file /usr/share/alsa/ucm2/sof-soundwire/rt712.conf
Apr 28 22:09:32 construct alsactl[706]: alsa-lib parser.c:78:(uc_mgr_config_load_file) error: failed to open file /usr/share/alsa/ucm2/sof-soundwire/rt712.conf: -2
Apr 28 22:09:32 construct alsactl[706]: Found hardware: "sof-soundwire" "Intel Meteor Lake HDMI" "HDA:8086281d,80860101,00100000  cfg-amp:1 mic:dmic cfg-mics:2 iec61937-pcm:7,6,5 hs:rt712-sdca spk:rt712" "" ""
Apr 28 22:10:25 construct pipewire[1282]: pw.node: (alsa_output.pci-0000_00_1f.3-platform-sof_sdw.pro-output-2-56) suspended -> error (Start error: Invalid argument)
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ------------[ DSP dump start ]------------
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: DSP panic!
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: fw_state: SOF_FW_BOOT_COMPLETE (7)
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: 0x50000005: module: ROM_EXT, state: FW_ENTERED, running
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Firmware state: 0x5, status/error code: 0x0
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Unknown toolchain is used
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: error: DSP Firmware Oops
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: error: Exception Cause: AllocaCause, MOVSP instruction, if caller’s registers are not in the register file
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: EXCCAUSE 0x00000005 EXCVADDR 0x00000000 PS       0x00060520 SAR     0x0000000c
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: EPC1     0xa00703e1 EPC2     0x00000000 EPC3     0x00000000 EPC4    0x00000000
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: EPC5     0x00000000 EPC6     0x00000000 EPC7     0x00000000 DEPC    0x00000000
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: EPS2     0x00000000 EPS3     0x00000000 EPS4     0x00000000 EPS5    0x00000000
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: EPS6     0x00000000 EPS7     0x00000000 INTENABL 0x00000000 INTERRU 0x00000000
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: stack dump from 0x00000000
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: AR registers:
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: 0x0: a004b826 a00fbbf0 00000000 40116200
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: 0x10: a0116280 00000018 400ffc10 a00fbbf0
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: 0x20: a005b861 a00fbbb0 400ffc10 a005ffe4
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: 0x30: a005b861 a00fbbb0 400ffc10 a005ffe4
Apr 28 22:10:25 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ------------[ DSP dump end ]------------
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc timed out for 0xe030004|0xc00
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ------------[ IPC dump start ]------------
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Host IPC initiator: 0x8e030004|0xc00|0x0, target: 0x1b0a0000|0x0|0x0, ctl: 0x3
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ------------[ IPC dump end ]------------
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: IPC timeout
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ASoC: error at soc_component_trigger on 0000:00:1f.3: -110
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc4_tx_msg_unlocked: ipc message send for 0xe010004|0x0 failed: -19
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ASoC: error at soc_component_trigger on 0000:00:1f.3: -19
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc4_tx_msg_unlocked: ipc message send for 0xe010103|0x0 failed: -19
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ASoC: error at soc_component_trigger on 0000:00:1f.3: -19
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc4_tx_msg_unlocked: ipc message send for 0xe000103|0x0 failed: -19
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: sof_pcm_stream_free: pcm_ops hw_free failed -19
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ASoC: error at snd_soc_pcm_component_prepare on 0000:00:1f.3: -19
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc4_tx_msg_unlocked: ipc message send for 0x13000003|0x1 failed: -19
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: failed to pause all pipelines
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ASoC: error at soc_component_trigger on 0000:00:1f.3: -19
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc4_tx_msg_unlocked: ipc message send for 0x46000002|0x3 failed: -19
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: failed to unbind modules mixin.0.1:0 -> mixout.1.1:0
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc4_tx_msg_unlocked: ipc message send for 0x12000000|0x0 failed: -19
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: failed to free pipeline widget pipeline.0
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Failed to free connected widgets

The last few errors are repeated over and over again.

Now for the practical results - the good part is, the headphone jack works! \o/

The bad part is, the internal speakers don't. I haven't tested HDMI yet, will test it out in a minute.

liquidev avatar Apr 28 '24 20:04 liquidev

Alright, I plugged the laptop into the TV in my living room, and HDMI audio is not working. In pavucontrol there is no distinct output port for HDMI:

image

Video is working fine, though I guess that's to be expected.

liquidev avatar Apr 28 '24 20:04 liquidev

One weird thing that happens with the headphone jack is a two very loud audible clicks coming from my amplifier whenever there's a new audio source in PipeWire (or any other change in audio configuration, for that matter.) This doesn't happen with my other laptop so I'm thinking it might be a soundcard configuration issue.

Either way, here's a video demonstrating the issue:

https://github.com/thesofproject/sof/assets/16415678/52ecafce-c946-49d2-8989-624bddf0e005

Another odd issue is that when the amplifier is connected to the headphone jack but off (in standby), the GNOME OSD for audio volume shows the headphone output getting muted as if you hit the Volume Down key combo repeatedly in a steady interval:

Screencast from 2024-04-29 00-07-18.webm

which actually confused the heck out of me when I first saw it. I presume it may be another soundcard-related issue. (On the video, I'm the counteracting the volume changes manually by holding down the appropriate Fn-key combination.)

liquidev avatar Apr 28 '24 22:04 liquidev

@liquidev Can you run "sudo alsaucm reload" command and see if there is any error output?

bardliao avatar Apr 29 '24 06:04 bardliao

The firmware panic is a ChainDMA start

ci-intel-mtl 0000:00:1f.3: ------------[ DSP dump end ]------------
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ipc timed out for 0xe030004|0xc00
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ------------[ IPC dump start ]------------
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: Host IPC initiator: 0x8e030004|0xc00|0x0, target: 0x1b0a0000|0x0|0x0, ctl: 0x3
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: ------------[ IPC dump end ]------------
Apr 28 22:10:26 construct kernel: sof-audio-pci-intel-mtl 0000:00:1f.3: IPC timeout

To have more information the sof-dyndbg.conf as described here https://github.com/thesofproject/linux/issues/4923#issuecomment-2052436089 and a full dmesg would probably give more insights. Locally I cannot reproduce it.

ujfalusi avatar Apr 29 '24 06:04 ujfalusi

@bardliao, UCM is looking for rt712.conf? There is not such a file in UCM, not even in git version...

Apr 28 22:09:32 construct alsactl[706]: alsa-lib utils.c:364:(uc_mgr_config_load_into) could not open configuration file /usr/share/alsa/ucm2/sof-soundwire/rt712.conf
Apr 28 22:09:32 construct alsactl[706]: alsa-lib parser.c:78:(uc_mgr_config_load_file) error: failed to open file /usr/share/alsa/ucm2/sof-soundwire/rt712.conf: -2
Apr 28 22:09:32 construct alsactl[706]: Found hardware: "sof-soundwire" "Intel Meteor Lake HDMI" "HDA:8086281d,80860101,00100000  cfg-amp:1 mic:dmic cfg-mics:2 iec61937-pcm:7,6,5 hs:rt712-sdca spk:rt712" "" ""

ujfalusi avatar Apr 29 '24 07:04 ujfalusi

@bardliao Same thing as in the journal:

ALSA lib utils.c:364:(uc_mgr_config_load_into) could not open configuration file /usr/share/alsa/ucm2/sof-soundwire/rt712.conf
ALSA lib parser.c:78:(uc_mgr_config_load_file) error: failed to open file /usr/share/alsa/ucm2/sof-soundwire/rt712.conf: -2
ALSA lib main.c:1554:(snd_use_case_mgr_open) error: failed to import hw:0 use case configuration -2
alsaucm: error failed to open sound card hw:0: No such file or directory

@ujfalusi dmesg after booting with the configuration you requested: dmesg.txt (just ran dmesg > /tmp/dmesg.txt as root)

Note this is with headphones plugged in; I can also provide the logs when no headphones are connected as well as when HDMI is connected if that makes a difference.

liquidev avatar Apr 29 '24 07:04 liquidev

@bardliao, UCM is looking for rt712.conf? There is not such a file in UCM, not even in git version...

Apr 28 22:09:32 construct alsactl[706]: alsa-lib utils.c:364:(uc_mgr_config_load_into) could not open configuration file /usr/share/alsa/ucm2/sof-soundwire/rt712.conf
Apr 28 22:09:32 construct alsactl[706]: alsa-lib parser.c:78:(uc_mgr_config_load_file) error: failed to open file /usr/share/alsa/ucm2/sof-soundwire/rt712.conf: -2
Apr 28 22:09:32 construct alsactl[706]: Found hardware: "sof-soundwire" "Intel Meteor Lake HDMI" "HDA:8086281d,80860101,00100000  cfg-amp:1 mic:dmic cfg-mics:2 iec61937-pcm:7,6,5 hs:rt712-sdca spk:rt712" "" ""

Right, rt722.conf is missing in UCM. @shumingfan FYI

bardliao avatar Apr 29 '24 08:04 bardliao

~~Just to me clear, this is a completely different layout compared to the Acer Swift Go 14 handled in https://github.com/thesofproject/sof/pull/9041 and https://github.com/thesofproject/linux/issues/4923~~

Edit: never mind, it's indeed the same hardware as https://github.com/thesofproject/sof/pull/9041 and https://github.com/thesofproject/linux/issues/4923


!!ACPI SoundWire Device Status Information
!!---------------

Realtek 0x000030025d071201

plbossart avatar Apr 29 '24 13:04 plbossart

And there's something completely corrupted in the setup reported in alsa-info:

[    4.266357] sof-audio-pci-intel-mtl 0000:00:1f.3: No SoundWire machine driver found
[    4.266360] sof-audio-pci-intel-mtl 0000:00:1f.3: hda codecs found, mask 4
[    4.266362] sof-audio-pci-intel-mtl 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[    4.266364] sof-audio-pci-intel-mtl 0000:00:1f.3: DMICs detected in NHLT tables: 2
[    4.269590] sof-audio-pci-intel-mtl 0000:00:1f.3: Firmware paths/files for ipc type 1:
[    4.269593] sof-audio-pci-intel-mtl 0000:00:1f.3:  Firmware file:     intel/sof-ipc4/mtl/sof-mtl.ri
[    4.269595] sof-audio-pci-intel-mtl 0000:00:1f.3:  Firmware lib path: intel/sof-ipc4-lib/mtl
[    4.269596] sof-audio-pci-intel-mtl 0000:00:1f.3:  Topology file:     intel/sof-ace-tplg/sof-hda-generic-idisp-2ch.tplg
[    4.270561] sof-audio-pci-intel-mtl 0000:00:1f.3: Loaded firmware library: ADSPFW, version: 2.9.0.1
[    4.383815] sof-audio-pci-intel-mtl 0000:00:1f.3: Booted firmware version: 2.9.0.1
[    4.405010] sof-audio-pci-intel-mtl 0000:00:1f.3: Topology: ABI 3:29:0 Kernel ABI 3:23:0
[    4.405051] sof-audio-pci-intel-mtl 0000:00:1f.3: error: can't connect DAI alh-copier.Playback-SimpleJack.0 stream Playback-SimpleJack

The last error means that the topology file for HDaudio was overidden with a topology file for SoundWire. Obviously this can't work. it's like putting diesel instead of regular gas in your car. Don't do it.

plbossart avatar Apr 29 '24 14:04 plbossart

So the summary is that this device has TWO PCH-attached DMICs, and RT712 on link0. ~~The topology used for Acer Swift Go 14 cannot be reused.~~ It's indeed the same topology as https://github.com/thesofproject/sof/pull/9041, I confused RT712 and RT713 haha.

DMICs detected in NHLT tables: 2
Realtek 0x000030025d071201

plbossart avatar Apr 29 '24 14:04 plbossart

@liquidev Could you try to test the patch (https://github.com/shumingfan/alsa-ucm-conf/commit/395ed2a6cb70d992967cb756ca84e021caef025c)?

shumingfan avatar Apr 30 '24 07:04 shumingfan