Alex,†Thanks for the info.† Iíve got a second SDCard with a dev environment and I have enabled debugging in lircd, but perhaps not enough yet.† This enabled me to realise at least one mistake on my part.† I originally thought I was seeing this...†KEY-1, gap,KEY-2,gap,..., KEY-X,gap, KEY-X-Duplicate,gap, KEY-Y†(the ďgapsĒ are added by me because the Samsung TV Iím blasting at takes time to action any command).†..with the duplicate being the bug.† In fact I was seeing†KEY-1,KEY-1,gap,KEY-2,KEY-2,gap,...,KEY-X,random gap, KEY-X,gap,KEY-Y,gap,KEY_Y...†It seems that the TV normally expects a pair of keys (and thatís what the remote sends) but the random and unexpected gap between the KEY-Xs causes the TV to interpret these as two key presses instead of one.†But stopping the repeat has introduced a new problem which Iíve got to look at namely I now see keys periodically miss-sent so in a 12 key macro, #9 _always_ fails Ė bizarre but reproducibly true yesterday.†So more debugging to do.† In the meantime Iíve come across this...†
Looks quite interesting in that it uses a PIC to offload the transmission.† using this with the Raspberry-Pi, a suitable prototype board and a new LIRC daemon (which could run in user space of course since itís not doing direct hardware IO, just writing to the serial port) might offer a far more reliable solution.
Paul DS.††††On Sun, Jan 19, 2014 at 5:16 PM, Paul Smith <firstname.lastname@example.org> wrote:
I believe I debugged a problem which I've narrowed down to an IRsend timing issue.† I wonder if someone with more knowledge of Linux internals can consider my conclusions and comment on whether I'm correct or not?
I'm using "irsend" to send commands to a Samsung TV.† Both a real and "fake" Samsung remotes send the same key twice in rapid succession and it seems that the TV allows a period of time during which a second occurence of the same code is ignored.† I understand this is done for reliability reasons as if one of the pair is corrupted, the other probably arrives OK.
Unfortunately sometimes this fails, for example, if try to send (pairs of) the keys "1", "2", "3", the TV might react as if I've sent "1", "2, "2", "3".† When this "duplicate" detection occurs is very random and, for example, when sending a "macro" of 11 keys, any one of them might be detected as a duplicate but it could be any of the 11 with no reproducibility.
What I believe is happening is that LIRC (probably the lircd daemon) sends the first of a pair of codes but then the time period until the second of the pair (remember each code is sent twice) is occasionally longer than expected.† The Samsung TV has given up ignoring duplicates and treats the second of the pair as a NEW code.
I've seen similar to this on DOS/Windows where timers get delayed because of interupts etc and I suspect something similar is happening here.† Do you, the reader, agree?
If so, is there a way to send the pair of keys with a more reliable interval between them so that this doesn't happen?† For now I've had to stop the "send twice" and this seems to work but obviously it would be better, and presumably more reliable, if I could follow the example of teh Samsung remote and send a pair of each code.
Paul D Smith†--alec[Well, I'm certainly not the person knowing LInux internals. That said, the general answer to your question is "Yes, you can do anything. It's just to patch the sources". Admittedly, this isn't that helpful for us mere mortals. But still.Perhaps some help,
Have you tried the debugging options? They might give some more info (?)† Depending on your platform you might need to rebuild the sources. For Fedora, there are scratch packages with debug enabled at