[Linux] HOW-TO MCE Remote WITHOUT LIRC (Natty)
#16
Nice info!

@parag
for me the file '/etc/init/xbmc-ir-keytable' had to be named '/etc/init/xbmc-ir-keytable.conf'
in order for it to be seen on oneiric...
Reply
#17
Quote:for me the file '/etc/init/xbmc-ir-keytable' had to be named '/etc/init/xbmc-ir-keytable.conf'
in order for it to be seen on oneiric...

yes your right that is what it should be. I fixed my post. Thanks
Reply
#18
Followed guide. OK and BACK buttons how works tho have lost Volume UP/DOWN.
These keys seems to have mapped UP and DOWN.
Removing ir-keytable, just running stock Kernel - Volume UP/DOWN work buts no OK and BACK buttons. Argh!!!
Reply
#19
I'm super new at this. I have some previous Ubuntu experience but I just installed Natty and XBMC and now I'm just trying to get my OK button to work.

I got all the commands to work (when I realized I had to add sudo)...except for "make" and "cp ./ir-keytable /usr/bin".

"make" returns "make: *** No targets specified and no makefile found. Stop."
"cp ./ir-keytable /usr/bin" returns "cp: cannot stat `./ir-keytable': No such file or directory"

Nevermind... Got it figured out.
Reply
#20
cant wait to read this thread at home, it would appear to be the missing link to the problems i was experiencing, i could add ir-keytable and get my remote working on the desktop, but not in xbmc, and was still being guided through lirc specifci solutions.
Reply
#21
Ubuntu Oneiric 11.10 - Kernel 3.0.15- Xbmc PPA latest
This guides fixes OK and BACK buttons on XBMC but no volume UP or DOWN.
I have tried this 3 times now each from clean install.
Have now given up and installed OPENELEC 1.02 for Intel - all is working VAPPI, MCE remote (all buttons)
Reply
#22
Smile 
Thanks for your help, appreciate the time you took to write this guide.

Now works great.
Reply
#23
Since i upgraded to 11.10 a few months ago, i gave up my remote control and started using my keyboard again as remote control. Using this guide i can finally use my remote control again!

Almost there now, still a few quirks:
- The volume up and down button seem to do a page up and page down instead of controlling the volume.
- When pressing the up button a few times in a row, results in scrolling up very fast.
Toyed around with the repeat delay and repeat period settings of ir-keytable, but that didnt help.

In the end i disabled the startup script, reinstalled lirc and everything is working again Smile
Reply
#24
--> wstewart

Excellent *mr burns hands*
Reply
#25
djk29a Wrote:And if you want to set the repeat frequency / delay, modify the command used in the ir-keytable command.

I don't understand your advise Huh

Exact same problem. But only in XBMC, not in desktop.

When selecting video file from list, If I press too fast repeatedly "down" or "up"-buttons, it goes wild, and skips tens on videos.

"sudo ir-keytable" shows following:

Code:
[email protected]:~$ sudo ir-keytable
Found /sys/class/rc/rc0/ (/dev/input/event9) with:
    Driver mceusb, table rc-rc6-mce
    Supported protocols: NEC RC-5 RC-6 JVC SONY LIRC
    Enabled protocols: RC-5 RC-6
    Repeat delay = 500 ms, repeat period = 125 ms
Found /sys/class/rc/rc1/ (/dev/input/event11) with:
    Driver af9015, table rc-empty
    Supported protocols: NEC
    Enabled protocols:
    Repeat delay = 500 ms, repeat period = 125 ms

Any ideas? Oo

EDIT: Oh, now I remember something that I had to work on before that MIGHT help. Remote sends command straight to XBMC AND through "keyboard driver" ALSO / or something like that...
EDIT 2: Actually that might been for doubletapping problem.
Reply
#26
Seems you can change repeat rates by:
Code:
sudo ir-keytable --delay 500
sudo ir-keytable --period 50

And ofcourse check repeat rate with:
Code:
sudo ir-keytable

But when I change them to 1 or 1410065407 there is absolutely no effect.

So do I have to create "home/.xbmc/userdata/advancedsettings.xml" and figure a way out over there? (since this problem only appears with XBMC)

With Ubuntu 10.04 + XBMC and this MCE (clone) remote everything was working fine. I just dont remember was I messing out with Lirc. Propably yes.
That hard disk is destroyed so that can't be really help.

(Using Ubuntu 11.10 + XBMC 10.1 + MCE remote clone)

EDIT: Got the hard drive working half way, and yes, lirc was installed.
Reply
#27
Another option is to recompile your kernel with your button mapping hard coded in. I used this option since the current version of V4L-utils didn't support the Streamzap protocol. This method worked great but would be a pain every time I upgrade as I would need to recompile the kernel, so I also wrote a patch for V4L-utils which adds in the required code to support the RC5-SZ protocol which the Streamzap remote uses. I have a patch for the GIT version and one that should apply to the latest release(0.8.5).

Here's the on for the release version(also adds in any other changes between this version and git):

Code:
--- v4l-utils-0.8.5/utils/keytable/keytable.c   2011-07-17 12:06:39.000000000 -0400
+++ v4l-utils-0.8.5/utils/keytable/keytable.new 2012-01-16 10:26:55.000000000 -0500
@@ -86,6 +86,8 @@
        JVC             = 1 << 3,
        SONY            = 1 << 4,
        LIRC            = 1 << 5,
+       SANYO           = 1 << 6,
+       RC_5_SZ         = 1 << 7,
        OTHER           = 1 << 31,
};

@@ -110,7 +112,7 @@
        "  SYSDEV   - the ir class as found at /sys/class/rc\n"
        "  TABLE    - a file with a set of scancode=keycode value pairs\n"
        "  SCANKEY  - a set of scancode1=keycode1,scancode2=keycode2.. value pairs\n"
-       "  PROTOCOL - protocol name (nec, rc-5, rc-6, other) to be enabled\n"
+       "  PROTOCOL - protocol name (nec, rc-5, rc-5-sz, rc-6, jvc, sony, sanyo, lirc, other) to be enabled\n"
        "  DELAY    - Delay before repeating a keystroke\n"
        "  PERIOD   - Period to repeat a keystroke\n"
        "  CFGFILE  - configuration file that associates a driver/table name with a keymap file\n"
@@ -213,7 +215,9 @@
                                } else if (!strcmp(p, "type")) {
                                        p = strtok(NULL, " ,\n");
                                        do {
-                                               if (!strcasecmp(p,"rc5") || !strcasecmp(p,"rc-5"))
+                                                if (!strcasecmp(p,"rc5-sz") || !strcasecmp(p,"rc-5-sz"))
+                                                        ch_proto |= RC_5_SZ;
+                                               else if (!strcasecmp(p,"rc5") || !strcasecmp(p,"rc-5"))
                                                        ch_proto |= RC_5;
                                                else if (!strcasecmp(p,"rc6") || !strcasecmp(p,"rc-6"))
                                                        ch_proto |= RC_6;
@@ -223,6 +227,8 @@
                                                        ch_proto |= JVC;
                                                else if (!strcasecmp(p,"sony"))
                                                        ch_proto |= SONY;
+                                               else if (!strcasecmp(p,"sanyo"))
+                                                       ch_proto |= SANYO;
                                                else if (!strcasecmp(p,"other") || !strcasecmp(p,"unknown"))
                                                        ch_proto |= OTHER;
                                                else {
@@ -442,7 +448,9 @@
        case 'p':
                p = strtok(arg, ",;");
                do {
-                       if (!strcasecmp(p,"rc5") || !strcasecmp(p,"rc-5"))
+                        if (!strcasecmp(p,"rc5-sz") || !strcasecmp(p,"rc-5-sz"))
+                                ch_proto |= RC_5_SZ;
+                       else if (!strcasecmp(p,"rc5") || !strcasecmp(p,"rc-5"))
                                ch_proto |= RC_5;
                        else if (!strcasecmp(p,"rc6") || !strcasecmp(p,"rc-6"))
                                ch_proto |= RC_6;
@@ -452,6 +460,8 @@
                                ch_proto |= JVC;
                        else if (!strcasecmp(p,"sony"))
                                ch_proto |= SONY;
+                       else if (!strcasecmp(p,"sanyo"))
+                               ch_proto |= SANYO;
                        else if (!strcasecmp(p,"lirc"))
                                ch_proto |= LIRC;
                        else
@@ -713,8 +723,10 @@
        while (p) {
                if (debug)
                        fprintf(stderr, "%s protocol %s\n", name, p);
-               if (!strcmp(p, "rc-5"))
-                       proto |= RC_5;
+               if (!strcmp(p, "rc-5-sz"))
+                       proto |= RC_5_SZ;
+                else if (!strcmp(p, "rc-5"))
+                        proto |= RC_5;
                else if (!strcmp(p, "rc-6"))
                        proto |= RC_6;
                else if (!strcmp(p, "nec"))
@@ -723,6 +735,9 @@
                        proto |= JVC;
                else if (!strcmp(p, "sony"))
                        proto |= SONY;
+               else if (!strcmp(p, "sanyo"))
+                       proto |= SANYO;
+
                else
                        proto |= OTHER;

@@ -748,6 +763,9 @@
                return errno;
        }

+       if (rc_dev->current & RC_5_SZ)
+               fprintf(fp, "rc-5-sz ");
+
        if (rc_dev->current & RC_5)
                fprintf(fp, "rc-5 ");

@@ -763,6 +781,9 @@
        if (rc_dev->current & SONY)
                fprintf(fp, "sony ");

+       if (rc_dev->current & SANYO)
+               fprintf(fp, "sanyo ");
+
        if (rc_dev->current & OTHER)
                fprintf(fp, "unknown ");

@@ -873,7 +894,9 @@
                        fprintf(stderr, "%s protocol %s (%s)\n", name, p,
                                enabled? "enabled" : "disabled");

-               if (!strcmp(p, "rc-5"))
+               if (!strcmp(p, "rc-5-sz"))
+                       proto = RC_5_SZ;
+               else if (!strcmp(p, "rc-5"))
                        proto = RC_5;
                else if (!strcmp(p, "rc-6"))
                        proto = RC_6;
@@ -883,6 +906,8 @@
                        proto = JVC;
                else if (!strcmp(p, "sony"))
                        proto = SONY;
+               else if (!strcmp(p, "sanyo"))
+                       proto = SANYO;
                else if (!strcmp(p, "lirc"))    /* Only V2 has LIRC support */
                        proto = LIRC;
                else
@@ -917,6 +942,9 @@
        /* Disable all protocols */
        fprintf(fp, "none\n");

+       if (rc_dev->current & RC_5_SZ)
+               fprintf(fp, "+rc-5-sz\n");
+
        if (rc_dev->current & RC_5)
                fprintf(fp, "+rc-5\n");

@@ -932,6 +960,9 @@
        if (rc_dev->current & SONY)
                fprintf(fp, "+sony\n");

+       if (rc_dev->current & SANYO)
+               fprintf(fp, "+sanyo\n");
+
        if (rc_dev->current & LIRC)
                fprintf(fp, "+lirc\n");

@@ -952,12 +983,16 @@
                fprintf (stderr, "NEC ");
        if (proto & RC_5)
                fprintf (stderr, "RC-5 ");
+       if (proto & RC_5_SZ)
+               fprintf (stderr, "RC-5-SZ ");
        if (proto & RC_6)
                fprintf (stderr, "RC-6 ");
        if (proto & JVC)
                fprintf (stderr, "JVC ");
        if (proto & SONY)
                fprintf (stderr, "SONY ");
+       if (proto & SANYO)
+               fprintf (stderr, "SANYO ");
        if (proto & LIRC)
                fprintf (stderr, "LIRC ");
        if (proto & OTHER)
@@ -1350,6 +1385,27 @@
        get_rate(fd, &delay, &period);
}

+static void device_info(int fd, char *prepend)
+{
+       struct input_id id;
+       char buf[32];
+       int rc;
+
+       rc = ioctl(fd, EVIOCGNAME(sizeof(buf)), buf);
+       if (rc >= 0)
+               fprintf(stderr,"%sName: %.*s\n",prepend, rc, buf);
+       else
+               perror ("EVIOCGNAME");
+
+       rc = ioctl(fd, EVIOCGID, &id);
+       if (rc >= 0)
+               fprintf(stderr,
+                       "%sbus: %d, vendor/product: %04x:%04x, version: 0x%04x\n",
+                       prepend, id.bustype, id.vendor, id.product, id.version);
+       else
+               perror ("EVIOCGID");
+}
+
static int show_sysfs_attribs(struct rc_device *rc_dev)
{
        static struct sysfs_names *names, *cur;
@@ -1374,6 +1430,7 @@
                        display_proto(rc_dev);
                        fd = open(rc_dev->input_name, O_RDONLY);
                        if (fd > 0) {
+                               device_info(fd, "\t");
                                show_evdev_attribs(fd);
                                close(fd);
                        } else {
@@ -1395,6 +1452,16 @@

        /* Just list all devices */
        if (!clear && !readtable && !keys.next && !ch_proto && !cfg.next && !test && !delay && !period) {
+               if (devname) {
+                       fd = open(devname, O_RDONLY);
+                       if (fd < 0) {
+                               perror("Can't open device");
+                               return -1;
+                       }
+                       device_info(fd, "");
+                       close(fd);
+                       return 0;
+               }
                if (show_sysfs_attribs(&rc_dev))
                        return -1;

See next message for the git patch. Was too big to fit in one message. :-)
Reply
#28
Here's the one that should work with GIT:

Code:
--- v4l-utils/utils/keytable/keytable.c 2012-01-27 14:37:50.000000000 -0500
+++ src/v4l-utils-0.8.5/utils/keytable/keytable.c       2012-01-27 14:31:45.000000000 -0500
@@ -12,7 +12,6 @@
    GNU General Public License for more details.
  */

-#include <config.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
@@ -88,6 +87,7 @@
        SONY            = 1 << 4,
        LIRC            = 1 << 5,
        SANYO           = 1 << 6,
+       RC_5_SZ         = 1 << 7,
        OTHER           = 1 << 31,
};

@@ -112,7 +112,7 @@
        "  SYSDEV   - the ir class as found at /sys/class/rc\n"
        "  TABLE    - a file with a set of scancode=keycode value pairs\n"
        "  SCANKEY  - a set of scancode1=keycode1,scancode2=keycode2.. value pairs\n"
-       "  PROTOCOL - protocol name (nec, rc-5, rc-6, jvc, sony, sanyo, lirc, other) to be enabled\n"
+       "  PROTOCOL - protocol name (nec, rc-5, rc-5-sz, rc-6, jvc, sony, sanyo, lirc, other) to be enabled\n"
        "  DELAY    - Delay before repeating a keystroke\n"
        "  PERIOD   - Period to repeat a keystroke\n"
        "  CFGFILE  - configuration file that associates a driver/table name with a keymap file\n"
@@ -202,11 +202,9 @@

        while (fgets(s, sizeof(s), fin)) {
                char *p = s;
-
-               line++;
                while (*p == ' ' || *p == '\t')
                        p++;
-               if (line==1 && p[0] == '#') {
+               if (!line && p[0] == '#') {
                        p++;
                        p = strtok(p, "\n\t =:");
                        do {
@@ -217,7 +215,9 @@
                                } else if (!strcmp(p, "type")) {
                                        p = strtok(NULL, " ,\n");
                                        do {
-                                               if (!strcasecmp(p,"rc5") || !strcasecmp(p,"rc-5"))
+                                                if (!strcasecmp(p,"rc5-sz") || !strcasecmp(p,"rc-5-sz"))
+                                                        ch_proto |= RC_5_SZ;
+                                               else if (!strcasecmp(p,"rc5") || !strcasecmp(p,"rc-5"))
                                                        ch_proto |= RC_5;
                                                else if (!strcasecmp(p,"rc6") || !strcasecmp(p,"rc-6"))
                                                        ch_proto |= RC_6;
@@ -281,6 +281,7 @@
                        return ENOMEM;
                }
                nextkey = nextkey->next;
+               line++;
        }
        fclose(fin);

@@ -288,7 +289,7 @@

err_einval:
        fprintf(stderr, "Invalid parameter on line %d of %s\n",
-               line, fname);
+               line + 1, fname);
        return EINVAL;

}
@@ -313,8 +314,6 @@

        while (fgets(s, sizeof(s), fin)) {
                char *p = s;
-
-               line++;
                while (*p == ' ' || *p == '\t')
                        p++;

@@ -352,6 +351,7 @@
                        return ENOMEM;
                }
                nextcfg = nextcfg->next;
+               line++;
        }
        fclose(fin);

@@ -359,7 +359,7 @@

err_einval:
        fprintf(stderr, "Invalid parameter on line %d of %s\n",
-               line, fname);
+               line + 1, fname);
        return EINVAL;

}
@@ -448,7 +448,9 @@
        case 'p':
                p = strtok(arg, ",;");
                do {
-                       if (!strcasecmp(p,"rc5") || !strcasecmp(p,"rc-5"))
+                        if (!strcasecmp(p,"rc5-sz") || !strcasecmp(p,"rc-5-sz"))
+                                ch_proto |= RC_5_SZ;
+                       else if (!strcasecmp(p,"rc5") || !strcasecmp(p,"rc-5"))
                                ch_proto |= RC_5;
                        else if (!strcasecmp(p,"rc6") || !strcasecmp(p,"rc-6"))
                                ch_proto |= RC_6;
@@ -721,8 +723,10 @@
        while (p) {
                if (debug)
                        fprintf(stderr, "%s protocol %s\n", name, p);
-               if (!strcmp(p, "rc-5"))
-                       proto |= RC_5;
+               if (!strcmp(p, "rc-5-sz"))
+                       proto |= RC_5_SZ;
+                else if (!strcmp(p, "rc-5"))
+                        proto |= RC_5;
                else if (!strcmp(p, "rc-6"))
                        proto |= RC_6;
                else if (!strcmp(p, "nec"))
@@ -733,6 +737,7 @@
                        proto |= SONY;
                else if (!strcmp(p, "sanyo"))
                        proto |= SANYO;
+
                else
                        proto |= OTHER;

@@ -758,6 +763,9 @@
                return errno;
        }

+       if (rc_dev->current & RC_5_SZ)
+               fprintf(fp, "rc-5-sz ");
+
        if (rc_dev->current & RC_5)
                fprintf(fp, "rc-5 ");

@@ -886,7 +894,9 @@
                        fprintf(stderr, "%s protocol %s (%s)\n", name, p,
                                enabled? "enabled" : "disabled");

-               if (!strcmp(p, "rc-5"))
+               if (!strcmp(p, "rc-5-sz"))
+                       proto = RC_5_SZ;
+               else if (!strcmp(p, "rc-5"))
                        proto = RC_5;
                else if (!strcmp(p, "rc-6"))
                        proto = RC_6;
@@ -932,6 +942,9 @@
        /* Disable all protocols */
        fprintf(fp, "none\n");

+       if (rc_dev->current & RC_5_SZ)
+               fprintf(fp, "+rc-5-sz\n");
+
        if (rc_dev->current & RC_5)
                fprintf(fp, "+rc-5\n");

@@ -970,6 +983,8 @@
                fprintf (stderr, "NEC ");
        if (proto & RC_5)
                fprintf (stderr, "RC-5 ");
+       if (proto & RC_5_SZ)
+               fprintf (stderr, "RC-5-SZ ");
        if (proto & RC_6)
                fprintf (stderr, "RC-6 ");
        if (proto & JVC)

Hope this helps others who have a Streamzap remote. I am not sure how to submit patches to the V4L project, it doesn't seem clear on their website.

Kevin
Reply
#29
I REALLY don't understand how to do that Sad

Can you put detailed instructions? Rolleyes
Reply
#30
Gave up / Installed lirc and moved than info here --> http://forum.xbmc.org/showthread.php?p=1...ost1004678
Reply



Logout Mark Read Team Forum Stats Members Help
[Linux] HOW-TO MCE Remote WITHOUT LIRC (Natty)2
This forum uses Lukasz Tkacz MyBB addons.