Sublime Forum

Cursor movement jerky under Xinerama on Ubuntu

#1

When I hold down the cursor keys to move left or right, as soon as the keyboard repeat kicks in the cursor will move 4-6 characters at a time, rather than character by character. Similarly, if I hold the up and down keys, the cursor (and the highlighting) will jump several lines at a time, not just one.

Things are fine when I turn off Xinerama. However it’s not necessarily an upstream (Xinerama/X11) bug, since it only happens in sublime, not in [x]emacs, gedit, bluefish, geany, or openoffice.
Seems like the keyboard gets ahead of the screen refresh. Is there any way to make this a synchronous operation, even if that means the cursor will move more slowly under Xinerama?

Specs:
Sublime Build 2051 on Ubuntu 10.04
3 monitors, 2 NVIDIA cards (8400 GS and 9600 GSO), nvidia binary driver 270.18
Xinerama on, TwinView off (TwinView conflicts with Xinerama afaik)
Athlon 3800+ Dual Core, 3 GB RAM

Ideas anyone?

0 Likes

#2

Did a little bit more digging. The issue is linked to having 3 monitors across two graphics cards. If I disable the monitor that has its own card then the cursor movements are not jerky, even with Xinerama enabled.

I am out of my depth here and not sure what causes it, one hypthesis is that Sublime might use opengl damage events, and these are disabled in multi-GPU setups with the NVidia driver.

Thoughts anyone?

From the NVidia documentation:

[quote]Option “DamageEvents” “boolean”

Use OS-level events to efficiently notify X when a client has performed direct rendering to a window that needs to be composited. This will significantly improve performance and interactivity when using GLX applications with a composite manager running. It will also affect applications using GLX when rotation is enabled. This option is currently incompatible with SLI and Multi-GPU modes and will be disabled if either are used. Enabled by default.

[/quote]

Here are the libraries that sublime is using on my machine

[quote]ldd sublime_text
linux-gate.so.1 => (0xb7839000)
libgtk-x11-2.0.so.0 => /usr/lib/libgtk-x11-2.0.so.0 (0xb744f000)
libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0xb73b9000)
libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0xb739c000)
libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0xb72fe000)
libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0xb72d7000)
libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0xb72cb000)
libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0xb72b1000)
libcairo.so.2 => /usr/lib/libcairo.so.2 (0xb7236000)
libpng12.so.0 => /lib/libpng12.so.0 (0xb7211000)
libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0xb71ce000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb7158000)
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0xb7128000)
libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb70e8000)
libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb70e3000)
libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb70dd000)
librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0xb70d4000)
libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0xb700a000)
libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb6ff0000)
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb6fec000)
libutil.so.1 => /lib/tls/i686/cmov/libutil.so.1 (0xb6fe8000)
libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb6fc2000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb6ecc000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6eac000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb6d52000)
libX11.so.6 => /usr/lib/libX11.so.6 (0xb6c35000)
libz.so.1 => /lib/libz.so.1 (0xb6c20000)
libXext.so.6 => /usr/lib/libXext.so.6 (0xb6c10000)
libXrender.so.1 => /usr/lib/libXrender.so.1 (0xb6c06000)
libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0xb6c01000)
libXi.so.6 => /usr/lib/libXi.so.6 (0xb6bf3000)
libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0xb6beb000)
libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0xb6be1000)
libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0xb6bdd000)
libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0xb6bd8000)
libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0xb6bd2000)
libpcre.so.3 => /lib/libpcre.so.3 (0xb6ba1000)
libresolv.so.2 => /lib/tls/i686/cmov/libresolv.so.2 (0xb6b8d000)
libselinux.so.1 => /lib/libselinux.so.1 (0xb6b72000)
libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0xb6b17000)
libdirectfb-1.2.so.0 => /usr/lib/libdirectfb-1.2.so.0 (0xb6aa0000)
libfusion-1.2.so.0 => /usr/lib/libfusion-1.2.so.0 (0xb6a96000)
libdirect-1.2.so.0 => /usr/lib/libdirect-1.2.so.0 (0xb6a80000)
libxcb-render-util.so.0 => /usr/lib/libxcb-render-util.so.0 (0xb6a7b000)
libxcb-render.so.0 => /usr/lib/libxcb-render.so.0 (0xb6a72000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb6a58000)
libexpat.so.1 => /lib/libexpat.so.1 (0xb6a31000)
/lib/ld-linux.so.2 (0xb783a000)
libXau.so.6 => /usr/lib/libXau.so.6 (0xb6a2c000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb6a26000)
[/quote]

And here’s my xorg.conf:

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 270.18  (buildmeister@swio-display-x86-rhel47-07.nvidia.com)  Tue Jan 18 22:05:38 PST 2011

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 1.0  (buildd@palmer)  Sun Feb  1 20:21:04 UTC 2009
#Section "Files"
#    FontPath        "unix/:7100"
#EndSection

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 1920 0
    Screen      1  "Screen1" 3840 0
    Screen      2  "Screen2" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "type1"
    Load           "freetype"
    Load           "glx"
EndSection

Section "ServerFlags"
    Option         "Xinerama" "1"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "keyboard"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"

    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Samsung SyncMaster"
    HorizSync       30.0 - 81.0
    VertRefresh     56.0 - 75.0
    Option         "DPMS"
EndSection

Section "Monitor"

    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "Samsung SyncMaster"
    HorizSync       30.0 - 81.0
    VertRefresh     56.0 - 75.0
    Option         "DPMS"
    Option         "Rotate" "left"
    Option         "RandRRotation" "on"
EndSection

Section "Monitor"

    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor2"
    VendorName     "Unknown"
    ModelName      "Samsung SyncMaster"
    HorizSync       30.0 - 81.0
    VertRefresh     56.0 - 75.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 9600 GSO"
    BusID          "PCI:6:0:0"
    Screen          0
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 9600 GSO"
    BusID          "PCI:6:0:0"
    Screen          1
EndSection

Section "Device"
    Identifier     "Device2"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 8400 GS"
    BusID          "PCI:2:0:0"
EndSection

Section "Screen"

# Removed Option "metamodes" "DFP-1: nvidia-auto-select +0+0"
# Removed Option "metamodes" "nvidia-auto-select +0+0"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinViewXineramaInfoOrder" "DFP-1"
    Option         "TwinView" "0"
    Option         "metamodes" "DFP-0: nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"

# Removed Option "metamodes" "1600x1200 +0+0"
# Removed Option "metamodes" "nvidia-auto-select +0+0"
# Removed Option "metamodes" "DFP-1: nvidia-auto-select +0+0"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "metamodes" "DFP-1: nvidia-auto-select +0+0; DFP-1: 1600x1200 +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"

# Removed Option "metamodes" "DFP-0: nvidia-auto-select +0+0"
    Identifier     "Screen2"
    Device         "Device2"
    Monitor        "Monitor2"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "metamodes" "nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
0 Likes