DelayNode: signals connected to delayTime are ignored, and delayTime = 0 delays by maxDelayTime

Aperta
#1,491 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@mdydek ci sta già lavorando.

Dal 23/11/2026.

  • #1492 di @mdydek — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp, react-native, typescript

Direzione di ricerca

Start with DelayNodeHostObject, where delayTimeParam_ is created with node_ as its owner, then read AudioParamHostObject and how it links bridgeNode_ to ownerNode_. Next, check DelayWriter's write-index calculation and how DelayWriterHostNode and DelayReaderHostNode are ordered. Done when a signal connected to delayTime modulates the delay and delayTime 0 gives no delay, matching the four-row table in the issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Description

In react-native-audio-api 1.0.1, DelayNode has two related delayTime bugs:

  1. A signal connected to delayTime has no effect, so an LFO can't modulate a delay (chorus, flanger, vibrato).
  2. With delayTime at 0, the output is delayed by maxDelayTime instead of 0.

Nothing is logged and no error is thrown.

Repro repository: https://github.com/wwrinkle/rnaa-delaytime-repro

Repro

Each case renders a one-sample click through createDelay(1) in an OfflineAudioContext and measures when it comes out:

const delay = ctx.createDelay(1);
delay.delayTime.value = 0;
source.connect(delay);
delay.connect(ctx.destination);

const control = ctx.createConstantSource();
control.offset.value = 0.25;
control.connect(delay.delayTime);
control.start(0);
delayTime.value Connected signal Expected, and Chrome 1.0.1 on Pixel 10
0.25 none 0.250 s 0.250 s
0 0.25 0.250 s 1.000 s
0.25 0.25 0.500 s 0.250 s
0 none 0.000 s 1.000 s

The Pixel gave the same results in repeated runs, each in a fresh app process, including a build from a clean clone of the repro repository. iOS is not tested, but the code involved is shared C++.

Cause (as far as I can tell)

Connected signals: DelayNodeHostObject creates the param with node_, the outer DelayNode, as its owner:

delayTimeParam_ =
    std::make_shared<AudioParamHostObject>(graph_, node_, delayNode_->getDelayTimeParam());

AudioParamHostObject then adds bridgeNode_ -> ownerNode_. Audio actually flows through DelayWriterHostNode and DelayReaderHostNode, and DelayWriter is what reads the param. The outer node's processNode is a no-op and it has no path to the destination, so the bridge's input never seems to reach the param the writer reads.

Zero delay: DelayWriter computes (readForWrite + delayTime * sampleRate) % size. At 0, the write index equals the read index. If the reader has already read that slot in the quantum, the new sample isn't read until the ring comes back around, which is maxDelayTime later.

The same code is on main today.

Possible fixes
  • Make the writer the param's owner, so the bridge is ordered before the node that reads it.
  • Handle a delay shorter than one quantum explicitly, for example by making sure the writer runs before the reader when there is no cycle.
Steps to reproduce
  1. Clone https://github.com/wwrinkle/rnaa-delaytime-repro and run npm install.
  2. Run npx expo prebuild --platform android, then npx expo run:android --variant release with a device connected.
  3. Run adb logcat ReactNativeJS:V '*:S' | grep '\[repro\]', or read the results on screen.
Snack or a link to a repository

https://github.com/wwrinkle/rnaa-delaytime-repro

React Native Audio API version

1.0.1

React Native version

0.86.3

Platforms

Android

JavaScript runtime

Hermes

Workflow

Expo Dev Client

Architecture

Fabric (New Architecture)

Build type

Release app & production bundle

Device

Real device

Device model

Pixel 10, Android 17

Acknowledgements

Yes


Investigated and drafted with an AI coding assistant. The reproduction in the linked repository was built from a clean clone and verified on a Pixel 10 before filing.

Lingua principale
C++
Stelle
864
Fork
103
Merge medio
1g 16h
PR unite (30g)
77

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di software-mansion/react-native-audio-api

Tutte le issue di software-mansion/react-native-audio-api

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.