DelayNode: signals connected to delayTime are ignored, and delayTime = 0 delays by maxDelayTime
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 30/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- cpp, react-native, typescript
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- C++
- 星标
- 864
- 派生
- 103
- 平均合并
- 1 天 16 小时
- 30 天内合并 PR
- 77
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
software-mansion/react-native-audio-api 的其他 Issue
-
AudioContext destructor dereferences a null audioPlayer_ when construction fails before initialize()可能已有人在做 @maciejmakowski2003 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
software-mansion/react-native-audio-api#1504 · 已指派 1 人 ·
维护者通常 1 天内回复
-
bug ios
难度 2/5 1-3 小时 新手友好度 78/100
software-mansion/react-native-audio-api#1238 · 1 条评论 ·
维护者通常 1 天内回复
-
Closed AudioContext / OfflineAudioContext is never released: stateChange listener is never unregistered可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug
难度 4/5 1-2 天 新手友好度 35/100
software-mansion/react-native-audio-api#1497 · 1 条评论 ·
维护者通常 1 天内回复
-
android bug
难度 4/5 3-5 天 新手友好度 20/100
software-mansion/react-native-audio-api#1494 · 3 条评论 ·
维护者通常 1 天内回复
-
[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 nothing可能已有人在做 @maciejmakowski2003 于 18 天前认领。 未关闭android bug
难度 4/5 3-5 天 新手友好度 48/100
software-mansion/react-native-audio-api#1416 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 software-mansion/react-native-audio-api 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
component: tabs platform: macOS
难度 2/5 1-3 小时 新手友好度 72/100
zen-browser/desktop#16860 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
metasequoiaime/msime#12003 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
windirstat/windirstat#776 ·
维护者通常 2 天内回复