Please help! Can't get camera to work with ZM

Support and queries relating to all previous versions of ZoneMinder
harty83
Posts: 11
Joined: Wed Jul 04, 2007 2:46 pm

Post by harty83 »

heythisisnate wrote:hmm ... that's frustrating. Maybe I can still help though. Did you try turning on debug mode (from the web panel)? Set it to debug level 1, restart ZM and check your logs directory for a bunch of files. Paste the output of some of them here

Also, if you modify the kernel shared memory max, you need to restart Ubuntu.
I did restart my computer after editing the kernel shared memory max. I did not change the debug level. So, here are a few of the logs that I noticed were different:

Code: Select all

07/07/07 21:35:07.226077 zmfix[32678].INF-zm_debug.c/304 [New Debug Level = 1, New Debug Log = /tmp/zm_debug.log.32678]
07/07/07 21:35:07.227270 zmfix[32678].DB1-zmfix.cpp/67 [Permissions on /dev/video0 are ok at 20666]

Code: Select all

07/07/07 21:35:11.467152 zmc_dvideo0[32724].INF-zm_debug.c/304 [New Debug Level = 1, New Debug Log = /tmp/zm_debug.log.32724]
07/07/07 21:35:11.467674 zmc_dvideo0[32724].DB1-zm_monitor.cpp/1529 [Got 1 monitors]
07/07/07 21:35:11.599283 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/91 [Old P:4]
07/07/07 21:35:11.599361 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/92 [Old D:24]
07/07/07 21:35:11.599382 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/93 [Old B:10496]
07/07/07 21:35:11.599403 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/94 [Old h:0]
07/07/07 21:35:11.599422 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/95 [Old Cl:0]
07/07/07 21:35:11.599440 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/96 [Old Cn:30720]
07/07/07 21:35:11.624829 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/140 [Old X:0]
07/07/07 21:35:11.624911 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/141 [Old Y:0]
07/07/07 21:35:11.624931 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/142 [Old W:160]
07/07/07 21:35:11.624951 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/143 [Old H:120]
07/07/07 21:35:11.625045 zmc_dvideo0[32724].ERR-zm_local_camera.cpp/155 [Failed to set window attributes: Invalid argument]
07/07/07 21:35:11.625197 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/166 [vmb.frames = 2]
07/07/07 21:35:11.625219 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/167 [vmb.size = 2457616]
07/07/07 21:35:11.625454 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/192 [Old C:0]
07/07/07 21:35:11.625478 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/193 [Old F:0]
07/07/07 21:35:11.625497 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/194 [Old Fl:0]
07/07/07 21:35:11.625515 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/195 [Old T:2]
07/07/07 21:35:11.625535 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/212 [New X:0]
07/07/07 21:35:11.625554 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/213 [New Y:0]
07/07/07 21:35:11.625571 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/214 [New W:160]
07/07/07 21:35:11.625589 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/215 [New H:120]
07/07/07 21:35:11.634292 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/222 [New P:4]
07/07/07 21:35:11.634370 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/223 [New D:24]
07/07/07 21:35:11.634391 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/224 [New B:10496]
07/07/07 21:35:11.634410 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/225 [New h:0]
07/07/07 21:35:11.634429 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/226 [New Cl:0]
07/07/07 21:35:11.634448 zmc_dvideo0[32724].DB1-zm_local_camera.cpp/227 [New Cn:30720]
07/07/07 21:35:11.636471 zmc_dvideo0[32724].DB1-zm_monitor.cpp/253 [monitor purpose=1]
07/07/07 21:35:11.636540 zmc_dvideo0[32724].DB1-zm_monitor.cpp/260 [shm.size=4284988]
07/07/07 21:35:11.652544 zmc_dvideo0[32724].DB1-zm_zone.cpp/49 [Initialised zone 0/All - 1 - 340x280 - Rgb:ff0000, CM:3, MnAT:15, MxAT:0, MnAP:50, MxAP:75000, FB:3x3, MnFP:50, MxFP:50000, MnBS:10, MxBS:0, MnB:0, MxB:0]
07/07/07 21:35:11.660389 zmc_dvideo0[32724].DB1-zm_monitor.cpp/329 [Monitor Test has function 2]
07/07/07 21:35:11.660461 zmc_dvideo0[32724].DB1-zm_monitor.cpp/330 [Monitor Test LBF = '%%s - %y/%m/%d %H:%M:%S', LBX = 0, LBY = 0]
07/07/07 21:35:11.660483 zmc_dvideo0[32724].DB1-zm_monitor.cpp/331 [Monitor Test IBC = 15, WUC = 25, pEC = 10, PEC = 10, EAF = 1, FRI = 1000, RBP = 7, FM = 0]
07/07/07 21:35:11.660855 zmc_dvideo0[32724].DB1-zm_zone.cpp/849 [Got 1 zones for monitor Test]
07/07/07 21:35:11.660947 zmc_dvideo0[32724].DB1-zm_zone.cpp/49 [Initialised zone 2/All - 1 - 340x280 - Rgb:ff0000, CM:3, MnAT:25, MxAT:0, MnAP:2856, MxAP:71400, FB:3x3, MnFP:2856, MxFP:71400, MnBS:1904, MxBS:0, MnB:1, MxB:0]
07/07/07 21:35:11.669083 zmc_dvideo0[32724].DB1-zm_monitor.cpp/1619 [Loaded monitor 2(Test), 1 zones]
07/07/07 21:35:11.669148 zmc_dvideo0[32724].INF-zmc.cpp/183 [Starting Capture]
07/07/07 21:35:11.669323 zmc_dvideo0[32724].ERR-zm_local_camera.cpp/592 [Capture failure for frame 0: Invalid argument]

Code: Select all

07/07/07 21:39:53.063710 zmc_dvideo0[963].INF-zm_debug.c/304 [New Debug Level = 1, New Debug Log = /tmp/zm_debug.log.00963]
07/07/07 21:39:53.064401 zmc_dvideo0[963].DB1-zm_monitor.cpp/1529 [Got 1 monitors]
07/07/07 21:39:53.243939 zmc_dvideo0[963].DB1-zm_local_camera.cpp/91 [Old P:4]
07/07/07 21:39:53.244004 zmc_dvideo0[963].DB1-zm_local_camera.cpp/92 [Old D:24]
07/07/07 21:39:53.244026 zmc_dvideo0[963].DB1-zm_local_camera.cpp/93 [Old B:10496]
07/07/07 21:39:53.244044 zmc_dvideo0[963].DB1-zm_local_camera.cpp/94 [Old h:0]
07/07/07 21:39:53.244062 zmc_dvideo0[963].DB1-zm_local_camera.cpp/95 [Old Cl:0]
07/07/07 21:39:53.244079 zmc_dvideo0[963].DB1-zm_local_camera.cpp/96 [Old Cn:30720]
07/07/07 21:39:53.267931 zmc_dvideo0[963].DB1-zm_local_camera.cpp/140 [Old X:0]
07/07/07 21:39:53.268001 zmc_dvideo0[963].DB1-zm_local_camera.cpp/141 [Old Y:0]
07/07/07 21:39:53.268022 zmc_dvideo0[963].DB1-zm_local_camera.cpp/142 [Old W:160]
07/07/07 21:39:53.268041 zmc_dvideo0[963].DB1-zm_local_camera.cpp/143 [Old H:120]
07/07/07 21:39:53.268130 zmc_dvideo0[963].ERR-zm_local_camera.cpp/155 [Failed to set window attributes: Invalid argument]
07/07/07 21:39:53.268577 zmc_dvideo0[963].DB1-zm_local_camera.cpp/166 [vmb.frames = 2]
07/07/07 21:39:53.268627 zmc_dvideo0[963].DB1-zm_local_camera.cpp/167 [vmb.size = 2457616]
07/07/07 21:39:53.268947 zmc_dvideo0[963].DB1-zm_local_camera.cpp/192 [Old C:0]
07/07/07 21:39:53.268975 zmc_dvideo0[963].DB1-zm_local_camera.cpp/193 [Old F:0]
07/07/07 21:39:53.268993 zmc_dvideo0[963].DB1-zm_local_camera.cpp/194 [Old Fl:0]
07/07/07 21:39:53.269010 zmc_dvideo0[963].DB1-zm_local_camera.cpp/195 [Old T:2]
07/07/07 21:39:53.269031 zmc_dvideo0[963].DB1-zm_local_camera.cpp/212 [New X:0]
07/07/07 21:39:53.269049 zmc_dvideo0[963].DB1-zm_local_camera.cpp/213 [New Y:0]
07/07/07 21:39:53.269068 zmc_dvideo0[963].DB1-zm_local_camera.cpp/214 [New W:160]
07/07/07 21:39:53.269086 zmc_dvideo0[963].DB1-zm_local_camera.cpp/215 [New H:120]
07/07/07 21:39:53.277906 zmc_dvideo0[963].DB1-zm_local_camera.cpp/222 [New P:4]
07/07/07 21:39:53.277974 zmc_dvideo0[963].DB1-zm_local_camera.cpp/223 [New D:24]
07/07/07 21:39:53.277994 zmc_dvideo0[963].DB1-zm_local_camera.cpp/224 [New B:10496]
07/07/07 21:39:53.278013 zmc_dvideo0[963].DB1-zm_local_camera.cpp/225 [New h:0]
07/07/07 21:39:53.278032 zmc_dvideo0[963].DB1-zm_local_camera.cpp/226 [New Cl:0]
07/07/07 21:39:53.278050 zmc_dvideo0[963].DB1-zm_local_camera.cpp/227 [New Cn:30720]
07/07/07 21:39:53.286378 zmc_dvideo0[963].DB1-zm_monitor.cpp/253 [monitor purpose=1]
07/07/07 21:39:53.286481 zmc_dvideo0[963].DB1-zm_monitor.cpp/260 [shm.size=32257148]
07/07/07 21:39:53.286536 zmc_dvideo0[963].ERR-zm_monitor.cpp/264 [Can't shmget, probably not enough shared memory space free: Invalid argument]

I noticed a couple errors in there that could be the problem. But not for sure what to do about it. Thanks!
heythisisnate
Posts: 9
Joined: Fri Jul 06, 2007 9:48 pm
Location: Atlanta, GA, United States

Post by heythisisnate »

I still think that you are having a shared memory problem. These lines from your log indicate that:
07/07/07 21:39:53.286481 zmc_dvideo0[963].DB1-zm_monitor.cpp/260 [shm.size=32257148]
07/07/07 21:39:53.286536 zmc_dvideo0[963].ERR-zm_monitor.cpp/264 [Can't shmget, probably not enough shared memory space free: Invalid argument]
It looks like your shared memory max is still a little low. What is your capture resolution setting? This has a huge impact on memory usage. Try capturing a smaller video (i.e. 320 x 240) first, and then see if you can go up from there. Also, I know I've said this already, lower the #of buffer frames.

Restart VM after every change. I think you'll get it.
harty83
Posts: 11
Joined: Wed Jul 04, 2007 2:46 pm

Post by harty83 »

Awesome! Got it to work. Guess I didn't go low enough.

I increased the kernel shared memory max:

Code: Select all

alan@desktop:~$ sudo sysctl kernel | grep shmmax
kernel.shmmax = 67108864
I wonder why that didn't work. Is that number in bytes?
Locked