[Bug 2131647] Re: pipewire failed to work with v4l2loopback devices

Dirk Su 2131647 at bugs.launchpad.net
Wed Dec 3 02:32:25 UTC 2025


** Description changed:

  [Impact]
  Using pipewire with video device created by v4l2loopback will get following error log
  
  $ gst-launch-1.0 pipewiresrc ! videoconvert ! autovideosink
  Setting pipeline to PAUSED ...
  ERROR: from element /GstPipeline:pipeline0/GstPipeWireSrc:pipewiresrc0: stream error: can't negotiate buffers on port
  Additional debug info:
  ../src/gst/gstpipewiresrc.c(692): on_state_changed (): /GstPipeline:pipeline0/GstPipeWireSrc:pipewiresrc0
  ERROR: pipeline doesn't want to preroll.
  ERROR: from element /GstPipeline:pipeline0/GstPipeWireSrc:pipewiresrc0: Internal data stream error.
  Additional debug info:
  ../libs/gst/base/gstbasesrc.c(3177): gst_base_src_loop (): /GstPipeline:pipeline0/GstPipeWireSrc:pipewiresrc0:
  streaming stopped, reason not-negotiated (-4)
  Failed to set pipeline to PAUSED.
  ERROR: pipeline doesn't want to preroll.
  Setting pipeline to NULL ...
  Freeing pipeline ...
  
  [ Test Plan ]
  Need to test two kind of scenarios
-  1. video device of USB camera
-    - play video with command "gst-launch-1.0 pipewiresrc ! videoconvert ! autovideosink"
-  2. virtual video device created by v4l2loopback
-    - insert v4l2loopback kernel module with command "sudo modprobe v4l2loopback card_label="v4l2 Visual Webcam" exclusive_caps=1"
-    - get video device with command "ls /sys/devcies/virtual | grep video"
-    - generate video source to device get in previous step with command "gst-launch-1.0 videotestsrc ! video/x-raw,format=YUY2 ! identity drop-allocation=true ! v4l2sink device=/dev/{VIDEO_DEVICE}"
-    - reload pipewire with command "systemctl --user restart pipewire.service"
-    - get video source number with "wpctl status | grep "v4l2 Visual Webcam (V4L2)"
-    - play video with command "gst-launch-1.0 pipewiresrc path={VIDEO_SOURCE_NUMBER} ! videoconvert ! autovideosink"
+  1. video device of USB camera
+    - play video with command "gst-launch-1.0 pipewiresrc ! videoconvert ! autovideosink"
+  2. virtual video device created by v4l2loopback
+    - insert v4l2loopback kernel module with command "sudo modprobe v4l2loopback card_label="v4l2 Visual Webcam" exclusive_caps=1"
+    - get video device with command "ls /sys/devcies/virtual/video4linux | grep video"
+    - generate video source to device get in previous step with command "gst-launch-1.0 videotestsrc ! video/x-raw,format=YUY2 ! identity drop-allocation=true ! v4l2sink device=/dev/{VIDEO_DEVICE}"
+    - reload pipewire with command "systemctl --user restart pipewire.service"
+    - get video source number with "wpctl status | grep "v4l2 Visual Webcam (V4L2)"
+    - play video with command "gst-launch-1.0 pipewiresrc path={VIDEO_SOURCE_NUMBER} ! videoconvert ! autovideosink"
  
  [ Where problems could occur ]
  This SRU add V4L2 video fallback method mmap, the origin method USERPTR should still works without problem. The risk should be low. But modify V4L2 video handling may have chance cause video unable to play.
  
  [ Other Info ]
  related upstream patches
  https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/b2dd733520667f90896cc0eb10f3614d4f7f961a
  https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/877c262e7877defff9462d4ece1c44d87bbc3caf
  https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/37eef2cf2370c9dee47820855b8d60bfc52da41a
  https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/b9df297e2a2704934bd7d9e04f754eb6ea161576

-- 
You received this bug notification because you are a member of Ubuntu
Sponsors, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/2131647

Title:
  pipewire failed to work with v4l2loopback devices

Status in pipewire package in Ubuntu:
  Fix Released
Status in pipewire source package in Noble:
  Fix Committed

Bug description:
  [Impact]
  Using pipewire with video device created by v4l2loopback will get following error log

  $ gst-launch-1.0 pipewiresrc ! videoconvert ! autovideosink
  Setting pipeline to PAUSED ...
  ERROR: from element /GstPipeline:pipeline0/GstPipeWireSrc:pipewiresrc0: stream error: can't negotiate buffers on port
  Additional debug info:
  ../src/gst/gstpipewiresrc.c(692): on_state_changed (): /GstPipeline:pipeline0/GstPipeWireSrc:pipewiresrc0
  ERROR: pipeline doesn't want to preroll.
  ERROR: from element /GstPipeline:pipeline0/GstPipeWireSrc:pipewiresrc0: Internal data stream error.
  Additional debug info:
  ../libs/gst/base/gstbasesrc.c(3177): gst_base_src_loop (): /GstPipeline:pipeline0/GstPipeWireSrc:pipewiresrc0:
  streaming stopped, reason not-negotiated (-4)
  Failed to set pipeline to PAUSED.
  ERROR: pipeline doesn't want to preroll.
  Setting pipeline to NULL ...
  Freeing pipeline ...

  [ Test Plan ]
  Need to test two kind of scenarios
   1. video device of USB camera
     - play video with command "gst-launch-1.0 pipewiresrc ! videoconvert ! autovideosink"
   2. virtual video device created by v4l2loopback
     - insert v4l2loopback kernel module with command "sudo modprobe v4l2loopback card_label="v4l2 Visual Webcam" exclusive_caps=1"
     - get video device with command "ls /sys/devcies/virtual/video4linux | grep video"
     - generate video source to device get in previous step with command "gst-launch-1.0 videotestsrc ! video/x-raw,format=YUY2 ! identity drop-allocation=true ! v4l2sink device=/dev/{VIDEO_DEVICE}"
     - reload pipewire with command "systemctl --user restart pipewire.service"
     - get video source number with "wpctl status | grep "v4l2 Visual Webcam (V4L2)"
     - play video with command "gst-launch-1.0 pipewiresrc path={VIDEO_SOURCE_NUMBER} ! videoconvert ! autovideosink"

  [ Where problems could occur ]
  This SRU add V4L2 video fallback method mmap, the origin method USERPTR should still works without problem. The risk should be low. But modify V4L2 video handling may have chance cause video unable to play.

  [ Other Info ]
  related upstream patches
  https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/b2dd733520667f90896cc0eb10f3614d4f7f961a
  https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/877c262e7877defff9462d4ece1c44d87bbc3caf
  https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/37eef2cf2370c9dee47820855b8d60bfc52da41a
  https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/b9df297e2a2704934bd7d9e04f754eb6ea161576

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pipewire/+bug/2131647/+subscriptions




More information about the Ubuntu-sponsors mailing list