Runtime controlling sources in rodio, can we do better?
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
- 技术栈
- rust
调研方向
Read the Source examples in the issue and compare the proposed approaches with hodaun, kira, and the linked channel_router pull request. Start by weighing periodic callbacks, atomics, and command queues for the different source types; the issue is done when the discussion reaches a decision on an approach and its tradeoffs.
由索引模型根据 Issue 内容生成。
描述
Chains of rodio Source's are currently only controllable using periodic callback. It has a few great advantages namely:
- Users get to pick between latency and performance through longer and shorter periods between callbacks. Those periods are defined in real time not number of samples
- Can have very little overhead as one periodic callback at the end can control the entire chain. That means only one conditional is added for most samples.
It does have its downsides it require users to either: have lots of periodic callbacks which negates the advantages, for example:
let controlled source = sine(..).periodic_callback(function_controlling_sine)
.amplify(1.0).periodic_callback(function_controlling_amplify)
.pausable().periodic_callback(function_controlling_pausable)
Or to use lots of inner_mut to navigate through the pipeline/chain. This feels akward and is less readable.
let controlled source = sine(..).amplify(1.0).pausable().periodic_callback(|pausable| {
function_controlling_pausable(pausable);
function_controlling_amplify(pausable.inner_mut())
function_controlling_sine(pausable.inner_mut().inner_mut())
})
Users also have to set up their own method of moving intentions/commands into the callbacks. Two solutions are: checking a queue receiver or always updating inner sources from loaded atomic's. This can be hard for newer rust users or those not skilled at concurrency.
Over the last few months a few alternatives have been proposed such as:
- heap allocated atomics.
- a command queue.
There are also other audio projects we can take inspiration from, such as:
hodaun and
kira.
Not all of these solutions are optimal for every source. Where atomics might
work well for simple few paramater sources like amplify and pausable they could
really hamper performance for things like channel_router.
Lets discuss our options highlighting advantages and potential drawbacks then
evaluate those.
- 主要语言
- Rust
- 星标
- 2.5k
- 派生
- 338
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
RustAudio/rodio 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
-
难度 1/5 1 小时以内 新手友好度 73/100
-
难度 3/5 1-2 天 新手友好度 45/100
-
难度 3/5 1-2 天 新手友好度 67/100
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
ci: migrate pinned macos-15 runners to macos-26 and macos-26-intel可能已有人在做 @hawkingrei 今天认领。 未关闭enhancement
难度 2/5 1-3 小时 新手友好度 85/100
nowledge-co/hawdb#2224 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
eclipse-score/coverage_tool#95 ·
维护者通常 2 天内回复
-
bug nvim
难度 2/5 1-3 小时 新手友好度 74/100