Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

macOS helper audio-probe always reports -90 dBFS: AVAudioPCMBuffer frameLength set after the copy

Abierto Apto para principiantes
#3,771 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
88/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
swift
Área
desktop

Línea de trabajo

Empieza en AudioProbe.swift, dentro de add(sampleBuffer:), y comprueba el orden de la asignación de frameLength y la llamada a CMSampleBufferCopyPCMDataIntoAudioBufferList. Establece la longitud de trama antes de la copia y luego ejecuta agent-device-macos-helper audio-probe mientras se reproduce sonido; estará listo cuando los buckets indiquen niveles por encima de -90 dBFS.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug ready-for-agent

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.

Lenguaje dominante
TypeScript
Estrellas
5k
Forks
334
Merge medio
12 h 2 min
PR fusionados (30 d)
706

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de callstack/agent-device

Todos los issues de callstack/agent-device

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.