macOS helper audio-probe always reports -90 dBFS: AVAudioPCMBuffer frameLength set after the copy
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 AudioProbe.swift 中的 add(sampleBuffer:) 开始,检查 frameLength 赋值和调用 CMSampleBufferCopyPCMDataIntoAudioBufferList 的顺序。在复制之前设置帧长度,然后在播放声音时运行 agent-device-macos-helper audio-probe;当各个 bucket 报告的电平高于 -90 dBFS 时即为完成。
由索引模型根据 Issue 内容生成。
描述
What happens
agent-device-macos-helper audio-probe reports every bucket at -90 dBFS while sound is playing. Seen on macOS 26/27, agent-device 0.21.15 through 0.21.28 (latest on npm at the time of writing). The ScreenCaptureKit audio session starts and buffers arrive, but no sample is ever counted.
Cause
In AudioProbe.swift, add(sampleBuffer:) calls CMSampleBufferCopyPCMDataIntoAudioBufferList while the new AVAudioPCMBuffer still has frameLength 0, so every mDataByteSize in its mutableAudioBufferList is 0. The call returns OSStatus -12731 on every buffer, the guard returns, and nothing is added. The pcmBuffer.frameLength = frameCount line comes after the copy:
guard frameCount > 0,
let pcmBuffer = AVAudioPCMBuffer(pcmFormat: format, frameCapacity: frameCount)
else {
return
}
let status = CMSampleBufferCopyPCMDataIntoAudioBufferList(
sampleBuffer,
at: 0,
frameCount: Int32(frameCount),
into: pcmBuffer.mutableAudioBufferList
)
guard status == noErr else {
return
}
pcmBuffer.frameLength = frameCount
Fix
Set pcmBuffer.frameLength = frameCount before the copy (or read the sample buffer with CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer).
Evidence
A standalone probe using the same ScreenCaptureKit stream (display filter, 48 kHz stereo) while a system sound played:
- helper's copy order:
status -12731 frames 960 byteSizesBefore [0, 0]on 155 of 155 buffers - reading the sample buffer directly: peak 0.48 (-6.3 dBFS) for the same audio
- the helper at the same moment:
[-90,-90,-90,-90,-90]
Happy to open a PR if wanted.
- 主要语言
- TypeScript
- 星标
- 5k
- 派生
- 334
- 平均合并
- 12 小时 2 分钟
- 30 天内合并 PR
- 706
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
callstack/agent-device 的其他 Issue
-
CLI: an empty numeric flag value is read as 0可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 83/100
callstack/agent-device#3792 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
callstack/agent-device#1869 ·
维护者通常 1 天内回复
-
ready-for-agent refactor
难度 5/5 一周以上 新手友好度 25/100
callstack/agent-device#3794 ·
维护者通常 1 天内回复
-
bug in-progress ready-for-agent
难度 3/5 1-2 天 新手友好度 72/100
callstack/agent-device#3787 ·
维护者通常 1 天内回复
-
Daemon startup: wait for a live daemon instead of a fixed 15 s deadline on slow or overloaded hosts可能已有人在做 @thymikee 今天认领。 未关闭needs-triage
难度 5/5 一周以上 新手友好度 35/100
callstack/agent-device#3782 ·
维护者通常 1 天内回复
查看 callstack/agent-device 的全部 Issue
相似的 Issue
-
The inspector never shows the instances field, so scaling out is unreachable可能已有人在做 @Mrkewl 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
xevrion/breakscale#96 ·
维护者通常 4 天内回复
-
Object parameters lose their structure when resources is enabled可能已有人在做 @asts-top 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
rossant/awesome-math#199 ·
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
jaegertracing/jaeger-ui#4618 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
mifi/lossless-cut#3125 ·
维护者通常 1 天内回复