lirc_mod_mce 0.2.0

Help
2008-04-26
2013-04-15
  • Florian Demski
    Florian Demski
    2008-04-26

    Hi there,

    I just prepared a new release and re-synced with lirc, so that a bunch of new receivers are supported now.

    Just to help you with using it:

    1) Copy lirc_dev.h, lirc.h and kcompat.h from your installed version of lirc into the source directory prior to compilation.

    2) Warnings about missing symbols like this:

    WARNING: "lirc_register_plugin" [/500gb/projekte/mod_mce/lirc_mod_mce/lirc_mod_mce.ko] undefined!
    WARNING: "lirc_unregister_plugin" [/500gb/projekte/mod_mce/lirc_mod_mce/lirc_mod_mce.ko] undefined!
    WARNING: "lirc_get_pdata" [/500gb/projekte/mod_mce/lirc_mod_mce/lirc_mod_mce.ko] undefined!

    are not relevant as the symbols are defined in one of lirc's own modules.

    3) When receiving errors (in syslog) like this:
    [   29.926207] lirc_dev: lirc_register_plugin: no module owner registered
    [   29.926307] lirc_mod_mce[2]: out of memory (code=9)

    you probably haven't copied over the header files in step 1 properly.

    4) When still having problems, be sure to load the module with the argument "debug" and check your syslog.

    5) When lirc_mod_mce is loaded, you can get the correspondent mouse device by examining /proc/bus/input/devices:

    I: Bus=0003 Vendor=0471 Product=0815 Version=0000
    N: Name="Philips eHome Infrared Transceiver"
    P: Phys=/input0
    S: Sysfs=/devices/pci0000:00/0000:00:1d.0/usb6/6-1/input/input10
    U: Uniq=
    H: Handlers=kbd mouse2 event5
    B: EV=7
    B: KEY=30000 7 ff87207ac14057ff febeffdfffefffff fffffffffffffffe
    B: REL=3

    In this case, the mouse device is /dev/input/mouse2; the event device is /dev/input/event5.

    See http://gentoo-wiki.com/HOWTO_Advanced_Mouse for configuring multiple mice with xorg. I doubt that setting mouse speeds for different mice independently is possible when using /dev/input/mice.

    Please forgive me that I have responded to multiple forum posts in this post.

    That's it for now,

    Florian

     
    • richard joss
      richard joss
      2008-04-26

      Florian GREAT ADVANCES - the mouse, keyboard keys AND media keys all now work together and at the same time. But there is one problem (see below).  First, what I did:

      I followed your instructions to install the new version.  All went fine except the installed version of lirc in mythbuntu 8.04 does not contain any of the files you wanted copied to the source directory.  None of them existed on the hard disk (after a fresh install). 

      I therefore installed lirc-modules-source which installed and built lirc-0.8.3 pre1.  Then I copied over the files from that.  I "made" and it went fine - no error messages, just the same warnings as in your post. I had to rename lirc_mceusb2.ko again, as it is reinstalled by lirc-modules-source.

      I copied the new lirc_mod_mce.ko file to /lib/modules/MYKERNEL/ubuntu/misc.  Then I ran depmod -a and rebooted.

      Lirc installed fine:

      richard@antec:~$ ps aux|grep lirc
      root      4129  0.0  0.0   2932   584 ?        S<s  16:35   0:00 /usr/sbin/lircd --device=/dev/lirc0
      richard   7367  0.0  0.0   3008   772 pts/2    S+   16:56   0:00 grep lirc
      richard@antec:~$

      Lsmod looked good:

      richard@antec:~$ lsmod |grep lirc
      lirc_mod_mce           19204  0
      lirc_dev               15860  1 lirc_mod_mce
      usbcore               146028  5 lirc_mod_mce,usbhid,ehci_hcd,uhci_hcd
      richard@antec:~$

      And the driver seemed to be "playing nice":

      richard@antec:~$ dmesg |grep lirc
      [   35.792677] lirc_dev: IR Remote Control driver registered, major 61
      [   35.863947] lirc_mod_mce: no version for "lirc_get_pdata" found: kernel tainted.
      [   35.875704] lirc_mod_mce: Input driver for Microsoft MCE 2005 keyboard v0.2.0
      [   35.875853] lirc_mod_mce: Florian Demski
      [   36.173239] lirc_dev: lirc_register_plugin: sample_rate: 0
      [   36.294988] lirc_mod_mce[2]: SMK eHome Infrared Transceiver on usb3:2
      [   36.295132] usbcore: registered new interface driver lirc_mod_mce
      richard@antec:~

      Devices seemed to have all the right info too:

      I: Bus=0003 Vendor=0609 Product=031d Version=0000
      N: Name="SMK eHome Infrared Transceiver"
      P: Phys=/input0
      S: Sysfs=/devices/pci0000:00/0000:00:1d.2/usb3/3-2/input/input6
      U: Uniq=
      H: Handlers=kbd mouse2 event6
      B: EV=7
      B: KEY=30000 0 7 ff87207a c14057ff febeffdf ffefffff ffffffff fffffffe
      B: REL=3

      Now the good/bad news.  The mouse on the keyboard worked fine after the reboot.  The mce kbd keys also worked OK, but kept repeating - tried it by typing in a terminal and also in a text editor.  Pressing other keys, including the Return made no difference.  Which ever key I hit, repeated - even the Return key.  However, I could stop this happening by hitting the left mouse key once.  This was the only key that would stop the repeating.  However, it would start again immediately I hit another keyboard key.

      I then fired up mythfrontend and found that the media keys also worked. So I could control mythtv with either the keyboard keys or the media keys.  Never been able to do this before so that is a great result. CONGRATULATIONS!!

      However, I got the same problem with the repeating keys.  For example, if I used the up/down arrows to try to move up or down in the main menu, it began to cycle endlessly up and down the menu.  The only way to stop it was to hit the mouse button.

      I seem to remember that there is a post here from Tom (?) which IIRC was about the same thing.  Iĺl post this and then have a look at what you said to him.

      In the meantime many thanks again - you are a star.

      Richard

       
    • richard joss
      richard joss
      2008-04-26

      Florian - further to my post above. I have the same repeating keys problem as Tom had in the "pinnacle" post in this forum. I have solved it temporarily as he did, by turning off the repeat keys option under keyboard settings. I have tried using the keyboard under mythbuntu (ubuntu + xfce desktop) and under Kubuntu (KDE desktop) and both times the keyboard repeats endlessly, unless I turn of the repeat option.

      If you want any further info just ask, but you will have to spell out exactly what you want as I don't have anything like the knowledge that Tom has!

      Richard

       
      • Florian Demski
        Florian Demski
        2008-04-26

        Richard,

        maybe the key repetition problem is caused by some Ubuntu configuration

        See https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/124406

        I haven't read the whole thread but as it seems, many people seem to have the same problem (but with other keyboards). At least on my system it works nicely.

        Florian

         
        • Sami Laitinen
          Sami Laitinen
          2008-04-26

          This bug is not specific to Ubuntu as I experience the same behaviour on Gentoo.

           
          • richard joss
            richard joss
            2008-04-27

            Sami - thanks for the input.  Very interesting, especially to Florian as he runs gentoo.

            Florian - thanks for the links to ubuntu related bugs.  I'll try some of the reported solutions and post back here.  It does look like a kernel or X related problem.  I may be that your driver is just triggering the problem - perhaps because of heavy load or something. Doesn't sound like anything to do with the driver itself.

            Richard

             
            • richard joss
              richard joss
              2008-04-27

              OK I tried all the suggested solutions I could find but none work.  For the kernel I tried nolapic, noapic, acpi=off, nosmp, and ec_intr=0 in the boot sequence. Once booted I tried (in a terminal) "set r rate 1000 50".

              The only thing that worked was setting an option in the ServerFlags section of xorg.conf to disable Xkb:

              Section "ServerFlags"
              Option "XkbDisable" "true"
              EndSection

              However, this only seems to work because it nullifies the Repeat Keys setting normally set within settings when at the desktop.  Only of use if you don mind not having keys repeat at all.  I find it OK except for having to hit the Delete key 50 times if you want to delete a sentence!

              As I will be using the keyboard mainly for a Mythtv setup, I won't need the keyboard keys too much - just titling music, typing a few emails etc.. Perhaps I can put up with that for the moment - just pleased to have kbd keys and media keys plus mouse all working together.

               
        • richard joss
          richard joss
          2008-04-28

          Florian

          I installed Mythdora 5.0 (released yesterday) and then installed your driver.  The driver install went just fine, but sorry to say that the keys repeat here just as in Ubuntu (see also the post from azmotus who says that he has the same problem but is running gentoo).

          Sounds more like a kernel issue. Mythdora 5.0 is running on 2.6.24.4-64.fc8

          Richard

           
      • Florian Demski
        Florian Demski
        2008-04-26

        Just to give you further information:

        When enabling the debug mode of the driver, you should be able to see the decoded key strokes in your syslog file.

        Apr 26 10:43:26 fd-home lirc_mod_mce RC5: key=00 mask=02
        Apr 26 10:43:26 fd-home lirc_mod_mce RC5: key=1C mask=02
        Apr 26 10:43:26 fd-home lirc_mod_mce RC5: key=00 mask=02
        Apr 26 10:43:29 fd-home lirc_mod_mce RC5: key=00 mask=00

        The messages translate to

        key=00 mask=02 --> left shift pressed
        key=1C mask=02 --> Y pressed while left shift is pressed
        key=00 mask=02 --> left shift pressed --> Y released while left shift is still pressed
        key=00 mask=00 --> no key pressed --> left shift released

        The driver does the following:

        When a key/mask combination is received, it checks whether the keys are still pressed (the keyboard keeps repeating the transmission until you actually release the key) and if not, it informs the kernel that the key is pressed. When a keycode of zero is received, it sends a release event for all keys previously marked as pressed and sent to the kernel.

        If the driver would send a key release event directly after the key pressed event, all combinations would be suppressed, as you probably won't press shift and a letter at the same moment.

        Repetition occurs if either the key release event (key=00 mask=00) hasn't been received or if (like in your case) the xorg input driver simulates repetition and somehow isn't properly informed of the fact that the key has been released. In the first case, the problems would remain if you switched of the repetition in xorg and that should be clearly visible in the syslog.

        Florian

         
        • DrMazz
          DrMazz
          2008-08-03

          I also have a key repeat problem with lirc_mod_mce 0.2.0 on Ubuntu 8.04 with the MCE keyboard.  I get about 12-15 instances of a key for each keypress and then it stops.  When looking at the console or a text editor and pressing a key, I see the keystroke echoed, followed by an initial delay before the second echo, followed by a burst of more rapid echoes.

          Using irw I also tend to get 2-3 button presses with the MCE remote control for most buttons...not sure if that's related or not.

          I enabled debug on the driver and had a look at syslog.  With no keypresses this type of thing going on constantly:

          Aug  3 17:06:07 mavis kernel: [ 4635.345360] lirc_mod_mce[3]: data received 84 90 72 91 74  (length=5)
          Aug  3 17:06:07 mavis kernel: [ 4635.358345] lirc_mod_mce[3]: data received 84 8f 72 91 74  (length=5)
          Aug  3 17:06:07 mavis kernel: [ 4635.371332] lirc_mod_mce[3]: data received 84 8f 73 90 73  (length=5)
          Aug  3 17:06:07 mavis kernel: [ 4635.384320] lirc_mod_mce[3]: data received 84 90 74 8f 73  (length=5)
          Aug  3 17:06:07 mavis kernel: [ 4635.398305] lirc_mod_mce[3]: data received 84 90 74 90 72  (length=5)
          Aug  3 17:06:07 mavis kernel: [ 4635.411291] lirc_mod_mce[3]: data received 84 90 72 91 73  (length=5)
          Aug  3 17:06:07 mavis kernel: [ 4635.424276] lirc_mod_mce[3]: data received 84 90 73 90 73  (length=5)
          Aug  3 17:06:07 mavis kernel: [ 4635.437263] lirc_mod_mce[3]: data received 84 90 73 90 73  (length=5)
          Aug  3 17:06:07 mavis kernel: [ 4635.450249] lirc_mod_mce[3]: data received 84 90 73 90 73  (length=5)
          Aug  3 17:06:07 mavis kernel: [ 4635.463236] lirc_mod_mce[3]: data received 84 90 73 90 72  (length=5)
          Aug  3 17:06:07 mavis kernel: [ 4635.477222] lirc_mod_mce[3]: data received 84 91 73 90 73  (length=5)
          Aug  3 17:06:07 mavis kernel: [ 4635.490208] lirc_mod_mce[3]: data received 84 90 73 90 74  (length=5)
          Aug  3 17:06:07 mavis kernel: [ 4635.503195] lirc_mod_mce[3]: data received 84 90 73 90 73  (length=5)

          I don't know if this is anticipated behaviour or not, but it seems to be receiving 5 bytes of data every 13ms or so.

          Here's a section with a keypress and release:

          Aug  3 17:06:09 mavis kernel: [ 4636.846789] lirc_mod_mce[3]: data received 84 8e 0b 87 05  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.848788] lirc_mod_mce[3]: data received 84 8d 05 87 0b  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.850786] lirc_mod_mce[3]: data received 84 88 05 87 05 84 87 05 87 05  (length=10)
          Aug  3 17:06:09 mavis kernel: [ 4636.852785] lirc_mod_mce[3]: data received 84 87 05 88 04  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.854782] lirc_mod_mce[3]: data received 84 88 05 87 05 84 87 05 87 05  (length=10)
          Aug  3 17:06:09 mavis kernel: [ 4636.856779] lirc_mod_mce[3]: data received 84 87 05 8e 05  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.858778] lirc_mod_mce[3]: data received 84 87 0b 8d 0b  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.860776] lirc_mod_mce[3]: data received 84 87 06 87 05 84 87 05 87 05  (length=10)
          Aug  3 17:06:09 mavis kernel: [ 4636.862773] lirc_mod_mce[3]: data received 84 87 05 87 05  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.867770] lirc_mod_mce[3]: data received 84 88 05 87 7f  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.892745] lirc_mod_mce[3]: data received 84 7f 7f 7f 7f  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.918719] lirc_mod_mce[3]: data received 84 7f 7f 7f 7f  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.936699] lirc_mod_mce[3]: data received 84 7f 7f 3a b8  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.938694] lirc_mod_mce[3]: data received 84 05 87 05 8d  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.938699] lirc_mod_mce RC5: key=0D mask=00
          Aug  3 17:06:09 mavis kernel: [ 4636.940695] lirc_mod_mce[3]: data received 84 0b 87 05 87  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.942690] lirc_mod_mce[3]: data received 84 06 87 05 87  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.944687] lirc_mod_mce[3]: data received 84 05 8d 0b 87  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.946686] lirc_mod_mce[3]: data received 84 06 8d 05 87  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.948684] lirc_mod_mce[3]: data received 84 0b 87 06 86 84 05 87 06 87  (length=10)
          Aug  3 17:06:09 mavis kernel: [ 4636.950680] lirc_mod_mce[3]: data received 84 05 87 05 87  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.952679] lirc_mod_mce[3]: data received 84 05 87 05 88 84 05 86 06 87  (length=10)
          Aug  3 17:06:09 mavis kernel: [ 4636.954677] lirc_mod_mce[3]: data received 84 05 87 05 8d  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.956677] lirc_mod_mce[3]: data received 84 05 87 0c 8c  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.958673] lirc_mod_mce[3]: data received 84 0c 87 05 87 84 05 87 06 86  (length=10)
          Aug  3 17:06:09 mavis kernel: [ 4636.960670] lirc_mod_mce[3]: data received 84 06 86 06 87  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.962668] lirc_mod_mce[3]: data received 84 05 87 05 87  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.984650] lirc_mod_mce[3]: data received 84 7f 7f 7f 7f  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.995637] lirc_mod_mce[3]: data received 84 7f 1c b8 06  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.995644] lirc_mod_mce RC5: key=0D mask=00
          Aug  3 17:06:09 mavis kernel: [ 4636.997631] lirc_mod_mce[3]: data received 84 86 06 8c 0c  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4636.999629] lirc_mod_mce[3]: data received 84 87 05 87 05  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4637.001629] lirc_mod_mce[3]: data received 84 87 06 86 06  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4637.003627] lirc_mod_mce[3]: data received 84 86 06 86 06  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4637.005629] lirc_mod_mce[3]: data received 84 87 05 87 06 84 86 06 86 06  (length=10)
          Aug  3 17:06:09 mavis kernel: [ 4637.007624] lirc_mod_mce[3]: data received 84 86 06 86 06 84 87 06 86 06  (length=10)
          Aug  3 17:06:09 mavis kernel: [ 4637.009622] lirc_mod_mce[3]: data received 84 86 06 86 06  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4637.011620] lirc_mod_mce[3]: data received 84 86 06 87 05 84 87 06 86 06  (length=10)
          Aug  3 17:06:09 mavis kernel: [ 4637.013619] lirc_mod_mce[3]: data received 84 86 06 86 06  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4637.015615] lirc_mod_mce[3]: data received 84 86 06 87 06 84 86 06 86 06  (length=10)
          Aug  3 17:06:09 mavis kernel: [ 4637.017614] lirc_mod_mce[3]: data received 84 86 06 86 06 84 87 06 86 06  (length=10)
          Aug  3 17:06:09 mavis kernel: [ 4637.019612] lirc_mod_mce[3]: data received 84 86 06 86 06  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4637.024609] lirc_mod_mce[3]: data received 84 86 06 86 7f  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4637.049582] lirc_mod_mce[3]: data received 84 7f 7f 7f 7f  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4637.075556] lirc_mod_mce[3]: data received 84 7f 7f 7f 7f  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4637.100530] lirc_mod_mce[3]: data received 84 7f 7f 7f 7f  (length=5)
          Aug  3 17:06:09 mavis kernel: [ 4637.118512] lirc_mod_mce[3]: data received 83 7f 7f 5f 9f 01 01 9f 15 00 00 80  (length=12)
          Aug  3 17:06:10 mavis kernel: [ 4637.645961] lirc_mod_mce[3]: data received 84 82 7f 01 84  (length=5)
          Aug  3 17:06:10 mavis kernel: [ 4637.645967] lirc_mod_mce RC5: key=00 mask=00
          Aug  3 17:06:10 mavis kernel: [ 4637.658943] lirc_mod_mce[3]: data received 84 7e 85 7c 87  (length=5)
          Aug  3 17:06:10 mavis kernel: [ 4637.671929] lirc_mod_mce[3]: data received 84 7a 89 79 8a  (length=5)

          If I read this right it looks like lirc_mod_mce detected two keypresses before release.  So that suggests to me that something else is turning the two keypresses into a dozen. 

          I tried copying not only lirc_dev.h but also kcompat.h and lirc.h from the Ubuntu lirc source package, but this hasn't made any difference.  I might try mod_mce on its own and see if it has the same behaviour.

          Any suggestions will be much appreciated :-)

           
          • DrMazz
            DrMazz
            2008-08-03

            I tried lirc_mod_mce 1.5.0 instead, and I'm typing this with the MCE keyboard.  It's kind-of usable, but it seems to have quite alot of latency and misses about one keystroke in 10.  I also just had the space key stick in an endless loop, so I'm not confident this is a robust solution yet...

             
    • Sami Laitinen
      Sami Laitinen
      2008-04-28

      This patch is required to compile the driver under 2.6.25 kernel.

      --- lirc_mod_mce.old/lirc_mod_mce.c    2008-04-26 11:42:47.000000000 +0300
      +++ lirc_mod_mce/lirc_mod_mce.c    2008-04-28 20:38:12.000000000 +0300
      @@ -1298,7 +1298,7 @@
           input_dev->name = ir->name;
           input_dev->phys = ir->phys;
           usb_to_input_id(dev, &input_dev->id);
      -    input_dev->cdev.dev = &dev->dev;
      +    input_dev->dev.parent = &dev->dev;
           input_dev->evbit[BIT_WORD(EV_KEY)] |= BIT_MASK(EV_KEY);
           input_dev->evbit[BIT_WORD(EV_REL)] |= BIT_MASK(EV_REL);
           input_dev->relbit[BIT_WORD(REL_X)] |= BIT_MASK(REL_X);

       
      • richard joss
        richard joss
        2008-04-28

        Sami - thanks for this info.  However:

        1. Do you mean the 2.6.25 kernel as you say or do you mean 2.6.24 kernel which is what we are all using?  Will your patch work with 2.6.24?

        2.  Also - I have no idea how to execute this patch.  I am only a newbie at all this.  Could you explain?

        Thanks

        Richard

         
        • Sami Laitinen
          Sami Laitinen
          2008-04-29

          1. I meant the 2.6.25 kernel. They changed something in the kernel headers so this patch is necessary. It is not needed on 2.6.24 or below.

          2. Download a working patch from here ( http://www.redcrow.fi/tmp/lirc_mod_mce-kernel-2.6.25.patch ) as the one posted above has all the whitespace removed by this forum, so it won't work. :( Save it to the same directory where you unpacked the lirc_mod_mce-0.2.0.tar.bz2 package and run "patch -p1 < lirc_mod_mce-kernel-2.6.25.patch" without the quotes in terminal.