<html><head></head><body><div class="ydp8d76237yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div></div>
<div dir="ltr" data-setdir="false">Hi Nicolas,</div><div dir="ltr" data-setdir="false">Thanks for the reply.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">First of all,<br></div><div dir="ltr" data-setdir="false">> <span>Note thats libcamera project track bufs like this one at <a shape="rect" href="https://bugs.libcamera.org/" rel="nofollow" target="_blank">https://bugs.libcamera.org/</a></span><br></div><div dir="ltr" data-setdir="false">Sorry for the disturbance, I'll open a ticket at the proper bugzilla site.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">> This assertion is what needs to be debugged. Preferably, it would be
nice to take this as an opportunity to turn this assertion into a crash
safe format (see g_return_if* glib assertions). The best way to debug
GLib assertion is to ask GLib to abort on it. This can be done using
environment variable:<div>><br clear="none">> G_DEBUG=fatal_criticals<br clear="none">><br clear="none">> From
there, you will be able to check the backtrace of the current and other
threads running, and also inspect local variables state. This
information will be key in understand what is going on, and what could
be the fix. Please try and provide similar information. <br></div><div dir="ltr" data-setdir="false">I'll try it and post relevant information at the Bugzilla ticket.<br></div><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.18<br></div><div><br></div>
</div><div id="ydp5c7c4eeyahoo_quoted_9592458702" class="ydp5c7c4eeyahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
在 2024年10月17日 星期四 下午09:05:06 [GMT+8], Nicolas Dufresne<nicolas@ndufresne.ca> 寫道:
</div>
<div><br></div>
<div><br></div>
<div><div id="ydp5c7c4eeyiv9871093256"><div dir="ltr" data-setdir="false"><div>Hi,</div><div><br clear="none"></div><div>Le vendredi 11 octobre 2024 à 03:10 +0000, 康 心奕 a écrit :</div><blockquote type="cite" style="margin:0 0 0 .8ex;border-left:2px #729fcf solid;padding-left:1ex;"><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;" class="ydp5c7c4eeyiv9871093256yahoo-style-wrap"><div dir="ltr">Hello, everyone</div><div dir="ltr"><br clear="none"></div><div dir="ltr">This is a re-post of the issue at the Raspberry PI branch: <a shape="rect" href="https://github.com/raspberrypi/libcamera/issues/186?notification_referrer_id=NT_kwDOAH7EvLMxMjc0NDgwODE0NTo4MzA3OTAw" class="ydp5c7c4eeyiv9871093256" rel="nofollow" target="_blank">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 clear="none"></div><div dir="ltr"><div dir="ltr"><h2>Symptom</h2><div dir="ltr">I'm experiencing the following assertion fail error when running two RPi<span> cameras simultaneously.</span><br clear="none"></div><p><code class="ydp5c7c4eeyiv9871093256ydpac92d1e9notranslate">void GstLibcameraSrcState::requestCompleted(libcamera::Request*): assertion 'wrap->request_.get() == request' failed</code> <br clear="none"></p><p></p></div></div></div></blockquote><div>This assertion is what needs to be debugged. Preferably, it would be nice to take this as an opportunity to turn this assertion into a crash safe format (see g_return_if* glib assertions). The best way to debug GLib assertion is to ask GLib to abort on it. This can be done using environment variable:<br clear="none"><br clear="none"> G_DEBUG=fatal_criticals<br clear="none"><br clear="none">From there, you will be able to check the backtrace of the current and other threads running, and also inspect local variables state. This information will be key in understand what is going on, and what could be the fix. Please try and provide similar information. Note thats libcamera project track bufs like this one at <a shape="rect" href="https://bugs.libcamera.org/" rel="nofollow" target="_blank" class="">https://bugs.libcamera.org/</a></div><div><br></div></div><div dir="ltr" data-setdir="false"><div><br></div><div><br></div><div><br clear="none"></div><blockquote type="cite" style="margin:0 0 0 .8ex;border-left:2px #729fcf solid;padding-left:1ex;"><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;" class="ydp5c7c4eeyiv9871093256yahoo-style-wrap"><div dir="ltr"><div dir="ltr">Some additional tests:<br clear="none"><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 clear="none"></h2><ul><li>Hardware: Raspberry PI-5 4GB/ 8GB</li><li>Camera: Camera module V2</li></ul></div></div></div></blockquote><div><br clear="none"></div><div>If someone from RPi could provide me a second module, I would then be able to reproduce.</div><div><br clear="none"></div><div>cheers,</div><div>Nicolas</div><div id="ydp5c7c4eeyiv9871093256yqtfd50733" class="ydp5c7c4eeyiv9871093256yqt7373926222"><div><br clear="none"></div><blockquote type="cite" style="margin:0 0 0 .8ex;border-left:2px #729fcf solid;padding-left:1ex;"><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;" class="ydp5c7c4eeyiv9871093256yahoo-style-wrap"><div dir="ltr"><div dir="ltr"><ul><li>OS: Bookworm (<code class="ydp5c7c4eeyiv9871093256ydpac92d1e9notranslate">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="ydp5c7c4eeyiv9871093256ydpac92d1e9notranslate">libcamera0.3/stable,now 0.3.2+rpt20240927-1 arm64</code></li><li>Camera debug file with <code class="ydp5c7c4eeyiv9871093256ydpac92d1e9notranslate">camera-bug-report</code>: <a shape="rect" 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="ydp5c7c4eeyiv9871093256ydpac92d1e9notranslate">libcamerasrc</code>:</p><div class="ydp5c7c4eeyiv9871093256ydpac92d1e9highlight ydp5c7c4eeyiv9871093256ydpac92d1e9highlight-source-shell ydp5c7c4eeyiv9871093256ydpac92d1e9notranslate ydp5c7c4eeyiv9871093256ydpac92d1e9position-relative ydp5c7c4eeyiv9871093256ydpac92d1e9overflow-auto"><pre class="ydp5c7c4eeyiv9871093256ydpac92d1e9notranslate">gst-launch-1.0 -v libcamerasrc camera-name=<span class="ydp5c7c4eeyiv9871093256ydpac92d1e9pl-s"><span class="ydp5c7c4eeyiv9871093256ydpac92d1e9pl-pds">"</span>/base/axi/pcie@120000/rp1/i2c@80000/imx219@10<span class="ydp5c7c4eeyiv9871093256ydpac92d1e9pl-pds">"</span></span> <span class="ydp5c7c4eeyiv9871093256ydpac92d1e9pl-k">!</span> video/x-raw,colorimetry=bt709,format=NV12,width=1664,height=1232,framerate=10/1 <span class="ydp5c7c4eeyiv9871093256ydpac92d1e9pl-k">!</span> x264enc tune=zerolatency speed-preset=fast pass=qual quantizer=23 bitrate=16384 <span class="ydp5c7c4eeyiv9871093256ydpac92d1e9pl-k">!</span> video/x-h264,profile=high,stream-format=avc <span class="ydp5c7c4eeyiv9871093256ydpac92d1e9pl-k">!</span> rtph264pay pt=96 <span class="ydp5c7c4eeyiv9871093256ydpac92d1e9pl-k">!</span> udpsink host=<span class="ydp5c7c4eeyiv9871093256ydpac92d1e9pl-smi">$IP</span> port=8600
gst-launch-1.0 -v libcamerasrc camera-name=<span class="ydp5c7c4eeyiv9871093256ydpac92d1e9pl-s"><span class="ydp5c7c4eeyiv9871093256ydpac92d1e9pl-pds">"</span>/base/axi/pcie@120000/rp1/i2c@88000/imx219@10<span class="ydp5c7c4eeyiv9871093256ydpac92d1e9pl-pds">"</span></span> <span class="ydp5c7c4eeyiv9871093256ydpac92d1e9pl-k">!</span> video/x-raw,colorimetry=bt709,format=NV12,width=1664,height=1232,framerate=10/1 <span class="ydp5c7c4eeyiv9871093256ydpac92d1e9pl-k">!</span> x264enc tune=zerolatency speed-preset=fast pass=qual quantizer=23 bitrate=16384 <span class="ydp5c7c4eeyiv9871093256ydpac92d1e9pl-k">!</span> video/x-h264,profile=high,stream-format=avc <span class="ydp5c7c4eeyiv9871093256ydpac92d1e9pl-k">!</span> rtph264pay pt=96 <span class="ydp5c7c4eeyiv9871093256ydpac92d1e9pl-k">!</span> udpsink host=<span class="ydp5c7c4eeyiv9871093256ydpac92d1e9pl-smi">$IP</span> port=8601</pre></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="ydp5c7c4eeyiv9871093256ydpac92d1e9snippet-clipboard-content ydp5c7c4eeyiv9871093256ydpac92d1e9notranslate ydp5c7c4eeyiv9871093256ydpac92d1e9position-relative ydp5c7c4eeyiv9871093256ydpac92d1e9overflow-auto"><pre class="ydp5c7c4eeyiv9871093256ydpac92d1e9notranslate"><code class="ydp5c7c4eeyiv9871093256ydpac92d1e9notranslate">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><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 shape="rect" 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="ydp5c7c4eeyiv9871093256ydpac92d1e9notranslate">rpicam-apps</code> since at such low FPS, the <a shape="rect" 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="ydp5c7c4eeyiv9871093256ydpac92d1e9notranslate">sudo sysctl -w net.core.wmem_max=134217728</code></li></ul></div></div><div dir="ltr"><br clear="none"></div><div dir="ltr"><br clear="none"></div><div dir="ltr">Best regards,</div><div dir="ltr">Ewing Kang</div><div dir="ltr">2024.10.11<br clear="none"></div><div><br clear="none"></div></div></blockquote><div><br clear="none"></div><div><span></span></div></div></div></div></div>
</div>
</div></body></html>