简体   繁体   English

Raspberry Pi NoIR相机挂起

[英]Raspberry Pi NoIR camera hangs

Background Information: 背景资料:

I built a smart door solution with a RPi B+ (Raspbian) which makes use of three sensors (PIR, Gyroscope [I2C] and an Ultrasound). 我用RPi B +(Raspbian)构建了智能门解决方案,该解决方案使用了三个传感器(PIR,陀螺仪[I2C]和超声波)。 Depending on the sensor status managed by a Python script, I start recording a video by using the raspivid command and/or play sounds on Bluetooth speakers. 根据Python脚本管理的传感器状态,我开始使用raspivid命令录制视频和/或在蓝牙扬声器上播放声音。 I also have a USB WIFI dongle connected to the RPi. 我还有一个连接到RPi的USB WIFI加密狗。

This is how I call the Pi NoIR camera in my .sh file: 这就是我在.sh文件中调用Pi NoIR相机的方法:

raspivid -w 800 -h 600 -t 15000 -o file.h264 -n -rot 270

Problem description: 问题描述:

The camera works fine for a while (I cannot precise for how long [2 hours maybe] nor what triggers the issue), but then it stops working. 相机工作正常一段时间(我不能确切地知道多长时间[也许是2个小时]也不会触发问题)但是它会停止工作。 The funny thing is that I get no error message. 有趣的是,我没有收到任何错误消息。

What did I do to identify the root cause: 我做了什么来确定根本原因:

  • I tried to manually kill the child process (Raspivid) but it simply doesn't work. 我试图手动杀死子进程(Raspivid),但它根本不起作用。 If I kill the parent process (.sh file) then my child process gets assigned to the PID 1 (init.d). 如果我终止父进程(.sh文件),那么我的子进程将被分配给PID 1(init.d)。

  • I tried recording a new video in a new terminal window but the new process hangs too. 我尝试在新的终端窗口中录制新视频,但新过程也会挂起。

  • Rebooting the Pi doesn't work neither. 重新启动Pi也不起作用。 It says it is rebooting but it does not (not even with the -f option). 它说它正在重启,但它没有(甚至没有-f选项)。

  • I installed a new Pi Camera ensuring it was not a hardware or ribbon problem. 我安装了一个新的Pi Camera,确保它不是硬件或色带问题。

  • Camera has enough memory available. 相机有足够的内存可用。

  • Pi has enough power (Red led is always on) Pi有足够的力量(红色LED始终打开)

  • -v returns no error -v不返回错误

  • I have installed V4L2-CTL but I have the same issue 我安装了V4L2-CTL,但我遇到了同样的问题

How can I get it fixed? 我怎样才能修好它? Thanks! 谢谢!

** Edit ** **编辑**

dmesg: 的dmesg:

[   90.555578] ------------[ cut here ]------------
[   90.555698] WARNING: CPU: 0 PID: 3593 at drivers/media/v4l2-core/videobuf2-core.c:2135 __vb2_queue_cancel+0xf4/0x160 [videobuf2_core]()
[   90.555715] Modules linked in: evdev uinput rfcomm bnep bcm2835_v4l2 videobuf2_vmalloc videobuf2_memops videobuf2_core v4l2_common videodev media snd_bcm2835 snd_pcm snd_seq snd_seq_device snd_timer snd spi_bcm2708 i2c_bcm2708 i2c_dev ecb btusb 8192cu bluetooth rfkill uio_pdrv_genirq uio
[   90.555843] CPU: 0 PID: 3593 Comm: v4l2-ctl Not tainted 3.18.7+ #755
[   90.555915] [<c00151fc>] (unwind_backtrace) from [<c0012710>] (show_stack+0x20/0x24)
[   90.556012] [<c0012710>] (show_stack) from [<c0555b30>] (dump_stack+0x20/0x28)
[   90.556053] [<c0555b30>] (dump_stack) from [<c0022ef4>] (warn_slowpath_common+0x7c/0x9c)
[   90.556083] [<c0022ef4>] (warn_slowpath_common) from [<c0022fd0>] (warn_slowpath_null+0x2c/0x34)
[   90.556143] [<c0022fd0>] (warn_slowpath_null) from [<bf263a1c>] (__vb2_queue_cancel+0xf4/0x160 [videobuf2_core])
[   90.556252] [<bf263a1c>] (__vb2_queue_cancel [videobuf2_core]) from [<bf265548>] (vb2_internal_streamoff+0x40/0xdc [videobuf2_core])
[   90.556361] [<bf265548>] (vb2_internal_streamoff [videobuf2_core]) from [<bf2656d8>] (vb2_streamoff+0x3c/0x60 [videobuf2_core])
[   90.556436] [<bf2656d8>] (vb2_streamoff [videobuf2_core]) from [<bf26574c>] (vb2_ioctl_streamoff+0x50/0x54 [videobuf2_core])
[   90.556669] [<bf26574c>] (vb2_ioctl_streamoff [videobuf2_core]) from [<bf228658>] (v4l_streamoff+0x28/0x2c [videodev])
[   90.556938] [<bf228658>] (v4l_streamoff [videodev]) from [<bf22baf4>] (__video_do_ioctl+0x254/0x2e8 [videodev])
[   90.557182] [<bf22baf4>] (__video_do_ioctl [videodev]) from [<bf22b49c>] (video_usercopy+0x180/0x560 [videodev])
[   90.557414] [<bf22b49c>] (video_usercopy [videodev]) from [<bf22b898>] (video_ioctl2+0x1c/0x24 [videodev])
[   90.557616] [<bf22b898>] (video_ioctl2 [videodev]) from [<bf2266b0>] (v4l2_ioctl+0x11c/0x14c [videodev])
[   90.557791] [<bf2266b0>] (v4l2_ioctl [videodev]) from [<c014c478>] (do_vfs_ioctl+0x3f0/0x5d4)
[   90.557872] [<c014c478>] (do_vfs_ioctl) from [<c014c6a0>] (SyS_ioctl+0x44/0x6c)
[   90.557917] [<c014c6a0>] (SyS_ioctl) from [<c000e8c0>] (ret_fast_syscall+0x0/0x48)
[   90.557936] ---[ end trace 28c9150399e29093 ]---
[ 3123.544118] ------------[ cut here ]------------
[ 3123.544235] WARNING: CPU: 0 PID: 28629 at drivers/media/v4l2-core/videobuf2-core.c:2135 __vb2_queue_cancel+0xf4/0x160 [videobuf2_core]()
[ 3123.544251] Modules linked in: evdev uinput rfcomm bnep bcm2835_v4l2 videobuf2_vmalloc videobuf2_memops videobuf2_core v4l2_common videodev media snd_bcm2835 snd_pcm snd_seq snd_seq_device snd_timer snd spi_bcm2708 i2c_bcm2708 i2c_dev ecb btusb 8192cu bluetooth rfkill uio_pdrv_genirq uio
[ 3123.544404] CPU: 0 PID: 28629 Comm: v4l2-ctl Tainted: G        W      3.18.7+ #755
[ 3123.544475] [<c00151fc>] (unwind_backtrace) from [<c0012710>] (show_stack+0x20/0x24)
[ 3123.544570] [<c0012710>] (show_stack) from [<c0555b30>] (dump_stack+0x20/0x28)
[ 3123.544676] [<c0555b30>] (dump_stack) from [<c0022ef4>] (warn_slowpath_common+0x7c/0x9c)
[ 3123.545092] [<c0022ef4>] (warn_slowpath_common) from [<c0022fd0>] (warn_slowpath_null+0x2c/0x34)
[ 3123.545178] [<c0022fd0>] (warn_slowpath_null) from [<bf263a1c>] (__vb2_queue_cancel+0xf4/0x160 [videobuf2_core])
[ 3123.545253] [<bf263a1c>] (__vb2_queue_cancel [videobuf2_core]) from [<bf265548>] (vb2_internal_streamoff+0x40/0xdc [videobuf2_core])
[ 3123.545316] [<bf265548>] (vb2_internal_streamoff [videobuf2_core]) from [<bf2656d8>] (vb2_streamoff+0x3c/0x60 [videobuf2_core])
[ 3123.545377] [<bf2656d8>] (vb2_streamoff [videobuf2_core]) from [<bf26574c>] (vb2_ioctl_streamoff+0x50/0x54 [videobuf2_core])
[ 3123.545562] [<bf26574c>] (vb2_ioctl_streamoff [videobuf2_core]) from [<bf228658>] (v4l_streamoff+0x28/0x2c [videodev])
[ 3123.545803] [<bf228658>] (v4l_streamoff [videodev]) from [<bf22baf4>] (__video_do_ioctl+0x254/0x2e8 [videodev])
[ 3123.546060] [<bf22baf4>] (__video_do_ioctl [videodev]) from [<bf22b49c>] (video_usercopy+0x180/0x560 [videodev])
[ 3123.546309] [<bf22b49c>] (video_usercopy [videodev]) from [<bf22b898>] (video_ioctl2+0x1c/0x24 [videodev])
[ 3123.546483] [<bf22b898>] (video_ioctl2 [videodev]) from [<bf2266b0>] (v4l2_ioctl+0x11c/0x14c [videodev])
[ 3123.546595] [<bf2266b0>] (v4l2_ioctl [videodev]) from [<c014c478>] (do_vfs_ioctl+0x3f0/0x5d4)
[ 3123.546676] [<c014c478>] (do_vfs_ioctl) from [<c014c6a0>] (SyS_ioctl+0x44/0x6c)
[ 3123.546717] [<c014c6a0>] (SyS_ioctl) from [<c000e8c0>] (ret_fast_syscall+0x0/0x48)
[ 3123.546737] ---[ end trace 28c9150399e29094 ]---
[34462.831249] bcm2835_v4l2: error 0 waiting for sync completion
[34465.833783] bcm2835_v4l2: error 0 waiting for sync completion
[34465.833853] bcm2835_v4l2: failed disconnecting src port
[34468.833772] bcm2835_v4l2: error 0 waiting for sync completion
[34468.833818] bcm2835-v4l2: Failed to disable encode component -62
[34471.834219] bcm2835_v4l2: error 0 waiting for sync completion
[34471.834395] bcm2835-v4l2: vidioc_s_fmt_vid_cap: failed to setup mmal components: -62
[34474.873813] bcm2835_v4l2: error 0 waiting for sync completion
[34474.890435] bcm2835-v4l2: queue_setup: capture port not configured
[34495.914162] bcm2835_v4l2: error 0 waiting for sync completion
[34498.916190] bcm2835_v4l2: error 0 waiting for sync completion
[34498.916290] bcm2835-v4l2: vidioc_s_fmt_vid_cap: failed to setup mmal components: -62
[34502.064159] bcm2835_v4l2: error 0 waiting for sync completion
[34502.070076] bcm2835-v4l2: queue_setup: capture port not configured
[36016.330148] bcm2835_v4l2: error 0 waiting for sync completion
[36019.339279] bcm2835_v4l2: error 0 waiting for sync completion
[36019.339327] bcm2835-v4l2: vidioc_s_fmt_vid_cap: failed to setup mmal components: -62
[36022.430218] bcm2835_v4l2: error 0 waiting for sync completion
[36022.441684] bcm2835-v4l2: queue_setup: capture port not configured

syslog: 系统日志:

Feb 20 05:35:02 raspberrypi kernel: [34462.831249] bcm2835_v4l2: error 0 waiting for sync completion
Feb 20 05:35:05 raspberrypi kernel: [34465.833783] bcm2835_v4l2: error 0 waiting for sync completion
Feb 20 05:35:05 raspberrypi kernel: [34465.833853] bcm2835_v4l2: failed disconnecting src port
Feb 20 05:35:08 raspberrypi kernel: [34468.833772] bcm2835_v4l2: error 0 waiting for sync completion
Feb 20 05:35:08 raspberrypi kernel: [34468.833818] bcm2835-v4l2: Failed to disable encode component -62
Feb 20 05:35:11 raspberrypi kernel: [34471.834219] bcm2835_v4l2: error 0 waiting for sync completion
Feb 20 05:35:11 raspberrypi kernel: [34471.834395] bcm2835-v4l2: vidioc_s_fmt_vid_cap: failed to setup mmal components: -62
Feb 20 05:35:14 raspberrypi kernel: [34474.873813] bcm2835_v4l2: error 0 waiting for sync completion
Feb 20 05:35:14 raspberrypi kernel: [34474.890435] bcm2835-v4l2: queue_setup: capture port not configured
Feb 20 05:35:35 raspberrypi kernel: [34495.914162] bcm2835_v4l2: error 0 waiting for sync completion
Feb 20 05:35:38 raspberrypi kernel: [34498.916190] bcm2835_v4l2: error 0 waiting for sync completion
Feb 20 05:35:38 raspberrypi kernel: [34498.916290] bcm2835-v4l2: vidioc_s_fmt_vid_cap: failed to setup mmal components: -62
Feb 20 05:35:41 raspberrypi kernel: [34502.064159] bcm2835_v4l2: error 0 waiting for sync completion
Feb 20 05:35:41 raspberrypi kernel: [34502.070076] bcm2835-v4l2: queue_setup: capture port not configured
Feb 20 06:00:55 raspberrypi kernel: [36016.330148] bcm2835_v4l2: error 0 waiting for sync completion
Feb 20 06:00:58 raspberrypi kernel: [36019.339279] bcm2835_v4l2: error 0 waiting for sync completion
Feb 20 06:00:58 raspberrypi kernel: [36019.339327] bcm2835-v4l2: vidioc_s_fmt_vid_cap: failed to setup mmal components: -62
Feb 20 06:01:01 raspberrypi kernel: [36022.430218] bcm2835_v4l2: error 0 waiting for sync completion
Feb 20 06:01:01 raspberrypi kernel: [36022.441684] bcm2835-v4l2: queue_setup: capture port not configured

messages: 消息:

Feb 19 20:02:10 raspberrypi kernel: [   90.555578] ------------[ cut here ]------------
Feb 19 20:02:10 raspberrypi kernel: [   90.555698] WARNING: CPU: 0 PID: 3593 at drivers/media/v4l2-core/videobuf2-core.c:2135 __vb2_queue_cancel+0xf4/0x160 [videobuf2_core]()
Feb 19 20:02:10 raspberrypi kernel: [   90.555715] Modules linked in: evdev uinput rfcomm bnep bcm2835_v4l2 videobuf2_vmalloc videobuf2_memops videobuf2_core v4l2_common videodev media snd_bcm2835 snd_pcm snd_seq snd_seq_device snd_timer snd spi_bcm2708 i2c_bcm2708 i2c_dev ecb btusb 8192cu bluetooth rfkill uio_pdrv_genirq uio
Feb 19 20:02:10 raspberrypi kernel: [   90.555843] CPU: 0 PID: 3593 Comm: v4l2-ctl Not tainted 3.18.7+ #755
Feb 19 20:02:10 raspberrypi kernel: [   90.555915] [<c00151fc>] (unwind_backtrace) from [<c0012710>] (show_stack+0x20/0x24)
Feb 19 20:02:10 raspberrypi kernel: [   90.556012] [<c0012710>] (show_stack) from [<c0555b30>] (dump_stack+0x20/0x28)
Feb 19 20:02:10 raspberrypi kernel: [   90.556053] [<c0555b30>] (dump_stack) from [<c0022ef4>] (warn_slowpath_common+0x7c/0x9c)
Feb 19 20:02:10 raspberrypi kernel: [   90.556083] [<c0022ef4>] (warn_slowpath_common) from [<c0022fd0>] (warn_slowpath_null+0x2c/0x34)
Feb 19 20:02:10 raspberrypi kernel: [   90.556143] [<c0022fd0>] (warn_slowpath_null) from [<bf263a1c>] (__vb2_queue_cancel+0xf4/0x160 [videobuf2_core])
Feb 19 20:02:10 raspberrypi kernel: [   90.556252] [<bf263a1c>] (__vb2_queue_cancel [videobuf2_core]) from [<bf265548>] (vb2_internal_streamoff+0x40/0xdc [videobuf2_core])
Feb 19 20:02:10 raspberrypi kernel: [   90.556361] [<bf265548>] (vb2_internal_streamoff [videobuf2_core]) from [<bf2656d8>] (vb2_streamoff+0x3c/0x60 [videobuf2_core])
Feb 19 20:02:10 raspberrypi kernel: [   90.556436] [<bf2656d8>] (vb2_streamoff [videobuf2_core]) from [<bf26574c>] (vb2_ioctl_streamoff+0x50/0x54 [videobuf2_core])
Feb 19 20:02:10 raspberrypi kernel: [   90.556669] [<bf26574c>] (vb2_ioctl_streamoff [videobuf2_core]) from [<bf228658>] (v4l_streamoff+0x28/0x2c [videodev])
Feb 19 20:02:10 raspberrypi kernel: [   90.556938] [<bf228658>] (v4l_streamoff [videodev]) from [<bf22baf4>] (__video_do_ioctl+0x254/0x2e8 [videodev])
Feb 19 20:02:10 raspberrypi kernel: [   90.557182] [<bf22baf4>] (__video_do_ioctl [videodev]) from [<bf22b49c>] (video_usercopy+0x180/0x560 [videodev])
Feb 19 20:02:10 raspberrypi kernel: [   90.557414] [<bf22b49c>] (video_usercopy [videodev]) from [<bf22b898>] (video_ioctl2+0x1c/0x24 [videodev])
Feb 19 20:02:10 raspberrypi kernel: [   90.557616] [<bf22b898>] (video_ioctl2 [videodev]) from [<bf2266b0>] (v4l2_ioctl+0x11c/0x14c [videodev])
Feb 19 20:02:10 raspberrypi kernel: [   90.557791] [<bf2266b0>] (v4l2_ioctl [videodev]) from [<c014c478>] (do_vfs_ioctl+0x3f0/0x5d4)
Feb 19 20:02:10 raspberrypi kernel: [   90.557872] [<c014c478>] (do_vfs_ioctl) from [<c014c6a0>] (SyS_ioctl+0x44/0x6c)
Feb 19 20:02:10 raspberrypi kernel: [   90.557917] [<c014c6a0>] (SyS_ioctl) from [<c000e8c0>] (ret_fast_syscall+0x0/0x48)
Feb 19 20:02:10 raspberrypi kernel: [   90.557936] ---[ end trace 28c9150399e29093 ]---
Feb 19 20:52:43 raspberrypi kernel: [ 3123.544118] ------------[ cut here ]------------
Feb 19 20:52:43 raspberrypi kernel: [ 3123.544235] WARNING: CPU: 0 PID: 28629 at drivers/media/v4l2-core/videobuf2-core.c:2135 __vb2_queue_cancel+0xf4/0x160 [videobuf2_core]()
Feb 19 20:52:43 raspberrypi kernel: [ 3123.544251] Modules linked in: evdev uinput rfcomm bnep bcm2835_v4l2 videobuf2_vmalloc videobuf2_memops videobuf2_core v4l2_common videodev media snd_bcm2835 snd_pcm snd_seq snd_seq_device snd_timer snd spi_bcm2708 i2c_bcm2708 i2c_dev ecb btusb 8192cu bluetooth rfkill uio_pdrv_genirq uio
Feb 19 20:52:43 raspberrypi kernel: [ 3123.544404] CPU: 0 PID: 28629 Comm: v4l2-ctl Tainted: G        W      3.18.7+ #755
Feb 19 20:52:43 raspberrypi kernel: [ 3123.544475] [<c00151fc>] (unwind_backtrace) from [<c0012710>] (show_stack+0x20/0x24)
Feb 19 20:52:43 raspberrypi kernel: [ 3123.544570] [<c0012710>] (show_stack) from [<c0555b30>] (dump_stack+0x20/0x28)
Feb 19 20:52:43 raspberrypi kernel: [ 3123.544676] [<c0555b30>] (dump_stack) from [<c0022ef4>] (warn_slowpath_common+0x7c/0x9c)
Feb 19 20:52:43 raspberrypi kernel: [ 3123.545092] [<c0022ef4>] (warn_slowpath_common) from [<c0022fd0>] (warn_slowpath_null+0x2c/0x34)
Feb 19 20:52:43 raspberrypi kernel: [ 3123.545178] [<c0022fd0>] (warn_slowpath_null) from [<bf263a1c>] (__vb2_queue_cancel+0xf4/0x160 [videobuf2_core])
Feb 19 20:52:43 raspberrypi kernel: [ 3123.545253] [<bf263a1c>] (__vb2_queue_cancel [videobuf2_core]) from [<bf265548>] (vb2_internal_streamoff+0x40/0xdc [videobuf2_core])
Feb 19 20:52:43 raspberrypi kernel: [ 3123.545316] [<bf265548>] (vb2_internal_streamoff [videobuf2_core]) from [<bf2656d8>] (vb2_streamoff+0x3c/0x60 [videobuf2_core])
Feb 19 20:52:43 raspberrypi kernel: [ 3123.545377] [<bf2656d8>] (vb2_streamoff [videobuf2_core]) from [<bf26574c>] (vb2_ioctl_streamoff+0x50/0x54 [videobuf2_core])
Feb 19 20:52:43 raspberrypi kernel: [ 3123.545562] [<bf26574c>] (vb2_ioctl_streamoff [videobuf2_core]) from [<bf228658>] (v4l_streamoff+0x28/0x2c [videodev])
Feb 19 20:52:43 raspberrypi kernel: [ 3123.545803] [<bf228658>] (v4l_streamoff [videodev]) from [<bf22baf4>] (__video_do_ioctl+0x254/0x2e8 [videodev])
Feb 19 20:52:43 raspberrypi kernel: [ 3123.546060] [<bf22baf4>] (__video_do_ioctl [videodev]) from [<bf22b49c>] (video_usercopy+0x180/0x560 [videodev])
Feb 19 20:52:43 raspberrypi kernel: [ 3123.546309] [<bf22b49c>] (video_usercopy [videodev]) from [<bf22b898>] (video_ioctl2+0x1c/0x24 [videodev])
Feb 19 20:52:43 raspberrypi kernel: [ 3123.546483] [<bf22b898>] (video_ioctl2 [videodev]) from [<bf2266b0>] (v4l2_ioctl+0x11c/0x14c [videodev])
Feb 19 20:52:43 raspberrypi kernel: [ 3123.546595] [<bf2266b0>] (v4l2_ioctl [videodev]) from [<c014c478>] (do_vfs_ioctl+0x3f0/0x5d4)
Feb 19 20:52:43 raspberrypi kernel: [ 3123.546676] [<c014c478>] (do_vfs_ioctl) from [<c014c6a0>] (SyS_ioctl+0x44/0x6c)
Feb 19 20:52:43 raspberrypi kernel: [ 3123.546717] [<c014c6a0>] (SyS_ioctl) from [<c000e8c0>] (ret_fast_syscall+0x0/0x48)
Feb 19 20:52:43 raspberrypi kernel: [ 3123.546737] ---[ end trace 28c9150399e29094 ]---

By looking at your kernel messages, specifically the line containing '__vb2_queue_cancel', I think your problem may partially be related to Raspberry's kernel drivers. 通过查看内核消息,特别是包含'__vb2_queue_cancel'的行,我认为您的问题可能部分与Raspberry的内核驱动程序有关。 Have you checked if your kernel contains the fix given at [1]? 您是否检查过您的内核是否包含[1]中给出的修复程序? If not, applying that oneliner may fix your problem. 如果没有,应用该oneliner可能会解决您的问题。

For some reason your camera application is stopping video capture and due to the aformentioned bug it fails to do so. 出于某种原因,您的相机应用程序正在停止视频捕获,并且由于前面提到的错误,它无法执行此操作。 This may at least give you a chance to restart your capture pipeline. 这可能至少让您有机会重新启动捕获管道。

[1] https://github.com/6by9/linux/commit/f1e870c2c910d0620b1a48ac7165c8f9e9a75527 [1] https://github.com/6by9/linux/commit/f1e870c2c910d0620b1a48ac7165c8f9e9a75527

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM