DisplayLink / evdi

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

DisplayLink not showing up with xrandr --listproviders #204

Closed Luc45 closed 4 years ago

Luc45 commented 4 years ago

tl;dr

My monitor connected through my DisplayLink device is not recognized anymore (as if it wasn't connected) after an evdi update (1.6.4-2 that came with Manjaro to 1.7.0-1). . I suspect the root cause is that DisplayLink does not show up as a xrandr provider when I run xrandr --list-providers. I would like to know how can I further debug and fix this.

Full story

I can see that the USB device is recognized. When booting in Windows the monitor works, so it's not a faulty hardware or a loose cable.

lsusb -d 17e9:
Bus 001 Device 004: ID 17e9:037a DisplayLink Plugable UGA-165

The DisplayLink service is enabled and started:

sudo systemctl status displaylink.service
[sudo] password for lucas: 
● displaylink.service - DisplayLink Manager Service
     Loaded: loaded (/usr/lib/systemd/system/displaylink.service; enabled; vendor preset: disabled)
     Active: active (running) since Wed 2020-05-13 13:38:19 -03; 10min ago
    Process: 978 ExecStartPre=/sbin/modprobe evdi (code=exited, status=0/SUCCESS)
   Main PID: 979 (DisplayLinkMana)
      Tasks: 7 (limit: 19117)
     Memory: 7.1M
     CGroup: /system.slice/displaylink.service
             └─979 /usr/lib/displaylink/DisplayLinkManager

mai 13 13:38:19 lucas-gl502vs systemd[1]: Starting DisplayLink Manager Service...
mai 13 13:38:19 lucas-gl502vs systemd[1]: Started DisplayLink Manager Service.

I'm using NVidia Proprietary drivers. When I run xrandr --listproviders I don't see the DisplayLink device there:

xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x1b8 cap: 0x1, Source Output crtcs: 4 outputs: 4 associated providers: 0 name:NVIDIA-0

I can see that I have udl module loaded and udlfb is blacklisted:

➜  lsmod | grep udlfb   
➜  lsmod | grep udl  
udl                    24576  0
drm_kms_helper        245760  4 udl,evdi,nvidia_drm
drm                   569344  11 udl,drm_kms_helper,evdi,nvidia_drm

I'm using evdi 1.7.0 and DisplayLink 5.2.14-1:

cat /sys/devices/evdi/version                                                     
1.7.0
sudo pacman -Q --info displaylink         
Name            : displaylink
Version         : 5.2.14-1
Description     : Linux driver for DL-6xxx, DL-5xxx, DL-41xx and DL-3x00
Architecture    : x86_64
URL             : http://www.displaylink.com/downloads/ubuntu.php
Licenses        : custom  GPL2  LGPL2.1
Groups          : None
Provides        : None
Depends On      : evdi>=1.5.0  libusb>=1.0.0
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 10.68 MiB
Packager        : Unknown Packager
Build Date      : qua 13 mai 2020 00:27:51
Install Date    : qua 13 mai 2020 00:27:58
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : None

I see evdi loaded in DKMS for my current kernel version:

dkms status
evdi, 1.7.0, 5.4.39-1-MANJARO, x86_64: installed
evdi, 1.7.0, 5.6.11-1-MANJARO, x86_64: installed
evdi, 1.7.0, 5.7.0-1-MANJARO, x86_64: installed
uname -r
5.6.11-1-MANJARO

I have this file in xorg.conf.d:

cat /usr/share/X11/xorg.conf.d/20-evdidevice.conf
Section "OutputClass"
        Identifier "DisplayLink"
        MatchDriver "evdi"
        Driver "modesetting"
        Option  "AccelMethod" "none"
EndSection

Any ideas on how to further debug this? Thanks!

elguero commented 4 years ago

@Luc45 Just commented on the other issue. You need the DisplayLink 5.3.1 driver if you have installed evdi 1.7.0.

Luc45 commented 4 years ago

@elguero that's interesting, thanks. DisplayLink 5.3.1 is not available on Arch Linux, yet, so I'll try to compile the module from sources. I never did that before. What I did so far was:

➜  evdi git:(01e246f) make     
CFLAGS="-Werror -Wextra -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-error=missing-field-initializers" make -C module 
make[1]: Entering directory '/home/lucas/Downloads/evdi/module'
make -C /lib/modules/5.6.11-1-MANJARO/build M=$PWD
make[2]: Entering directory '/usr/lib/modules/5.6.11-1-MANJARO/build'
  AR      /home/lucas/Downloads/evdi/module/built-in.a
  CC [M]  /home/lucas/Downloads/evdi/module/evdi_drv.o
  CC [M]  /home/lucas/Downloads/evdi/module/evdi_modeset.o
  CC [M]  /home/lucas/Downloads/evdi/module/evdi_connector.o
  CC [M]  /home/lucas/Downloads/evdi/module/evdi_encoder.o
  CC [M]  /home/lucas/Downloads/evdi/module/evdi_main.o
  CC [M]  /home/lucas/Downloads/evdi/module/evdi_fb.o
  CC [M]  /home/lucas/Downloads/evdi/module/evdi_gem.o
  CC [M]  /home/lucas/Downloads/evdi/module/evdi_painter.o
  CC [M]  /home/lucas/Downloads/evdi/module/evdi_params.o
  CC [M]  /home/lucas/Downloads/evdi/module/evdi_cursor.o
  CC [M]  /home/lucas/Downloads/evdi/module/evdi_debug.o
  CC [M]  /home/lucas/Downloads/evdi/module/evdi_ioc32.o
  LD [M]  /home/lucas/Downloads/evdi/module/evdi.o
  MODPOST 1 modules
  CC [M]  /home/lucas/Downloads/evdi/module/evdi.mod.o
  LD [M]  /home/lucas/Downloads/evdi/module/evdi.ko
make[2]: Leaving directory '/usr/lib/modules/5.6.11-1-MANJARO/build'
make[1]: Leaving directory '/home/lucas/Downloads/evdi/module'
CFLAGS="-I../module -Werror -Wextra -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-error=missing-field-initializers " make -C library 
make[1]: Entering directory '/home/lucas/Downloads/evdi/library'
cc -I../module -std=gnu99 -fPIC -I../module -Werror -Wextra -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-error=missing-field-initializers    -c -o evdi_lib.o evdi_lib.c
cc evdi_lib.o -shared -Wl,-soname,libevdi.so.0 -o libevdi.so.1.6.4 -lc -lgcc 
cp libevdi.so.1.6.4 libevdi.so
make[1]: Leaving directory '/home/lucas/Downloads/evdi/library'

And I've stopped there to write this because I really don't know what I'm doing. Should I run dkms install {evdi_folder} instead of make?

elguero commented 4 years ago

I am not familiar enough with Manjaro. My suggestion would be to look at how the current packages are installed.

Here is what is done to install evdi on Manjaro: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=evdi-git

I see some comments from people that have been able to install evdi-git and DisplayLink 5.3.1 on Manjaro. Looks like some step by step instructions are here in the comments: https://aur.archlinux.org/packages/evdi-git/

Someone has provided a patch for getting DisplayLink 5.3.1 packaged up. https://aur.archlinux.org/packages/displaylink/

If you want to build your own package: https://wiki.archlinux.org/index.php/PKGBUILD https://wiki.archlinux.org/index.php/Creating_packages

Hope this helps. Someone more knowledgeable can chime in and help. I just wanted to help point you in the right direction in regards to the combination you need to have for DisplayLink to work.

Luc45 commented 4 years ago

Ok. I could compile it with:

git clone git@github.com:DisplayLink/evdi.git
cd evdi/module && make && cd -
sudo cp evdi/module /usr/src/evdi-1.6.4
sudo dkms add -m evdi -v 1.6.4
sudo dkms build -m evdi -v 1.6.4
sudo dkms install -m evdi -v 1.6.4 

Now when I run dkms status I see EVDI 1.6.4 loaded in my 5.6.11-1 module:

dkms status
evdi, 1.6.4, 5.6.11-1-MANJARO, x86_64: installed (original_module exists)

Now, I'm trying to figure out how I'm going to install DisplayLink 5.2.14-1, since in Arch it depends on evdi >= 1.5.0 which resolves to 1.7.0-1 again, so I can't use the Arch one and will probably have to compile it, too. Before I try to go that route I'll just reboot and see if with just EVDI it works. Who knows

PS: Just saw your message. Thanks for pointing those resources. I'll read them if need be.

Luc45 commented 4 years ago

@elguero I appreciate your help but using evdi 1.6.4 and DisplayLink 5.2.14-1 still didn't solve it.

➜  ~ sudo pacman -Q --info displaylink    
Name            : displaylink
Version         : 5.2.14-1
Description     : Linux driver for DL-6xxx, DL-5xxx, DL-41xx and DL-3x00
Architecture    : x86_64
URL             : http://www.displaylink.com/downloads/ubuntu.php
Licenses        : custom  GPL2  LGPL2.1
Groups          : None
Provides        : None
Depends On      : libusb>=1.0.0
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 10.68 MiB
Packager        : Unknown Packager
Build Date      : qua 13 mai 2020 15:50:38
Install Date    : qua 13 mai 2020 15:51:00
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : None

➜  ~ cat /sys/devices/evdi/version  
1.6.4
➜  ~ dkms status
evdi, 1.6.4, 5.6.11-1-MANJARO, x86_64: installed (original_module exists)
➜  ~ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x1b8 cap: 0x1, Source Output crtcs: 4 outputs: 4 associated providers: 0 name:NVIDIA-0

I will probably try the fix on the links you suggested to use DisplayLink 5.3~ and evdi 1.7~. Phew...

Luc45 commented 4 years ago

I've installed DisplayLink 5.3~ and evdi 1.7~ following the instructions from this comment https://aur.archlinux.org/packages/displaylink/#comment-744236 but it's still not working.

Also did the same with DisplayLink 5.3 and the latest version of EVDI cloned from this repo.

➜  ~ sudo pacman -Q --info displaylink    
[sudo] password for lucas: 
Name            : displaylink
Version         : 5.3.1.34-1
Description     : Linux driver for DL-6xxx, DL-5xxx, DL-41xx and DL-3x00
Architecture    : x86_64
URL             : http://www.displaylink.com/downloads/ubuntu.php
Licenses        : custom  GPL2  LGPL2.1
Groups          : None
Provides        : None
Depends On      : evdi>=1.5.0  libusb>=1.0.0
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 12.00 MiB
Packager        : Unknown Packager
Build Date      : qua 13 mai 2020 16:13:52
Install Date    : qua 13 mai 2020 16:14:07
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : None

➜  ~ cat /sys/devices/evdi/version  
1.7.0
➜  ~ dkms status
evdi, 1.7.0, 5.4.39-1-MANJARO, x86_64: installed
evdi, 1.7.0, 5.6.11-1-MANJARO, x86_64: installed (original_module exists)
evdi, 1.7.0, 5.7.0-1-MANJARO, x86_64: installed
➜  ~ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x1b8 cap: 0x1, Source Output crtcs: 4 outputs: 4 associated providers: 0 name:NVIDIA-0

I literally ran out of options. If anyone has any idea, I'd gladly hear it. Thanks.

strix commented 4 years ago

displaylink on aur is now at version 5.3.1.34-1 and is also showing up as a package to upgrade on Manjaro so the manual installation may not be necessary anymore to be compatible with evdi 1.7.0

Luc45 commented 4 years ago

@strix Indeed. Unfortunately, removing evdi and DisplayLink, rebooting and installing the version from AUR still gives me the same results. There must be something going on at a UDL/Nvidia drivers level. I guess I'll try to uninstall Nvidia drivers, go back to Noeuvau and see if that helps. Thank you.

Luc45 commented 4 years ago

SOLVED IT!

All I had to do was completely wipe my hard drive and install a fresh Manjaro again. Yay!!

It works without displaylink, evdi or dkms on a proprietary Nvidia driver. It worked on Nouveau as well:

[lucas@lucas-gl502vs ~]$ sudo pacman -Q --info displaylink 
error: package 'displaylink' was not found
[lucas@lucas-gl502vs ~]$  cat /sys/devices/evdi/version  
cat: /sys/devices/evdi/version: No such file or directory
[lucas@lucas-gl502vs ~]$ dkms status
bash: dkms: command not found
[lucas@lucas-gl502vs ~]$ mhwd -li
> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
           video-linux            2018.05.04                true            PCI
    video-nvidia-440xx            2019.10.25               false            PCI

Warning: No installed USB configs!
[lucas@lucas-gl502vs ~]$

My DisplayLink device is a Plugable UGA-165, according to Arch Linux's DisplayLink page, for chipsets 1X5 (such as mine, 165), you don't need any additional drivers. The DisplayLink drivers are for chipsets DL-6xxx, DL-5xxx, DL-41xx and DL-3x00.

I don't know if that's related to the problem I had, since before migrating to Manjaro I used that same driver on Ubuntu 18.04 with this same device (UGA-165) and it worked fine. It tremendously improved the performance when rendering a video or a Gif in the DisplayLink monitor, thus why I had installed it in Manjaro.

Looking back now, and realizing that it works without evdi, dkms and displaylink, I would probably try to remove these three packages and see if that would have solved it. The only one I didn't remove when I was trying to fix this was dkms.

Anyway, this is my xrandr --listproviders now:

[lucas@lucas-gl502vs ~]$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x1b8 cap: 0x1, Source Output crtcs: 4 outputs: 4 associated providers: 1 name:NVIDIA-0
Provider 1: id: 0x239 cap: 0x2, Sink Output crtcs: 1 outputs: 1 associated providers: 1 name:modesetting

As expected.

Thank you all for your good will and effort.

Luc45 commented 4 years ago

For christ sake, I broke it again.

I've installed linux56-headers (as I did previously before the issues started) and it broke it again.

It must be related. It's exactly how it broke the last time.

Luc45 commented 4 years ago

Output of commands now:

➜  ~ sudo pacman -Q --info displaylink 
[sudo] password for lucas: 
error: package 'displaylink' was not found
➜  ~ cat /sys/devices/evdi/version 
cat: /sys/devices/evdi/version: No such file or directory
➜  ~ dkms status
➜  ~ mhwd -li
> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
           video-linux            2018.05.04                true            PCI
    video-nvidia-440xx            2019.10.25               false            PCI

Warning: No installed USB configs!
➜  ~ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x1b8 cap: 0x1, Source Output crtcs: 4 outputs: 4 associated providers: 0 name:NVIDIA-0

I've already removed linux56-headers, but it won't come back anymore... Sigh...

Luc45 commented 4 years ago

I'll move this conversation to Manjaro forums, since this is not related to evdi. I'll update this comment with the link there if anyone wants to follow up.

Link: “linux56-headers” breaks native DisplayLink 1XX support on fresh Manjaro installation