DelayNode: signals connected to delayTime are ignored, and delayTime = 0 delays by maxDelayTime
I maintainer di solito rispondono entro 1 giorno
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
- Ambito
- audio-video-rtc
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
Description
In react-native-audio-api 1.0.1, DelayNode has two related delayTime bugs:
- A signal connected to
delayTimehas no effect, so an LFO can't modulate a delay (chorus, flanger, vibrato). - With
delayTimeat 0, the output is delayed bymaxDelayTimeinstead 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
- Clone https://github.com/wwrinkle/rnaa-delaytime-repro and run
npm install. - Run
npx expo prebuild --platform android, thennpx expo run:android --variant releasewith a device connected. - 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
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di software-mansion/react-native-audio-api
-
AudioContext destructor dereferences a null audioPlayer_ when construction fails before initialize()Forse già presa @maciejmakowski2003 l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
software-mansion/react-native-audio-api#1504 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
bug ios
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
software-mansion/react-native-audio-api#1238 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Closed AudioContext / OfflineAudioContext is never released: stateChange listener is never unregisteredForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 4/5 1-2 giorni Idoneità per principianti 35/100
software-mansion/react-native-audio-api#1497 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
android bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 20/100
software-mansion/react-native-audio-api#1494 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[Android] AudioRecorder reopens a disconnected input stream with no limit: a re-route on every open (Samsung, concurrent capture) loops hundreds of times a minute and records nothingForse già presa @maciejmakowski2003 l’ha presa 18 giorni fa. Apertaandroid bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
software-mansion/react-native-audio-api#1416 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di software-mansion/react-native-audio-api
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
component: tabs platform: macOS
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
zen-browser/desktop#16860 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
metasequoiaime/msime#12003 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
windirstat/windirstat#776 ·
I maintainer di solito rispondono entro 2 giorni