<html><head></head><body><div class="yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div dir="ltr" data-setdir="false">Hello, everyone</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">This is a re-post of the issue at the Raspberry PI branch: <a href="https://github.com/raspberrypi/libcamera/issues/186?notification_referrer_id=NT_kwDOAH7EvLMxMjc0NDgwODE0NTo4MzA3OTAw" rel="nofollow" target="_blank" class="">https://github.com/raspberrypi/libcamera/issues/186?notification_referrer_id=NT_kwDOAH7EvLMxMjc0NDgwODE0NTo4MzA3OTAw</a>. The admin redirected me here. <span>I'd really appreciate it if anyone could point me some directions on how to resolve or further debug the issue. Thanks</span> .<br></div><div dir="ltr" data-setdir="false"><div dir="ltr" data-setdir="false"><h2>Symptom</h2><div dir="ltr" data-setdir="false">I'm experiencing the following assertion fail error when running two RPi<span> cameras simultaneously.</span><br></div>
<p><code class="ydpac92d1e9notranslate">void GstLibcameraSrcState::requestCompleted(libcamera::Request*): assertion 'wrap->request_.get() == request' failed</code> <br></p>
Some additional tests:<br><ul><li>Setting both cameras down to 5 FPS can avoid the problem.</li><li>No problem at any FPS if we run one camera only</li></ul>
<h2>Spec/ Platform<br></h2>
<ul><li>Hardware: Raspberry PI-5 4GB/ 8GB</li><li>Camera: Camera module V2</li><li>OS: Bookworm (<code class="ydpac92d1e9notranslate">Linux gmpi6 6.6.51+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.51-1+rpt2 (2024-10-01) aarch64 GNU/Linux</code>)</li><li>Version: <code class="ydpac92d1e9notranslate">libcamera0.3/stable,now 0.3.2+rpt20240927-1 arm64</code></li><li>Camera debug file with <code class="ydpac92d1e9notranslate">camera-bug-report</code>: <a href="https://github.com/user-attachments/files/17275031/113.10.7.pi6.bug-report.txt" rel="nofollow" target="_blank">bug-report.txt</a></li></ul>
<h2>Detail</h2>
<p>I have two IMX219 (Pi camera V2) connected to two Raspberry Pi-5. I'm launching the two cameras with the gstreamer element <code class="ydpac92d1e9notranslate">libcamerasrc</code>:</p>
<div class="ydpac92d1e9highlight ydpac92d1e9highlight-source-shell ydpac92d1e9notranslate ydpac92d1e9position-relative ydpac92d1e9overflow-auto"><pre class="ydpac92d1e9notranslate">gst-launch-1.0 -v libcamerasrc camera-name=<span class="ydpac92d1e9pl-s"><span class="ydpac92d1e9pl-pds">"</span>/base/axi/pcie@120000/rp1/i2c@80000/imx219@10<span class="ydpac92d1e9pl-pds">"</span></span> <span class="ydpac92d1e9pl-k">!</span> video/x-raw,colorimetry=bt709,format=NV12,width=1664,height=1232,framerate=10/1 <span class="ydpac92d1e9pl-k">!</span> x264enc tune=zerolatency speed-preset=fast pass=qual quantizer=23 bitrate=16384 <span class="ydpac92d1e9pl-k">!</span> video/x-h264,profile=high,stream-format=avc <span class="ydpac92d1e9pl-k">!</span> rtph264pay pt=96 <span class="ydpac92d1e9pl-k">!</span> udpsink host=<span class="ydpac92d1e9pl-smi">$IP</span> port=8600
gst-launch-1.0 -v libcamerasrc camera-name=<span class="ydpac92d1e9pl-s"><span class="ydpac92d1e9pl-pds">"</span>/base/axi/pcie@120000/rp1/i2c@88000/imx219@10<span class="ydpac92d1e9pl-pds">"</span></span> <span class="ydpac92d1e9pl-k">!</span> video/x-raw,colorimetry=bt709,format=NV12,width=1664,height=1232,framerate=10/1 <span class="ydpac92d1e9pl-k">!</span> x264enc tune=zerolatency speed-preset=fast pass=qual quantizer=23 bitrate=16384 <span class="ydpac92d1e9pl-k">!</span> video/x-h264,profile=high,stream-format=avc <span class="ydpac92d1e9pl-k">!</span> rtph264pay pt=96 <span class="ydpac92d1e9pl-k">!</span> udpsink host=<span class="ydpac92d1e9pl-smi">$IP</span> port=8601</pre><div class="ydpac92d1e9zeroclipboard-container ydpac92d1e9position-absolute ydpac92d1e9right-0 ydpac92d1e9top-0">
</div></div>
<p>For a short period, I can receive streaming from both
cameras on the client side. However, the first launched camera will
always hangs after a few 10's of seconds with following error:</p>
<div class="ydpac92d1e9snippet-clipboard-content ydpac92d1e9notranslate ydpac92d1e9position-relative ydpac92d1e9overflow-auto"><pre class="ydpac92d1e9notranslate"><code class="ydpac92d1e9notranslate">0:01:37.9 / 99:99:99.
** (gst-launch-1.0:4162): CRITICAL **: 15:26:46.151: void GstLibcameraSrcState::requestCompleted(libcamera::Request*): assertion 'wrap->request_.get() == request' failed
Caught SIGSEGV
#0 0x00007fffbc08ba58 in gst_pad_query_default@plt () from /lib/aarch64-linux-gnu/gstreamer-1.0/libgstrtp.so
#1 0x00007fffbf11bb9c in gst_pad_query () from /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#2 0x00007fffbf11c36c in gst_pad_peer_query () from /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#3 0x00007fffbe248d8c in ?? () from /lib/aarch64-linux-gnu/libgstbase-1.0.so.0
#4 0x00007fffbf0f0b98 in gst_element_query () from /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#5 0x00007fffbf0c2ee4 in ?? () from /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#6 0x00007fffbf1050f8 in gst_iterator_fold () from /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#7 0x00007fffbf0c2fc0 in ?? () from /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#8 0x00007fffbf0c9140 in ?? () from /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#9 0x00007fffbf0f0b98 in gst_element_query () from /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#10 0x00007fffbf15d350 in gst_element_query_duration () from /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#11 0x00005555922c3aa4 in ?? ()
#12 0x00007fffbef782ac in ?? () from /lib/aarch64-linux-gnu/libglib-2.0.so.0
#13 0x00007fffbef77614 in g_main_context_dispatch () from /lib/aarch64-linux-gnu/libglib-2.0.so.0
#14 0x00007fffbef779e0 in ?? () from /lib/aarch64-linux-gnu/libglib-2.0.so.0
#15 0x00007fffbef77d04 in g_main_loop_run () from /lib/aarch64-linux-gnu/libglib-2.0.so.0
#16 0x00005555922c60d4 in ?? ()
#17 0x00007fffbed07740 in __libc_start_call_main (main=main@entry=0x5555922c38c0, argc=argc@entry=22, argv=argv@entry=0x7fffe8059bc8) at ../sysdeps/nptl/libc_start_call_main.h:58
#18 0x00007fffbed07818 in __libc_start_main_impl (main=0x5555922c38c0, argc=22, argv=0x7fffe8059bc8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=<optimized out>) at ../csu/libc-start.c:360
#19 0x00005555922c3930 in ?? ()
Spinning. Please run 'gdb gst-launch-1.0 4162' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.
^\Quit8.3 / 99:99:99.
</code></pre><div class="ydpac92d1e9zeroclipboard-container ydpac92d1e9position-absolute ydpac92d1e9right-0 ydpac92d1e9top-0">
</div></div>
<p>Additional background info:</p>
<ul><li>I intended to have the resolution of 1640x1232, which is the default binning mode for the IMX219. However, due to some <a href="https://forums.raspberrypi.com/viewtopic.php?t=377359" rel="nofollow" target="_blank">presumably alignment issue</a>, I can only set it to 1664x1232</li><li>I cannot use the <code class="ydpac92d1e9notranslate">rpicam-apps</code> since at such low FPS, the <a href="https://forums.raspberrypi.com/viewtopic.php?t=377323" rel="nofollow" target="_blank">8-frame delay</a> become a huge delay</li><li>I did enlarge the UDP memroy size beforehand by: <code class="ydpac92d1e9notranslate">sudo sysctl -w net.core.wmem_max=134217728</code></li></ul></div></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Best regards,</div><div dir="ltr" data-setdir="false">Ewing Kang</div><div dir="ltr" data-setdir="false">2024.10.11<br></div><div><br></div></div></body></html>