DisplayLink / evdi

Extensible Virtual Display Interface
MIT License
704 stars 184 forks source link

Cursor Glitches on Gnome 3.20 and KDE Plasma #29

Closed aiudirog closed 3 years ago

aiudirog commented 8 years ago

Hi, I've been using evdi and the DisplayLink driver with my StarTech 4K USB 3.0 to HDMI adapter and I am very happy with how it works, except that have noticed that around borders for windows and widgets that the cursor will flicker and trail or will simply disappear. I did some testing as I have both Gnome and Plasma installed on Arch Linux and it happened in both. I also noticed that I was using an older version, so before commenting, I pulled down the current source and built it and installed it but the issue continued. If you would like a video, I can probably put one together.

Thank you

unfulvio commented 8 years ago

this could be a power issue - for example my display came with a usb Y cable, if I connect only 1 end of the usb cable I have got (albeit very occasionally) similar glitches as those you describe, but if I use both plugs the problem never manifests

aiudirog commented 8 years ago

That's interesting. Mine did not come with a Y cable, but I have found the issue to be very predictable on what items on my screen it will glitch over, which led me to believe it was more software than hardware. What's even more interesting is I tried to record a screen cast of it using https://extensions.gnome.org/extension/690/easyscreencast/ and the problem disappeared while I was recording and returned promptly when I stopped recording. I can video it with my phone though, just not using a screen recorder.

JumpLink commented 8 years ago

I have a similar problem, see my 2 videos for demonstration.

This issue occurs with me but do not force on the monitor plugged in with DisplayLink, but I have this issue in combination with DisplayLink only (or just with 4 Screens?)

I use the I-TEC USB 3.0 Display Video Adapter DVI with the DisplayLink DL-3500 Chipset.

This seems to be a known bug, see support.displaylink.com. Is there a solution or useful tips?

SparxySys commented 8 years ago

Put your compositor into a full-screen repainting method (meaning redraw the entire screen every frame, not just changed areas). This will fix it, but be aware that displaylink CPU time and latency may increase greatly.

displaylink-mlukaszek commented 8 years ago

We've seen this as well with KDE. This disappears if you change the compositor type to Xrender.

SparxySys commented 8 years ago

Xrender is comparatively slow for compositing as well. The issue also occurs when running without a compositor.

JumpLink commented 8 years ago

My issue seems to be resolved on Ubuntu since last Linux kernel update to version 4.4.0-28.47, can anyone confirm this?

auswahl_216

SparxySys commented 8 years ago

Still having the issue with kernel 4.4.0-28.47.

aiudirog commented 8 years ago

I'm on kernal 4.6.2-1.

@DarkSpyro003 It seems like Gnome has dropped the option when they adopted Mutter to control compositing unfortunately.

JumpLink commented 8 years ago

My issue is definitely fixed since last update, maybe from another updated package?

CPU: Intel® Core™ i7-4790K CPU @ 4.00GHz × 8 GPU: Intel® Haswell Desktop OS: Ubuntu 16.04 LTS 64-Bit

dpkg -l gnome-shell
gnome-shell 3.20.2-1ubuntu1~xenia amd64

I use the GNOME3 Staging PPA.

What happens if you run this command?

sync
SparxySys commented 8 years ago

@JumpLink the command doesn't seem to do anything. Possibly the gnome compositor or compositor settings changed to do repaints differently in the staging version? Is the issue resolved for you on other desktop environments as well?

SparxySys commented 8 years ago

Note that I'm seeing this issue in XFCE as well, not just KDE and Gnome.

aiudirog commented 8 years ago

@JumpLink I am actually on the same Gnome version you updated to (albeit on Arch and not Ubuntu) and have been since it came out in May. Is there any chance when it upgraded you were switched over to Wayland? I noticed that the option to choose "Gnome on Wayland" from the gdm lock screen disappeared this version and I am still using X11, but maybe you were forced to change? I currently have an update waiting for Gnome 3.20.3 so I'll run a full upgrade and see if anything changes.

I have done some work with graphics drivers and I noticed that the code here implements custom cursor functionality. Does anyone know if replacing it with the stock DRM functionality would break anything, just for testing purposes?

Edit: Upgrade to Gnome 3.20.3 didn't change anything, however a kernel upgrade to 4.6.3 caused evdi 1.1.65 to fail to build:

make -C /lib/modules/4.6.3-1-ARCH/build M=$PWD
make[1]: Entering directory '/usr/lib/modules/4.6.3-1-ARCH/build'
  LD      /usr/src/evdi-1.1.65/built-in.o
  CC [M]  /usr/src/evdi-1.1.65/evdi_drv.o
  CC [M]  /usr/src/evdi-1.1.65/evdi_modeset.o
  CC [M]  /usr/src/evdi-1.1.65/evdi_connector.o
  CC [M]  /usr/src/evdi-1.1.65/evdi_encoder.o
  CC [M]  /usr/src/evdi-1.1.65/evdi_main.o
/usr/src/evdi-1.1.65/evdi_main.c: In function ‘evdi_driver_unload’:
/usr/src/evdi-1.1.65/evdi_main.c:85:3: error: implicit declaration of function ‘drm_connector_unregister_all’ [-Werror=implicit-function-declaration]
   drm_connector_unregister_all(dev);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:292: /usr/src/evdi-1.1.65/evdi_main.o] Error 1
make[1]: *** [Makefile:1429: _module_/usr/src/evdi-1.1.65] Error 2
make[1]: Leaving directory '/usr/lib/modules/4.6.3-1-ARCH/build'
make: *** [Makefile:55: module] Error 2

1.1.62 currently is running fine, as I didn't remove it when I upgraded.

Edit 2: Apparently, that function has not actually been defined yet in 4.6.3. I'm going to up the kernel version requirement and see what happens.

aiudirog commented 8 years ago

Sorry for double posting, I tried editing my last comment a few times and got an undefined error.

I found that the preprocessor checks to change functions for kernel versions greater than 4.6 prevented me from compiling as drm_connector_unregister_all() doesn't exist yet in 4.6 and drm_gem_object_lookup() hasn't been updated to the new version. Not sure why this is the case, but I had to up the version checks to 4.7 to get it to compile. I'm assuming that when I upgraded from 4.5 to 4.6 that I wasn't paying attention to the fact that evdi 1.6.5 wasn't compiling so dkms just used the older version that was installed instead. Its easy to miss when pacman is scrolling through with lots of updates.

After that, I removed all of the cursor callbacks to see if that would affect anything (since they are optional anyways, as stated in drm_crtc.h). None of these changes did.

Maybe the issue is actually in the user space DisplayLink service?

displaylink-mlukaszek commented 8 years ago

@aiudirog fixes for 4.6 and 4.7 kernels are now pushed to devel branch. You could recompile the module and the library, the libevdi API has not changed so no change is required in DisplayLinkManager.

aiudirog commented 8 years ago

@displaylink-mlukaszek The master branch compiles now that I am on kernel 4.7.0, but I will download the devel branch and see if anything else changes. As of right now, the cursor issue only seems to affect monitors that aren't over USB while the USB adapter is plugged in. I have a built-in, HDMI, and USB-HDMI display right now and I just tried every single combination of on-off of all of them and it only occurs when the USB-HDMI is plugged in with one or both of the other devices and only on those devices.

Currently I am running the driver via the Arch Wiki instructions using xrandr --setprovideroutputsource [# for modesetting, typically 1] [# for intel, typically 0]. Is this the correct?

Update: devel branch is the same in terms of cursor issue.

displaylink-mlukaszek commented 8 years ago

A blinking cursor on multi-monitor setup is unfortunately a generic problem, and there are multiple reports of this in the web. E.g. here, here or here.

The repaints not being correct with different compositors is interesting. I'd be keen to see what are the exact rectangles evdi is being told as requiring refresh - as essentially they will be propagated from kernel to userspace, and devices will update screens accordingly. Could someone check if equivalent screen corruptions appear on a multi-screen setup directly attached to built-in GPUs?

mathansen commented 8 years ago

I am experiencing this problem on my Dell Precision 5510 using the built-in Intel GPU (listed by lspci as HD Graphics P530). The discrete Nvidia GPU is disabled. The flickering does not occur when I attach a screen using HDMI, however I can only attach one screen this way. Is there anything I can do to help? I would be willing to buy a thunderbolt adapter to test if the problem occurs there as well. Are there any dual-HDMI thunderbolt adapters out there?

nekromoff commented 7 years ago

happening to me as well, display response time slow, cursor "tearing"

4.7.0-040700-generic #201607241632 SMP Sun Jul 24 20:34:30 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Description: Ubuntu 16.04.1 LTS evdi 40960 2 drm_kms_helper 147456 2 i915,evdi drm 364544 11 i915,evdi,drm_kms_helper Bus 002 Device 013: ID 17e9:4307 DisplayLink

carbinefreak commented 7 years ago

Same issue here with kernel 4.8 and KDE plasma 5.8 on latest evdi and binary running gentoo x64. After removing the evdi module all screen painting issues are resolved so there is a nasty bug hiding in the latest release it appears.....

perk11 commented 7 years ago

I'm also experiencing this on KDE Plasma 5.9.1, kernel 4.4. Setting Tearing prevention ("vsync") option to "Full screen repaints" fixes it.

nekromoff commented 7 years ago

I can confirm that fixes it. However slow cursor repaint still happens.

On Thu, Oct 13, 2016 at 11:27 AM, Konstantin Pereiaslov < notifications@github.com> wrote:

I'm also experiencing this on KDE Plasma 5.9.1. Setting Tearing prevention ("vsync") option to "Full screen repaints" fixes it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/DisplayLink/evdi/issues/29#issuecomment-253462317, or mute the thread https://github.com/notifications/unsubscribe-auth/AIJ3zXhCwNrK4augXmQaFA5oc2HviD6Aks5qzfmAgaJpZM4I-nu0 .

displaylink-mlukaszek commented 7 years ago

Recent 1.3 release of Ubuntu driver for DisplayLink devices uses the freshest evdi and has fixes for corruptions in KDE - you should no longer require full screen repaints. Please test and report back - thanks.

perk11 commented 7 years ago

Unfortunately I can't check this because of having this more serious issue http://displaylink.org/forum/showthread.php?t=64952

majgis commented 7 years ago

Ubuntu 17.04 Gnome 3.24 Intel® HD Graphics 630 (Kaby Lake GT2) Dell Precision 5520

I added /usr/share/X11/xorg.conf.d/20-intel.conf as described in #85 which got DisplayLink device working but I was experiencing cursor glitches.

I removed Option "TearFree" "true" from /usr/share/X11/xorg.conf.d/20-intel.conf and no more cursor glitches!

displaylink-dkurek commented 6 years ago

Does anyone still see this problem with the latest software? There has been quiet for some time so hopefully, we had got rid of those glitches :)

majgis commented 6 years ago

I'm upgraded to Ubuntu 18.04. I restored the 20-intel.conf file as I described above, but the trailing mouse pointer issue remains.

ghost commented 6 years ago

I also have a flickering mouse cursor. i-tec dvi USB 3.0 display adapter.

majgis commented 6 years ago

Success! I removed /usr/share/X11/xorg.conf.d/20-intel.conf and added the following:

$ cat /usr/share/X11/xorg.conf.d/20-displaylink.conf
Section "Device"
  Identifier "DisplayLink"
  Driver "modesetting"
EndSection 

Reference: https://support.displaylink.com/knowledgebase/articles/1181623-displaylink-ubuntu-driver-after-recent-x-upgrades

Also, it only worked with the Option "PageFlip" "false" line removed.

Kostanos commented 6 years ago

I'm not sure if my issue is the same or I need to open another thread. I have also problems with mouse cursor right after I install DisplayLink drivers. Tried both latest versions 4.1 and 4.2, the same results. Ubuntu 16.04, all latest updates.

I uploaded the video with behavior of cursor: https://youtu.be/vVwa-cVU_cA Tried solution above, it doesn't change anything.

PS. screens itself works well.

trxcllnt commented 5 years ago

@Kostanos in case you never found a fix, adding a new mode to xrandr as described here worked for me: https://wiki.archlinux.org/index.php/DisplayLink#Screen_redraw_is_broken. I also had to configure the driver to load both monitors on boot, as described here: https://support.displaylink.com/knowledgebase/articles/1883074-ubuntu-16-04-x-server-starts-in-low-graphics-mode

I used the excellent displaylink-debian installer to auto configure X11 for the displaylink devices, but was seeing the same cursor redraw issues as you connecting my System76 Bonobo WS to my Acer XR382CQK displays. Hope this helps!

Kostanos commented 5 years ago

Thank you @trxcllnt I'm in doubt which monitor resolution and refresh rate should I use with gtf command. As in my case I have two monitors connected. and both of them including the notebook's monitor itself has this issue.

bonanza123 commented 5 years ago

@trxcllnt thanks for the links. However, for me (single external monitor), none of the provided workarounds seem to work on Archlinux (evdi-pre-release) with Plasma (intel graphics and OpenGL3 set in compositor [Xrender compositor works fine but its performance is horrible])

noraj commented 5 years ago

No matter the workaround I tired /usr/share/X11/xorg.conf.d I still get glitches with upstream and LTS kernel of Archlinux, the only workaround that worked was setting the Compositor to XRender instead of OpenGL.

trxcllnt commented 5 years ago

@Kostanos ah yeah my monitors have a way of displaying the refresh rate as an overlay, so I used that to figure out the exact specs.

@bonanza123 I can't speak to the efficacy with Intel graphics, I've got NVidia cards in this laptop. I should also mention that while my steps did get it working for a while, the monitors would go black about once per hour for a few seconds, and occasionally refuse to turn back on without a reboot. This was frustrating enough that I rearranged my desk and went back to using DisplayPort cables.

Kostanos commented 5 years ago

@trxcllnt I think, I've used displaylink-installer up on your recommendation, and it works well. fortunately I don't have any issue with monitores/adapter since I used it. I also have added /usr/share/X11/xorg.conf.d/20-displaylink.conf file as per @majgis recommendation, but is has small difference, and, I think displaylink-installer added one more: 21-displaylink.conf which has exactly the same content:

Section "Device"
  Identifier "DisplayLink"
  Driver "modesetting"
  Option "PageFlip" "false"
EndSection

My monitors works well since that.

My notebook is: Lenovo Ideapad 720s with Nvidia GTX 1050i, has dual-boot Ubuntu 16.04 and Windows 10 - great notebook. Yes, I found the issue on Windows when I playing Fortnite, I get some lags if I have display link connected (start to happen after some updates), so, for now, I disconnect it when I'm playing.

My displaylink adapter is WavLink USB-C Dual 4K Ultra Dock DP Gen1 - very good one, recommended.

@trxcllnt about the monitors going black, happened to me with one, I found that changing the HDMI cable to new one resolved the issue completely. It is hard to believe, but cable actually plays a big role on this.

kowalcj0 commented 5 years ago

@Kostanos I had exactly the same issue as you described earlier:

I uploaded the video with behavior of cursor: https://youtu.be/vVwa-cVU_cA Tried solution above, it doesn't change anything.

your last solution worked like a charm! Thank you for it!

My setup is:

AsiaHenzel commented 5 years ago

@Kostanos I also had a problem with the flickering mouse cursor and your solution worked for me!

My setup:

I found this solution mentioned here: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1724307?comments=all.

ghost commented 4 years ago

@Kostanos Thanks for your file, I have an Nvidia GTX960M, an intergrated graphic card i7 6700HQ and Displaylink (ASUS screen MB14AC) Lenovo Ideapad Y700 https://www.lenovo.com/us/en/laptops/ideapad/ideapad-y700-series/Ideapad-Y700-15/p/88IPY700618 After a tiny hack. My cursor glitches are fixed!

Section "Device"
    Identifier "DisplayLink"
    #Driver "modesetting" I commented out this line. See below
    Option "PageFlip" "false"
EndSection

Sorry, I cannot make sure my statements are 100% correct, but what I can confirm is my DisplayLink is currently working together with the proprietary Nvidia driver (https://github.com/DisplayLink/evdi/issues/2)

I have a GTX960M GPU which does not support directly render to the primary screen (maybe?) This is my xrander --blabla output

╰─➤  xrandr --listmonitors
Monitors: 2
0: +*eDP-1-1 1920/344x1080/194+0+0  eDP-1-1
1: +DVI-I-2-1 1920/344x1080/194+1920+0  DVI-I-2-1

╰─➤  xrandr --listproviders
Providers: number : 3
Provider 0: id: 0x269 cap: 0x1, Source Output crtcs: 0 outputs: 0 associated providers: 2 name:NVIDIA-0
Provider 1: id: 0xc8 cap: 0x2, Sink Output crtcs: 1 outputs: 1 associated providers: 1 name:modesetting
Provider 2: id: 0x44 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 1 name:modesetting

NOTE: Provider0: Nvidia Provider1: Displaylink Provider2: Intel (Maybe?)

I have a line in /usr/share/sddm/scripts/Xsetup which seems allowing GPU to render directly and put it to the screen.

╰─➤  cat /usr/share/sddm/scripts/Xsetup
#!/bin/sh
xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto

OS: Arch Linux

uname -a : Linux MYLAPTOPNAME 5.3.11-arch1-1 #1 SMP PREEMPT Tue, 12 Nov 2019 22:19:48 +0000 x86_64 GNU/Linux
plasmashell 5.17.3

It makes the DisplayLink compatible with the Nvidia proprietary driver? I'm not a pro in X Server so I may provide anything if necessary.

stheid commented 4 years ago

Issue still persists (random disconnect, flickering cursor)

Device: Dell Dockingstation D6000

gnome: 3.34.3 compositor: x11

os: ArchLinux (Manjaro) kernel: 5.4.18 evdi: 1.6.4 GPU: Intel UHD 630

$> cat /usr/share/X11/xorg.conf.d/20-evdidevice.conf 
Section "Device"
    Identifier "Intel Graphics"
    Driver "intel"
EndSection

Workaround disconnect

win+p to toggle to "internal only" and than again back to "join displays". This will have the same effect as replugging the display to the dockingstation

mauromol commented 4 years ago

Just installed DisplayLink driver 5.2 on Linux Mint KDE 18.3 (based on Ubuntu 16.04). Seeing ghost tracks on the mouse pointer. Workarounds found, already mentioned: set vsync to "full screen repaints", or use XRender rendering engine instead of OpenGL 2.x/3.x. Using an i-Tec USB 3.0 docking station.

0k00l commented 4 years ago

In KDE Plasma disabling Tering preventions("vsync") fixed issue for me. I've setted its value to Never

Settings --> Display and Monitor --> Compositor

Edit: but is doesn't resolve it fully. Some glitches still remains.

BarbecueSilver commented 4 years ago

@0k00l This made it run a lot faster too! :)

mauromol commented 4 years ago

In my case, setting vsync to never does not solve the problem at all... The only setting that works in my case is "full screen repaints" with KDE. Any words from DisplayLink? Back in 2017 they said that "Recent 1.3 release of Ubuntu driver for DisplayLink devices uses the freshest evdi and has fixes for corruptions in KDE - you should no longer require full screen repaints.", however I'm using 5.2 driver and still has that exact same problem under Linux Mint 18.3 (based on Ubuntu 16.04).

0k00l commented 4 years ago

In my case, setting vsync to never does not solve the problem at all... The only setting that works in my case is "full screen repaints" with KDE. Any words from DisplayLink? Back in 2017 they said that "Recent 1.3 release of Ubuntu driver for DisplayLink devices uses the freshest evdi and has fixes for corruptions in KDE - you should no longer require full screen repaints.", however I'm using 5.2 driver and still has that exact same problem under Linux Mint 18.3 (based on Ubuntu 16.04).

I have intel GPU what you have ?

mauromol commented 4 years ago

I have intel GPU what you have ?

Me too. Haswell i5-4200M, no external graphics card.

Adrian-Benavente commented 4 years ago

In KDE Plasma I solved it by setting the "Tearing Prevention vsync" option to "Never"

thopiekar commented 4 years ago

Also works without any modifications. Just make sure load evdi early from initramfs and set initial devices to 4 as recommended in DisplayLink's post. Also make sure you add a xorg.conf with FlipPage false, etc.

Works nicely :)

Adrian-Benavente commented 3 years ago

@thopiekar I have no idea how to do that neither I know what post are you talking about, can you explain me?

displaylink-emajewsk commented 3 years ago

Closing this old bug. There have been many improvements in X11 over the years. We'll verify it on our end. Please create a new issue if the problem resurfaces. Thanks!