MoCord Mode - Alarm Sound always plays? correct behavior?

Support and queries relating to all previous versions of ZoneMinder
pmurdock
Posts: 15
Joined: Wed Jun 08, 2005 5:23 am
Location: Herriman, Utah

MoCord Mode - Alarm Sound always plays? correct behavior?

Post 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
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post 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.
pmurdock
Posts: 15
Joined: Wed Jun 08, 2005 5:23 am
Location: Herriman, Utah

whoops

Post by pmurdock »

User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Okay, Yeah that could be annoying :lol:

I'll look into it 8)
pmurdock
Posts: 15
Joined: Wed Jun 08, 2005 5:23 am
Location: Herriman, Utah

man oh man

Post by pmurdock »

Oh good! :) So it's not just me...

I thought it a bit odd..

cheers!
Paul
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post 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.
pmurdock
Posts: 15
Joined: Wed Jun 08, 2005 5:23 am
Location: Herriman, Utah

interesting!

Post by pmurdock »

I found a bug! :) How exciting.. hehe

great piece of software I must admit though!

cheers,
Paul
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post 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 :)
Phil
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post 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.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post 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.
pmurdock
Posts: 15
Joined: Wed Jun 08, 2005 5:23 am
Location: Herriman, Utah

i can try to recompile

Post 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
pmurdock
Posts: 15
Joined: Wed Jun 08, 2005 5:23 am
Location: Herriman, Utah

recompile

Post 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
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post 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.
pmurdock
Posts: 15
Joined: Wed Jun 08, 2005 5:23 am
Location: Herriman, Utah

bummer

Post 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
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Sure just PM the Details :wink:
Locked