You are not logged in.

#1 2025-03-20 12:31:29

acutm
Member
From: Mar del Plata - Argentina
Registered: 2015-05-26
Posts: 26

[SOLVED] Audio Problem ALSA sof-audio-pci Realtek ALC287

Hi everyone,

I’ve been troubleshooting an intermittent audio issue on my Arch Linux system for a while and could use some help. The sound from my speakers (analog output) occasionally turns metallic or distorted, and despite extensive testing, I haven’t found a solution. Here’s the full rundown:

Hardware: Lenovo Yoga Pro 9 16IMH9 (SSID 17aa:38d6)

Audio Device: Meteor Lake-P HD Audio Controller with Realtek ALC287 codec

Driver: sof-audio-pci-intel-mtl using skl_hda_dsp_generic

Kernel: Latest Arch kernel (currently 6.13.17 as of March 20, 2025, but also tested LTS)

Firmware: sof-firmware installed, version 2.12.0.1

Output from aplay -l:


card 0: sofhdadsp [sof-hda-dsp], device 0: HDA Analog (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 3: HDMI1 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 4: HDMI2 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 5: HDMI3 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

The issue started when I was using PipeWire (with WirePlumber). The audio from the speakers would intermittently sound metallic—sometimes it’d start fine and distort after a while, especially under load (e.g., multiple videos from YouTube or WhatsApp Web). I migrated to PulseAudio to see if it’d help, but the problem persists unchanged. Even when testing with aplay /usr/share/sounds/alsa/Front_Center.wav (which uses ALSA directly), the metallic sound appears, ruling out PipeWire or PulseAudio as the sole culprits.

Interestingly, Bluetooth audio (via headphones) works perfectly, even when the speakers fail, suggesting the issue is specific to the analog output (hw:0,0) handled by the HDA route in sof-hda-dsp.

Tried PipeWire to PulseAudio migration: Removed PipeWire (pipewire, wireplumber, pipewire-pulse) and installed PulseAudio. No improvement.

Topology adjustments: The default topology is sof-hda-generic-4ch.tplg (from /usr/lib/firmware/intel/sof-ace-tplg/). Forced sof-hda-generic-2ch.tplg via /usr/share/alsa/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf with TQ "sof-hda-generic-2ch" and /etc/modprobe.d/sof.conf with options snd_sof_intel_hda_common hda_model=sof-hda-generic-2ch and rebuilt initramfs.

Result: Audio worked fine initially (even under load), but eventually reverted to 4ch and broke again. This is my theory, I can't really confirm 100% this is the jump from 2ch to 4ch, or the fact that it was never on 2ch.

Renamed 2ch.tplg to 4ch.tplg as a workaround, but it resulted in a "dummy output."

ALSA configuration: Edited /etc/asound.conf and ~/.asoundrc to force hw:0,0 with rate 48000 and format S16_LE. Got errors like Unknown field buffer_size until corrected syntax, but no fix.

PulseAudio tweaks: Set default-sample-rate = 48000, avoid-resampling = true, and adjusted buffer settings in /etc/pulse/daemon.conf. No change. Fixed the speaker sink with pactl set-default-sink, but the issue persists.

Kernel parameters: Tried snd_hda_intel.dmic_detect=0 snd_hda_intel.model=generic in GRUB: Audio was bad from the start. Tested snd_sof_pci.debug=1: No effect, parameter ignored.

Login behavior: Audio works fine in the login screen (volume adjustment sounds clean), but breaks instantly upon logging into my graphical session. In a TTY, aplay still produces the metallic sound after a while.

Logs: dmesg | grep -i sof shows firmware and topology loading fine, no errors:

[    4.021236] sof-audio-pci-intel-mtl 0000:00:1f.3:  Topology file:     intel/sof-ace-tplg/sof-hda-generic-4ch.tplg
[    4.021891] sof-audio-pci-intel-mtl 0000:00:1f.3: Loaded firmware library: ADSPFW, version: 2.12.0.1

journalctl -k | grep -i audio and PulseAudio logs show no obvious underruns or DSP errors.

The issue is specific to the analog speaker output (HDA Analog), not Bluetooth (SSP route).

sof-hda-generic-2ch seems more stable than 4ch, but the system keeps reverting to 4ch.

The problem occurs with aplay (ALSA directly), so it’s not just PipeWire or PulseAudio.

Something in the graphical session triggers or worsens it, but it’s not clear what.

Has anyone with Meteor Lake-P or sof-hda-dsp (ALC287) seen this metallic sound issue?

Why does sof-hda-dsp ignore my topology settings (2ch) and revert to 4ch?

Could this be a firmware bug in sof-firmware 2.12.0.1 or a kernel regression?

Any ideas on what might interfere with ALSA upon login?

I’m considering testing a live USB (e.g., Ubuntu) to rule out hardware, but I’d like to hear the input from the community first. Thanks !


EDIT:

After further investigation, I came across the fact that pipewire was not completely removed. In fact, Gnome will break to hell if I do, so I could only manage to disable it.

Journalctl does not give any report of the exact moment when my sound breaks.
If i leave my pc on for 30min untouched, audio remains fine. But as soon as I start loading random  sounds (mostly youtube, whatsapp web videos, and constantly rising and lowering volume to hear "plop"), that's when it eventually breaks.

Last edited by acutm (2025-03-26 05:16:59)

Offline

#2 2025-03-26 05:16:08

acutm
Member
From: Mar del Plata - Argentina
Registered: 2015-05-26
Posts: 26

Re: [SOLVED] Audio Problem ALSA sof-audio-pci Realtek ALC287

After more and more investigation, I got the problem fixed. Creating the file ~/.config/wireplumber/main.lua.d/51-custom.lua including:

table.insert(alsa_monitor.rules,
  {
    matches = {
      {
        { "node.name", "matches", "alsa_output.pci-0000_00_0e.0.*"  },
      },
      {
        { "node.name", "matches", "alsa_input.pci-0000_00_0e.0.*"  },
      },
    },
    apply_properties = {
      ["audio.format"]           = "S16LE",
    },
  }
)

I also did a fresh debian install to compare the problem. Ended up having the same issue and also fixed it with this file.

Offline

Board footer

Powered by FluxBB