LinHES Forums
http://forums.linhes.org/

Button on remote "pressing" twice
http://forums.linhes.org/viewtopic.php?f=17&t=18893
Page 2 of 2

Author:  srahrens [ Tue Nov 18, 2008 3:02 pm ]
Post subject: 

I don't know if you're still working on this, but I have been having a similar problem for a long time and have finally gotten fed up enough to fix it! My problem is that when pressing a given remote button, it sometimes "bounces" - i.e. it will send more than one command code for a single button press. This results in mythtv occasionally skipping through various screens, playing programs, etc. when i don't want it to.

I think your remote might be doing the same thing, only one command code is sent when you press down on the button, and another is sent when you relase it.

The real problem here is that for some reason lirc is not interpretting the 2nd button press as a repeat, but a new event. The repeat and delay settings in the lircrc file only work when the button press is regarded by lirc as a repeat. This is reflected by the fact that your irw output shows '00' in the 2nd column every button press.
Code:
000000000001006c 00 down /etc/lirc/lircd.conf
000000000001006c 00 down /etc/lirc/lircd.conf
000000000001006c 00 down /etc/lirc/lircd.conf
000000000001006c 00 down /etc/lirc/lircd.conf
0000000000010067 00 up /etc/lirc/lircd.conf
0000000000010067 00 up /etc/lirc/lircd.conf
0000000000010067 00 up /etc/lirc/lircd.conf
0000000000010067 00 up /etc/lirc/lircd.conf

If it were regarding subsequent button presses as repeats, that number would be incrementing...
Code:
000000000001006c 00 down /etc/lirc/lircd.conf
000000000001006c 01 down /etc/lirc/lircd.conf
000000000001006c 02 down /etc/lirc/lircd.conf
000000000001006c 03 down /etc/lirc/lircd.conf
0000000000010067 00 up /etc/lirc/lircd.conf
0000000000010067 01 up /etc/lirc/lircd.conf
0000000000010067 02 up /etc/lirc/lircd.conf
0000000000010067 03 up /etc/lirc/lircd.conf

or something like that. FYI this is just my working theory right now, not a known fact.

So if this is the case then I feel like there should be a parameter somewhere in lircd.conf that will fix this. Unfortunately I haven't found it yet, and I've experimneted with gap, repeat, and min_repeat.

Anyone on the forum know lircd.conf files well enough to help?? I've checked out the lirc documentation but it's a little technical for me:
http://winlirc.sourceforge.net/technicaldetails.html

This is something that's gotta be covered in LIRC already, no?
Thanks, --scott

Author:  Girkers [ Fri Nov 21, 2008 6:21 pm ]
Post subject: 

That is exactly what is happening in my case. Whilst I have not had time to work on this any more over the last month or so (much to my Father in Law's dismay) it is still to be addressed. To alleviate our problem have you looked at slowtolearn's post that I have quoted here:

slowtolearn wrote:
Although I don't see that it deals with the Up/Down keys specifically, I wonder if this code is in your version of lirc? (Not running a 5.5 box ATM so I can't check)

Author:  srahrens [ Sun Apr 19, 2009 11:22 pm ]
Post subject: 

FYI I did eventually solve my remote bouncing problem for those interested. The following is an excerpt from my correspondence with the LIRC mailing list.


Quote:
So I'm showing my EE geek tendencies here, but I decided to hook an o-scope up to me receiver and see how the signal levels looked on the receiver. Everything looks fine, but I did see a different problem. It looks like normally the remote sends a long IR string when pressing down on the button, and a short IR string when holding or releasing the button. For some reason, my remote occasionally sends two long IR strings when pressing down on the button, hence the bouncing.

The patch to lircd.c below fixes my problem. Sorry to bastardize your code, as it is almost assuredly the wrong way to do this, but that's probably becuase I have a combined total of about 2 hours of experience with this source. Anyway, this hack works for me becuase my remote should never be broadcasting the exact same string twice in a row as far as I can tell.


debounce.diff
Code:
--- lircd.c.orig        2009-04-19 21:28:42.000000000 -0600
+++ lircd.c     2009-04-19 22:16:52.000000000 -0600
@@ -1743,7 +1743,8 @@

 void broadcast_message(const char *message)
 {
-       int len,i;
+       int len,i,compare;
+        static char prev_message[PACKET_SIZE+1] = "";
        const char *release_message;

        release_message = check_release_event();
@@ -1753,7 +1754,11 @@
        }

        len=strlen(message);
-
+       compare=strcmp(message,prev_message);
+       strcpy(prev_message,message);
+
+        if(compare == 0) return;
+
        for (i=0; i<clin; i++)
        {
                LOGPRINTF(1,"writing to client %d",i);


to apply:
Code:
patch /usr/src/lirc-0.8.4a/daemons/lircd.c < debounce.diff

Author:  christ [ Mon Apr 20, 2009 11:25 am ]
Post subject: 

just seeing this now. Unless there is somethign strange, can't you just adjust the entries in lircrc to increase the value of the "repeat" parameter?

I know that is how I've solved this problem before.

Author:  srahrens [ Mon Apr 20, 2009 3:42 pm ]
Post subject: 

Quote:
just seeing this now. Unless there is somethign strange, can't you just adjust the entries in lircrc to increase the value of the "repeat" parameter?


Unfortunately not. LIRC is not recognizing the remote button bouncing as repeat events, but as entirely new events. So in other words LIRC isn't recognizing that the same button is being hit multiple times, so doesn't use the "repeat = N" setting.

Author:  Greg Frost [ Sun Jul 19, 2009 7:10 am ]
Post subject: 

If anyone is following this thread, you may be interested to know that R6 (upgraded using pacman -Syu) now supports the Dvico Dual Digital 4 rev 2 out of the box including the remote. The double key press problem is not an issue anymore.

I have tested the upgraded packages that make this possible by manually installing them. Im just building a new iso to confirm that the remote is auto detected and the tuners auto populated when installing from a CD.

Edit: Yep. it works great. the only problem is the remote doesnt work in the installer, but after the install completes it works out of the box. The only thing i had to do to after the install completed was scan channels and then set the start channel for both input connections (which I did with the remote). Then stratight into live tv and it works like a charm.

Edit: I forgot that I had posted this. The remote works in the installer now too.

Author:  Girkers [ Sat Aug 22, 2009 9:55 pm ]
Post subject: 

I have found a minor flaw in that the lircrc.dvico-dual-digital4 file used is for the Revision 1 remote. I am trying to track down Rev. 2 version of the file.

The remotes are similar and that is why it works, but not all of the buttons work as I expected them too.

Author:  Greg Frost [ Sun Aug 23, 2009 2:23 am ]
Post subject: 

What is a revision 1 and revision 2 remote?

I thought that the revision was a revision 1/2 referred to the tuner card.

Dual Digital 4 revision 1 looks like this:Image

Dual Digital 4 revision 2 looks like this:Image

The remote that comes with the rev 2 looks like this:Image

Author:  silentmic [ Tue Aug 25, 2009 4:44 am ]
Post subject: 

I've had a problem in the past where I had two entries in the lircrc file for the same button. It meant that when I pressed the button with the duplicate, the action would be performed twice.

Author:  Girkers [ Thu Aug 27, 2009 3:38 am ]
Post subject: 

Greg you have posted a picture of the Rev2 remote but as I stated the lircrc is for Rev.1. as it talks about the "top wheel"

Author:  Greg Frost [ Thu Aug 27, 2009 3:25 pm ]
Post subject: 

I dont know what remote comes with the revision 1 card. Is it this one? Image

Author:  Greg Frost [ Mon Aug 31, 2009 7:36 am ]
Post subject: 

Girkers wrote:
Greg you have posted a picture of the Rev2 remote but as I stated the lircrc is for Rev.1. as it talks about the "top wheel"
It may be for the rev1, but all of the Rev2 buttons function correctly, so I dont see what the problem is. Perhaps the remotes use the same codes.

Author:  denny58stout [ Mon Jan 25, 2010 8:50 am ]
Post subject: 

Fantastic!! I'm Denny Stout ..I'm new here and I Just want to share this quote as my first post here...

"The less you can live on, the more chance your idea will succeed. This is true even after you’ve 'made it.'.

Make it a Great day people...

Page 2 of 2 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/