bcm2835-codec H.264 decode: last ~100 frames never dequeued at end of stream (Chromium V4L2, Pi 3B+, kernel 6.12)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- c, linux
- Ambito
- audio-video-rtc, operating-systems
Direzione di ricerca
Reproduce the stall with the provided ffmpeg sample in Chromium on a Pi 3B+ with hardware decoding enabled, then inspect the bcm2835-codec V4L2 end-of-stream and buffer-dequeue handling around /dev/video10. Compare the behavior with the early V4L2_BUF_FLAG_LAST case described in #5059. Done means playback reaches the final frame and the video element emits ended without disabling hardware decoding.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
A <video> element playing H.264 in Chromium stops advancing roughly 3.3 s before
the end of the file and never reaches the end. The element stays in a healthy
state: readyState 2, paused false, error null, the whole file buffered.
Because the ended event never fires, loop never restarts and any code waiting
on ended waits forever. The rest of the page keeps rendering normally.
Playback runs to the end and loops correctly when Chromium is started with
--disable-accelerated-video-decode.
Environment
- Raspberry Pi 3 Model B Plus Rev 1.3
- Raspberry Pi OS (Trixie), arm64, kernel 6.12
- Chromium 152, kiosk under
cage(Wayland), 1280x720 gpu_mem=128- Hardware decode confirmed in use: the GPU process holds
/dev/video10open
(bcm2835-codec-decode), verified with
ls -l /proc/$(pgrep -f -- --type=gpu-process)/fd | grep video
Where it stalls
Element state sampled every 2 s over the DevTools protocol.
| source | stalls at | duration |
|---|---|---|
| original, H.264 High, B-frames, moov at end | 16.76 s | 20 s |
| same stream, moov moved to front | 16.81 s | 20 s |
| re-encoded without B-frames | 16.77 s | 20 s |
| keyframe every 2 s (last at 18.0 s) | 16.75 s | 20 s |
| 40 s version of the same content | 36.67 s | 40 s |
| original, service worker bypassed | 16.75 s | 20 s |
original, --disable-accelerated-video-decode |
plays to end, loops | 20 s |
Both stall points sit about 3.3 s before the end, and both sources are 30 fps.
That is roughly 100 frames in each case, which suggests a fixed queue rather than
a fixed amount of time: the last ~100 frames appear to stay in the decoder and are
never dequeued.
What has been ruled out
- The file: ffmpeg decodes it without error or warning.
- Container layout: moving
moovto the front changes nothing. - Stream structure: no B-frames, and a keyframe every 2 s, change nothing.
- Delivery: bypassing the service worker changes nothing.
- Duration: the same behaviour at 20 s and 40 s, at the same offset from the end.
Possibly related
This looks like the same class of problem as #5059 (frames left un-dequeued after
CMD_STOP because V4L2_BUF_FLAG_LAST arrives early), but the trigger differs:
#5059 is about mid-stream caps renegotiation on a Pi 4 through GStreamer, while
this is at end of stream through Chromium's V4L2 decoder on a Pi 3. It is not
established that it is the same bug.
Why it matters here
This is a digital signage fleet. A video that never reaches its end never loops,
and a playlist that waits for ended stops advancing. The two workarounds
available to us both cost something: software decoding drops 34% of frames at
720p30 at 84% CPU and 73 °C with soft thermal limiting active, and working around
it in the player means dropping the last three seconds of every video.
Reproducing
Any H.264 file reproduces it. A self-contained sample:
ffmpeg -f lavfi -i testsrc2=size=1280x720:rate=30:duration=20 \
-c:v libx264 -profile:v high -pix_fmt yuv420p -crf 23 -an sample.mp4
Load it in a <video loop> element in Chromium on a Pi 3B+ with hardware decode
active and watch currentTime and readyState. It stops advancing around
16.7 s and stays there.
- Lingua principale
- C
- Stelle
- 13.3k
- Fork
- 5.5k
- Merge medio
- 3g 20h
- PR unite (30g)
- 27
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di raspberrypi/linux
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
raspberrypi/linux#7718 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
raspberrypi/linux#7415 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
rp1-cfe doesn't forward V4L2_EVENT_SOURCE_CHANGE event from csi-2 sensor driver to userspace appAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
raspberrypi/linux#7399 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
raspberrypi/linux#7357 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
raspberrypi/linux#7054 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di raspberrypi/linux
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
SPIDevice selects an active-high device as soon as it is createdForse già presa @mikeysklar l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
adafruit/circuitpython#11869 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
gnif/LookingGlass#1352 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
kovidgoyal/kitty#10862 ·
I maintainer di solito rispondono entro 1 giorno