raspberrypi / linux

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/
Other
11k stars 4.95k forks source link

V4L2 hangs, prints kernel stack traces on gapless looping #5852

Open ardera opened 7 months ago

ardera commented 7 months ago

Describe the bug

When using a certain gstreamer pipeline and the v4l2 hardware decoder to do gapless looping of a video file, the playback will hang at the first EOS. Terminating the playback using Ctrl+C prints multiple kernel bugs/warnings/stack traces (?) and driver bug: messages

Steps to reproduce the behaviour

wget https://github.com/flutter/packages/raw/main/packages/video_player/video_player/example/assets/Butterfly-209.mp4 -O butterfly.mp4
gst-launch-1.0 multifilesrc location=butterfly.mp4 loop=true ! queue ! decodebin ! queue ! kmssink

Device (s)

Raspberry Pi 4 Mod. B

System

hannes@alpaka-pi:~ $ cat /etc/rpi-issue 
Raspberry Pi reference 2023-12-11
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 2acf7afcba7d11500313a7b93bb55a2aae20b2d6, stage2
hannes@alpaka-pi:~ $ sudo vcgencmd version
Oct 17 2023 15:39:16 
Copyright (c) 2012 Broadcom
version 30f0c5e4d076da3ab4f341d88e7d505760b93ad7 (clean) (release) (start)
hannes@alpaka-pi:~ $ uname -a
Linux alpaka-pi 6.1.0-rpi7-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux
hannes@alpaka-pi:~ $

Logs

dmesg output of the last few frames and subsequent Ctrl+C, with bcm2835-codec debug=5 and /dev/video10 debug=0x1f:

hannes@alpaka-pi:~ $ dmesg
...
[1070921.126048] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 000000000e1bac6d
[1070921.126048] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 000000000e1bac6d
[1070921.126077] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 000000000e1bac6d vbuf->flags 0, seq 0, bytesused 1382400
[1070921.126105] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.126119] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.126150] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 000000000e1bac6d
[1070921.126077] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 000000000e1bac6d vbuf->flags 0, seq 0, bytesused 1382400
[1070921.126197] video10: VIDIOC_QBUF: 00:03:34.000000 index=9, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.126105] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.126119] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.126252] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x40be2000, length=1382400
[1070921.126150] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 000000000e1bac6d
[1070921.126265] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
[1070921.126197] video10: VIDIOC_QBUF: 00:03:34.000000 index=9, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.126551] videodev: v4l2_poll: video10: poll: 00000104 0000003b
[1070921.126252] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x40be2000, length=1382400
[1070921.126265] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
[1070921.126551] videodev: v4l2_poll: video10: poll: 00000104 0000003b
[1070921.159365] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 000000001d2b0a73
[1070921.159365] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 000000001d2b0a73
[1070921.159395] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 000000001d2b0a73 vbuf->flags 0, seq 0, bytesused 1382400
[1070921.159422] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.159436] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.159466] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 000000001d2b0a73
[1070921.159513] video10: VIDIOC_QBUF: 00:03:31.000000 index=10, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.159566] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x40d34000, length=1382400
[1070921.159579] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
[1070921.159395] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 000000001d2b0a73 vbuf->flags 0, seq 0, bytesused 1382400
[1070921.159422] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.159436] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.159466] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 000000001d2b0a73
[1070921.159513] video10: VIDIOC_QBUF: 00:03:31.000000 index=10, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.159566] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x40d34000, length=1382400
[1070921.159579] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
[1070921.192545] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 000000004d94765e
[1070921.192576] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 000000004d94765e vbuf->flags 0, seq 0, bytesused 1382400
[1070921.192603] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.192617] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.192648] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 000000004d94765e
[1070921.192699] video10: VIDIOC_QBUF: 00:03:36.000000 index=11, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.192753] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x40e86000, length=1382400
[1070921.192766] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
[1070921.192545] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 000000004d94765e
[1070921.192576] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 000000004d94765e vbuf->flags 0, seq 0, bytesused 1382400
[1070921.192603] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.192617] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.192648] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 000000004d94765e
[1070921.192699] video10: VIDIOC_QBUF: 00:03:36.000000 index=11, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.192753] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x40e86000, length=1382400
[1070921.192766] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
[1070921.225920] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 00000000935b5180
[1070921.225948] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 00000000935b5180 vbuf->flags 0, seq 0, bytesused 1382400
[1070921.225975] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.225989] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.225920] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 00000000935b5180
[1070921.226017] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 00000000935b5180
[1070921.225948] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 00000000935b5180 vbuf->flags 0, seq 0, bytesused 1382400
[1070921.225975] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.226065] video10: VIDIOC_QBUF: 00:03:35.000000 index=0, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.226118] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x40000000, length=1382400
[1070921.225989] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.226131] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
[1070921.226017] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 00000000935b5180
[1070921.226065] video10: VIDIOC_QBUF: 00:03:35.000000 index=0, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.226118] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x40000000, length=1382400
[1070921.226131] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
[1070921.259140] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 000000003c8fca72
[1070921.259169] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 000000003c8fca72 vbuf->flags 0, seq 0, bytesused 1382400
[1070921.259198] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.259212] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.259241] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 000000003c8fca72
[1070921.259140] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 000000003c8fca72
[1070921.259293] video10: VIDIOC_QBUF: 00:03:37.000000 index=1, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.259169] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 000000003c8fca72 vbuf->flags 0, seq 0, bytesused 1382400
[1070921.259198] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.259348] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x40152000, length=1382400
[1070921.259212] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.259362] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
[1070921.259241] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 000000003c8fca72
[1070921.259293] video10: VIDIOC_QBUF: 00:03:37.000000 index=1, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.259348] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x40152000, length=1382400
[1070921.259362] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
[1070921.292423] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 000000000f023179
[1070921.292423] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 000000000f023179
[1070921.292455] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 000000000f023179 vbuf->flags 0, seq 0, bytesused 1382400
[1070921.292482] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.292496] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.292525] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 000000000f023179
[1070921.292576] video10: VIDIOC_QBUF: 00:03:38.000000 index=2, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.292629] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x402a4000, length=1382400
[1070921.292642] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
[1070921.292455] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 000000000f023179 vbuf->flags 0, seq 0, bytesused 1382400
[1070921.292482] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.292496] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.292525] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 000000000f023179
[1070921.292576] video10: VIDIOC_QBUF: 00:03:38.000000 index=2, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.292629] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x402a4000, length=1382400
[1070921.292642] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
[1070921.325710] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 000000006f33e245
[1070921.325740] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 000000006f33e245 vbuf->flags 0, seq 0, bytesused 1382400
[1070921.325766] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.325780] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.325809] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 000000006f33e245
[1070921.325858] video10: VIDIOC_QBUF: 00:03:39.000000 index=3, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.325911] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x403f6000, length=1382400
[1070921.325923] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
[1070921.325710] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 000000006f33e245
[1070921.325740] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 000000006f33e245 vbuf->flags 0, seq 0, bytesused 1382400
[1070921.325766] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.325780] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.325809] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 000000006f33e245
[1070921.325858] video10: VIDIOC_QBUF: 00:03:39.000000 index=3, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.325911] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x403f6000, length=1382400
[1070921.325923] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
[1070921.359005] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 00000000185f7645
[1070921.359033] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 00000000185f7645 vbuf->flags 0, seq 0, bytesused 1382400
[1070921.359059] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.359073] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.359103] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 00000000185f7645
[1070921.359153] video10: VIDIOC_QBUF: 00:03:40.000000 index=4, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.359233] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x40548000, length=1382400
[1070921.359245] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
[1070921.359005] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 00000000185f7645
[1070921.359033] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 00000000185f7645 vbuf->flags 0, seq 0, bytesused 1382400
[1070921.359059] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.359073] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.359103] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 00000000185f7645
[1070921.359153] video10: VIDIOC_QBUF: 00:03:40.000000 index=4, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.359233] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x40548000, length=1382400
[1070921.359245] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
[1070921.392297] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 0000000013c4965b
[1070921.392325] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 0000000013c4965b vbuf->flags 0, seq 0, bytesused 1382400
[1070921.392352] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.392366] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.392395] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 0000000013c4965b
[1070921.392447] video10: VIDIOC_QBUF: 00:03:41.000000 index=5, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.392498] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x4069a000, length=1382400
[1070921.392511] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
[1070921.392297] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 0000000013c4965b
[1070921.392325] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 0000000013c4965b vbuf->flags 0, seq 0, bytesused 1382400
[1070921.392352] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.392366] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.392395] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 0000000013c4965b
[1070921.392447] video10: VIDIOC_QBUF: 00:03:41.000000 index=5, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.392498] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x4069a000, length=1382400
[1070921.392511] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
[1070921.425616] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 0000000095ca3940
[1070921.425648] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 0000000095ca3940 vbuf->flags 0, seq 0, bytesused 1382400
[1070921.425674] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.425688] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.425718] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 0000000095ca3940
[1070921.425772] video10: VIDIOC_QBUF: 00:03:42.000000 index=6, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.425825] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x407ec000, length=1382400
[1070921.425837] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
[1070921.425616] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_prepare: type: 9 ptr 0000000095ca3940
[1070921.425648] bcm2835-codec bcm2835-codec: bcm2835_codec_buf_queue: type: 9 ptr 0000000095ca3940 vbuf->flags 0, seq 0, bytesused 1382400
[1070921.425674] bcm2835-codec bcm2835-codec: device_run: off we go
[1070921.425688] bcm2835-codec bcm2835-codec: device_run: Submitted op buffer
[1070921.425718] bcm2835-codec bcm2835-codec: device_run: Submitted src 0000000000000000, dst 0000000095ca3940
[1070921.425772] video10: VIDIOC_QBUF: 00:03:42.000000 index=6, type=vid-cap-mplane, request_fd=0, flags=0x00004003, field=none, sequence=0, memory=mmap
[1070921.425825] plane 0: bytesused=1382400, data_offset=0x00000000, offset/userptr=0x407ec000, length=1382400
[1070921.425837] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:01:10.084428762
Setting pipeline to NULL ...
[1070984.039594] videodev: v4l2_poll: video10: poll: 00000104 0000003b
[1070984.039852] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: type: 10 - return buffers
[1070984.039594] videodev: v4l2_poll: video10: poll: 00000104 0000003b
[1070984.039852] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: type: 10 - return buffers
[1070984.042872] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: done
[1070984.042907] video10: VIDIOC_STREAMOFF: type=vid-out-mplane
[1070984.043361] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 00000000e0f29a3c
[1070984.043391] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 00000000d27717f4
[1070984.043412] video10: VIDIOC_REQBUFS: count=0, type=vid-out-mplane, memory=mmap
[1070984.043818] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: type: 9 - return buffers
[1070984.044012] bcm2835-codec bcm2835-codec: op_buffer_cb: status:0, buf:0000000016bbe374, length:0, flags 0000, pts -9223372036854775808
[1070984.044043] bcm2835-codec bcm2835-codec: op_buffer_cb: length 0, flags 0, idx 8
[1070984.044058] bcm2835-codec bcm2835-codec: op_buffer_cb: Empty buffer - flags 0000
[1070984.044078] bcm2835-codec bcm2835-codec: op_buffer_cb: status:0, buf:000000007d7e6a8a, length:0, flags 0000, pts -9223372036854775808
[1070984.044098] bcm2835-codec bcm2835-codec: op_buffer_cb: length 0, flags 0, idx 9
[1070984.044112] bcm2835-codec bcm2835-codec: op_buffer_cb: Empty buffer - flags 0000
[1070984.044130] bcm2835-codec bcm2835-codec: op_buffer_cb: status:0, buf:00000000de814f93, length:0, flags 0000, pts -9223372036854775808
[1070984.044148] bcm2835-codec bcm2835-codec: op_buffer_cb: length 0, flags 0, idx 10
[1070984.044162] bcm2835-codec bcm2835-codec: op_buffer_cb: Empty buffer - flags 0000
[1070984.044180] bcm2835-codec bcm2835-codec: op_buffer_cb: status:0, buf:000000009da04e63, length:0, flags 0000, pts -9223372036854775808
[1070984.044197] bcm2835-codec bcm2835-codec: op_buffer_cb: length 0, flags 0, idx 11
[1070984.044210] bcm2835-codec bcm2835-codec: op_buffer_cb: Empty buffer - flags 0000
[1070984.044272] bcm2835-codec bcm2835-codec: op_buffer_cb: status:0, buf:0000000060accf84, length:0, flags 0000, pts -9223372036854775808
[1070984.044290] bcm2835-codec bcm2835-codec: op_buffer_cb: length 0, flags 0, idx 0
[1070984.044303] bcm2835-codec bcm2835-codec: op_buffer_cb: Empty buffer - flags 0000
[1070984.044321] bcm2835-codec bcm2835-codec: op_buffer_cb: status:0, buf:000000007c93cbcb, length:0, flags 0000, pts -9223372036854775808
[1070984.044337] bcm2835-codec bcm2835-codec: op_buffer_cb: length 0, flags 0, idx 1
[1070984.044384] bcm2835-codec bcm2835-codec: op_buffer_cb: Empty buffer - flags 0000
[1070984.044392] bcm2835-codec bcm2835-codec: bcm2835_codec_flush_buffers: Waiting for buffers to be returned - 5 outstanding
[1070984.044549] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: done
[1070984.044653] ------------[ cut here ]------------
[1070984.044660] WARNING: CPU: 3 PID: 33092 at drivers/media/common/videobuf2/videobuf2-core.c:2035 __vb2_queue_cancel+0x200/0x270 [videobuf2_common]
[1070984.044726] Modules linked in: cmac algif_hash aes_arm64 aes_generic algif_skcipher af_alg bnep tc358762 joydev vc4 brcmfmac brcmutil edt_ft5x06 snd_soc_hdmi_codec hci_uart drm_display_helper cec drm_dma_helper cfg80211 drm_kms_helper raspberrypi_hwmon btbcm bluetooth snd_soc_core binfmt_misc ecdh_generic ecc rfkill raspberrypi_gpiomem libaes snd_compress snd_pcm_dmaengine snd_bcm2835(C) bcm2835_isp(C) bcm2835_codec(C) snd_pcm bcm2835_v4l2(C) bcm2835_mmal_vchiq(C) snd_timer vc_sm_cma(C) videobuf2_vmalloc rpivid_hevc(C) v4l2_mem2mem videobuf2_dma_contig videobuf2_memops videobuf2_v4l2 snd videobuf2_common videodev fb_sys_fops syscopyarea sysfillrect sysimgblt v3d gpu_sched mc drm_shmem_helper nvmem_rmem uio_pdrv_genirq uio fuse dm_mod ip_tables x_tables ipv6 rpi_panel_attiny_regulator regmap_i2c i2c_mux_pinctrl i2c_mux i2c_brcmstb i2c_bcm2835 panel_simple drm drm_panel_orientation_quirks backlight
[1070984.045064] CPU: 3 PID: 33092 Comm: gst-launch-1.0 Tainted: G        WC         6.1.0-rpi7-rpi-v8 #1  Debian 1:6.1.63-1+rpt1
[1070984.045081] Hardware name: Raspberry Pi 4 Model B Rev 1.1 (DT)
[1070984.045088] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[1070984.045101] pc : __vb2_queue_cancel+0x200/0x270 [videobuf2_common]
[1070984.045145] lr : __vb2_queue_cancel+0x38/0x270 [videobuf2_common]
[1070984.045186] sp : ffffffc009adbaf0
[1070984.045192] x29: ffffffc009adbaf0 x28: ffffffe470c3dd18 x27: ffffff8041f9e000
[1070984.045214] x26: 0000000000000000 x25: 000000000000001f x24: ffffff8044c5f900
[1070984.045235] x23: ffffff804258f530 x22: ffffff80416af828 x21: ffffff80416af828
[1070984.045253] x20: 0000000000000009 x19: ffffff80416af828 x18: 0000000000000003
[1070984.045272] x17: 6e6974696157203a x16: ffffffe4e69ec188 x15: ffffffc009adb650
[1070984.045291] x14: 0000000000000001 x13: 656e6f64203a676e x12: 696d61657274735f
[1070984.045309] x11: 706f74735f636564 x10: ffffffe4e72eaba8 x9 : ffffffe4e5efbe9c
[1070984.045327] x8 : 0000000100042428 x7 : ffffffe4e72e47e8 x6 : 0000000000043428
[1070984.045347] x5 : ffffff807fba8a10 x4 : 0000000000000000 x3 : 0000000000000000
[1070984.045365] x2 : 0000000000000000 x1 : ffffff8044388000 x0 : 0000000000000005
[1070984.045384] Call trace:
[1070984.045390]  __vb2_queue_cancel+0x200/0x270 [videobuf2_common]
[1070984.045432]  vb2_core_streamoff+0x2c/0xd0 [videobuf2_common]
[1070984.045474]  vb2_streamoff+0x20/0x70 [videobuf2_v4l2]
[1070984.045508]  v4l2_m2m_streamoff+0x80/0x154 [v4l2_mem2mem]
[1070984.045547]  v4l2_m2m_ioctl_streamoff+0x20/0x2c [v4l2_mem2mem]
[1070984.045584]  v4l_streamoff+0x2c/0x40 [videodev]
[1070984.045687]  __video_do_ioctl+0x174/0x3f0 [videodev]
[1070984.045782]  video_usercopy+0x20c/0x77c [videodev]
[1070984.045875]  video_ioctl2+0x20/0x40 [videodev]
[1070984.045969]  v4l2_ioctl+0x48/0x6c [videodev]
[1070984.046065]  __arm64_sys_ioctl+0xb4/0xfc
[1070984.046094]  invoke_syscall+0x50/0x120
[1070984.046113]  el0_svc_common.constprop.0+0x68/0x124
[1070984.046130]  do_el0_svc+0x34/0xd0
[1070984.046145]  el0_svc+0x30/0x94
[1070984.046164]  el0t_64_sync_handler+0xf4/0x120
[1070984.046178]  el0t_64_sync+0x18c/0x190
[1070984.046190] ---[ end trace 0000000000000000 ]---
[1070984.042872] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: done
[1070984.042907] video10: VIDIOC_STREAMOFF: type=vid-out-mplane
[1070984.043361] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 00000000e0f29a3c
[1070984.043391] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 00000000d27717f4
[1070984.043412] video10: VIDIOC_REQBUFS: count=0, type=vid-out-mplane, memory=mmap
[1070984.043818] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: type: 9 - return buffers
[1070984.044012] bcm2835-codec bcm2835-codec: op_buffer_cb: status:0, buf:0000000016bbe374, length:0, flags 0000, pts -9223372036854775808
[1070984.044043] bcm2835-codec bcm2835-codec: op_buffer_cb: length 0, flags 0, idx 8
[1070984.044058] bcm2835-codec bcm2835-codec: op_buffer_cb: Empty buffer - flags 0000
[1070984.044078] bcm2835-codec bcm2835-codec: op_buffer_cb: status:0, buf:000000007d7e6a8a, length:0, flags 0000, pts -9223372036854775808
[1070984.044098] bcm2835-codec bcm2835-codec: op_buffer_cb: length 0, flags 0, idx 9
[1070984.044112] bcm2835-codec bcm2835-codec: op_buffer_cb: Empty buffer - flags 0000
[1070984.044130] bcm2835-codec bcm2835-codec: op_buffer_cb: status:0, buf:00000000de814f93, length:0, flags 0000, pts -9223372036854775808
[1070984.044148] bcm2835-codec bcm2835-codec: op_buffer_cb: length 0, flags 0, idx 10
[1070984.044162] bcm2835-codec bcm2835-codec: op_buffer_cb: Empty buffer - flags 0000
[1070984.044180] bcm2835-codec bcm2835-codec: op_buffer_cb: status:0, buf:000000009da04e63, length:0, flags 0000, pts -9223372036854775808
[1070984.044197] bcm2835-codec bcm2835-codec: op_buffer_cb: length 0, flags 0, idx 11
[1070984.044210] bcm2835-codec bcm2835-codec: op_buffer_cb: Empty buffer - flags 0000
[1070984.044272] bcm2835-codec bcm2835-codec: op_buffer_cb: status:0, buf:0000000060accf84, length:0, flags 0000, pts -9223372036854775808
[1070984.044290] bcm2835-codec bcm2835-codec: op_buffer_cb: length 0, flags 0, idx 0
[1070984.044303] bcm2835-codec bcm2835-codec: op_buffer_cb: Empty buffer - flags 0000
[1070984.044321] bcm2835-codec bcm2835-codec: op_buffer_cb: status:0, buf:000000007c93cbcb, length:0, flags 0000, pts -9223372036854775808
[1070984.044337] bcm2835-codec bcm2835-codec: op_buffer_cb: length 0, flags 0, idx 1
[1070984.044384] bcm2835-codec bcm2835-codec: op_buffer_cb: Empty buffer - flags 0000
[1070984.044392] bcm2835-codec bcm2835-codec: bcm2835_codec_flush_buffers: Waiting for buffers to be returned - 5 outstanding
[1070984.044549] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: done
[1070984.044653] ------------[ cut here ]------------
[1070984.044660] WARNING: CPU: 3 PID: 33092 at drivers/media/common/videobuf2/videobuf2-core.c:2035 __vb2_queue_cancel+0x200/0x270 [videobuf2_common]
[1070984.057427] videobuf2_common: driver bug: stop_streaming operation is leaving buf 000000000f023179 in active state
[1070984.044726] Modules linked in: cmac algif_hash aes_arm64 aes_generic algif_skcipher af_alg bnep tc358762 joydev vc4 brcmfmac brcmutil edt_ft5x06 snd_soc_hdmi_codec hci_uart drm_display_helper cec drm_dma_helper cfg80211 drm_kms_helper raspberrypi_hwmon btbcm bluetooth snd_soc_core binfmt_misc ecdh_generic ecc rfkill raspberrypi_gpiomem libaes snd_compress snd_pcm_dmaengine snd_bcm2835(C) bcm2835_isp(C) bcm2835_codec(C) snd_pcm bcm2835_v4l2(C) bcm2835_mmal_vchiq(C) snd_timer vc_sm_cma(C) videobuf2_vmalloc rpivid_hevc(C) v4l2_mem2mem videobuf2_dma_contig videobuf2_memops videobuf2_v4l2 snd videobuf2_common videodev fb_sys_fops syscopyarea sysfillrect sysimgblt v3d gpu_sched mc drm_shmem_helper nvmem_rmem uio_pdrv_genirq uio fuse dm_mod ip_tables x_tables ipv6 rpi_panel_attiny_regulator regmap_i2c i2c_mux_pinctrl i2c_mux i2c_brcmstb i2c_bcm2835 panel_simple drm drm_panel_orientation_quirks backlight
[1070984.057465] videobuf2_common: driver bug: stop_streaming operation is leaving buf 000000006f33e245 in active state
[1070984.045064] CPU: 3 PID: 33092 Comm: gst-launch-1.0 Tainted: G        WC         6.1.0-rpi7-rpi-v8 #1  Debian 1:6.1.63-1+rpt1
[1070984.057483] videobuf2_common: driver bug: stop_streaming operation is leaving buf 00000000185f7645 in active state
[1070984.045081] Hardware name: Raspberry Pi 4 Model B Rev 1.1 (DT)
[1070984.057501] videobuf2_common: driver bug: stop_streaming operation is leaving buf 0000000013c4965b in active state
[1070984.045088] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[1070984.057535] videobuf2_common: driver bug: stop_streaming operation is leaving buf 0000000095ca3940 in active state
[1070984.045101] pc : __vb2_queue_cancel+0x200/0x270 [videobuf2_common]
[1070984.057565] video10: VIDIOC_STREAMOFF: type=vid-cap-mplane
[1070984.045145] lr : __vb2_queue_cancel+0x38/0x270 [videobuf2_common]
[1070984.045186] sp : ffffffc009adbaf0
[1070984.057739] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 00000000935b5180
[1070984.045192] x29: ffffffc009adbaf0 x28: ffffffe470c3dd18 x27: ffffff8041f9e000
[1070984.057784] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 000000003c8fca72
[1070984.045214] x26: 0000000000000000 x25: 000000000000001f x24: ffffff8044c5f900
[1070984.057801] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 000000000f023179
[1070984.045235] x23: ffffff804258f530 x22: ffffff80416af828 x21: ffffff80416af828
[1070984.057821] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 000000006f33e245
[1070984.045253] x20: 0000000000000009 x19: ffffff80416af828 x18: 0000000000000003
[1070984.057857] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 00000000185f7645
[1070984.045272] x17: 6e6974696157203a x16: ffffffe4e69ec188 x15: ffffffc009adb650
[1070984.045291] x14: 0000000000000001 x13: 656e6f64203a676e x12: 696d61657274735f
[1070984.045309] x11: 706f74735f636564 x10: ffffffe4e72eaba8 x9 : ffffffe4e5efbe9c
[1070984.045327] x8 : 0000000100042428 x7 : ffffffe4e72e47e8 x6 : 0000000000043428
[1070984.045347] x5 : ffffff807fba8a10 x4 : 0000000000000000 x3 : 0000000000000000
[1070984.045365] x2 : 0000000000000000 x1 : ffffff8044388000 x0 : 0000000000000005
[1070984.045384] Call trace:
[1070984.045390]  __vb2_queue_cancel+0x200/0x270 [videobuf2_common]
[1070984.045432]  vb2_core_streamoff+0x2c/0xd0 [videobuf2_common]
[1070984.045474]  vb2_streamoff+0x20/0x70 [videobuf2_v4l2]
[1070984.045508]  v4l2_m2m_streamoff+0x80/0x154 [v4l2_mem2mem]
[1070984.045547]  v4l2_m2m_ioctl_streamoff+0x20/0x2c [v4l2_mem2mem]
[1070984.045584]  v4l_streamoff+0x2c/0x40 [videodev]
[1070984.045687]  __video_do_ioctl+0x174/0x3f0 [videodev]
[1070984.045782]  video_usercopy+0x20c/0x77c [videodev]
[1070984.045875]  video_ioctl2+0x20/0x40 [videodev]
[1070984.045969]  v4l2_ioctl+0x48/0x6c [videodev]
[1070984.046065]  __arm64_sys_ioctl+0xb4/0xfc
[1070984.046094]  invoke_syscall+0x50/0x120
[1070984.046113]  el0_svc_common.constprop.0+0x68/0x124
[1070984.046130]  do_el0_svc+0x34/0xd0
[1070984.046145]  el0_svc+0x30/0x94
[1070984.046164]  el0t_64_sync_handler+0xf4/0x120
[1070984.046178]  el0t_64_sync+0x18c/0x190
[1070984.046190] ---[ end trace 0000000000000000 ]---
[1070984.057427] videobuf2_common: driver bug: stop_streaming operation is leaving buf 000000000f023179 in active state
[1070984.057465] videobuf2_common: driver bug: stop_streaming operation is leaving buf 000000006f33e245 in active state
[1070984.057483] videobuf2_common: driver bug: stop_streaming operation is leaving buf 00000000185f7645 in active state
[1070984.057501] videobuf2_common: driver bug: stop_streaming operation is leaving buf 0000000013c4965b in active state
[1070984.060880] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 0000000013c4965b
[1070984.060907] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 0000000095ca3940
[1070984.060925] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 00000000a94f92cb
[1070984.060941] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 00000000f7e7d048
[1070984.060958] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 000000000e1bac6d
[1070984.061001] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 000000001d2b0a73
[1070984.061021] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 000000004d94765e
[1070984.061054] video10: VIDIOC_REQBUFS: count=0, type=vid-cap-mplane, memory=mmap
[1070984.057535] videobuf2_common: driver bug: stop_streaming operation is leaving buf 0000000095ca3940 in active state
[1070984.057565] video10: VIDIOC_STREAMOFF: type=vid-cap-mplane
[1070984.057739] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 00000000935b5180
[1070984.057784] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 000000003c8fca72
[1070984.057801] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 000000000f023179
[1070984.057821] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 000000006f33e245
[1070984.057857] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 00000000185f7645
[1070984.060880] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 0000000013c4965b
[1070984.060907] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 0000000095ca3940
[1070984.060925] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 00000000a94f92cb
[1070984.060941] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 00000000f7e7d048
[1070984.060958] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 000000000e1bac6d
[1070984.061001] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 000000001d2b0a73
[1070984.061021] bcm2835-codec bcm2835-codec: bcm2835_codec_buffer_cleanup: ctx:00000000b3d8dcac, vb 000000004d94765e
[1070984.061054] video10: VIDIOC_REQBUFS: count=0, type=vid-cap-mplane, memory=mmap
[1070984.083707] bcm2835-codec bcm2835-codec: bcm2835_codec_release: Releasing instance 00000000b3d8dcac
[1070984.085159] videodev: v4l2_release: video10: release
[1070984.083707] bcm2835-codec bcm2835-codec: bcm2835_codec_release: Releasing instance 00000000b3d8dcac
[1070984.085159] videodev: v4l2_release: video10: release
Freeing pipeline ...
hannes@alpaka-pi:~ $

Additional context

This is a kernel bug, right? i.e. gstreamer should not be able to cause kernel stack dumps?

I think the issue exists in this form since quite some time, I remember trying to do gapless looping in flutter-pi in 2020/2021 or something and having to do normal looping instead because of this hang. Now, I'm having some trouble with normal looping (though not sure it's gstreamer or kernel yet), and while trying to find some steps to reproduce it, I tried this again, saw all the warning / error messages in dmesg and decided to report this.

6by9 commented 7 months ago

What version of GStreamer are you using?

Whilst userspace shouldn't be able to produce kernel warns, this is a condition that is handed by the V4L2 frameworks and cleaned up anyway https://github.com/raspberrypi/linux/blob/rpi-6.1.y/drivers/media/common/videobuf2/videobuf2-core.c#L2029-L2035

ardera commented 7 months ago

gstreamer1.0-plugins-good shows version 1.22.0-5+rpt1+deb12u1; I'm on Raspberry Pi OS bookworm (64-bit), all packages are up-to-date.

So the actual hang might also be gstreamer related?

EDIT: Okay, my bad, apparently multifilesrc can not be used for video files. Doesn't work on other machines either. (In my defense, still bad UX if the playback just freezes at the end of the video without any indication/logging as to why and that it was left as an easter egg to the user that multifilesrc doesn't work with videos, but oh well)

Should I still leave this open for the kernel warnings? Otherwise, if I reproduce the actual hangs I seemingly had some time ago, I'll create a new issue.