Package: lirc
Version: 0.8.0-2
Severity: normal
Tags: patch, upstream, fixed-upstream

With lirc 0.8.0 packaged [yay :-)], I would like to point out a bug
reported[1] and fixed upstream quite some time ago.

I am using a Creative RM-900 (usually bundled with SB Live! cards and
a custom, technically inferior receiver) with a home-brew serial
receiver.
This remote features a major quirk, sending *two* full signals at the
start of a button press, regardless of wether the button is
immediately released or continuously held down afterwards. In repeat
mode, however, the remote sends short repeat signals, which totally
confuses the lirc daemon.

In order to circumvent this behaviour with a "delay=1" option in
.lircrc, a new lircd option "min_code_repeat" was created, specifying
the number of superfluous signals to ignore, and otherwise allowing
proper interpretation of repeat signals.

It would be great if this fix (taken from CVS commit at 2006-01-22)
were applied soon, rather than waiting for a new upstream version,
which seem to appear quite infrequently. This bug might not be
important for people not using above combination, but it certainly
makes lirc unusable for me.

Regards,
Peter

[1] http://sf.net/tracker/?func=detail&atid=105444&aid=1384415&group_id=5444


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (400, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-maia
Locale: LANG=C, [EMAIL PROTECTED] (charmap=ISO-8859-15)

Versions of packages lirc depends on:
ii  debconf [debconf-2.0]     1.5.1          Debian configuration management sy
ii  dialog                    1.0-20060221-1 Displays user-friendly dialog boxe
ii  libasound2                1.0.11-3       ALSA library
ii  libc6                     2.3.6-7        GNU C Library: Shared libraries
hi  liblircclient0            0.8.0-2        LIRC client library
ii  libusb-0.1-4              2:0.1.12-2     userspace USB programming library

lirc recommends no packages.

-- debconf information excluded
Index: daemons/config_file.c
===================================================================
RCS file: /cvsroot/lirc/lirc/daemons/config_file.c,v
retrieving revision 5.20
retrieving revision 5.21
diff -u -p -d -r5.20 -r5.21
--- daemons/config_file.c	18 Jun 2005 20:39:45 -0000	5.20
+++ daemons/config_file.c	22 Jan 2006 12:58:50 -0000	5.21
@@ -1,4 +1,4 @@
-/*      $Id: config_file.c,v 5.20 2005/06/18 20:39:45 lirc Exp $      */
+/*      $Id: config_file.c,v 5.21 2006/01/22 12:58:50 lirc Exp $      */
 
 /****************************************************************************
  ** config_file.c ***********************************************************
@@ -422,6 +422,10 @@ int defineRemote(char * key, char * val,
 		rem->min_repeat=s_strtoi(val);
 		return(1);
 	}
+	else if (strcasecmp("min_code_repeat",key)==0){
+		rem->min_code_repeat=s_strtoi(val);
+		return(1);
+	}
 	else if (strcasecmp("frequency",key)==0){
 		rem->freq=s_strtoui(val);
 		return(1);
@@ -910,6 +914,16 @@ struct ir_remote * read_config(FILE *f)
 				rem->bits_in_byte=8;
 			}
 		}
+		if(rem->min_code_repeat>0)
+		{
+			if(!has_repeat(rem) ||
+			   rem->min_code_repeat>rem->min_repeat)
+			{
+				logprintf(LOG_WARNING,
+					  "invalid min_code_repeat value");
+				rem->min_code_repeat = 0;
+			}
+		}
 		rem=rem->next;
 	}
 
Index: daemons/dump_config.c
===================================================================
RCS file: /cvsroot/lirc/lirc/daemons/dump_config.c,v
retrieving revision 5.16
retrieving revision 5.17
diff -u -p -d -r5.16 -r5.17
--- daemons/dump_config.c	7 Feb 2005 15:44:08 -0000	5.16
+++ daemons/dump_config.c	22 Jan 2006 12:58:50 -0000	5.17
@@ -1,4 +1,4 @@
-/*      $Id: dump_config.c,v 5.16 2005/02/07 15:44:08 lirc Exp $      */
+/*      $Id: dump_config.c,v 5.17 2006/01/22 12:58:50 lirc Exp $      */
 
 /****************************************************************************
  ** dump_config.c ***********************************************************
@@ -170,6 +170,11 @@ void fprint_remote_head(FILE *f, struct 
 		{
 			fprintf(f, "  min_repeat      %d\n",rem->min_repeat);
 		}
+		if(rem->min_code_repeat>0)
+		{
+			fprintf(f, "  min_code_repeat %d\n",
+				rem->min_code_repeat);
+		}
 		fprintf(f, "  toggle_bit      %d\n\n",rem->toggle_bit);
 		if(has_toggle_mask(rem))
 		{
Index: daemons/ir_remote_types.h
===================================================================
RCS file: /cvsroot/lirc/lirc/daemons/ir_remote_types.h,v
retrieving revision 5.4
retrieving revision 5.5
diff -u -p -d -r5.4 -r5.5
--- daemons/ir_remote_types.h	18 Jun 2005 20:39:45 -0000	5.4
+++ daemons/ir_remote_types.h	22 Jan 2006 12:58:50 -0000	5.5
@@ -1,4 +1,4 @@
-/*      $Id: ir_remote_types.h,v 5.4 2005/06/18 20:39:45 lirc Exp $      */
+/*      $Id: ir_remote_types.h,v 5.5 2006/01/22 12:58:50 lirc Exp $      */
 
 /****************************************************************************
  ** ir_remote_types.h *******************************************************
@@ -138,6 +138,12 @@ struct ir_remote 
 	int toggle_bit;             /* 1..bits */
 	int min_repeat;             /* code is repeated at least x times
 				       code sent once -> min_repeat=0 */
+	unsigned int min_code_repeat;/*meaningful only if remote sends
+				       a repeat code: in this case
+				       this value indicates how often
+				       the real code is repeated
+				       before the repeat code is being
+				       sent */
 	unsigned int freq;          /* modulation frequency */
 	unsigned int duty_cycle;    /* 0<duty cycle<=100 */
 	ir_code toggle_mask;        /* Sharp (?) error detection scheme */
Index: daemons/receive.c
===================================================================
RCS file: /cvsroot/lirc/lirc/daemons/receive.c,v
retrieving revision 5.29
retrieving revision 5.30
diff -u -p -d -r5.29 -r5.30
--- daemons/receive.c	20 Oct 2005 18:43:36 -0000	5.29
+++ daemons/receive.c	22 Jan 2006 12:58:50 -0000	5.30
@@ -1,4 +1,4 @@
-/*      $Id: receive.c,v 5.29 2005/10/20 18:43:36 lirc Exp $      */
+/*      $Id: receive.c,v 5.30 2006/01/22 12:58:50 lirc Exp $      */
 
 /****************************************************************************
  ** receive.c ***************************************************************
@@ -1258,7 +1258,7 @@ int receive_decode(struct ir_remote *rem
 		} /* end of mode specific code */
 	}
 	*prep=pre;*codep=code;*postp=post;
-	if(!has_repeat(remote) &&
+	if((!has_repeat(remote) || remote->reps<remote->min_code_repeat) &&
 	   expect_at_most(remote, sync, remote->remaining_gap))
 		*repeat_flagp=1;
 	else

Reply via email to