Crackling microphone

Here you go,

[root@oldblackbox jakub]# inxi -A
Audio:
  Device-1: AMD SBx00 Azalia driver: snd_hda_intel
  Sound Server-1: ALSA v: k5.15.13-arch1-1 running: yes
  Sound Server-2: PulseAudio v: 15.0 running: yes

But I’m just getting rid of PulseAudio

Just replace pulse with pipewire.

sudo pacman -S pipewire pipewire-pulse --needed

No effect at all.

I don’t think the issue is solvable, as evidenced here: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1569 There are just some mitigations that can be applied.
It’s pure hit or miss whether your hardware is affected, the problem at the bottom of it being a misalignment within the snd_hda_intel module. Somebody must have offered an offending commit (probably about a year ago) Most popular sound cards use this module, so sticking a discrete sound card does not guarantee that crackling will go away.
Anyway, is anybody here using an inexpensive discrete sound card which is not affected by (microphone) crackling? What model?

I don’t see a lot of posts regarding microphone crackling here issues.

If the driver used to work properly, it’s always possible to switch back to an older kernel.

I have overcome crackling by buying a second-hand Sound Blaster (13.23 Euro). The microphone is functional again. Even in MS Teams, which was horrid before. Now I have:

[jakub@oldblackbox ~]$ inxi -A
Audio:
  Device-1: Creative Labs EMU20k1 [Sound Blaster X-Fi Series]
    driver: snd_ctxfi
  Sound Server-1: ALSA v: k5.15.13-arch1-1 running: yes
  Sound Server-2: PipeWire v: 0.3.43 running: yes

All settings are default.
I have also found out that some crackling was caused by a bad mic cable. Before any slightest crackle was amplified to extreme proportions. Now I have two problems. The first one is opposite to what was happening before:

  1. The mic boost slider has disappeared while the microphone is too quiet, even at 100%.
  2. It’s not obvious how to save alsamixer settings. I can’t save and restore settings as root, because I can’t run alsamixer as root. I get:
cannot open mixer: Device is disabled

When I run it as a regular user, it sort of works, but not entirely:

[jakub@oldblackbox ~]$ alsactl --file ~/.config/asound.state restore
alsa-lib main.c:1412:(snd_use_case_mgr_open) error: failed to import hw:0 use case configuration -2

This is probably because config options seem to appear and vanish at will. Right after login and before using any audio device, alsamixer doesn’t show any settings for the PipeWire card / PipeWire chip. After playing a sound I get two settings: Master and Capture. Automatic retrieval of Alsa settings will therefore be limited.
Grumbles aside, the situation is now much better anyway.