Im trying to get Signal Loss detection working, and it seems to be doing so pretty well because in my syslog I get
zma_m7[28696]: WAR [Signal: Lost]
and
zma_m7[28696]: WAR [Signal: Reacquired]
messages fine, but, only occasionally do these show up as an event in the console.
What could be stopping them getting turned into events as a rule (rather than an exception?)
Thanks.
Signal Lost & Reacquired warnings not showing up as even
-
- Posts: 8
- Joined: Thu Aug 28, 2008 10:27 am
-
- Posts: 8
- Joined: Thu Aug 28, 2008 10:27 am
-
- Posts: 8
- Joined: Thu Aug 28, 2008 10:27 am
Ok here is my patch.
Most of the changes are actually to add the functionality that instead of comparing one pixel with the pre-defined colour in the config page of each monitor, it compares two randomly selected pixels (and if ZM_SIGNAL_CHECK_POINTS of them are the same, a signal change is registered)
Working like a charm.
Most of the changes are actually to add the functionality that instead of comparing one pixel with the pre-defined colour in the config page of each monitor, it compares two randomly selected pixels (and if ZM_SIGNAL_CHECK_POINTS of them are the same, a signal change is registered)
Working like a charm.
Code: Select all
--- ../../ZM-1.23.3/src/zm_monitor.cpp 2008-03-14 00:36:12.000000000 +1100
+++ zm_monitor.cpp 2008-10-26 23:22:49.201039574 +1100
@@ -879,9 +879,14 @@
for ( int i = 0; i < config.signal_check_points; i++ )
{
- int index = (rand()*pixels)/RAND_MAX;
+ /* int index = (rand()*pixels)/RAND_MAX; */
+ float foo = ((float) rand()) / ((float) RAND_MAX);
+ float foo1 = ((float) rand())/ ((float) RAND_MAX);
+ int index = pixels/3 + (int)((float) pixels * foo / 3.0f);
+ int index1= pixels/3 + (int)((float) pixels * foo1 / 3.0f);
const unsigned char *ptr = buffer+(index*colours);
- if ( (RED(ptr) != red_val) || (GREEN(ptr) != green_val) || (BLUE(ptr) != blue_val) )
+ const unsigned char *ptr1 = buffer+(index1*colours);
+ if ( (RED(ptr) != RED(ptr1) ) || (GREEN(ptr) != GREEN(ptr1) ) || (BLUE(ptr) != BLUE(ptr1) ) )
{
return( true );
}
@@ -1041,6 +1046,7 @@
else
signal_text = "Signal: Reacquired";
Warning(( signal_text ));
+ alarm_frame_count = 1;
if ( event )
{
closeEvent();
-
- Posts: 8
- Joined: Thu Aug 28, 2008 10:27 am