Linux MCE Remote repeats too fast

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
flopma Offline
Junior Member
Posts: 12
Joined: Jan 2010
Reputation: 0
Bug  RE: MCE Remote repeats too fast Post: #11
Hi again,

I think I've narrowed down the problem.

When testing the remote with the piece of code below, I can make the "bug" stop by increasing the interval's value given while calling SDL_EnableKeyRepeat. A value of 500 gives good result; while the value chosen in XBMC 11.0 (10ms) gives problems of too many repeats.

Where shall I open a bug report, XBMC or SDL ?

Thx
--
Issa


Code:
#include <SDL/SDL.h>

main(int argc, char *argv[])
{
    int quit = 0;
    int count = 0;
    SDL_Event event;

    if (SDL_Init(SDL_INIT_VIDEO) < 0 ) {
        fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError());
        exit(1);
    }

    if (!SDL_SetVideoMode(320, 200, 0, 0)) {
        fprintf(stderr, "Could not set video mode: %s\n", SDL_GetError());
        SDL_Quit();
        exit(1);
    }

    atexit(SDL_Quit);
    SDL_EnableUNICODE(1);
    SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, 500);

    while (!quit) {
/*        if (SDL_WaitEvent(&event) < 1) {
            fprintf(stderr, "WaitEvent error: %s\n", SDL_GetError());
            exit(1);
        }
*/
        if (SDL_PollEvent(&event) < 1) {
            continue;
        }

        switch (event.type) {
        case SDL_KEYDOWN:
            printf("Key pressed:\n");
            printf("    state: %i\n", event.key.state);
            printf("    SDL sim: %i\n", event.key.keysym.sym);
            printf("    modifiers: %i\n", event.key.keysym.mod);
            printf("    unicode: %i (if enabled with SDL_EnableUNICODE)\n", event.key.keysym.unicode);

        break;

        case SDL_KEYUP:
            printf("Key released:\n");
            printf("    state: %i\n", event.key.state);
            printf("    SDL sim: %i\n", event.key.keysym.sym);
            printf("    modifiers: %i\n", event.key.keysym.mod);
            printf("    unicode: %i (if enabled with SDL_EnableUNICODE)\n", event.key.keysym.unicode);
        break;

        case SDL_QUIT:
            printf("Request to quit\n");
            quit = 1;
        break;

        case SDL_USEREVENT:
            printf("User event:\n");
            printf("    code:  %i\n", event.user.code);
            printf("    data1: %p\n", event.user.data1);
            printf("    data2: %p\n", event.user.data2);
        break;
        }

        printf("%i\n", ++count);
    }
}
find quote
luke16 Offline
Junior Member
Posts: 1
Joined: Jun 2012
Reputation: 0
Post: #12
Thanks, flopma. I've noticed the same issue.

I'd report it to both.
SDL appears to have an issue in that it is issuing far more keypresses than its receiving.

XBMC has an issue that you can't control how keypresses are managed. advancedsettings.xml used to be the place for this (see: http://wiki.xbmc.org/index.php?title=Use...repeat.3E) but that doesn't appear to work with Eden - which is critical in cases like this.

Keep us updated!
Luke.
find quote
phunkyfish Offline
Junior Member
Posts: 47
Joined: May 2007
Reputation: 0
Post: #13
Hi,

I have the same problem with XBMCBuntu Eden. This would work perfectly if it was possible to control the delay and period in ir-keytable.

Cheers,

Ross
(This post was last modified: 2012-06-18 01:00 by phunkyfish.)
find quote
Dilligaf Online
Fan
Posts: 308
Joined: Dec 2008
Reputation: 9
Post: #14
If you run the command ir-keytable it will show you the current delay and repeat period, running ir-keytable -P 1000 -D 1000 will change the delay and repeat to 1000. I have found running the command after boot in terminal works and sticks, unfortunately if you set the P and D in a startup script such as rc.local the values don't stick and are reset to default. The strange thing is if you monitor the text on screen while booting you can see that the values are set, so they are being reset later in the process. I don't know the solution other than running the P and D commands manually, possibly running them later in the boot process will make them stick, I just don't know.

Mike

If I have been of help, please add to my reputation as a way of saying thanks.
find quote
phunkyfish Offline
Junior Member
Posts: 47
Joined: May 2007
Reputation: 0
Post: #15
I tried using the console to set the period and delay values but onscreen in XBMC I don't see them reflected. The repeating problem still exists. Should I be setting these before starting XBMC?

If I can get it working manually I should able to get it set just before XBMC starts.
find quote
FernetMenta Online
Team-XBMC Member
Posts: 1,622
Joined: Jul 2010
Reputation: 34
Location: Munich
Post: #16
I don't think you can influence the current behavior. SDL ignores key repeats generated by X11, it has its own mechanism and the parameters are hard coded as mentioned above. As we are currently phasing out SDL for X11 we can think about a parameter to make this adjustable.
find quote
phunkyfish Offline
Junior Member
Posts: 47
Joined: May 2007
Reputation: 0
Post: #17
(2012-06-18 09:19)FernetMenta Wrote:  I don't think you can influence the current behavior. SDL ignores key repeats generated by X11, it has its own mechanism and the parameters are hard coded as mentioned above. As we are currently phasing out SDL for X11 we can think about a parameter to make this adjustable.

Cool, I can wait for a future release to get this working. Thanks for filling in the blanks.
find quote
boosted Offline
Member
Posts: 61
Joined: Oct 2011
Reputation: 0
Location: New Zealand
Post: #18
I had the same problem. Have a look at http://forum.xbmc.org/printthread.php?tid=104541&page=7 Page 7
After moving to *buntu 12.04 I can just use Lirc without ir-keytable
If using debian, Lirc appears broken. I had to use the one from ubuntu with ir-keytable.
Lirc allows me to start XBMC with my remote using irexec http://www.lirc.org/html/irexec.html
find quote
brando56894 Offline
Member
Posts: 93
Joined: Jan 2010
Reputation: 0
Post: #19
I have this problem also with XBMC 11 and ir-keytable using a cheap MCE remote. It doesn't happen often but it is annoying. I'll trying using the flags mentioned for ir-keytable to see if it fixes anything. I've been trying to compile XBMC v12 but can't get it to work yet since I'm not using Ubuntu, but Arch Linux (well actually Chakra).
find quote
flopma Offline
Junior Member
Posts: 12
Joined: Jan 2010
Reputation: 0
Post: #20
Bug report created

http://bugzilla.libsdl.org/show_bug.cgi?id=1538

http://trac.xbmc.org/ticket/13157

A workaround is to search for calls to method SDL_EnableKeyRepeat in XBMC source code and increase the value of the interval.
find quote
Post Reply