Page 1 of 2

MoCord Mode - Alarm Sound always plays? correct behavior?

Posted: Wed Feb 07, 2007 10:20 pm
by pmurdock
I have set my zoneminder 1.22.3 box up and when I set it up in MoCord mode it always plays the .wav file that I have put in the options dialog box.

Ideally it would only play the sound file when actual motion is being recorded.

Is this normal behavior for the sound file to continuously play in mocord mode even when no motion alarm has been triggered?

If anyone is curious you can check it out at

http://166.70.204.130:82/zm

username "guest"
password "guest"

to see what I mean..


cheers,
Paul

Posted: Wed Feb 07, 2007 10:34 pm
by cordel
It should only sound while in alert or alarm mode.
I tried to access your link, but get no responce from the server.

whoops

Posted: Wed Feb 07, 2007 11:20 pm
by pmurdock

Posted: Wed Feb 07, 2007 11:52 pm
by cordel
Okay, Yeah that could be annoying :lol:

I'll look into it 8)

man oh man

Posted: Thu Feb 08, 2007 12:48 am
by pmurdock
Oh good! :) So it's not just me...

I thought it a bit odd..

cheers!
Paul

Posted: Thu Feb 08, 2007 1:01 am
by cordel
After reviewing the php code, I found no issues there. I also was able to duplicate the issue here localy. It must be some where in the c code but nothing there stood out.
I'll have to refer this issue to Phil.

interesting!

Posted: Thu Feb 08, 2007 1:26 am
by pmurdock
I found a bug! :) How exciting.. hehe

great piece of software I must admit though!

cheers,
Paul

Posted: Thu Feb 08, 2007 11:44 am
by zoneminder
Yes, this does look wrong.

You could try editing zm_html_view_watchstatus.php and finding the lines

Code: Select all

$new_alarm = ( $status > STATE_PREALARM && $last_status <= STATE_PREALARM );
$old_alarm = ( $status <= STATE_PREALARM && $last_status > STATE_PREALARM );
and change them to

Code: Select all

$new_alarm = ( $status > STATE_PREALARM && $status <= STATE_ALERT && $last_status <= STATE_PREALARM );
$old_alarm = ( $status <= STATE_PREALARM && $last_status > STATE_PREALARM && $last_status <= STATE_ALERT );
I _think_ that might fix it, but I haven't tested it myself :)

Posted: Thu Feb 08, 2007 12:03 pm
by cordel
Okay I applied the code here and that gets rid of the sound in mocord but if I force an alarm there is still no sound. If I cancel the alarm there is also no sound. So this has just the opposite effect of no sound in mocord mode.

All other modes seem to preform as intended though.

Posted: Thu Feb 08, 2007 12:52 pm
by cordel
I'm going to ask hopefully before I decide to make the change and rebuild but could this be the issue???

zm_monitor.cpp line 1155 zm-1.22.3

Code: Select all

						else if ( state != PREALARM )
						{
							Info(( "%s: %03d - Gone into prealarm state", name, image_count ));
							shared_data->state = state = PREALARM;
						}
should the first line not be

Code: Select all

else if ( state == PREALARM )
I don't have anything left for a test bed so it depends on when my couriosity gets the best of me :roll: as to when I give it a shot.

i can try to recompile

Posted: Thu Feb 08, 2007 2:02 pm
by pmurdock
I found that line you refer to.. I'll try to recompile and give it a shot.. and get back to you..

cheers!
Paul

recompile

Posted: Thu Feb 08, 2007 2:11 pm
by pmurdock
Curiously,

I'm not very well versed with recompiling.. if I want to recompile without overwriting all the configuration files i've made do I just simply go through the

./configure
make

and leave out the make install and just copy one of the binaries on top of the existing binaries? zm_monitor goes into what? zmc? or can I run make install without worry?

cheers,
Paul

Posted: Thu Feb 08, 2007 2:21 pm
by cordel
The only file you should have to be concerned about is zm.conf thats in /etc or /user/local/etc depending on how you configured ZM. Just make a copy named zm.conf.bak so you don't lose your database settings. Check the config.log in the source folder so that you make sure you use the same configure line ( It's allmost the top of the file and will be overwitten when you rebuild). Then you can do your make clean, ./configure.... , make, make install.

but your method should work as well, just make a backup of the source file.

bummer

Posted: Thu Feb 08, 2007 2:27 pm
by pmurdock
Well I changed the line to == and it did get rid of the "Force Alarm" option on the page, but did not solve the sound playing over and over again.. would ssh access help on this machine?

it's only being used for this purpose - so if it gets guzzied up no worries.. :)

cheers,
Paul

Posted: Thu Feb 08, 2007 2:34 pm
by cordel
Sure just PM the Details :wink: