Segfault when two threads create AudioResampler at once (recorder + Google realtime)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- audio-video-rtc
Línea de trabajo
Start by reading livekit/rtc/_ffi_client.py around line 295 and livekit/rtc/audio_resampler.py around line 71, where both thread stacks enter the FFI request during resampler creation. Reproduce with recorder audio enabled so the recorder encode thread and Google realtime input path create resamplers concurrently. Done means concurrent creation no longer causes the reported segfault.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
A realtime agent sometimes crashes with a segfault right as the session starts, when two threads create an rtc.AudioResampler at the same moment. It happened in 3 of 10 local runs for us.
The two threads are Google realtime's input path on the main thread and the session recorder's encode thread:
Current thread (most recent call first):
livekit/rtc/_ffi_client.py, line 295 in request
livekit/rtc/audio_resampler.py, line 71 in __init__
livekit/plugins/google/realtime/realtime_api.py, line 1668 in _resample_audio
livekit/plugins/google/realtime/realtime_api.py, line 792 in push_audio
livekit/agents/voice/agent_activity.py, line 1680 in push_audio
Thread (recorder_io encode thread):
livekit/rtc/_ffi_client.py, line 295 in request
livekit/rtc/audio_resampler.py, line 71 in __init__
livekit/agents/voice/recorder_io/recorder_io.py, line 88 in _resample
livekit/agents/voice/recorder_io/recorder_io.py, line 105 in push
livekit/agents/voice/recorder_io/recorder_io.py, line 299 in _encode_thread
Fatal Python error: Segmentation fault
Versions: livekit 1.1.18, livekit-agents 1.8.2, livekit-plugins-google 1.8.2, Python 3.12.14, macOS arm64.
Starting the session with record={"audio": False} avoids it, since no recorder thread is created. Is livekit_ffi_request meant to be safe when resamplers are created from two threads at once?
- Lenguaje dominante
- Python
- Estrellas
- 14.6k
- Forks
- 3.9k
- Merge medio
- 3 d 11 h
- PR fusionados (30 d)
- 196
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de livekit/agents
-
Assistant markup is stripped from chat history when expressive mode is offPosiblemente ocupada @ShivamSharma43 la tomó hace 17 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
docs: openai.LLM vs openai.responses.LLM for HTTP OpenAI-compat hostsQuizá libre de nuevo @AbarnaaSree la tomó hace 56 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
livekit/agents#7022 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Los mantenedores suelen responder en 1 día
-
TranslationRoomIO: unset_track() before a track is linked stalls startup, so the translation is never publishedPosiblemente ocupada @RaphaelFakhri la tomó hoy. Abierto
livekit/agents#8114 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Python AgentServer health check (GET /) returns 200 before the worker has registered with LiveKitPosiblemente ocupada @ninglinLiu la tomó hace 2 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
livekit/agents#8092 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de livekit/agents
Issues similares
-
Project submission:Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
slavakurilyak/awesome-ai-agents#845 ·
Los mantenedores suelen responder en 1 día
-
tests: pin that the atomic writers in utils/paths.py stage the temporary file in the target's directoryPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertodifficulty:2 enhancement good first issue
Dificultad 1/5 1-3 horas Aptitud para principiantes 92/100
MakazhanAlpamys/Soup#2178 ·
Los mantenedores suelen responder en 1 día
-
[BUG] dcg.waggr permutation p-values are folded twice, so near-zero scores get the smallest p-valuesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
scverse/rapids-singlecell#854 ·
Los mantenedores suelen responder en 1 día
-
Slang input: int8_t4_packed and uint8_t4_packed are copied into CrossGLPosiblemente ocupada @ninglinLiu la tomó hace 1 día. Abiertoarea:frontend backend:slang bug direction:input
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
random_elements(unique=True) on an OrderedDict: ZeroDivisionError once only zero weights remain, AssertionError with use_weighting=FalsePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 13 días