v4l2 "newly allocated buffer <NUMBER> is not free" flood (1.22.6)
Hey,
I am building a broadcasting system with multiple GStreamer pipelines. I am currently using a Camlink 4K as the capture card and access it with v4l2src.
This in connection with a simple intervideo* pipeline results in a flood of warnings and occasionally segmentation faults.
Pipeline:
GST_DEBUG=3 gst-launch-1.0 v4l2src device=/dev/video0 ! queue ! intervideosink intervideosrc ! queue ! fakevideosink
Output:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
0:00:00.145709999 12104 0x7f0f40000f90 FIXME default gstutils.c:4036:gst_pad_create_stream_id_internal:<intervideosrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
0:00:00.161686681 12104 0x7f0f40001190 WARN v4l2 gstv4l2object.c:4450:gst_v4l2_object_set_crop:<v4l2src0:src> VIDIOC_S_CROP failed
0:00:00.190617383 12104 0x7f0f40001190 WARN v4l2 gstv4l2object.c:3274:gst_v4l2_object_reset_compose_region:<v4l2src0:src> Failed to get default compose rectangle with VIDIOC_G_SELECTION: Invalid argument
0:00:00.192160526 12104 0x7f0f40001190 WARN v4l2bufferpool gstv4l2bufferpool.c:848:gst_v4l2_buffer_pool_start:<v4l2src0:pool0:src> Uncertain or not enough buffers, enabling copy threshold
0:00:00.234279496 12104 0x7f0f40001190 WARN v4l2bufferpool gstv4l2bufferpool.c:1331:gst_v4l2_buffer_pool_dqbuf:<v4l2src0:pool0:src> Driver should never set v4l2_buffer.field to ANY
0:00:00.234318118 12104 0x7f0f40001190 WARN v4l2src gstv4l2src.c:1281:gst_v4l2src_create:<v4l2src0> Timestamp does not correlate with any clock, ignoring driver timestamps
Redistribute latency...
0:00:00.348729727 12104 0x7f0f40000b90 WARN v4l2bufferpool gstv4l2bufferpool.c:483:gst_v4l2_buffer_pool_alloc_buffer:<v4l2src0:pool0:src> newly allocated buffer 0 is not free
0:00:00.382058474 12104 0x7f0f40000b90 WARN v4l2bufferpool gstv4l2bufferpool.c:483:gst_v4l2_buffer_pool_alloc_buffer:<v4l2src0:pool0:src> newly allocated buffer 5 is not free
0:00:00.415633830 12104 0x7f0f40000b90 WARN v4l2bufferpool gstv4l2bufferpool.c:483:gst_v4l2_buffer_pool_alloc_buffer:<v4l2src0:pool0:src> newly allocated buffer 2 is not free
0:00:00.448723022 12104 0x7f0f40000b90 WARN v4l2bufferpool gstv4l2bufferpool.c:483:gst_v4l2_buffer_pool_alloc_buffer:<v4l2src0:pool0:src> newly allocated buffer 6 is not free
0:00:00.482057426 12104 0x7f0f40000b90 WARN v4l2bufferpool gstv4l2bufferpool.c:483:gst_v4l2_buffer_pool_alloc_buffer:<v4l2src0:pool0:src> newly allocated buffer 3 is not free
0:00:00.515680903 12104 0x7f0f40000b90 WARN v4l2bufferpool gstv4l2bufferpool.c:483:gst_v4l2_buffer_pool_alloc_buffer:<v4l2src0:pool0:src> newly allocated buffer 7 is not free
0:00:00.548965860 12104 0x7f0f40000b90 WARN v4l2bufferpool gstv4l2bufferpool.c:483:gst_v4l2_buffer_pool_alloc_buffer:<v4l2src0:pool0:src> newly allocated buffer 0 is not free
...
V4L2 Device:
Driver Info:
Driver name : uvcvideo
Card type : Cam Link 4K: Cam Link 4K
Bus info : usb-0000:05:00.4-1
Driver version : 6.1.62
Capabilities : 0x84a00001
Video Capture
Metadata Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : uvcvideo
Model : Cam Link 4K: Cam Link 4K
Serial : 00045D6F85000
Bus info : usb-0000:05:00.4-1
Media version : 6.1.62
Hardware revision: 0x00000000 (0)
Driver version : 6.1.62
Interface Info:
ID : 0x03000002
Type : V4L Video
Entity Info:
ID : 0x00000001 (1)
Name : Cam Link 4K: Cam Link 4K
Function : V4L2 I/O
Flags : default
Pad 0x01000007 : 0: Sink
Link 0x0200000d: from remote pad 0x100000a of entity 'Processing 2' (Video Pixel Formatter): Data, Enabled, Immutable
Priority: 2
Video input : 0 (Input 1: ok)
Format Video Capture:
Width/Height : 1920/1080
Pixel Format : 'YUYV' (YUYV 4:2:2)
Field : None
Bytes per Line : 3840
Size Image : 4147200
Colorspace : sRGB
Transfer Function : Rec. 709
YCbCr/HSV Encoding: Rec. 709
Quantization : Default (maps to Limited Range)
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 1920, Height 1080
Default : Left 0, Top 0, Width 1920, Height 1080
Pixel Aspect: 1/1
Selection Video Capture: crop_default, Left 0, Top 0, Width 1920, Height 1080, Flags:
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 1920, Height 1080, Flags:
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 50.000 (50/1)
Read buffers : 0
User Controls
brightness 0x00980900 (int) : min=-128 max=127 step=1 default=0 value=0
contrast 0x00980901 (int) : min=0 max=255 step=1 default=128 value=128
saturation 0x00980902 (int) : min=0 max=255 step=1 default=128 value=128
hue 0x00980903 (int) : min=-128 max=127 step=1 default=0 value=0
Feeding it directly into the sink or with an intermediary like a queue works flawlessly.
System:
- OS: NixOS 23.05
- Kernel: 6.1.62
- CPU: AMD Ryzen 7 5700G with Radeon Graphics (16) @ 3.800GHz
- GPU: AMD ATI Radeon Vega Series / Radeon Vega Mobile Series