#7 x11vnc: keystrokes repeating

closed
Karl J. Runge
None
5
2004-09-16
2004-04-10
David Grossberg
No

I am using recent CVS versions of libvncserver and
specifically x11vnc on my Linux computer (SuSE 9) and
recently it has become very unusable because most
keystrokes are repeating, often a dozen or two times.

Here is my commandline:

x11vnc -rfbauth [path] -nap -rfbport [port] -desktop
DavidTest -display :0.0 -modtweak -alwaysshared
-dontdisconnect -shared -forever

I can't test threading because then it fails to connect
at all (from Windows TightVNC 1.2.9 anyway)

Discussion

  • Karl J. Runge
    Karl J. Runge
    2004-04-20

    Logged In: YES
    user_id=219571

    Hi David, Could you provide some more information:

    does an older version of libvncserver+x11vnc not show
    the problem on your current setup?

    what happens if you tap a single character extremely
    quickly?

    What does 'xset q' say your autorepeat, etc
    settings are?

    Has anything recently changed in your setup? (e.g.
    update X server, libraries, etc)

    Is there any repeating if you do not supply
    '-modtweak'?

    I saw keystroke repeating problems with x11vnc on a Sun box,
    it turned out the keyrepeat setting in the server was too low
    '-ar1 ...' I had to disable it. Doubt this is your problem on
    SuSE, though.. but could be something close.

     
  • Logged In: YES
    user_id=443104

    I have not yet had a chance to test an old version, I've
    been at home, and I only have the one computer - and the
    problem would likely not show up on a LAN anyway: I forgot
    to mention this, but it was a lot worse when the client was
    on a form of dial-up then from a client on DSL.

    Tapping as fast as possible makes no difference

    xset q
    auto repeat: on key click percent: 0 LED mask:
    00000002
    auto repeat delay: 250 repeat rate: 30
    auto repeating keys: 00ffffffdffffbbf
    fadfffdfffdfe56f
    ffffffffffffffff
    ffffffffffffffff
    etc. I like the repeat setting when I'm using the computer
    locally (which I usually am)

    I did upgrade to KDE 3.2.1 on March 22nd, which I just
    noticed is near when the problem began. Hmm.

    when I didn't include -modtweak I wasn't able to type a '>'
    (or was it a '<'?) but next time I get a chance I'll try it
    without that.

     
  • Karl J. Runge
    Karl J. Runge
    2004-04-20

    Logged In: YES
    user_id=219571

    > problem would likely not show up on a LAN anyway: I forgot
    > to mention this, but it was a lot worse when the client was
    > on a form of dial-up then from a client on DSL.
    >
    > Tapping as fast as possible makes no difference

    OK. BTW, with respect to 'xset q' I think I forgot to say
    the value for where the VNC viewer runs might be the more
    important one (if it is not Unix, then whatever shows the
    keyrepeat settings).

    But since you say tapping once very quickly makes no
    difference, the problem is likely somewhere else.

    > I did upgrade to KDE 3.2.1 on March 22nd, which I just
    > noticed is near when the problem began. Hmm.

    Could be somehow... Another thing to check is if the
    problem occurs running no desktop just a simple window
    manager like twm and see if the problem is still there.
    I found some very weird behavior with KDE and the clipboard
    a few months ago, nothing with keyboard though...

    > when I didn't include -modtweak I wasn't able to type a '>'
    > (or was it a '<'?) but next time I get a chance I'll try it

    Yes next time please try w/o -modtweak and see what happens.

    Also use the new -debug_keyboard option. Should show every
    event with timestamps and additional details to help trace
    down what is going on.

    BTW, see: http://www.karlrunge.com/x11vnc/#FAQ-25 for a
    number of workarounds to the '>' and '<' problem.

     
    • assigned_to: nobody --> runge
     
  • Karl J. Runge
    Karl J. Runge
    2004-07-09

    Logged In: YES
    user_id=219571

    We think we may have a better understanding now of what may
    be causing
    the repeating keystrokes.

    When x11vnc receives a key-down event it passes the event it
    to the X
    server via XTEST. Some time may pass, 100's of ms say, due
    to network
    latency or screen framebuffer processing or both, before it
    processes the
    corresponding key-up event. If the time between those two
    key events
    is greater than the X server's auto repeat delay, the X
    server thinks
    the key is held down and sends repeats to the X application(s).

    You can see what your X server's setting is by running "xset
    q" and
    looking for "auto repeat delay". From your previous comment
    it is 250ms
    which is close to the latency of a dialup line.

    Try setting the delay to a very large value by "xset r rate
    1500" and
    see if the problem goes away.

     
  • Logged In: YES
    user_id=443104

    Yeah, Sorry I forgot to post an update to this, I have been
    doing a lot of upgrades recently and it got lost in the
    shuffle.

    I too discovered that setting the key repeat delay high on
    the server is an effective workaround, I had it set at the
    maximum my distro's control panel can do: 1000 ms, and that
    was effective Most of the time (a cell-phone modem can have
    latencies higher then that - also higher then 1500ms
    occasionally)

    So I wonder, is there anything that can be done about this
    to actually fix the problem short of a new protocol?
    Does the client include a timestamp that the server could
    use to determine if a key should repeat (by maybe not
    setting the key down in X until another key related packet
    is received or a much longer-then-repeat-delay timer expires)

     
  • Karl J. Runge
    Karl J. Runge
    2004-07-11

    Logged In: YES
    user_id=219571

    Glad to see adjusting the repeat delay works around your
    problem.

    I too have tested x11vnc over a cell phone (14.4 and 1-1.5 sec
    latency). I didn't think I would meet someone else who did
    this :-)

    We are looking into a good way to solve this, it may be possible
    with better monitoring inside x11vnc, or it may require some
    extensions to the libvncserver API to better monitor events.

    In the meantime I just commited to the CVS this new option to
    make the workaround more convenient:

    -norepeat:

    Disable X server key auto repeat when clients are
    connected. This works around the repeating keystrokes
    bug (triggered by long processing delays between key
    down and key up client events: either from large screen
    changes or high latency). Note: your VNC viewer side
    will likely do autorepeating, so this is no loss unless
    someone is simultaneously at the real X display.

    It is important to realize autorepeating will be done on your
    VNC VIEWER side, so it is not a big deal to shut off autorepeat
    on the remote X server (unless someone is there). Xvnc
    (i.e. vncserver) seems to do this too.

    HTH. Please try it if you get the chance.

     
  • Logged In: YES
    user_id=443104

    The -norepeat option works great: I can even use the page up
    and down keys remotely! (they were among the worst
    offenders, I had forgotten to mention that - must be that
    the server failed to notice the key-up while sending the
    massive screen update)

    and the viewer side repeating is functional as described.

     
  • Karl J. Runge
    Karl J. Runge
    2004-09-16

    • status: open --> closed
     
  • Karl J. Runge
    Karl J. Runge
    2004-09-16

    Logged In: YES
    user_id=219571

    Marking this bug closed because -norepeat seems an acceptable
    workaround. After more testing I'll make -norepeat the default
    (if it didn't modify the X server state I'd have it be the
    default immediately)