irsend synchronous or asynchronous?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

irsend synchronous or asynchronous?

Gert Kok
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?

Is the irsend daemon maintaining a queue with codes to transmit?

In fact the most important question:

Has the client program some responsibility when sending codes in rapid
succession?


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: irsend synchronous or asynchronous?

Alec Leamas


> 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: irsend synchronous or asynchronous?

Alec Leamas


On 19/06/17 15:49, Adrian Wadey wrote:
> What would you expect the effect to be if lirc tried to decode what it
> was transmitting?
> Adrian


I have no such expectations. Should I?

--alec

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Loading...