Skip to content

fix(audio-context): iOS targeted disconnect, per-connection channel mixing, splitter/merger and connect(AudioParam) - #286

Merged
triniwiz merged 3 commits into
masterfrom
feat/ios-audio-gaps
Nov 25, 2026
Merged

triniwiz merged 3 commits into
masterfrom
feat/ios-audio-gaps

Conversation

@triniwiz

@triniwiz triniwiz commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

iOS catches up with the Web Audio routing the specs check: targeted disconnects, per-connection channel mixing, a real ChannelSplitterNode/ChannelMergerNode and AudioNode.connect(AudioParam) on most params.

Routing

  • disconnect(destination), disconnect(output), disconnect(destination, output, input) and disconnect(param) remove only the matching connections. Connecting to a node no longer drops the source's other connections.
  • NSCChannelMixerNode (an in-process AUAudioUnit) gives each connection its own bus at its source's channel count and mixes with the speaker rules (1, 2, 4, 6 channels) or discretely.
    • Each AudioWorkletNode input mixes through one at its own channelCount.
    • A buffer with more channels than the context plays all of them.
  • ChannelMergerNode puts each input on its channel.
  • ChannelSplitterNode plays each output from its own node. AVAudioEngine drops the connections of a unit's other output buses when one output bus is connected, which silenced splitter output 0.

connect(AudioParam)

  • Params take an input block that a sink fills each render; param reads include it.
  • Every frame:
    • GainNode.gain, DelayNode.delayTime
    • the BiquadFilterNode params (now Chromium's per-frame biquad)
    • oscillator frequency and detune
    • ConstantSourceNode.offset
    • AudioBufferSourceNode.playbackRate and detune
    • the params of a worklet with inputs
  • Once per quantum, one quantum late: StereoPannerNode.pan, PannerNode position/orientation, and the params of a worklet without inputs.

Specs (iOS simulator, audio suite: 58 passed, 0 failed, 2 skipped)

  • The splitter-into-filter and worklet speakers specs now run on iOS.
  • New specs:
    • disconnect(node) keeps the source's other connections
    • disconnect(output)
    • disconnect(node, output, input)
    • disconnect(param)
    • per-frame oscillator frequency, biquad frequency and ConstantSource offset inputs
  • The biquad param spec is skipped on Android, whose biquad params ignore audio.
  • audio-graph's two iOS skips stay:
    • The DelayNode feedback loop hangs the render on iOS.
    • The explicit channelCount gain spec fails (a gain takes no channelCount).

Limits

  • PannerNode's own connect still uses the old routing, which cuts the source's other outputs.
  • A multi-output AudioWorkletNode is still one unit with several output buses, so connecting more than one of its outputs may hit the same AVAudioEngine behaviour.

Android

These specs now run on Android too, except four skipped there for Android bugs that this PR does not fix:

  • disconnect(output) and disconnect(node, output, input): disconnecting a splitter output on Android silences realtime worklet contexts created later in the suite.
  • OscillatorNode.frequency param input: the oscillator drifts from the automated reference.
  • BiquadFilterNode.frequency param input: Android biquad params ignore audio.

Android audio: 56 passed, 0 failed (Pixel_9_Pro). iOS audio: 58 passed, 0 failed.

…ixing, splitter/merger and connect(AudioParam)

- disconnect(destination), disconnect(output), disconnect(destination, output, input) and
  disconnect(param) remove only the matching connections (NSCConnectAdding /
  NSCDisconnectRemoving); connecting to a node no longer drops the source's other connections.
- NSCChannelMixerNode gives every connection its own bus at its source's channel count and mixes
  with the Web Audio speaker rules (1, 2, 4, 6 channels) or discretely. Each AudioWorkletNode
  input mixes through one at its own channelCount, and a buffer with more channels than the
  context plays all of them.
- ChannelMergerNode puts each input on its channel. ChannelSplitterNode plays each output from its
  own node: AVAudioEngine drops a unit's other output connections when one output bus is
  connected, which silenced splitter output 0.
- Params take an input block filled by a sink each render. BiquadFilterNode is Chromium's
  per-frame biquad, so frequency, Q, gain and detune take audio every frame, as do oscillator
  frequency and detune, ConstantSourceNode.offset, AudioBufferSourceNode playbackRate and detune
  and the params of a worklet with inputs. StereoPannerNode.pan, PannerNode position and
  orientation and the params of a worklet without inputs follow audio once per quantum.
- Specs: the splitter-into-filter and worklet speakers specs run on iOS; new specs for targeted
  disconnects and per-frame param inputs. audio-graph's feedback-loop and explicit channelCount
  specs stay skipped on iOS (a cycle hangs AVAudioEngine; gains take no channelCount).
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0923c84a-6c1c-4519-8e79-176f3b2538ae

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@triniwiz
triniwiz merged commit fc78886 into master Nov 25, 2026
33 checks passed
@triniwiz
triniwiz deleted the feat/ios-audio-gaps branch November 25, 2026 05:50
@github-actions

Copy link
Copy Markdown

ℹ️ Note: npm publishing is disabled for pull requests.
Publishing is performed only from tag pushes via the npm Release workflow.
If you need a test publish, merge to master — pushes publish pr-tagged prereleases.

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.

1 participant