-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
motion stops with: bcm2835-v4l2: error 0 waiting for frame completion #1754
Comments
I thought I'd pushed a patch to count the number of pixels in the frame instead of absolute width/height limits, but it appears not. |
Hi 6by9, thanks for the hint. I'll change my /etc/modules to set the max_ parameters and will try if I still get the error. Frank |
Hi 6by9, it appears that the module parameters have changed the resolution nicely, but it seems that it stays in "stills mode". I also see the error popping up once in a while, sucht that is is not yet stable. pi@raspberrypi4:~ $ dmesg |grep bcm2835-v Any idea what I should try next? I am not tied to the resolution, so if using a different one works better, it is fine. Can it be that this error depends on the available light? The room in which the camera was, was pretty dark yesterday night. Now there is light and somehow, just a feeling, it fails again more often. Regards Frank |
No immediate thoughts. motion has a watchdog that kicks in if it fails to receive a buffer for a certain amount of time, and it is the shutdown on that event that normally triggers the issue with an error waiting on frame completion (ie it doesn't get a buffer back when it thought it should). |
Hi 6by9, here the 1st results from running into the problem:
I hope it might help you to figure out what is wrong with my system/setup. Frank |
Using different resolutions does not help. I tried 1280x1020 and saw the same effect. |
Hi, I tried as follows: worked ok so far and I got a video which showed something reasonable. Frank |
Just in case, here my motion.conf, now trying a different resolution, but still does not work:
|
Nothing in those asserts out of the ordinary. You can enable more logging from bcm2835-v4l2 by setting module parameter bcm2835_v4l2_debug to 2. There may be something more useful in there. |
To rule out that the camera might be defective, I plugged it now into a RaspberryPi3 B+ instead of the Raspberry A+ I was using in the failing scenario. That runs now stable using the same configuration for 15min. I will leave that running for some time to see if it stays working before switching back to debug mode 2 on the A+ model. Is there anything which I might have been missing to configure on the A+ model, which cannot be verified by the data I attached so far? E.g. I have the 1wire bus configured with a DS1820 to sense the temperature, some GPIOs for switches and a LCD 2x16 via GPIOs too? At least I thought, that should not make a difference, since it always works for some minutes before it fails. So something should be right at least. But obviously something it wrong too, which makes it time out and stop working. |
Just checking the simple things - you have got a decent power supply I assume (no lightning bolt on the HDMI output) |
HDMI is not connected, the power-supply has 5V 2.4A. I used it for the Raspi3 before. The camera still runs nicely using the Raspi3. I guess I connect it back to the A+ and see what happens with debug=2 as you recommended. |
Check |
pi@raspberrypi4:~ $ vcgencmd get_throttled
16 and 18, if I have the bit-order right. Well. Under-voltage sounds strange regarding the 2.4A power-supply. Maybe my switch GPIOs? Or the LCD? Maybe I should stop my little switch monitoring, temperature displaying script, which operates the GPIOs. |
I assume the camera is using the 3.3V and not the 5V? |
pi@raspberrypi4:~ $ vcgencmd get_throttled Now "under-voltage" and "currently throttled" too. Still, the picture is transmitted. I have turned the python script off, which should normally use GPIOs and the 1-wire port. Let me see how long it survives. The Raspberry3 had no GPIOs connected and no 1-wire port populated. |
I'll agree that it is backward that a Pi3 (which has higher power requirements) works, but an A+ doesn't. Power problems do tend to be a little random in nature though. The USB lead can have as much impact to supply voltage as the PSU itself. It is 3.3V fed up the ribbon to the camera, which then has regulators to 2.8V and 1.8V on board IIRC. Most of the SoC itself will run with a lower supply voltage than specified, but USB devices (including LAN) tend to fail early, and you then have no headroom for momentary supply voltage sags. |
I think I could try to detach my GPIO connections to LCD, switches, 1-wire, just in case I did something wrong or if they are too many (well the switches are input and I would hope that the LCD ones are not serious too, but anyways). I wonder if motion itself produces huge CPU load and therefore power-consumption once it looks at the pictures to detect the "motion"? That you mention USB and the WLAN connected into it makes me wonder, if I like to try operating the WLAN-stick with an externally powered USB hub, before I rip the thing entirely apart. I mean there is just one USB-connect or for the A+ Raspberry. |
Certainly last time I looked at motion (probably >2 years ago) it was quite processor intensive. It was worse when it was trying to software decode JPEG/MJPEG from the camera, analyse it, and the JPEG the result if it saw motion. It now supports YU12 and various other formats, so isn't quite as crazy (but still does software JPEG for encoding). |
Ok, the experiment with the self-powered USB-Hub for the WLAN card, failed. It timed out again.
Here the log:
|
I disconnected all GPIOs and the problem still occurs.
|
Is this just a problem only I have? Or is this camera somehow not really working well with the RaspberryPi A+ model? Or could my RaspberryPi A+ be an unlucky Monday version? |
That log appears to be showing the driver producing frames all the way up to 22:28:51 when stop_streaming is called. That is not indicative of any error on the part of the driver, just that motion isn't wanting more buffers. When you swapped from the A+ to the Pi3, did you use the same uSD card? It sounds like you've got something going wrong in that install of motion, particularly as raspivid is quite happy. Try again from a clean install. |
In the Pi3 I had a different uSD card. It is one based on RetroPi, but I made sure that in both cases I did a `sudo apt-get update && apt-get dist-upgrade -y' to try the latest version available. Let me try to turn motions logging to the highest level and see what that says. Before doing the install thing. |
You might call it brute force, but could still be quicker than trying to diagnose some tiny version difference in the multitude of packages used by motion (and the rest of the system). Fortunately, quickly building a new SD card is very quick for the Pi, so it's a valid approach. |
Take uSD card out of Pi3 and use that in the A+. Does it work? If so then something is wrong on the uSD originally in the A+. Download the latest image from https://www.raspberrypi.org/downloads/raspbian/, install on a uSD card. "sudo apt-get update". "sudo apt-get install motion". Update V4L2 driver params. Drop your motion config file in. Does that work? Sounds like about 30mins work to me. |
I tried to increase the motion loglevel somewhat more and have set it to 9. I find now the following in my /tmp/motion.log:
I tried now to change the access rights to the /var/lib/motion directory to 777:
It ran ok for some minutes now. Could it be that easy? I continue to test it and will reduce all the logging now step by step. |
I was still running when I left the room. |
Based on the kernel logs, that would fit the symptoms. No actual error, the client (motion) just bailed. |
Since it seems working now, let me close this bug or was it user-error ;-)? 6by9, thanks for helping to figure out what was wrong! |
|
I logged in via ssh (as admin/pass set in motioneye) but I cannot apply the command. "ls" command shows no folders. It is like I am logged as admin in the "Pictures" :) folder or something, cannot even "cd" to another folders because there aren't any. |
Update: 20210408this
worked for me!,I had to hit disable and enable "Automatic Brightness" motioneye for it to work. Hardware:
|
Hi,
I tried to use motion with my RaspberryPi model A+ and a NoIR camera module. I can open the webinterface (http://raspberrypi1:8081) and it appears working for a while, but after a few
frames, I find the following output in dmesg:
pi@raspberrypi4:~ $ dmesg |grep vid
[ 3.873291] Linux video capture interface: v2.00
[ 3.986852] bcm2835-v4l2: V4L2 device registered as video0 - stills mode > 1280x720
[ 3.992334] bcm2835-v4l2: Broadcom 2835 MMAL video capture ver 0.0.2 loaded.
....
[ 4028.377732] bcm2835-v4l2: error 0 waiting for frame completion
Now the motion webinterface is not working anymore. I tried to restart motion using:
sudo /etc/init.d/motion restart
That somehow reanimates the camera.
Here my version information as far as I gathered it:
pi@raspberrypi4:~ $ uname -a
Linux raspberrypi4 4.4.36+ #933 Fri Dec 2 21:57:25 GMT 2016 armv6l GNU/Linux
pi@raspberrypi4:~ $ v4l2-ctl -V
Format Video Capture:
Width/Height : 1024/768
Pixel Format : 'YU12'
Field : None
Bytes per Line: 1024
Size Image : 1179648
Colorspace : Broadcast NTSC/PAL (SMPTE170M/ITU601)
Flags :
pi@raspberrypi4:~ $ /opt/vc/bin/vcgencmd version
Dec 3 2016 18:56:05
Copyright (c) 2012 Broadcom
version bc845578aa7adbf453bbda241faadbcde2e670bf (clean) (release)
pi@raspberrypi4:~ $
pi@raspberrypi4:~ $ modinfo bcm2835-v4l2
filename: /lib/modules/4.4.36+/kernel/drivers/media/platform/bcm2835/bcm2835-v4l2.ko
version: 0.0.2
license: GPL
author: Vincent Sanders
description: Broadcom 2835 MMAL video capture
srcversion: A7D6DBEB2D67BE83A6FC776
depends: videobuf2-v4l2,videodev,videobuf2-vmalloc,videobuf2-core,v4l2-common
intree: Y
vermagic: 4.4.36+ mod_unload modversions ARMv6
parm: debug:int
parm: bcm2835_v4l2_debug:Debug level 0-2
parm: video_nr:videoX start numbers, -1 is autodetect (array of int)
parm: max_video_width:Threshold for video mode (int)
parm: max_video_height:Threshold for video mode (int)
parm: gst_v4l2src_is_broken:If non-zero, enable workaround for Gstreamer (int)
Can you recommend anything stabelizing the camera support?
Regards
Frank
The text was updated successfully, but these errors were encountered: