Code: Select all
Jul 10 11:15:06 server zmc_m12[25882]: WAR [Buffer overrun at index 148, image 42398, slow down capture, speed up analysis or increase ring buffer size]
Jul 10 11:15:09 server zmc_m13[6891]: WAR [Buffer overrun at index 159, image 134407, slow down capture, speed up analysis or increase ring buffer size]
Since I don't want to slow down the capture it finally dawned on me that maybe I can go past 200 for the "Image Buffer Size (frames)" just don't use more then 200 for Pre and Post. Sure enough it worked, was able to set "Image Buffer Size (frames)" to 250 on m12 so we'll see if this "buffer overrun" stops.
But wasn't able to set m13 to 250, it was at 190, knew I couldn't go to 200, ran into that when I installed the camera so left it at 190. And it's not a shmmax/shmall issue, I'm a UNIX System Admin by day. Turns out 194 was the max, at 195 or more shmget breaks.
That magic number, 194, puts the shared memory needed for the camera at just under 2GB, 195 and you're over 2GB. Interesting... This shouldn't happen on a 64bit system. So checked the binaries to be sure they were compiled 64bit. Yep. So I dug around for maybe another system parameter that needed to be bumped up. Nope.
That left the application, ZoneMinder, so went digging through the code. Sure enough, in zm_monitor.cpp mem_size, the variable used to calculate the the shared memory needed is a signed int. That limits it to a max value of 2147483647. Sure enough 1920*1920*3*195=2156544000 so already too big before other overhead is added. Bottom line, mem_size needs to be a long.
Changed "int mem_size;" to "long mem_size;" in two spots in zm_monitor.h, recompiled, and all is well.
Hopefully this will make it into the next release.