Skip to content

Instantly share code, notes, and snippets.

@frafra
Last active April 20, 2023 20:25
Show Gist options
  • Select an option

  • Save frafra/47f2e448c033b0306d4422508f5a504b to your computer and use it in GitHub Desktop.

Select an option

Save frafra/47f2e448c033b0306d4422508f5a504b to your computer and use it in GitHub Desktop.
USB C headphones sound distorsion fix for Linux

Affected devices

  • Bowers & Wilkins PX7 19b5:0025 B & W Group
  • Dali IO-6 0a12:0001 Cambridge Silicon Radio

Fix

The best way to fix that is to use PipeWire, since it allows to set rules for a specific device only, instead of having to change the sampling rate of the whole audio system.

PipeWire

mkdir -p ~/.config/wireplumber/main.lua.d
cat << EOF > ~/.config/wireplumber/main.lua.d/51-dali.lua
table.insert(alsa_monitor.rules,
  {
    matches = {
      {
        { "node.name", "matches", "alsa_output.usb-0a12_DALI_IO_451004010173-00.*" },
      },
    },
    apply_properties = {
      ["audio.rate"] = 96000,
    },
  }
)
EOF

PulseAudio

default-sample-rate = 96000 in /etc/pulse/daemon.conf

Alsa

defaults.pcm.dmix.rate 96000 in /etc/asound.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment