Skip to content

wireplumber: add AYN Odin 3 ALSA buffer quirk - #893

Open
ShrimpTale wants to merge 1 commit into
armada-os:mainfrom
ShrimpTale:odin3-audio-buffers
Open

ShrimpTale wants to merge 1 commit into
armada-os:mainfrom
ShrimpTale:odin3-audio-buffers

Conversation

@ShrimpTale

Copy link
Copy Markdown
Contributor

What

Adds a WirePlumber drop-in for the AYN Odin 3 (SM8750-AYN), scoped to that card only.

Why

Intermittent audio crackle in Proton/FEX games on Odin 3, plus a click when playback restarts after silence.

Measured on Armada 20261109.dfed5d6: hardware runs S16_LE / 48000 / 2ch, period_size 480, buffer_size 3840 (80 ms). The crackle reproduces with both stable and winnative Turnip drivers, so it is not GPU-related. Thor Lite and PocketMax already ship wireplumber.conf.d drop-ins; Odin 3 had none.

What it does

  • api.alsa.headroom = 1024
  • session.suspend-timeout-seconds = 0 + node.pause-on-idle = false

Not setting api.alsa.period-size on purpose: the hardware period is fixed at 480 frames and a hint there gets overridden.

Tested

  • AYN Odin 3, Armada 20261109.dfed5d6, PipeWire 1.6.11 / WirePlumber 0.5.19
  • Before: crackle bursts while playing Trails in the Sky 2nd Chapter
  • After: crackle bursts gone over a ~1h session

Note

Crackle also disappears with PULSE_LATENCY_MSEC=60 in the game launch options, so the effective lever may be the Wine/Pulse fragment size. Happy to run A/B tests on the hardware if you prefer a pipewire-pulse level fix.

This configuration file adjusts the ALSA headroom and session properties for the AYN Odin 3 device to prevent audio crackling under load.
@ShrimpTale

Copy link
Copy Markdown
Contributor Author

Related: #615 (disable audio power suspension). This drop-in is deliberately
device-scoped to SM8750-AYN because the crackle reproduces on Odin 3 and I
cannot test the other handhelds. If you would rather fold the
session.suspend-timeout-seconds = 0 part into the global change from #615 and
keep only the headroom override here, I'm happy to rework the patch.

@FeralAI FeralAI self-assigned this Nov 15, 2026
@FeralAI

FeralAI commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

I just merged #876, which is an alternative to #615. Can you provide examples of games that have crackle so I can test the headroom part of this?

@ShrimpTale

Copy link
Copy Markdown
Contributor Author

I just merged #876, which is an alternative to #615. Can you provide examples of games that have crackle so I can test the headroom part of this?

@FeralAI one title so far, and I think it's a different mechanism from #876, so it should still be a valid test of the headroom part:

Trails in the Sky 2nd Chapter — the September 2026 remake of SC, not the 2006 original (there is a free demo on Steam if you want to reproduce it cheaply). Proton 11.0 arm64 + FEX, on an Odin 3 running the stock 20261109 image. Launch options: PULSE_LATENCY_MSEC=60. User-level audio overrides in place while testing: 50-quantum.conf (quantum 1024), 51-alsa-buffers.conf (api.alsa.headroom=1024, session.suspend-timeout-seconds=0, node.pause-on-idle=false).

What it sounds like: broadband crackle in bursts of a few seconds over BGM and voice, and it always coincides with a frame stutter. Resuming playback after silence gives a single small click. It is not restricted to loud passages, and the Odin 3 profile has the headphone compander off, so I don't think this is the class-H window issue from #876 — I'd expect that one to show up on loud passages.

Why I put it down to headroom rather than the codec: ALSA on SM8750-AYN is pinned by the DSP to period 480 frames / buffer 3840 (80 ms @ 48 kHz, S16_LE), so userspace can't enlarge the period at all — headroom is the only lever. Adding api.alsa.headroom=1024 plus node.pause-on-idle=false and session.suspend-timeout-seconds=0 stopped the bursty crackle; what's left is the occasional single stutter.

Two caveats you should have before you test: (a) my data is from image 20261109, i.e. before #876, so I can't yet say whether this headroom override is still needed on top of it; (b) I have not A/B'd the three pieces separately — that needs pw-top xrun counts and pipewire-utils is missing from 20261109 (that's why #896 exists).

Happy to run whichever you prefer:

  1. A/B on current main + fix(kernel): WCD939x class-H: program the class-H port window and run the start-up once #876: baseline / headroom only / Pulse-latency only / all three, with pw-top xrun counts.
  2. Your note in fix(kernel): WCD939x class-H: program the class-H port window and run the start-up once #876 says the Odin 3 profile only turns the compander off because it clipped before — I can retest with it re-enabled and tell you whether that profile line can go.

And if #876 covers the power-suspend side of this, say so and I'll drop session.suspend-timeout-seconds from this PR and keep only the headroom line — or hold the PR until the A/B is in, your call.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants