Skip to content

CM4: bcm2835-codec / bcm2835_mmal_vchiq timeouts and videobuf2 "driver bug" when stopping broken live H.264 #7163

@nfstoney

Description

@nfstoney

Describe the bug

I have noticed the following error. I start an RTP stream from our TV provider. After a few seconds or minutes, the image freezes, but the sound continues to play.

I can confirm this with a high degree of certainty on CM4, Bookworm, kernel 6.12.47+rpt-rpi-v8.
CM4, Bullseye, kernel 5.x also has this error, but it takes longer.
CM5, Bookworm, kernel 6.12.47+rpt-rpi-v8 has this error never.

play the stream from rtp://@239.186.68.1:10000, after a few seconds or minutes the screen freezes, audio still go on
cvlc rtp://@239.186.68.1:10000 --audio-track=0 --aspect-ratio=16:9 --network-caching=1000 -f --no-osd --vout=opengles --width=1920 --height=1080

dmesg
[ 414.295487] vc4-drm gpu: swiotlb buffer is full (sz: 1572864 bytes), total 32768 (slots), used 1619 (slots)
[ 414.314773] vc4-drm gpu: swiotlb buffer is full (sz: 3121152 bytes), total 32768 (slots), used 1 (slots)
[ 414.366952] vc4-drm gpu: swiotlb buffer is full (sz: 327680 bytes), total 32768 (slots), used 1 (slots)
[ 415.647809] vc4-drm gpu: swiotlb buffer is full (sz: 1290240 bytes), total 32768 (slots), used 73 (slots)
[ 418.120075] vc4-drm gpu: swiotlb buffer is full (sz: 524288 bytes), total 32768 (slots), used 1119 (slots)
[ 421.383858] vc4-drm gpu: swiotlb buffer is full (sz: 524288 bytes), total 32768 (slots), used 3463 (slots)
[ 423.464651] vc4-drm gpu: swiotlb buffer is full (sz: 524288 bytes), total 32768 (slots), used 1143 (slots)
[ 424.469852] vc4-drm gpu: swiotlb buffer is full (sz: 524288 bytes), total 32768 (slots), used 2117 (slots)
[ 425.471839] vc4-drm gpu: swiotlb buffer is full (sz: 524288 bytes), total 32768 (slots), used 2697 (slots)
[ 430.172846] vc4-drm gpu: swiotlb buffer is full (sz: 524288 bytes), total 32768 (slots), used 3511 (slots)
[ 444.847048] vc4-drm gpu: swiotlb buffer is full (sz: 524288 bytes), total 32768 (slots), used 3521 (slots)
[ 446.855413] vc4-drm gpu: swiotlb buffer is full (sz: 348160 bytes), total 32768 (slots), used 63 (slots)
[ 467.464871] vc4-drm gpu: swiotlb buffer is full (sz: 524288 bytes), total 32768 (slots), used 3339 (slots)
[ 527.467992] vc4-drm gpu: swiotlb buffer is full (sz: 524288 bytes), total 32768 (slots), used 3375 (slots)
[ 658.066479] vc4-drm gpu: swiotlb buffer is full (sz: 524288 bytes), total 32768 (slots), used 1043 (slots)
[ 664.052385] bcm2835_mmal_vchiq: timed out waiting for sync completion
[ 664.052406] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: Failed disabling i/p port, ret -62
[ 667.124422] bcm2835_mmal_vchiq: timed out waiting for sync completion
[ 667.124443] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: Failed disabling o/p port, ret -62

Steps to reproduce the behaviour

Use a CM4 with Bookworm and kernel 6.12.47+rpt-rpi-v8

Since my TV signal from our provider is only available locally here, I logged this for about 5 minutes so that you can reproduce it.

Download Teststream from:
http://www.dreidb.ch/stream_239.186.68.1_10000_2025-12-03_13-20-51.ts

Play stream with:
cvlc stream_239.186.68.1_10000_2025-12-03_13-20-51.ts -f

After a few seconds or minutes, the videopicture freezes, but the sound continues to play. If this does not happen, restart Raspberry Pi and try again.

In case of an error, check the logs below the cvlc call and in dmesg.

Example:
play the ts-stream, after a few seconds or minutes the screen freezes, audio still go on
cvlc stream_239.186.68.1_10000_2025-12-03_13-20-51.ts -f
VLC media player 3.0.21 Vetinari (revision 3.0.21-0-gdd8bfdbabe8)
Fernsteuerungs-Interface initialisiert. `help' für Hilfe eingeben.
[00a395b0] dummy interface: using the dummy interface module...
[e81060e8] avcodec decoder error: unspecified video dimensions
[00a2de80] main audio output error: too low audio sample frequency (0)
[e812020] main decoder error: failed to create audio output
[e81060e8] main decoder error: buffer deadlock prevented
[00a2de80] vlcpulse audio output error: digital pass-through stream connection failure: Eingabe/Ausgabe-Fehler
[00a2de80] main audio output error: module not functional
[e812020] main decoder error: failed to create audio output
status change: ( audio volume: 256 )
[00a88b88] wl_xdg_shell window: <<< WL XDG: 1280x720 fs 1 standalone 0
[e810e360] wl_dmabuf vout display: <<< Open: DPV0 1280x720(1280x720 @ 0,0 0/0), cfg.display: 1280x720, source: 1280x720(1280x720 @ 0,0 1/1), scale=0/0
[e81060e8] avcodec decoder: Using DRM Video Accel for hardware decoding
status change: ( audio volume: 256 )
status change: ( audio volume: 256 )
status change: ( audio volume: 256 )

dmesg:
[ 184.293578] bcm2835_mmal_vchiq: timed out waiting for sync completion
[ 184.293602] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: Failed disabling i/p port, ret -62
[ 187.365732] bcm2835_mmal_vchiq: timed out waiting for sync completion
[ 187.365751] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: Failed disabling o/p port, ret -62
[ 189.381863] bcm2835-codec bcm2835-codec: bcm2835_codec_flush_buffers: Timeout waiting for buffers to be returned - 19 outstanding
[ 192.486049] bcm2835_mmal_vchiq: timed out waiting for sync completion
[ 192.486067] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: Failed enabling component, ret -62
[ 192.486143] ------------[ cut here ]------------
[ 192.486148] WARNING: CPU: 3 PID: 2751 at drivers/media/common/videobuf2/videobuf2-core.c:2215 __vb2_queue_cancel+0x238/0x2d8 [videobuf2_common]
[ 192.486177] Modules linked in: cfg80211 rfcomm snd_seq_dummy snd_hrtimer snd_seq uinput cmac algif_hash aes_arm64 aes_generic algif_skcipher af_alg bnep sg binfmt_misc vc4 snd_soc_hdmi_codec snd_usb_audio hci_uart v3d btbcm drm_display_helper rpi_hevc_dec cec gpu_sched bcm2835_codec(C) drm_dma_helper drm_shmem_helper snd_hwdep bluetooth snd_soc_core bcm2835_v4l2(C) drm_kms_helper uvcvideo snd_usbmidi_lib bcm2835_isp(C) joydev uvc snd_rawmidi snd_bcm2835(C) snd_compress ecdh_generic snd_seq_device bcm2835_mmal_vchiq(C) snd_pcm_dmaengine snd_pcm ecc vc_sm_cma(C) videobuf2_vmalloc v4l2_mem2mem videobuf2_dma_contig videobuf2_memops rfkill videobuf2_v4l2 libaes videodev videobuf2_common snd_timer raspberrypi_hwmon mc i2c_brcmstb i2c_bcm2835 snd pwm_bcm2835 raspberrypi_gpiomem nvmem_rmem hid_multitouch uio_pdrv_genirq uio i2c_dev ledtrig_pattern drm fuse dm_mod drm_panel_orientation_quirks backlight ip_tables x_tables ipv6
[ 192.486358] CPU: 3 UID: 1000 PID: 2751 Comm: vlc Tainted: G C 6.12.47+rpt-rpi-v8 #1 Debian 1:6.12.47-1+rpt1~bookworm
[ 192.486368] Tainted: [C]=CRAP
[ 192.486372] Hardware name: Raspberry Pi Compute Module 4 Rev 1.1 (DT)
[ 192.486376] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 192.486381] pc : __vb2_queue_cancel+0x238/0x2d8 [videobuf2_common]
[ 192.486395] lr : __vb2_queue_cancel+0x34/0x2d8 [videobuf2_common]
[ 192.486407] sp : ffffffc08bc83a30
[ 192.486410] x29: ffffffc08bc83a30 x28: ffffff808a792100 x27: 0000000000000009
[ 192.486421] x26: 0000000000000001 x25: 0000000000000000 x24: ffffff808a792700
[ 192.486430] x23: ffffff80408b8da0 x22: ffffff8084451428 x21: ffffff8044f0fd48
[ 192.486440] x20: ffffff80844514d0 x19: ffffff8084451428 x18: 00000000fffffffe
[ 192.486449] x17: 656c696146203a67 x16: 6e696d6165727473 x15: 5f706f74735f6365
[ 192.486459] x14: 646f635f35333832 x13: 32362d2074657220 x12: 2c746e656e6f706d
[ 192.486468] x11: 6f6320676e696c62 x10: ffffffddd589d4f0 x9 : ffffffddd411e820
[ 192.486477] x8 : 00000000ffffefff x7 : ffffffddd589d4f0 x6 : 80000000fffff000
[ 192.486487] x5 : ffffff80f7be2408 x4 : 0000000000000000 x3 : 0000000000000000
[ 192.486496] x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000000013
[ 192.486505] Call trace:
[ 192.486509] __vb2_queue_cancel+0x238/0x2d8 [videobuf2_common]
[ 192.486522] vb2_core_queue_release+0x2c/0x88 [videobuf2_common]
[ 192.486534] vb2_queue_release+0x18/0x30 [videobuf2_v4l2]
[ 192.486546] v4l2_m2m_ctx_release+0x28/0x50 [v4l2_mem2mem]
[ 192.486562] bcm2835_codec_release+0x64/0x110 [bcm2835_codec]
[ 192.486571] v4l2_release+0xec/0x100 [videodev]
[ 192.486617] __fput+0xd0/0x2e0
[ 192.486632] ____fput+0x1c/0x30
[ 192.486640] task_work_run+0x80/0xe8
[ 192.486647] do_exit+0x2f0/0x9b8
[ 192.486654] do_group_exit+0x3c/0xa0
[ 192.486660] get_signal+0x9b4/0x9d0
[ 192.486667] do_signal+0x100/0x1128
[ 192.486673] do_notify_resume+0xd0/0x150
[ 192.486680] el0_svc_compat+0x6c/0x80
[ 192.486690] el0t_32_sync_handler+0x98/0x140
[ 192.486698] el0t_32_sync+0x194/0x198
[ 192.486703] ---[ end trace 0000000000000000 ]---
[ 192.486708] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 0 in active state
[ 192.486714] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 1 in active state
[ 192.486718] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 2 in active state
[ 192.486722] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 3 in active state
[ 192.486726] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 4 in active state
[ 192.486729] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 5 in active state
[ 192.486733] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 6 in active state
[ 192.486737] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 7 in active state
[ 192.486741] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 8 in active state
[ 192.486744] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 9 in active state
[ 192.486748] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 10 in active state
[ 192.486752] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 11 in active state
[ 192.486756] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 12 in active state
[ 192.486759] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 13 in active state
[ 192.486763] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 14 in active state
[ 192.486767] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 15 in active state
[ 192.486771] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 16 in active state
[ 192.486774] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 18 in active state
[ 192.486778] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 19 in active state
[ 195.558223] bcm2835_mmal_vchiq: timed out waiting for sync completion
[ 198.630386] bcm2835_mmal_vchiq: timed out waiting for sync completion

Device (s)

Raspberry Pi CM4 Lite

System

Raspberry Pi reference 2025-05-13
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, f548f25325e28bea61904f5038a9b9fd0c92b07b, stage4
Aug 20 2025 17:02:31
Copyright (c) 2012 Broadcom
version cd866525580337c0aee4b25880e1f5f9f674fb24 (clean) (release) (start)
Linux trinity-65281-CM4 6.12.47+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.47-1+rpt1~bookworm (2025-09-16) aarch64 GNU/Linux

Logs

See above

Additional context

I can imagine that the stream is not entirely compliant, but this kind of behavior should not occur. CM4 with kernel 5 can handle it for hours before showing the error externally, while CM5 is not affected at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions