[mythtv-users] LIRC: sending the same IR code multiple times (repeated, but not repeating) results in receiving device seeing only one instance

Tom Metro tmetro+mythtv-users at gmail.com
Mon Apr 23 02:29:11 UTC 2012


Gary Buhrmaster wrote:
> Tom Metro wrote:
>> if I run the command:
>>
>> % irsend SEND_ONCE MotorolaDTA100-PaceDC50X KEY_3 KEY_3 KEY_ENTER
>>
>> instead of the receiving device switching to ch 33, it goes to ch 3.
> 
> This is typical.  Most IR receivers have "de-bounce" protection
> because either the remote or the user is likely to "bounce" a key.

Not to sound ungrateful for the one reply I received on this, but I'm
aware of the debounce feature of the receiver.


>> An interesting observation: when I tried a 3-digit number, there was
>> slight, but noticeable delay between the 1st and 2nd number, then the
>> DTA immediately showed the call sign for the 2-digit station, as if the
>> enter key had been sent, even though it hadn't.
> 
> The DTA has a timeout, which allows you to send one or two
> keys, and wait (or hit enter) to tune.  Since the current channel
> maps only allow 3 digits, once the DTA gets that third, it is
> done, and tunes without the enter.

You seem to have misread what I wrote. What you describe is exactly what
I *expect* to happen (and I explained that in the post). That it doesn't
work that way is what is notable.

The receiver should not tune to the station immediately if it has only
received two digits (which is what the on screen display shows). The
timeout is absent in that circumstance, yet it shouldn't be.

I can only speculate that the receiver is misinterpreting the 3rd digit
as if it was an enter or LIRC is issuing incorrectly formatted codes
that the receiver is interpreting in unexpected ways.


> As you suspect, there needs to be some "idle" time between
> duplicate keys.

Yes, so let me restate the problem in a far simpler way:

When irsend is executed with parameters like:

% irsend SEND_ONCE remote KEY_1 KEY_2 KEY_3

what parameter in lirc.conf specifically controls the pause between the
transmission of KEY_1 and KEY_2?

'gap' seems like the obvious answer, but experimentally it doesn't seem
to do the trick. Some information I've seen suggests that 'gap' might
control the spacing between the initial code and the repeat code when a
code is being sent repeatedly, which is not necessarily the same thing
as the pause between different codes.


> On the wiki there is a sample lirc tuning script which as
> part of the examples has values for delays that seem to
> work for iguanaIR and Pace DTAs (it also have a lot of
> other features that may be overkill).
> http://www.mythtv.org/wiki/LircChannelChanger

Thanks for the pointer. That's the best channel changer script I've seen
so far. It has a bunch of features absent from the other channel changer
scripts I've seen, such as:

 -has support for multi-channel transmitters
 -handling key names that have a prefix, like "KEY_" (which the
definition file I'm using requires)
 -uses a high resolution timer, so you can specify delays less an 1 second
 -uses semaphores (a lock file) so multiple invocations of the script
don't lead to overlapping irsend calls.

Plus written by someone who clearly understands Perl.

All features I have added or planned to add to the other channel
changing script I ran across. So I'll likely just switch to this one
instead.

This channel changer script deserves greater visibility, so I've added
several links to it from other relevant wiki pages.

However, I don't think invoking irsend multiple times with
application-layer delays is the right approach to solving the problem I
describe above. If the lirc.conf is properly designed for the target
receiver, it should embed all the requiring timing characteristics, and
not require the end-user to tune the timings in the code that calls
irsend. Those details belong hidden within LIRC.

 -Tom



More information about the mythtv-users mailing list