Re: irsend synchronous or asynchronous?
Alec Leamas <[email protected]>
| Newsgroups | gmane.comp.hardware.lirc |
|---|---|
| Message-ID | <[email protected]> |
> Lircd is running on a Raspberry Pi with 10 pushbuttons.
>
> When the user presses a button, channelnumbers consisting of one or more
> digits are sent to the TV. When shortly after this event (less than a
> second) a new call is executed, (maybe because of bouncing buttons maybe
> because of unhappy user) the TV ends up with channel numbers that can be
> a combination of channelnumbers, or digits may be lost.
>
>
> When I see the TV getting channel numbers mixed up, is this happening in
> the TV and can I rule out lircd as the culprit?
>
> This is the code that is used:
>
> import subprocess
>
> def irsend(self,key_list):
> arg_list = ["irsend", "SEND_ONCE", remote] + key_list
> rtn = subprocess.call(arg_list)
> if rtn:
> print(' '.join(key_list), ' returned errorcode: ', rtn)
>
>
>
>
> Will control to the main python program return only after all key-codes
> are sent completely?
> There is no risc to start a new send while the previous is not finished
> yet?
I wouldn't say "no risc"... That said, there is code generating a delay
so that the calling code shouldn't return until the sending is completed.
You could have a look at lib/ir_remote.c, the function send_ir_ncode(),
called from send_once() in daemons/lircd.cpp. This should complete
before sending a reply to the irsend client.
> Is the irsend daemon maintaining a queue with codes to transmit?
No, it's basically fire-and-forget. BTW, there is no specific irsend
daemon, it's the same lircd which is handling input decoding.
> In fact the most important question:
>
> Has the client program some responsibility when sending codes in rapid
> succession?
To be honest, this has not been defined to my limited knowledge. One
thing to do is certainly to test with some delays between each irsend
invocation to see possible results.
Cheers!
--alec
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot