Menu

#161 LIRCD+UINPUT = NO INPUT, in my case

0.9.4
closed
nobody
None
fixed
2016-04-28
2015-11-23
Nicolas
No

i'm using lircd on a raspberry via buildroot.

LIRC_TOOLS_VERSION = 0.9.2
https://github.com/digitalLumberjack/recalbox-buildroot/tree/unified/package/lirc-tools

It's not the last lirc version.
But perhaps you can help me.
Perhaps the problem occurs with the last version.

When running :
1) mode2 and pressing buttons, i get signal
2) lircd and irw and pressing buttons : i get buttons pressed
3) lircd --uinput and irw, or evtest and pressing buttons : nothing

I've debugged, and find a cause in lircd.c :

  • related to the macro use_hw()
  • related to a new client connection
  • related to the select() function

until a first client is connected, current_driver->initialize is not called.
the select() function is waiting only on new client connection => normal.

At the first connection,
in case of no-uinput :
if(!use_hw) // returns true, and the driver is initiliazed
the select function waits on new client connection, and the driver (/dev/lirc0 in my case)

in case of uinput :
if(!use_hw) // returns false, and the driver is NOT initiliazed
the select() function doesn't wait on the driver (/dev/lirc0) file.

By changing the use_hw function, i get irw displaying events. But i don't exactly know which fix is supposed to be the best.

And by testing tonight, i see that irw now returns events, but
evtest on /dev/input/event4 on the lircd device doesn't display nothing.

My current modifications :

diff --git a/daemons/lircd.c b/daemons/lircd.c
index 3a7f744..a5ff658 100644
--- a/daemons/lircd.c
+++ b/daemons/lircd.c
@@ -318,7 +318,7 @@ static lirc_t setup_max_pulse = 0, setup_max_space = 0;
/ Use already opened hardware? /
int use_hw()
{

  • return (clin > 0 || (useuinput && uinputfd != -1) || repeat_remote != NULL);
  • return (clin > 0 || repeat_remote != NULL);
    }

/ set_transmitters only supports 32 bit int /

Discussion

  • Nicolas

    Nicolas - 2015-11-23

    hum, my patch workds if at least one client is connected via irw.

     
  • Nicolas

    Nicolas - 2015-11-23

    Ok,
    so finally, the following patch solves my problem.
    But i guess an initialisation of the driver is missing somewhere, but i don't understand why in my case.

    diff --git a/daemons/lircd.c b/daemons/lircd.c
    index 3a7f744..ed1ef5d 100644
    --- a/daemons/lircd.c
    +++ b/daemons/lircd.c
    @@ -2165,6 +2165,13 @@ void loop()
     {
            char *message;
    
    
    +       /* initialized the device */
    +       if(useuinput) {
    +         if (curr_driver->init_func) {
    +           if (!curr_driver->init_func()) { 
    +               logprintf(LIRC_WARNING, "Failed to initialize hardware"); }
    +         }
    +       }
    +
            logprintf(LIRC_NOTICE, "lircd(%s) ready, using %s",curr_driver->name,  lircdfile);
            while (1) {
                    (void)mywaitfordata(0);
    
     

    Last edit: Alec Leamas 2015-11-24
  • Alec Leamas

    Alec Leamas - 2015-11-29

    Hm... looks like this bug reveals some major design flaws.

    For current release 0.9.3 the patch makes sense. It is applied to the 0.9.3 branch as [7b5d69]. It is still broken w r t the handling when clients disconnects, but still better in the uinput usecases.

    As for upcoming 0.9.4 this should be redesigned. See [#162]. Temporary fix pushed as [dfaa2b]

     

    Related

    Tickets: #162
    Commit: [7b5d69]
    Commit: [dfaa2b]

  • Alec Leamas

    Alec Leamas - 2015-11-29

    New hm... which driver are you using?

     
  • Alec Leamas

    Alec Leamas - 2015-12-06

    Ping? Really need som feedback here...

     
  • Alec Leamas

    Alec Leamas - 2016-04-28
    • status: open --> closed
    • Resolution: na --> fixed
    • Milestone: Future --> 0.9.4
     
  • Alec Leamas

    Alec Leamas - 2016-04-28

    Here is a temporary fix in 0.9.3 a new service in 0.9.4 [#162] and no further info. Thanks for reporting! Closing bug.

     

    Related

    Tickets: #162


    Last edit: Alec Leamas 2016-04-28

Log in to post a comment.

MongoDB Logo MongoDB