Skip to content

Let PipeWire follow the source's sample rate - #13834

Closed
manuaudio wants to merge 3 commits into
omacom:quattrofrom
manuaudio:feat/pipewire-follow-sample-rate
Closed

manuaudio wants to merge 3 commits into
omacom:quattrofrom
manuaudio:feat/pipewire-follow-sample-rate

Conversation

@manuaudio

@manuaudio manuaudio commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Part 2 of the pro-audio proposal in #13832. Nothing changes for 48 kHz sources; 44.1, 88.2 and 96 kHz sources play at their own rate when the hardware supports it, and other rates are still resampled.

Problem

PipeWire's clock.allowed-rates is [ 48000 ] on a stock install, so every 44.1 kHz track and 88.2/96 kHz recording is resampled on its way to the device. On macOS, CoreAudio follows the source's rate.

Change

  • config/pipewire/pipewire.conf.d/10-sample-rates.conf sets default.clock.allowed-rates = [ 44100 48000 88200 96000 ]. When a stream starts on an idle device, PipeWire switches the device to that stream's rate if the hardware supports it. Otherwise it resamples exactly as it does today. New installs get the file through config/.
  • Migration 1790745839 installs the drop-in for existing users with omarchy-refresh-config. It also applies the same rates to the running graph with pw-metadata, since PipeWire only reads conf.d at startup. So the change takes effect on update without restarting PipeWire or interrupting playback. If the user already has the file, the migration leaves it and the running rates alone.

#11092 pins screen recording audio at 48 kHz, which is a separate setting. Recordings keep that fixed rate either way.

Testing

Live on Omarchy 4.0.0.alpha, PipeWire 1.6.8. I played a 44.1 kHz file and read the graph rate from pw-top:

allowed-rates graph rate while playing 44.1 kHz
[ 48000 ] (today) 48000, the source is resampled
[ 44100 48000 88200 96000 ] 44100, no resampling

The test machine's only output was PipeWire's null sink (its monitor was off). So this shows the graph switching rate, not a specific DAC. A check on real hardware from anyone with a USB DAC or audio interface would be welcome.

New test/shell.d/pipewire-sample-rates-test.sh:

  • PipeWire's own pw-config merges the shipped drop-in and reports default.clock.allowed-rates: [ 44100 48000 88200 96000 ].
  • The migration installs the file and applies the rates with pw-metadata.
  • A user's existing file is left untouched, and the running rates aren't changed.

./test/cli: the only failure, vscode generated theme references current theme file, is the same on quattro.

🤖 Generated with Claude Code

PipeWire only allowed 48 kHz, so every 44.1 kHz track and 88.2/96 kHz recording was resampled. A drop-in allows 44.1, 48, 88.2 and 96 kHz, so PipeWire switches an idle device to the rate of the stream that starts on it when the hardware supports it, and plays it bit-perfect. Rates a device can't do still resample.

New installs get the drop-in from config/. Existing installs get it from a migration that also applies the rates to the running graph, since PipeWire only reads conf.d at startup, and that leaves a user's own copy of the file alone.

Refs omacom#13832

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@manuaudio
manuaudio marked this pull request as ready for review October 1, 2026 19:28
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adds PipeWire audio sample rate configuration.

The PR appears safe to merge; no new actionable issue or outstanding previous finding was identified.

Summary

The PR adds a PipeWire drop-in allowing 44.1, 48, 88.2, and 96 kHz graph rates, a migration that applies those rates to the running graph when no existing rate choice is detected, and tests for installation and preservation of user and system settings.

Reviews (3) · Last reviewed commit: "Read system PipeWire config through PIPE..."

Comment thread migrations/1790745839.sh Resolved
Comment thread migrations/1790745839.sh Resolved
…ser in the test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tays off the host

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the enhancement New feature or request label Oct 1, 2026
@manuaudio

Copy link
Copy Markdown
Contributor Author

Closing this to keep my open PRs to a handful. Thanks for looking, and I'm happy to reopen it if it's still useful.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants