bcm2835-codec: a second encoder STOP during drain produces duplicate EOS
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
- 40/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- c, linux
- Área
- embedded-iot
Línea de trabajo
Start in drivers/media/platform/raspberrypi/bcm2835-codec/bcm2835-v4l2-codec.c, at the VIDIOC_ENCODER_CMD handler that services V4L2_ENC_CMD_STOP and calls the drain/EOS path, and follow where the driver records that a drain is in progress. Find the existing guard that is skipped before both queues are streaming (referenced in #7733) and extend it so a second STOP, or a START while draining, returns EBUSY once drain has begun. Done means a double-STOP reports a single EOS event and stream teardown finishes without the bcm2835_codec_flush_buffers timeout — reproduce with the two-STOP sequence on a CM4, as the report and its logged output describe.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
On a Compute Module 4, a second V4L2_ENC_CMD_STOP while an H.264 encode is draining returns success. The driver submits EOS twice. In the immediate double-STOP test, stream teardown then timed out with one buffer outstanding. The second STOP should return EBUSY while the first drain is in progress.
Steps to reproduce the behaviour
- On a CM4 with an unmodified 64-bit rpi-6.18.y kernel, open /dev/video11 and configure H.264 capture and YUV420 output. Start both queues and encode a picture.
- Queue 12 more source frames and enough capture buffers.
- Call VIDIOC_ENCODER_CMD with V4L2_ENC_CMD_STOP twice before dequeuing the CAPTURE buffer marked LAST.
- Dequeue the buffers and EOS events, then stop streaming.
Expected: the second STOP returns EBUSY, one EOS is reported, and teardown completes without a timeout.
Observed: both STOP calls returned success and two EOS events were reported. An immediate second STOP also caused a teardown timeout with one buffer outstanding. A second STOP 250 ms later still produced two EOS events.
Device (s)
Raspberry Pi CM4
System
Board: Raspberry Pi Compute Module 4.
OS: Minimal RAM-based test environment; no Raspberry Pi OS image was used.
Kernel: unmodified 64-bit rpi-6.18.y at adb947547136096c91f037dd392cd8af3aa98451 (6.18.64-v8).
Firmware version: not recorded for this test.
Logs
Selected serial/test output from the unmodified kernel:
STOP #1: ret=0 errno=0 (Success) at 9565 ms
STOP #2: ret=0 errno=0 (Success) at 9565 ms
drain: result=complete, output=12/12, LAST=yes, EOS_events=2
[ 11.935653] bcm2835-codec bcm2835-codec: bcm2835_codec_flush_buffers: Timeout waiting for buffers to be returned - 1 outstanding
A single STOP under the same conditions produced one EOS event and no timeout.
Additional context
A local change that rejects a second STOP or a START during drain with EBUSY was built and tested on rpi-6.18.y at 731e90c14fb88950a44575276f2f190493af713f. On the same CM4 it produced one EOS event and no teardown timeout; START after a completed drain resumed encoding. The existing behavior before both queues are streaming was left unchanged (see #7733).
- Lenguaje dominante
- C
- Estrellas
- 13.4k
- Forks
- 5.5k
- Merge medio
- 2 d 11 h
- PR fusionados (30 d)
- 32
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 raspberrypi/linux
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
raspberrypi/linux#7415 · 2 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
rp1-cfe doesn't forward V4L2_EVENT_SOURCE_CHANGE event from csi-2 sensor driver to userspace appAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
raspberrypi/linux#7399 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Documentation update requiredAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
raspberrypi/linux#7357 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
raspberrypi/linux#7054 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
v3d: [drm:v3d_reset [v3d]] *ERROR* V3D_ERR_STAT: 0x00001000 when running app that uses vulkanAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 12/100
raspberrypi/linux#7790 · 18 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de raspberrypi/linux
Issues similares
-
Termux compilation failureAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
area/build-framework kind/enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
yugabyte/yugabyte-db#39342 ·
Los mantenedores suelen responder en 1 día
-
nuttx/esp32s3: sdkconfig.h has no "no console" case, so CONFIG_NO_SERIAL_CONSOLE builds failAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Document the isv:HDFGroup Linux package repositories and signing keyPosiblemente ocupada @brtnfld la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
kind:silent-wrong needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
InauguralSystems/EigenScript#2567 · 1 comentario ·
Los mantenedores suelen responder en 1 día