Page 1 of 1

only 1 camera work at time on raspbian buster

Posted: Mon Sep 23, 2019 12:10 am
by cesp
Hi, i need help with this:

only 1 camera work at time on raspbian buster installed on raspberry pi 4/4Gb (ZM v1.33.14)

the following errors are shown in the log:

2019-09-22 17:49:17 zmwatch 2162 ERR Memory map file '/dev/shm/zm.mmap.1' should have been 1160 but was instead 0 zmwatch.pl
2019-09-22 17:49:13 zmdc 2070 ERR 'zma -m 1' exited abnormally, exit status 255 zmdc.pl
2019-09-22 17:49:13 zma_m1 2388 ERR Got empty memory map file size 0, is the zmc process for this monitor running?

and there is enough memory to run it:

root@ZMRPI4:/home/pi# df -h /dev/shm
Filesystem Size Used Avail Use% Mounted on
tmpfs 2.0G 132M 1.8G 7% /dev/shm
root@ZMRPI4:/home/pi#
root@ZMRPI4:/home/pi# ls -lrt /dev/shm
total 270016
-rw------- 1 www-data www-data 138245744 Sep 22 17:46 zm.mmap.2
-rw------- 1 www-data www-data 138245744 Sep 22 17:48 zm.mmap.1
root@ZMRPI4:/home/pi#

what can i do??

Re: only 1 camera work at time on raspbian buster

Posted: Mon Sep 23, 2019 4:57 pm
by snake
Try lowering the FPS at the camera, the resolution, and / or use record instead of Mocord or Modect so that no analysis is done. You can also disable all logging on ZM (Options - Logging), and anything else that might use up CPU. Reference: https://wiki.zoneminder.com/Single_Board_Computers

You will also want to consider which mode you are using on the camera, whether it is encode, passthrough, or JPEG saving. Passthrough or JPEG saving (not both, because this is ARM) is a good start. Reference: https://zoneminder.readthedocs.io/en/1. ... torage-tab

Re: only 1 camera work at time on raspbian buster

Posted: Mon Sep 23, 2019 4:59 pm
by mikb
Am I being thick here, or is there a discrepancy between these reports :-

Code: Select all

tmpfs 2.0G *132M* 1.8G 7% /dev/shm

Code: Select all

total *270016*
-rw------- 1 www-data www-data 138245744 Sep 22 17:46 zm.mmap.2
-rw------- 1 www-data www-data 138245744 Sep 22 17:48 zm.mmap.1
It seems like the df "usage" indicates one the the zm maps isn't there after all ... (132M vs 270M)

Re: only 1 camera work at time on raspbian buster

Posted: Mon Sep 23, 2019 5:08 pm
by snake
mikb wrote: Mon Sep 23, 2019 4:59 pm It seems like the df "usage" indicates one the the zm maps isn't there after all ... (132M vs 270M)
I'm going to guess ZM is trying to initialize the mmap, and then is unable to keep up with the camera feed, at which point it balks, and the mmap is constantly being re-made. He might've just caught the df output when it was inbetween. I will admit I'm not familiar with the code for this aspect so I could be off base, but when I've gotten this error on RPI before, it was due to too high of a resolution or FPS. The CPU can't keep up.

What are the cameras resolution and FPS? What make/model of camera?

Re: only 1 camera work at time on raspbian buster

Posted: Wed Sep 25, 2019 4:47 pm
by cesp
2 Hosafe cameras, 1280x720 /24 bits color / 10 fps configured on the cameras
those 2 cameras work good in a previous ZM version (1.29) running on a RPi 3b, so why not in pi4/raspbian buster
i already made a complete OS and ZM reinstall (4 times ) following different guides but i get same issue: just 1 camera at time can work on ZM 1.33/RPi4

Re: only 1 camera work at time on raspbian buster

Posted: Fri Sep 27, 2019 12:02 am
by bbunge
Try Ubuntu, 18.04, armhf or arm64. Then use the iconnor ppa. I have had two cams running on a pi 3b÷
I have had no success with Debian and Zm on a pi.

Re: only 1 camera work at time on raspbian buster

Posted: Sat Sep 28, 2019 12:44 pm
by bodgit
I also have been trying for a few days to get 1.33 working on a raspberry pi 4/4, with raspian lite,problems, only one camera working etc.

Switched to Ubuntu 18.04 from here https://jamesachambers.com/raspberry-pi ... ion-guide/ and using this guide https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way just changing the repository to master to get 1.33.

I now have a setup that has been running perfectly for the past week with 4 cameras,2 x Wyze v2 and 2 x Trendnet TV-IP751WIC one of which is located at a remote site.

I did find it a bit slugish at first but when i changed to running on a usb sd drive the difference was dramatic. Considering at the moment whether to add another 2 Wvze cameras.

Would rather be running on raspian so hopefully in the future......

Re: only 1 camera work at time on raspbian buster

Posted: Sat Sep 28, 2019 10:12 pm
by iconnor
1 camera at a time means you are running out of space in /dev/shm. Reconfigure it to use more ram, or edit the monitor and reduce the # of image buffers.

Re: only 1 camera work at time on raspbian buster

Posted: Sat Sep 28, 2019 10:14 pm
by iconnor
One other thing to note is that sometimes you can get into a situation where zm.mmap files have been deleted, but are still held open by one of the daemon scripts. So you actually be using more of /dev/shm that ls will show.

Re: only 1 camera work at time on raspbian buster

Posted: Mon Sep 30, 2019 4:19 pm
by bodgit
Thanks for that iconner, although to be honest due to time constraints and how well ubuntu 18.04/zoneminder 1.33.14 is running on the Pie4 I will probable stay on this setup.

The system is regularly backing events up to dropbox with a nightly backup of the DB.

I have also added a 5th camera, raspberry 2 with a USB camera connected, running motioneye os with the camera as a fast network camera. All this running through ZM on a Pie 4/4.

So a big thank you to yourself and every one involved with ZM, not to forget James A Chambers for the Ubuntu image.

Re: only 1 camera work at time on raspbian buster

Posted: Sat Oct 19, 2019 7:37 pm
by Sumfx
I am new to this board so I hope this is appropriate. I just set up my rasp pi 4 running buster and have 5 cameras all working. 3 old IP cameras and 2 newer IP onvif running on ZM 1.33. I am not having any issues now however I moved over for RP 3 running 1.30.4 and had a few problems with initial setup. Buster will run ZM 1.33.

Re: only 1 camera work at time on raspbian buster

Posted: Wed Jan 08, 2020 1:19 pm
by piflipper
Hi,

I had the same issue, to solve it I upped the GPU memory to 512MB, via raspi-config and everything started working. Now have 3 cameras working without any issues.

Re: only 1 camera work at time on raspbian buster

Posted: Thu Dec 16, 2021 10:20 pm
by landrower
You are right.
As I understand it, ffmpeg uses the memory reserved for the GPU to do the hardware processing of the cameras.
In my setup, I have an rpi4/2GB, raspbian 10, zm 1.34.10, 6 cameras with 360x640 resolution at 15fps, and only 5 were online, even with /dev/shm with only 12% busy.
If I used the source type as a remote for the 6th camera, it was online.
I consulted the video memory with the command "vcgencmd get_mem gpu" and it returned 128mb.
Through raspi-config utility, I increased gpu memory to 256Mb.
raspi-config -> Advanced options -> Memory Split -> 256
Now I managed to put the 6 cameras online in record mode and the system is very fluid.

I will now try the same solution with zm 1.36.11 on debian 11.

Thank you so much Mr Iconnor for presenting us with this wonderful software.