grimace
Posts: 10
Joined: Sat Jan 18, 2014 7:42 pm

motion kills the camera - needs power cycle

Tue Jan 20, 2015 10:11 pm

I'm using motion with the camera board ( mmal ) and it works great but periodically errors out with a 'Watchdog timeout'. Motion attempts to do a graceful restart but fails. I believe that motion doesn't properly shutdown the camera. Even if I turn off the motion service I can not use 'Raspistill' ( it just hangs ).

I find I have to power cycle the RPi in order for things to be resolved, a reboot doesn't seem to work. Is there a way to reset the camera without a power cycle? like with gpio?

User avatar
DougieLawson
Posts: 35364
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: motion kills the camera - needs power cycle

Tue Jan 20, 2015 10:14 pm

What firmware version are you running? What kernel?

uname -r
vcgencmd version

Tells us that stuff.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

grimace
Posts: 10
Joined: Sat Jan 18, 2014 7:42 pm

Re: motion kills the camera - needs power cycle

Tue Jan 20, 2015 10:22 pm

Thx, the info is
$ uname -r
3.18.3+
$ vcgencmd version
Jan 20 2015 18:07:34
Copyright (c) 2012 Broadcom
version b95d88a52e7948aa6036ee43cff39d28fe1a54bd (clean) (release)

User avatar
DougieLawson
Posts: 35364
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: motion kills the camera - needs power cycle

Tue Jan 20, 2015 10:44 pm

If you revert to your old firmware/kernel does it still happen? Is it a new bug in the brand new 3.18.3+ kernel?
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

grimace
Posts: 10
Joined: Sat Jan 18, 2014 7:42 pm

Re: motion kills the camera - needs power cycle

Wed Jan 21, 2015 1:29 pm

this has been happening for as long as I've been using motion, so I can't say whether a former rev worked. Depending on the the resolution selected, it may work for 2 days or for 4 hours. My goal is to be able to reset the camera without having to power down the device since the device is unattended and a power back up is difficult to accomplish.

User avatar
dozencrows
Posts: 172
Joined: Sat Aug 04, 2012 6:02 pm

Re: motion kills the camera - needs power cycle

Wed Jan 21, 2015 9:59 pm

This started happening to one of my motion installs for my 'cat-cam'.

In my case, it was the Pi itself ageing - the voltage across the two test points was drooping below 4.8v. I switched to a newer Pi with the same camera, power supply and SD card - and it became reliable again.

I would recommend checking the power supply's output voltage, and also check the voltage on the Pi board itself (see http://elinux.org/R-Pi_Troubleshooting# ... r_problems). When this starts getting close to the low value above, you start getting intermittent unreliability, particularly when using the Pi to power peripherals (such as the camera).

I've now seen this twice - once with my original Pi, and also with one I bought second hand.

grimace
Posts: 10
Joined: Sat Jan 18, 2014 7:42 pm

Re: motion kills the camera - needs power cycle

Fri Jan 23, 2015 4:31 pm

I've tried this with more than 1 RPi with the same results. The machine is still up and running but the camera doesn't work. It seems to be locked. Even if I turn off motion at that point, Raspistill does not work. Raspistill just hangs. A reboot will clear the condition and if I don't run motion everything seems to be fine. I have existing camera code that works (seems to work ) without a hitch and can run for days with out having the camera lock up.

I would like to know if there is a way to reset the camera when it gets 'locked' without rebooting the device. Once again, sometimes a reboot doesn't work and I have to hard boot the PI.

User avatar
jbeale
Posts: 3436
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: motion kills the camera - needs power cycle

Sat Jan 24, 2015 1:56 am

FWIW: the camera just locked up on me running motion, after updating yesterday to the latest software. The RPi remains up and working, just the camera is locked. A remote software reboot ('sudo reboot', not a power cycle) solved the problem. I had been running silvanmelchior's RPi Cam Web Interface http://www.raspberrypi.org/forums/viewtopic.php?t=63276 without issue for some months. But I uninstalled and reinstalled the latest raspimjpeg/web interface software at the same time as doing dist-upgrade and rpi-update, so I don't know which one is the issue. The new version of the raspimjpeg software shows the time/date as a text string overlay on the video, the old version I'd run before didn't do that.

Code: Select all

[email protected] ~ $ uptime
 17:47:56 up 17:52,  2 users,  load average: 1.75, 1.82, 1.34

[email protected] ~ $ uname -a
Linux rp4 3.18.3+ #739 PREEMPT Tue Jan 20 17:45:32 GMT 2015 armv6l GNU/Linux

[email protected] ~ $ vcgencmd version
Jan 20 2015 18:07:34
Copyright (c) 2012 Broadcom
version b95d88a52e7948aa6036ee43cff39d28fe1a54bd (clean) (release)

grimace
Posts: 10
Joined: Sat Jan 18, 2014 7:42 pm

Re: motion kills the camera - needs power cycle

Sat Jan 24, 2015 10:00 pm

Do you happen to know the specifics of what you were running before? Or how to downgrade? I keep my PI way up-to-date and I wonder if an older version would work for me...

User avatar
jbeale
Posts: 3436
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: motion kills the camera - needs power cycle

Mon Jan 26, 2015 4:28 am

I don't know what version I had before, might have been from 6 months ago or so. But I haven't seen the problem again in the past two days. Also, I might have created the problem myself, as I had just set up a new script to convert raw .h264 to .mp4 in the background. If that script managed to convert and then delete the original .h264 while it was still open and being written, I think that would lock up the raspimjpeg process.

grimace
Posts: 10
Joined: Sat Jan 18, 2014 7:42 pm

Re: motion kills the camera - needs power cycle

Mon Mar 09, 2015 4:55 pm

I am still looking for a way to reset the camera port when it fails. Anyone know of a way to reset the camera without rebooting the RPi?

grimace
Posts: 10
Joined: Sat Jan 18, 2014 7:42 pm

Re: motion kills the camera - needs power cycle

Thu Apr 02, 2015 5:01 pm

crickets...
Anyone know of procedure to reset the camera when it is locked?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6883
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: motion kills the camera - needs power cycle

Thu Apr 02, 2015 5:07 pm

grimace wrote:crickets...
Anyone know of procedure to reset the camera when it is locked?
If you've totally wedged the GPU firmware, then the only way to restart it is a reboot.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

dickon
Posts: 295
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: motion kills the camera - needs power cycle

Thu Apr 02, 2015 6:59 pm

During the development of omxmotion, I managed to crash the OpenMAX stack hard enough that nothing would touch it. bcm_host_init() locked. I'm still not sure what did it, but it was repeatable. I wasn't trying to repeat it, however...

It's also possible to crash the individual blocks: I've had the MPEG 2 decoder lock up (when developing omxtx), whilst leaving the encoder running, and I've crashed the camera separately from the encoder.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6883
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: motion kills the camera - needs power cycle

Thu Apr 02, 2015 7:18 pm

Yes, it depends what threads you wedge.
- VCHI, and you'll kill all comms to VideoCore
- MMAL, and all MMAL component operations will fail
- ILCS, and all OpenMaxIL operations will fail.
- one component and it may or may not take out the framework above (eg as soon as the framework next calls into it)
- manage to leave a hardware block as "in use", and future uses of that block will fail.

VC is running an RTOS, and it doesn't support killing processes.
There was ongoing work for the next chip with rebooting VC whilst the ARM remained up with all VC services then being restarted, but (a) they canned all that development and laid off those working on it, and (b) that was on quite a different architecture.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Camera board”