<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[v821从uvc摄像头长时间取流（20分钟）uvcInput_WaiteBuffer UVC select timeout!]]></title><description><![CDATA[<p dir="auto">芯片：V821，kernel linux-5.4-ansc。摄像头是罗技 c930e<br />
流程是uvc获取mjpeg，通过vdec解码，传递给venc编码。uvc和vdec bind, vdec和venc bind。<br />
简化流程如下：</p>
<pre><code>// 绑定流程
MPP_CHN_S UvcChn = {MOD_ID_UVC,  mDevName[0], uvc_channel_}
MPP_CHN_S VdecChn = {MOD_ID_VDEC, 0, decode_channel_};
MPP_CHN_S VencChn = {MOD_ID_VENC, 0, encode_channel_};
AW_MPI_SYS_Bind(&amp;UvcChn, &amp;VdecChn);
AW_MPI_SYS_Bind(&amp;VdecChn, &amp;VencChn);

while (1) {
    eRet = AW_MPI_VENC_GetStream(encode_channel_, &amp;stVencStream, 500);
    // 长时间运行后会报错，错误码是-5ff67ff2
    
    // 业务逻辑代码：处理h.264流
    
    // 释放
    AW_MPI_VENC_ReleaseStream(encode_channel_, &amp;stVencStream);
}
</code></pre>
<p dir="auto">错误日志重复输出如下：</p>
<pre><code>W0101 04:25:30.063163   292 VideoDec_Component.c:4619] &lt;ComponentThread&gt; fatal error! wait vbs data timeout!
E0101 04:25:30.072333   299 uvcInput.c:884] &lt;uvcInput_WaiteBuffer&gt; the /dev/video0 UVC select timeout!
[1970-01-01 04:25:30.104] [error] [Uvc2Dec2Enc.cpp:194] fatal error! why not get stream from venc for too long? ret=-5ff67ff2
W0101 04:25:30.259138   294 VideoEnc_Component.c:10888] &lt;ComponentThread&gt; Be careful! vencChn[0] timeout for waiting outputStream. input frames stat:ready[0]+using[0]+used[0]=total[0]
E0101 04:25:30.273074   299 uvcInput.c:884] &lt;uvcInput_WaiteBuffer&gt; the /dev/video0 UVC select timeout!
E0101 04:25:30.473610   299 uvcInput.c:884] &lt;uvcInput_WaiteBuffer&gt; the /dev/video0 UVC select timeout!
</code></pre>
<p dir="auto">dmesg没有任何错误日志。当出错后，程序一直运行直到Segmentation fault。能稳定复现，运行20~40分钟后就会出现。当出现段错误后，重新启动程序，从UVC无法获取任何帧！！！。以下是重新启动程序直接报错：</p>
<pre><code class="language-shell">I0101 05:24:50.466994   333 mpi_sys.c:893] &lt;AW_MPI_SYS_SetConf&gt; kfctmpdir is [/tmp]
I0101 05:24:50.471314   333 mpi_sys.c:1560] &lt;AW_MPI_SYS_Init&gt; ISP init
I0101 05:24:50.473061   333 isp_version.h:32] &lt;isp_version_info&gt; [ISP]&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; ISP VERSION INFO &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
IPCORE: ISP603
branch: libisp-dev
commit: 17ff2691536c2703ffcaf9f77a536289b475960b
date  : Tue Nov 25 19:56:58 2025 +0800
author: &lt;mayifei@allwinnertech.com&gt;
--------------------------------------------------------

I0101 05:24:50.480214   333 mpi_sys.c:1562] &lt;AW_MPI_SYS_Init&gt; ISP init done
I0101 05:24:50.482474   333 hwdisplay.c:84] &lt;hw_display_init&gt;
I0101 05:24:50.483505   333 hwdisplay.c:1008] &lt;hwd_init&gt; (hwd_init 1008)
E0101 05:24:50.986184   333 hwdisplay.c:1001] &lt;tryOpenDev&gt; fatal error! open dev[/dev/disp] fail. error[2-No such file or directory]!
E0101 05:24:50.987246   333 hwdisplay.c:1018] &lt;hwd_init&gt; fatal error! Failed to open disp device
E0101 05:24:50.988217   333 mpi_vo.c:382] &lt;VO_Construct&gt; fatal error! hw display init fail!
E0101 05:24:50.989272   333 mpi_sys.c:1617] &lt;AW_MPI_SYS_Init&gt; VO Construct error!
I0101 05:24:51.018701   333 audio_hw.c:199] &lt;MakeAllMixerElemsAvailable&gt; pcm open and close, all MixerElems maybe exist.
I0101 05:24:51.019752   333 alsa_interface.c:736] &lt;alsaOpenMixer&gt; open mixer:hw:0
I0101 05:24:51.022494   333 alsa_interface.c:792] &lt;alsaOpenMixer&gt; set playback vol_val to value: 27, mppValue:385
I0101 05:24:51.023880   333 alsa_interface.c:805] &lt;alsaOpenMixer&gt; set playback soft_vol val to value: 130, mppValue:0
I0101 05:24:51.025372   333 alsa_interface.c:736] &lt;alsaOpenMixer&gt; open mixer:hw:1
I0101 05:24:51.028675   336 mpi_sys.c:1124] &lt;MonitorEnvVarThread&gt; detect user environment:
I0101 05:24:51.029684   336 mpi_sys.c:1125] &lt;MonitorEnvVarThread&gt; /tmp/mpp_log_level
I0101 05:24:51.030663   336 mpi_sys.c:1126] &lt;MonitorEnvVarThread&gt; /tmp/mpp_venc_sei_config_param
I0101 05:24:51.092973   333 uvcInput.c:586] &lt;uvcInput_SetDevAttr&gt; the /dev/video0 UVC support video capture!
I0101 05:24:51.093275   333 uvcInput.c:596] &lt;uvcInput_SetDevAttr&gt; the /dev/video0 UVC driver is uvcvideo
I0101 05:24:51.093476   333 uvcInput.c:597] &lt;uvcInput_SetDevAttr&gt; the /dev/video0 UVC card is Logitech Webcam C930e
I0101 05:24:51.093676   333 uvcInput.c:598] &lt;uvcInput_SetDevAttr&gt; the /dev/video0 UVC bus info is usb-sunxi-ehci-1
I0101 05:24:51.093847   333 uvcInput.c:599] &lt;uvcInput_SetDevAttr&gt; the version is 328924
I0101 05:24:51.094026   333 uvcInput.c:611] &lt;uvcInput_SetDevAttr&gt; the /dev/video0 UVC device can support YUYV 4:2:2 capture pixelformat[0x56595559]
I0101 05:24:51.094204   333 uvcInput.c:611] &lt;uvcInput_SetDevAttr&gt; the /dev/video0 UVC device can support Motion-JPEG capture pixelformat[0x47504a4d]
I0101 05:24:51.094358   333 uvcInput.c:614] &lt;uvcInput_SetDevAttr&gt; Congratulation: the /dev/video0 UVC support Motion-JPEG capture pixelformat
I0101 05:24:51.112049   333 uvcInput.c:849] &lt;uvcInput_SetDevAttr&gt; the /dev/video0 UVC capture fixformat is 0x47504a4d
I0101 05:24:51.113174   333 uvcInput.c:850] &lt;uvcInput_SetDevAttr&gt; the /dev/video0 UVC capture width is 1280
I0101 05:24:51.114170   333 uvcInput.c:851] &lt;uvcInput_SetDevAttr&gt; the /dev/video0 UVC capture height is 720
I0101 05:24:51.115135   333 uvcInput.c:852] &lt;uvcInput_SetDevAttr&gt; the /dev/video0 UVC capture fps is 30
I0101 05:24:51.116118   333 uvcInput.c:853] &lt;uvcInput_SetDevAttr&gt; the /dev/video0 UVC capture bufCount is 3
I0101 05:24:51.117175   333 uvcInput.c:854] &lt;uvcInput_SetDevAttr&gt; the /dev/video0 UVC capture bufLength is 1843200
W0101 05:24:51.118140   333 uvcInput.c:857] &lt;uvcInput_SetDevAttr&gt; the /dev/video0 UVC had init!
W0101 05:24:51.119700   333 UvcVirVi_Component.c:1026] &lt;UvcComponentInit&gt; UvcVirvi_Component had Init!!!
I0101 05:24:51.120848   337 UvcVirVi_Component.c:1038] &lt;Uvc_ComponentThread&gt; UVC ComponentThread start run!
E0101 05:24:51.123030   339 VideoDec_InputThread.c:70] &lt;InputThread&gt; VideoDecoder InputThread start run...
[1970-01-01 05:24:51.124] [info] [Uvc2Dec2Enc.cpp:374] Decode init wh: 1280x720
[1970-01-01 05:24:51.132] [info] [Uvc2Dec2Enc.cpp:451] venc set Rcmode= 2
INFO   : cedarc &lt;cdc_log_set_level:78&gt;: Set log level to 5 from /etc/cedarc.conf
I0101 05:24:51.154759   340 VideoEnc_Component.c:1353] &lt;CedarvEncInit&gt; VencChn[0] set VbrOptEn 0
I0101 05:24:51.155822   340 VideoEnc_Component.c:1375] &lt;CedarvEncInit&gt; VencChn[0] set ProductCase mode: 0
WARNING: cedarc &lt;CheckSetParamInt:778&gt;: Notice: sVbrParam.nQuality is 10, but its suggested value is 1 !
I0101 05:24:51.157090   333 VideoEnc_Component.c:990] &lt;setVbvBufferConfig&gt; bitrate: 1953 Kbps, set encode vbv size [1442816]bytes, frame length threshold [942080]bytes
I0101 05:24:51.157400   333 VideoEnc_Component.c:2537] &lt;CedarvVideoEncInit&gt; VencChn[0] Online Mode=1,Chn=0,BufNum=0,OnlineEnFlag=0,sensorID=0,bkID=0,VcuOn=1,MultiSensorOnlineEn=0
WARNING: cedarc &lt;resetEncoderVcu:887&gt;: reset vcu and encoder
[1970-01-01 05:24:51.231] [info] [RtspServerImpl.cpp:166] rtsp server start! url: rtsp://192.168.31.191:8554/ch0
W0101 05:24:51.233866   333 VideoDec_Component.c:2539] &lt;VideoDecComponentTunnelRequest&gt; Low probability! input portIndex[0] buffer supplier[1] is not same as output portIndex[1] buffer supplier[2], respect output port decision!
I0101 05:24:51.235034   333 VideoEnc_Component.c:8055] &lt;VideoEncComponentTunnelRequest&gt; set inputPortTunnelFlag = TRUE
W0101 05:24:51.650037   333 uvcInput.c:460] &lt;uvcInput_SetDevEnable&gt; Be careful! uvcDev[/dev/video0] streamon cost:413ms
I0101 05:24:51.651608   338 VideoDec_Component.c:676] &lt;CedarvCodecInit&gt; video_format: 0x101
W0101 05:24:51.653470   345 uvcInput.c:1222] &lt;uvcInput_CapThread&gt; loop uvcInput_CapThread the UVC name is /dev/video0 , fd = 8
I0101 05:24:51.665980   338 VideoDec_Component.c:781] &lt;CedarvCodecInit&gt; vdec output format set to [0x6]
I0101 05:24:51.666434   338 VideoDec_Component.c:799] &lt;CedarvCodecInit&gt; config vbvBufferSize[0]KB
WARNING: cedarc &lt;InitializeVideoDecoder:470&gt;: warning: the nDecodeSmoothFrameBufferNum is 0
WARNING: cedarc &lt;InitializeVideoDecoder:476&gt;: warning: the nDeInterlaceHoldingFrameBufferNum is 0
I0101 05:24:51.696103   338 VideoDec_Component.c:876] &lt;CedarvCodecInit&gt; vdecChn[0] video stream info:codecType[0x101], size[1280x720], frameRate[30000], isFramePackage[1]
I0101 05:24:51.697782   339 VideoDec_InputThread.c:303] &lt;InputThread&gt; tunnel_BufferSupplyOutput is not processed here.
E0101 05:24:51.854970   345 uvcInput.c:884] &lt;uvcInput_WaiteBuffer&gt; the /dev/video0 UVC select timeout!
E0101 05:24:52.055609   345 uvcInput.c:884] &lt;uvcInput_WaiteBuffer&gt; the /dev/video0 UVC select timeout!
W0101 05:24:52.199092   338 VideoDec_Component.c:4619] &lt;ComponentThread&gt; fatal error! wait vbs data timeout!
[1970-01-01 05:24:52.197] [error] [Uvc2Dec2Enc.cpp:194] fatal error! why not get stream from venc for too long? ret=0x-5ff67ff2
W0101 05:24:52.237116   340 VideoEnc_Component.c:10888] &lt;ComponentThread&gt; Be careful! vencChn[0] timeout for waiting outputStream. input frames stat:ready[0]+using[0]+used[0]=total[0]
E0101 05:24:52.256233   345 uvcInput.c:884] &lt;uvcInput_WaiteBuffer&gt; the /dev/video0 UVC select timeout!
E0101 05:24:52.456973   345 uvcInput.c:884] &lt;uvcInput_WaiteBuffer&gt; the /dev/video0 UVC select timeout!
E0101 05:24:52.657617   345 uvcInput.c:884] &lt;uvcInput_WaiteBuffer&gt; the /dev/video0 UVC select timeout!
</code></pre>
<p dir="auto">用v4l2-ctl获取mjpeg流，能正确运行。</p>
<pre><code>v4l2-ctl -d /dev/video0 --set-fmt-video=width=640,height=480,pixelformat=MJPG --stream-mmap --stream-to=test.mjpg

输出：
&lt; 64.45 fps, dropped buffers: 71
&lt; 64.83 fps, dropped buffers: 66
&lt; 64.72 fps, dropped buffers: 52
&lt;&lt; 65.22 fps, dropped buffers: 132
&lt;&lt;&lt; 65.38 fps, dropped buffers: 64
&lt;&lt;&lt; 66.11 fps, dropped buffers: 172
&lt; 65.66 fps, dropped buffers: 43
&lt;&lt;&lt; 65.75 fps, dropped buffers: 53
&lt;&lt; 65.32 fps, dropped buffers: 50
&lt;&lt; 64.37 fps, dropped buffers: 203
&lt;&lt; 64.51 fps, dropped buffers: 61
&lt; 64.06 fps, dropped buffers: 207
&lt; 64.09 fps, dropped buffers: 121
</code></pre>
<p dir="auto">以下是uvc插入时的日志:</p>
<pre><code>[    5.186790] usb 1-1: New USB device found, idVendor=046d, idProduct=0843, bcdDevice= 0.13
[    5.187704] usb 1-1: New USB device strings: Mfr=0, Product=2, SerialNumber=1
[    5.188525] usb 1-1: Product: Logitech Webcam C930e
[    5.189064] usb 1-1: SerialNumber: A597F8EE
[    5.190900] uvcvideo: Found UVC 1.00 device Logitech Webcam C930e (046d:0843)
[    5.196754] input: Logitech Webcam C930e as /devices/platform/soc@2002000/44101000.ehci0-controller/usb1/1-12
</code></pre>
<p dir="auto">请问如何修复此问题？</p>
]]></description><link>https://bbs.aw-ol.com/topic/7013/v821从uvc摄像头长时间取流-20分钟-uvcinput_waitebuffer-uvc-select-timeout</link><generator>RSS for Node</generator><lastBuildDate>Thu, 28 May 2026 16:09:44 GMT</lastBuildDate><atom:link href="https://bbs.aw-ol.com/topic/7013.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 19 May 2026 06:14:53 GMT</pubDate><ttl>60</ttl></channel></rss>