bcm2835-codec: a second encoder STOP during drain produces duplicate EOS
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 40/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- c, linux
- Domaine
- embedded-iot
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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).
- Langage dominant
- C
- Étoiles
- 13.4k
- Forks
- 5.5k
- Merge moyen
- 2 j 11 h
- PR mergées (30 j)
- 32
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de raspberrypi/linux
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
raspberrypi/linux#7415 · 2 commentaires · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
rp1-cfe doesn't forward V4L2_EVENT_SOURCE_CHANGE event from csi-2 sensor driver to userspace appOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
raspberrypi/linux#7399 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Documentation update requiredOuverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 82/100
raspberrypi/linux#7357 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
raspberrypi/linux#7054 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
v3d: [drm:v3d_reset [v3d]] *ERROR* V3D_ERR_STAT: 0x00001000 when running app that uses vulkanOuverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 12/100
raspberrypi/linux#7790 · 18 commentaires ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de raspberrypi/linux
Issues similaires
-
Termux compilation failureOuvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 1 jour
-
area/build-framework kind/enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
yugabyte/yugabyte-db#39342 ·
Les mainteneurs répondent en général sous 1 jour
-
nuttx/esp32s3: sdkconfig.h has no "no console" case, so CONFIG_NO_SERIAL_CONSOLE builds failOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
Document the isv:HDFGroup Linux package repositories and signing keyPeut-être pris @brtnfld l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 1 jour
-
kind:silent-wrong needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
InauguralSystems/EigenScript#2567 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour