2015-02-02 12 views
11

INFORMACJE OGÓLNE:aparat maliny Pi Noir zawiesza

I zbudowany inteligentnej rozwiązania drzwi z Rpi B + (Raspbian), co sprawia, że ​​zastosowanie trzech czujników (PIR, żyroskop [I2C] i ultradźwiękowe). W zależności od stanu czujnika zarządzanego przez skrypt w języku Python, zacznę nagrywać wideo za pomocą polecenia raspivid i/lub odtwarzać dźwięki w głośnikach Bluetooth. Posiadam także klucz USB WIFI podłączony do RPi.

ten sposób wzywam aparat Pi Noir w moim .sh pliku: opis

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

Problem:

Aparat działa dobrze na chwilę (nie mogę precyzyjnie jak długo [ Może 2 godziny] ani to, co wywołuje problem), ale potem przestaje działać. Zabawne jest to, że nie dostaję żadnego komunikatu o błędzie.

Co zrobić, aby zidentyfikować przyczynę:

  • Próbowałem ręcznie zabić procesu potomnego (Raspivid), ale to po prostu nie działa. Jeśli zabiję proces nadrzędny (plik .sh), mój proces potomny zostanie przypisany do PID 1 (init.d).

  • Próbowałem nagrać nowy film w nowym oknie terminala, ale nowy proces również się zawiesił.

  • Ponowne uruchomienie Pi nie działa. Mówi, że restartuje się, ale tak się nie dzieje (nawet z opcją -f).

  • Zainstalowałem nową kamerę Pi, upewniając się, że nie był to problem ze sprzętem lub wstążką.

  • Aparat ma wystarczającą ilość pamięci.

  • Pi ma wystarczającą moc (czerwona dioda LED jest zawsze włączona)

  • -v zwraca żadnego błędu

  • Mam zainstalowany V4L2-CTL ale mam ten sam problem

Jak mogę to naprawić? Dzięki!

** Edycja **

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 

wiadomości:

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 ]--- 
+0

Brak wiadomości w 'dmesg' lub syslog? Czy Pi ma wystarczającą moc? Masz dość mocną konfigurację, która może być podatna na fluktuacje mocy. Co się stanie, jeśli ponownie podłączasz kamerę po awarii? Jakie jest więc wyjście 'dmesg'? – nemo

+0

Wystarczająca moc, ponieważ czerwona dioda pozostaje włączona przez cały czas. Ponowne podłączenie aparatu niczego nie zmienia. -v nie zwraca żadnych błędów. O którym syslogie mówisz? Dziękuję Ci! –

+0

'/ var/log/messages' lub'/var/log/syslog'/i polecenie 'dmesg'. – nemo

Odpowiedz

2

Patrząc na wiadomości jądra, w szczególności linia zawierające "__vb2_queue_can cel ", myślę, że twój problem może być częściowo związany ze sterownikami jądra Raspberry. Czy sprawdziłeś, czy jądro zawiera poprawkę podaną w [1]? Jeśli nie, zastosowanie tego Onelinera może rozwiązać problem.

Z jakiegoś powodu aplikacja kamery zatrzymuje przechwytywanie wideo, a ze względu na nieprawidłowy błąd nie można tego zrobić. Może to przynajmniej dać Ci szansę na ponowne uruchomienie potoku przechwytującego.

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