omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Cannot record audio via built in stereo microphone

Open ckowega opened this issue 10 months ago • 10 comments

System details

AMD Ryzen AI 7 350, AMD Radeon 860M Graphics, Omarchy 3.2.3, Kernel 6.17.9-arch1-1

What's wrong?

I have microphone-problems: In the omarchy-hyprland session I can't use the built in stereo microphone, since the wrong one (dmic) is always set as default, and only this one is visible to apps like signal and so on...

  • digital microphone (dmic) is always set as default but does not record anything,
  • I cannot set the built in stereo-mic as default - it always switches back to dmic
  • exception: audacity is able to record audio via stereo mic.
  • all the other apps are not seeing the stereo mic.

I checked xdg-portals - they seem to be right and started in the right order.

I also tried to overwrite wireplumber/pipewire-settings but it doesn't do anything.

Is there any solution?

I also checked an Ubuntu-live-system - everything works perfectly fine over there. So there must be a fix that I just can't find.

I'd be glad if someone would have a suggestion...thanks for your help.

ckowega avatar Jan 03 '26 21:01 ckowega

Just found a solution via community.frame.work:

Go to /etc/modprobe.d/

Create the following file with sudo nvim ./disable-dmic.conf and add the following lines: blacklist snd_soc_dmic blacklist snd_acp_legacy_mach blacklist snd_acp_mac

What I also did is: I added to the file .config/wireplumber/wireplumber.conf.d/alsa-config.conf

the following lines: monitor.alsa.properties = { alsa.use-ucm = false }

Hope this helps!

ckowega avatar Jan 03 '26 22:01 ckowega

Oh nice. Could you turn this into a PR? Would be great to have this just work out of the box.

dhh avatar Jan 08 '26 10:01 dhh

https://github.com/qompassai/omarchy/blob/main/install/config/hardware/audio.sh

testing out the blacklist modules- may not be universally good to blacklist.

PhaedrusFlow avatar Jan 11 '26 02:01 PhaedrusFlow

I looked into this against the current development branch (quattro, which becomes Omarchy 4.x). I could not reproduce it: the failure depends on the laptop's AMD audio coprocessor and microphone wiring, and a virtual machine has neither.

What I found:

  • Omarchy already ships one Framework 13 AMD microphone fix, install/user/hardware/framework/fix-f13-amd-audio-input.sh. It switches the AMD audio card to the HiFi (Mic1, Mic2, Speaker) profile during setup. It was written for the earlier Ryzen 7040 boards and does not touch the dmic device, so nothing in Omarchy currently addresses what you describe on a Ryzen AI 300 machine.
  • The workaround from the Framework forum works for you, but as written it affects every machine it is installed on. The module blacklist disables those drivers system-wide, and alsa.use-ucm = false under monitor.alsa.properties turns off UCM for every sound card, not just this one. Shipping it by default would need a narrow hardware check and proof that it doesn't break microphones or speakers on other AMD laptops, and that can only be tested on the hardware itself.

To make it safe to ship, we need these from you:

  1. The exact laptop model (is it a Framework Laptop 13 with a Ryzen AI 300?), its BIOS version, and whether the problem still happens on a current Omarchy install without the workaround.
  2. With the workaround removed, the output of omarchy-debug, plus lspci -nnk | grep -iA3 audio, cat /proc/asound/cards, arecord -l, pactl list cards and wpctl status -n.
  3. Which part of the workaround is actually needed. Does the WirePlumber alsa.use-ucm = false change fix it on its own? Does the module blacklist fix it on its own? Or does it only work with both? If UCM alone is enough, the fix can be a rule that matches only this sound card.

A second opinion from Codex Medium agreed on all of this. It also pointed out that a virtual machine cannot recreate this audio path, and that turning off UCM through monitor.alsa.properties applies to every card. Its independence from my review is not guaranteed. This now waits on the details above, and then the maintainer will decide on a fix.

omarchybot avatar Oct 07 '26 23:10 omarchybot

Confirming this on a second machine — Framework Laptop 13 with an AMD Ryzen AI 300 board (FRANMGCP05), Omarchy 4.0.4, kernel 7.2.5-3-omarchy. I can reproduce the symptom and, usefully, I can answer @omarchybot's question about which part of the workaround is required: alsa.use-ucm = false on its own is sufficient. The module blacklist is not needed.

Hardware / driver stack

  • c1:00.6 AMD Ryzen HD Audio Controller (snd_hda_intel, ALC285) → alsa_card.pci-0000_c1_00.6
  • c1:00.5 AMD Audio Coprocessor (snd_acp_pci) → card acp-pdm-mach (DMIC capture dmic-hifi-0)
  • snd_acp_legacy_mach, snd_acp_mach, snd_soc_dmic loaded

Symptoms with UCM enabled (stock Omarchy)

  • Default source is HiFi__Headset__source — the headset-jack mic, silent with nothing plugged in.
  • The internal mic HiFi__Mic1__source ("Digital Microphone") records garbage, not audio.
  • Selecting the HiFi (Mic1, Mic2, Speaker) profile (what install/user/hardware/framework/fix-f13-amd-audio-input.sh intends) exposes Mic1 + Mic2, but both are also broken. Note that script greps the card for Family 17h/19h, so it does not even run here — this board reports Ryzen HD Audio Controller.

Measured with pw-record --target <src> ... piped to ffmpeg -af astats:

source DC offset RMS
Headset (jack) -0.20 -7.3 dB (silence)
Mic1 "Digital Microphone" (UCM) -0.9997 ~0 dB (full-scale DC)
Mic1 / Mic2 under HiFi (Mic1, Mic2, Speaker) -0.9997 / -0.33 full-scale DC

Fix (tested)

~/.config/wireplumber/wireplumber.conf.d/50-alsa-no-ucm.conf:

monitor.alsa.properties = { alsa.use-ucm = false }

then systemctl --user restart wireplumber — no reboot and no module blacklist.

Result:

  • Card falls back to output:analog-stereo+input:analog-stereo.
  • New source alsa_input.pci-0000_c1_00.6.analog-stereo, active port analog-input-internal-mic ("Internal Microphone", priority 8900).
  • Auto-selected as the default source.
  • Live capture: DC offset ≈ 0.00–0.02, RMS ≈ -1.5 dB, thousands of zero crossings → real audio.
  • Persists across systemctl --user restart wireplumber and reboots.

So the DMIC (snd_soc_dmic / ACP PDM) is the broken path, and the ALC285 legacy HDA input works once UCM stops routing to the DMIC.

Caveat for shipping

monitor.alsa.properties is global and disables UCM for every card (e.g. the Radeon HDMI card). A shippable fix should be scoped to alsa_card.pci-0000_c1_00.6 (or gated to Framework 13 Ryzen AI 300). Happy to test a scoped monitor.alsa.rules variant and open a PR.

anishvarsha avatar Oct 12 '26 18:10 anishvarsha

Thanks @anishvarsha, this answers the open question: on a Framework Laptop 13 with the Ryzen AI 300 board, turning UCM off is enough, and the module blacklist is not needed.

I checked your notes against quattro, the current development branch:

  • install/user/hardware/framework/fix-f13-amd-audio-input.sh looks for a card named Family 17h/19h. Setup still runs it on your board, but it finds no card with that name and does nothing. Your measurements also show that its HiFi (Mic1, Mic2, Speaker) profile is broken on this board, so making the name match would not fix it either.
  • Nothing else in Omarchy turns UCM off, blacklists the DMIC or ACP drivers, or handles acp-pdm-mach, so nothing currently addresses this.
  • alsa.use-ucm is the correct global setting under monitor.alsa.properties. For a single card, the setting is api.alsa.use-ucm = false, applied in a monitor.alsa.rules entry.

I could not reproduce this, because a virtual machine has neither the audio coprocessor nor the microphones. The diagnosis therefore rests on your measurements. It shows that the UCM path is broken on this machine and that the plain analog profile works. It does not yet show why UCM picks a broken source.

A scoped version would turn UCM off for this one card, and only on this laptop. Something like this, in place of the global setting:

monitor.alsa.rules = [
  {
    matches = [ { device.name = "~alsa_card.pci-*", device.product.name = "Ryzen HD Audio Controller" } ]
    actions = { update-props = { api.alsa.use-ucm = false } }
  }
]

The product name alone is shared by many AMD laptops. Omarchy would install this file only after a DMI check for this Framework model, the same way bin/omarchy-hw-framework16 identifies the Laptop 16. If you test it and open the pull request you offered, these would let it ship safely:

  1. cat /sys/class/dmi/id/{sys_vendor,product_name,product_family}, to show which field identifies this board.
  2. wpctl inspect on the card device for alsa_card.pci-0000_c1_00.6, so the match uses properties that card really has.
  3. With the global monitor.alsa.properties file removed and only the scoped rule in place, after a reboot: confirm the internal mic records, and that the speakers, headphone jack and HDMI audio all still work.
  4. Whether the working source captures both channels (pw-record --channels 2). The fallback analog-input-internal-mic might be on a different capture path from the DMIC that UCM picks.

@ckowega, if your Ryzen AI 7 350 laptop is not a Framework 13, please say which model it is. A check for that one laptop would not cover yours.

Codex Medium gave a second opinion and agreed on all of this. It also caught that the Framework script runs and does nothing, rather than not running at all, and it raised the question in point 4. Its independence from my review is not guaranteed. This now waits on a tested, scoped rule, ideally as the pull request offered above, and then on the maintainer.

omarchybot avatar Oct 13 '26 00:10 omarchybot

Tested the scoped monitor.alsa.rules approach — it's sufficient on its own, the module blacklist isn't needed, and it takes effect with just systemctl --user restart wireplumber (no reboot).

1. DMI fields

sys_vendor=Framework
product_name=Laptop 13 (AMD Ryzen AI 300 Series)
product_family=Laptop
product_version=A5
board_name=FRANMGCP05

2. wpctl inspect for the card

device.name         = "alsa_card.pci-0000_c1_00.6"
device.description  = "Ryzen HD Audio Controller"
device.product.id   = "0x15e3"
device.product.name = "Ryzen HD Audio Controller"
device.bus-path     = "pci-0000:c1:00.6"
alsa.mixer_name     = "Realtek ALC285"
alsa.components     = "HDA:10ec0285,f111000b,00100002"
api.alsa.use-ucm    = "false"   # with the rule in place

3. Scoped rule only (global monitor.alsa.properties setting and the module blacklist both removed):

  • The card moves from HiFi (Headset, Mic1, Speaker) to output:analog-stereo+input:analog-stereo.
  • Internal mic records — default source alsa_input.pci-0000_c1_00.6.analog-stereo, active port analog-input-internal-mic; a 2 s capture is real audio (DC ≈ −13, RMS ≈ −43 dBFS).
  • Speakers — sink alsa_output.pci-0000_c1_00.6.analog-stereo, active port analog-output-speaker.
  • Headphone port analog-output-headphones is present but not available (nothing plugged in), and with no display attached the Radeon card alsa_card.pci-0000_c1_00.1 reports available: no, so I can't verify those two on this unit. The rule only touches the ALC285 card, not the Radeon one.

4. Both channels capture — 2-channel (front-left,front-right), both carry signal over a 2 s window and are highly correlated (r ≈ 0.90, max|L−R| ≈ 687), consistent with the stereo mic array rather than duplicated mono.

Rule used:

monitor.alsa.rules = [
  {
    matches = [
      {
        device.name = "~alsa_card.pci-*"
        device.product.name = "Ryzen HD Audio Controller"
      }
    ]
    actions = {
      update-props = {
        api.alsa.use-ucm = false
      }
    }
  }
]

Installed only after an exact DMI match. Opened as #15218.

anishvarsha avatar Oct 13 '26 01:10 anishvarsha

Two open pull requests now fix this on the Framework Laptop 13 (AMD Ryzen AI 300 Series), and both install only on that model after an exact DMI check:

  • #15218 from @anishvarsha turns UCM off for the Ryzen HD Audio Controller card alone, through a WirePlumber rule, and leaves the kernel drivers loaded. That is the scoped rule tested above, with the measurements in this thread.
  • #10184 from @gulderov, the older of the two, blacklists the ACP drivers instead. That needs an initramfs rebuild and a reboot, and it removes the ACP path for the whole machine.

They are competing fixes for the same bug. Each is reviewed and tested as its own item, and the maintainer chooses between them. I checked both diffs against this thread; nothing here was run, because a virtual machine has neither the audio coprocessor nor the microphones.

I have not linked either one as closing this issue. @ckowega's original report names the processor but not the laptop, and both fixes do nothing on any machine other than the Framework 13. If yours is a Framework 13, cat /sys/class/dmi/id/product_name will say Laptop 13 (AMD Ryzen AI 300 Series), and then either fix covers you.

Codex Medium gave a second opinion and agreed on all of this: neither pull request should close this issue until the original reporter's model is known, and the two are alternatives. Its independence from my review is not guaranteed. This now waits on the maintainer's choice between the two pull requests.

omarchybot avatar Oct 13 '26 01:10 omarchybot

Adding headset and Bluetooth verification for the scoped WirePlumber fix (#15218) on this machine (Framework Laptop 13, AMD Ryzen AI 300 Series). The fix sets api.alsa.use-ucm = false for the Ryzen HD Audio Controller card only.

3.5 mm headset (plugged in)

  • Jack detection works: with a headset plugged, analog-output-speaker reports not available and the headset ports (availability group 2) take over.
  • Under the rule (UCM off) the card exposes analog-input-headset-mic; an ~8 s capture is real audio (RMS ≈ −15 dBFS, zcr ≈ 9.6k, L/R corr 0.999). The analog-output-headphones port is active.
  • For contrast, with UCM on the default source is HiFi__Headset__source and the same headset still captures, about 18 dB quieter (≈ −33 dBFS). So the fix does not regress the headset.

Bluetooth (Pixel Buds A-Series, A2DP)

The rule matches on device.name = "~alsa_card.pci-*" and device.product.name = "Ryzen HD Audio Controller", under monitor.alsa.rules. A Bluetooth card is bluez_card.<MAC>, driven by the bluez monitor, so it is excluded.

A/B with the rule removed vs installed:

rule ON (UCM off) rule OFF (UCM on)
analog card profile output:analog-stereo+input:analog-stereo HiFi (Headset, Mic1, Speaker)
analog api.alsa.use-ucm false absent
bluez card profile a2dp-sink a2dp-sink
bluez api.alsa.use-ucm absent absent
bluez card property diffs — none (ignoring volatile object.id/object.serial/client.id)

The bluez card is identical across both states, the BT sink stays front-left,front-right, and playback is audible in both.

USB-C / HDMI

A USB-C audio device would be alsa_card.usb-* (excluded by the glob), and the Radeon HDMI card (alsa_card.pci-..._c1_00.1, product Radeon High Definition Audio Controller) is excluded by the product-name predicate. The blast radius is the single ALSA card.

anishvarsha avatar Oct 13 '26 02:10 anishvarsha