Difference between revisions of "DisplayLink"

From ArchWiki
Jump to: navigation, search
(Load the framebuffer device: FILES section no longer needed, formatting improvements in code block)
(simplification and beautification of wikilinks, fixing whitespace, capitalization and section fragments (https://github.com/lahwaacz/wiki-scripts/blob/master/link-checker.py (interactive)))
 
(51 intermediate revisions by 17 users not shown)
Line 1: Line 1:
[[Category:Other hardware]]
+
[[Category:Displays]]
The following steps are the most recent ones that the DisplayLink support guy was suggesting. I packaged the revisions in AUR, that compiled and worked great so far.
+
[[ja:DisplayLink]]
According to the Plugable information they should work with almost every DisplayLink (DL-1**) device although they do not suggest using their devices with Linux for production use for now.
+
DisplayLink devices on Linux still only have experimental support. While some people have had success in using them, it is generally not an easy process and not guaranteed to work. The steps on this page describe the generally most successful methods of using external monitors with DisplayLink.
 +
 
 +
Also be warned that even over USB 3.0, a DisplayLink monitor may exhibit noticeably more lag than e.g. a DisplayPort monitor, especially when large portions of the screen are being redrawn.
  
 
==Installation==
 
==Installation==
  
Install the {{Pkg|xf86-video-fbdev}} package, which provides framebuffer video for X.org.
+
=== USB 2.0 DL-1xx Devices ===
 +
 
 +
The kernel [[Wikipedia: Direct_Rendering_Manager|DRM]] driver for DisplayLink is {{ic|udl}}, a rewrite of the original [https://www.kernel.org/doc/Documentation/fb/udlfb.txt udlfb] driver. It allows configuring DisplayLink monitors using [[Xrandr]].
 +
 
 +
First, the setup and installation:
 +
 
 +
* [[Kernel modules#Blacklisting|Blacklist]] the old kernel module, {{ic|udlfb}}, which may attempt to load itself first.
 +
 
 +
=== USB 3.0 DL-5xxx, DL-41xx, DL-3x00 Devices ===
 +
 
 +
# Install the {{AUR|displaylink}} driver. It allows configuring DisplayLink monitors using [[Xrandr]] in the same manner as the {{ic|udl}} driver.
 +
# Enable {{ic|displaylink.service}}.
 +
 
 +
=== Setting up X Displays ===
 +
 
 +
After that, run:
 +
 
 +
{{hc|$ xrandr --listproviders|<nowiki>
 +
Providers: number : 2
 +
Provider 0: id: 0x49 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 2 outputs: 8 associated providers: 0 name:Intel
 +
Provider 1: id: 0x13c cap: 0x2, Sink Output crtcs: 1 outputs: 1 associated providers: 0 name:modesetting
 +
</nowiki>}}
 +
 
 +
In the above output, we can see that provider 0 is the system's regular graphics provider (Intel), and provider 1 (modesetting) is the DisplayLink provider. To use the DisplayLink device, connect provider 1 to provider 0:
  
Hardware-level support is provided by the [[Kernel modules|kernel module]] {{ic|udlfb}}, which should be loadable by default in Arch.
+
$ xrandr --setprovideroutputsource 1 0
  
{{Note| Support for the features in {{AUR|xf86-video-fbdev-for-displaylink}} and {{AUR|udlfb}} from the AUR have been included upstream and are no longer needed. Use the official packages instead.}}
+
and xrandr will add a DVI output you can [[Xrandr#Configuration|use as normal with xrandr]]. This is still experimental but supports hotplugging and when works, it is by far the simplest setup. If it works then everything below is unnecessary.
  
 
==Configuration==
 
==Configuration==
Line 17: Line 42:
 
===Load the framebuffer device===
 
===Load the framebuffer device===
  
Before your system will recognize your DisplayLink device, the {{ic|udlfb}} kernel module must be loaded. To do this, run
+
Before your system will recognize your DisplayLink device, the {{ic|udl}} kernel module must be loaded. To do this, run
  
  # modprobe udlfb
+
  # modprobe udl
  
 
If your DisplayLink device is connected, it should show some visual indication of this. Although a green screen is the standard indicator of this, other variations have been spotted and are perfectly normal. Most importantly, the output of {{ic|dmesg}} should show something like the following, indicating a new DisplayLink device was found:
 
If your DisplayLink device is connected, it should show some visual indication of this. Although a green screen is the standard indicator of this, other variations have been spotted and are perfectly normal. Most importantly, the output of {{ic|dmesg}} should show something like the following, indicating a new DisplayLink device was found:
  
{{bc|<nowiki>usb 2-1.2: new high-speed USB device number 5 using ehci-pci
+
{{bc|<nowiki>usb 2-1.1: new high-speed USB device number 7 using ehci-pci
udlfb: DisplayLink Lenovo LT1421 wide - serial #6V9BBRM1
+
usb 2-1.1: New USB device found, idVendor=17e9, idProduct=03e0
udlfb: vid_17e9&pid_03e0&rev_0108 driver's dlfb_data struct at ffff880231e54800
+
usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
udlfb: console enable=1
+
usb 2-1.1: Product: Lenovo LT1421 wide
udlfb: fb_defio enable=1
+
usb 2-1.1: Manufacturer: DisplayLink
udlfb: shadow enable=1
+
usb 2-1.1: SerialNumber: 6V9BBRM1
udlfb: vendor descriptor length:17 data:17 5f 01 0015 05 00 01 03 00 04
+
[drm] vendor descriptor length:17 data:17 5f 01 00 15 05 00 01 03 00 04
udlfb: DL chip limited to 1500000 pixel modes
+
udl 2-1.1:1.0: fb1: udldrmfb frame buffer device
udlfb: allocated 4 65024 byte urbs
+
[drm] Initialized udl 0.0.1 20120220 on minor 1
udlfb: 1366x768 @ 60 Hz valid mode
+
</nowiki>}}
udlfb: Reallocating framebuffer. Addresses will change!
+
udlfb: 1366x768 @ 60 Hz valid mode
+
udlfb: set_par mode 1366x768
+
udlfb: DisplayLink USB device /dev/fb1 attached. 1366x768 resolution. Using 4104K framebuffer memory</nowiki>}}
+
  
 
Furthermore, {{ic|/dev}} should contain a new {{ic|fb}} device, likely {{ic|/dev/fb1}} if you already had a framebuffer for your primary display.
 
Furthermore, {{ic|/dev}} should contain a new {{ic|fb}} device, likely {{ic|/dev/fb1}} if you already had a framebuffer for your primary display.
  
To automatically load {{ic|udlfb}} at boot, add it to your {{ic|MODULES}} array in {{ic|mkinitcpio.conf}}.
+
To automatically load {{ic|udl}} at boot, create the file {{ic|udl.conf}} in {{ic|/etc/modules-load.d/}} with the following contents:
  
{{hc|/etc/mkinitcpio.conf|2=MODULES="... udlfb ..."}}
+
{{hc|/etc/modules-load.d/udl.conf|udl}}
  
Then, rebuild the kernel image:
+
For more information on loading kernel modules, see [[Kernel modules#Automatic module handling]].
  
# mkinitcpio -p linux
+
===Configuring X Server===
 +
Use {{ic|xrandr}} or your Desktop Environment's display setup UI to configure your USB monitors running either the {{ic|udl}} or {{ic|displaylink}} driver.
  
For more information on this, see [[Mkinitcpio]].
+
====xrandr====
  
===Update Xorg.conf===
+
Once the driver is loaded, the DisplayLink monitor is listed as an output provider:
You must update or create an [[xorg.conf]] with a properly configured {{ic|ServerLayout}} to use a DisplayLink monitor, as Xorg will prefer internal monitors by default. The DisplayLink device is normally only usable if it is set as {{ic|screen0}} and the internal display as {{ic|screen1}}.
+
  
Add this to the bottom of xorg.conf:
+
{{hc|$ xrandr --listproviders|<nowiki>
################ DisplayLink Stuff ###################
+
Providers: number : 2
Section "Device"
+
Provider 0: id: 0x43 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 2 outputs: 2 associated providers: 1 name:Intel
        Identifier      "DisplayLinkDevice"
+
Provider 1: id: 0xcb cap: 0x2, Sink Output crtcs: 1 outputs: 1 associated providers: 1 name:modesetting
        Driver          "fbdev"
+
</nowiki>}}
        BusID          "USB"              # needed to use multiple DisplayLink devices
+
In the above example, provider 1 is the DisplayLink device, and provider 0 is the default display. Running {{ic|xrandr --current}} gives a list of available screens:
        Option          "fbdev" "/dev/fb0"  # change to whatever device you want to use
+
#      Option          "rotate" "CCW"      # uncomment for rotation
+
EndSection
+
+
Section "Monitor"
+
        Identifier      "DisplayLinkMonitor"
+
EndSection
+
+
Section "Screen"
+
        Identifier      "DisplayLinkScreen"
+
        Device          "DisplayLinkDevice"
+
        Monitor        "DisplayLinkMonitor"
+
        DefaultDepth    16
+
EndSection
+
  
Then edit your server layout to look something like this
+
{{hc|$ xrandr --current|<nowiki>
 +
Screen 0: minimum 320 x 200, current 1600 x 900, maximum 8192 x 8192
 +
LVDS1 connected 1600x900+0+0 (normal left inverted right x axis y axis) 309mm x 174mm
 +
  1600x900      60.0*+  40.0 
 +
  1440x900      59.9 
 +
  1360x768      59.8    60.0 
 +
  1152x864      60.0 
 +
  1024x768      60.0 
 +
  800x600        60.3    56.2 
 +
  640x480        59.9 
 +
VGA1 disconnected (normal left inverted right x axis y axis)
 +
DVI-1-0 connected (normal left inverted right x axis y axis)
 +
  1366x768      60.0 +
 +
  1368x768_59.90  59.9 
 +
  1368x768_59.90 (0xd0)  85.7MHz
 +
        h: width  1368 start 1440 end 1584 total 1800 skew    0 clock  47.6KHz
 +
        v: height  768 start  769 end  772 total  795          clock  59.9Hz
 +
</nowiki>}}
  
Screen 0 "DisplayLinkScreen"
+
If the above does not list the DisplayLink screen, then you will need to offload DisplayLink to the main GPU:
Screen 1 "Internal" RightOf "DisplayLinkScreen"
+
Option "Xinerama" "on"
+
  
Change ''Internal'' to your main display, then restart X.
+
{{bc|xrandr --setprovideroutputsource 1 0}}
  
==Troubleshooting==
+
Once the screen is available, refer to [[Xrandr]] for info on setting it up. For automating the configuration process, see [https://github.com/nathantypanski/displaylink.sh displaylink.sh].
  
===X crashes or keeps blank===
+
====Enabling DVI output on startup====
 +
The DisplayLink provider will not be automatically connected to the main provider in most cases, therefore the DVI output device will not be available. It can be helpful to automatically do this when X starts to facilitate automatic display configuration by the window manager.
  
If X crashes, or nothing is shown at load, try to start X only using the external display by updating {{ic|xorg.conf}} as follows:
+
Edit your desktop manager's startup configuration and add commands similar to:
 +
{{bc|<nowiki>
 +
$(xrandr --listproviders | grep -q "modesetting") && xrandr --setprovideroutputsource 1 0
 +
</nowiki>}}
 +
 
 +
For example, the appropriate startup configuration file for [[SDDM]] is {{ic|/usr/share/sddm/scripts/Xsetup}}.
 +
 
 +
Avoid placing these commands in {{ic|~/.xprofile}} as this breaks the display configuration of some window managers. Instead these commands should be run prior to any display output or setup.
 +
 
 +
{{Note|If you have additional providers, specify the name of the provider instead of using indexes. The name of the DisplayLink device will be {{ic|modesetting}}}}
 +
 
 +
== Troubleshooting ==
 +
 
 +
=== Not working configuration ===
 +
 
 +
These are tested on [[XFCE4]] using Display settings (included in XFCE4 package) and external tool - {{pkg|arandr}}. XFCE4 Display settings are likelly to crash, so ARandR might help.
 +
 
 +
When you connect display link device via USB to your computer, the computer should show monitors in Display settings. There are few troubleshooting steps that you should try:
 +
 
 +
* Check [[#Setting up X Displays]]. If you can find any external monitors recognized, you should try to make them visible by the following commands:
 +
{{bc|<nowiki>xrandr --setprovideroutputsource 1 0
 +
xrandr --setprovideroutputsource 2 0
 +
xrandr --setprovideroutputsource 3 0
 +
...
 +
</nowiki>}}
 +
This will make them visible and recognized in Display settings.
 +
* Restart {{ic|displaylink.service}}.
 +
* Re-connecte USB cable.
 +
* Check if {{ic|udl}} driver is loaded and monitors are connected.
 +
 
 +
=== Screen redraw is broken ===
 +
If you are using {{ic|udl}} as your kernel driver and the monitor appears to work, but is only updating where you move the mouse or when windows change in certain places, then you probably have the wrong modeline for your screen. Getting a proper modeline for your screen with a command like
  
 
{{bc|
 
{{bc|
Screen 0 "DisplayLinkScreen"
+
gtf 1366 768 59.9
#Screen 1 "Internal" RightOf "DisplayLinkScreen"
+
#Option "Xinerama" "on"
+
 
}}
 
}}
  
There are reported instances in which Xinerama requires all its {{ic|Screen}} color depths to be the same. In both {{ic|Screen}} sections, try changing the {{ic|DefaultDepth}} to 16.
+
where {{ic|1366}} and {{ic|768}} are the horizontal and vertical resolutions for your monitor, and {{ic|59.9}} is the refresh rate from its specs. To use this, create a new mode with {{ic|xrandr}} like follows:
  
 
{{bc|
 
{{bc|
Section "Screen"
+
xrandr --newmode "1368x768_59.90" 85.72  1368 1440 1584 1800  768 769 772 795  -HSync +Vsync
    ...
+
    DefaultDepth    16
+
    ...
+
EndSection
+
 
+
 
}}
 
}}
  
{{Note| With fbdev this is not true anymore, because fbdev provides virtual 24 bit support. Everything may be used with {{ic|DefaultDepth 24}}. However, USB 2.0 has less bandwidth than a standard monitor, so a performance update may be seen from setting it to 16 bit mode.}}
+
and add it to [[Xrandr]]:
 
+
===Cannot start in framebuffer mode. Please specify busIDs for all framebuffer devices===
+
 
+
With two monitors configured in Xinerama mode, {{ic|/var/log/Xorg.0.log}} will sometimes display the following error:
+
  
 
{{bc|
 
{{bc|
Fatal server error:
+
xrandr --addmode DVI-0 1368x768_59.90
Cannot run in framebuffer mode. Please specify busIDs for all framebuffer devices
+
 
}}
 
}}
  
As indicated by [http://forums.gentoo.org/viewtopic-t-809655.html this Gentoo Forums thread], KMS might be incompatible with fbdev. They also suggested the possible fix of running {{ic|startx -- -retro}} which will allow X to run even when, to X itself, it doesn't appear to be working.
+
Then tell the monitor to use that mode for the DisplayLink monitor, and this should fix the redraw issues. Check the [[Xrandr]] page for information on using a different mode.
 +
 
 +
If this does not solve the problem (or if the correct modeline was already in place because of correct DDC data), it can help to run a compositor. E.g. when using plain i3, running {{Pkg|xcompmgr}} or {{Pkg|compton}} can mitigate the problem.
  
{{Note |1= A [https://bugs.freedesktop.org/show_bug.cgi?id=65384 bug report] has been filed for this issue.}}
+
=== DisplayLink refresh rate is extremely slow with gnome 3 ===
 +
If once you set up your DisplayLink your entire desktop becomes slow, try setting a "simpler" background image, such as complete black.
  
 
==See Also==
 
==See Also==
Line 124: Line 169:
 
* [http://displaylink.org/forum/forumdisplay.php?f=29 DisplayLink Open Source]: Official DisplayLink open source support forum
 
* [http://displaylink.org/forum/forumdisplay.php?f=29 DisplayLink Open Source]: Official DisplayLink open source support forum
 
* [http://plugable.com/platforms/linux Plugable]: Vendor blog chronicling Linux support for DisplayLink.
 
* [http://plugable.com/platforms/linux Plugable]: Vendor blog chronicling Linux support for DisplayLink.
 +
* [http://www.displaylink.com/downloads/ubuntu.php Ubuntu Driver Download]: DisplayLink Ubuntu Driver Download and Information
 +
* [http://downloads.displaylink.com/releasenotes/DisplayLink_Ubuntu_1.0.68_release-note.txt Release Notes]: Latest release notes for DisplayLink Ubuntu Software

Latest revision as of 19:55, 24 April 2016

DisplayLink devices on Linux still only have experimental support. While some people have had success in using them, it is generally not an easy process and not guaranteed to work. The steps on this page describe the generally most successful methods of using external monitors with DisplayLink.

Also be warned that even over USB 3.0, a DisplayLink monitor may exhibit noticeably more lag than e.g. a DisplayPort monitor, especially when large portions of the screen are being redrawn.

Installation

USB 2.0 DL-1xx Devices

The kernel DRM driver for DisplayLink is udl, a rewrite of the original udlfb driver. It allows configuring DisplayLink monitors using Xrandr.

First, the setup and installation:

  • Blacklist the old kernel module, udlfb, which may attempt to load itself first.

USB 3.0 DL-5xxx, DL-41xx, DL-3x00 Devices

  1. Install the displaylinkAUR driver. It allows configuring DisplayLink monitors using Xrandr in the same manner as the udl driver.
  2. Enable displaylink.service.

Setting up X Displays

After that, run:

$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x49 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 2 outputs: 8 associated providers: 0 name:Intel
Provider 1: id: 0x13c cap: 0x2, Sink Output crtcs: 1 outputs: 1 associated providers: 0 name:modesetting

In the above output, we can see that provider 0 is the system's regular graphics provider (Intel), and provider 1 (modesetting) is the DisplayLink provider. To use the DisplayLink device, connect provider 1 to provider 0:

$ xrandr --setprovideroutputsource 1 0

and xrandr will add a DVI output you can use as normal with xrandr. This is still experimental but supports hotplugging and when works, it is by far the simplest setup. If it works then everything below is unnecessary.

Configuration

These instructions assume that you already have an up and running X server and are simply adding a monitor to your existing setup.

Load the framebuffer device

Before your system will recognize your DisplayLink device, the udl kernel module must be loaded. To do this, run

# modprobe udl

If your DisplayLink device is connected, it should show some visual indication of this. Although a green screen is the standard indicator of this, other variations have been spotted and are perfectly normal. Most importantly, the output of dmesg should show something like the following, indicating a new DisplayLink device was found:

usb 2-1.1: new high-speed USB device number 7 using ehci-pci
usb 2-1.1: New USB device found, idVendor=17e9, idProduct=03e0
usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-1.1: Product: Lenovo LT1421 wide
usb 2-1.1: Manufacturer: DisplayLink
usb 2-1.1: SerialNumber: 6V9BBRM1
[drm] vendor descriptor length:17 data:17 5f 01 00 15 05 00 01 03 00 04
udl 2-1.1:1.0: fb1: udldrmfb frame buffer device
[drm] Initialized udl 0.0.1 20120220 on minor 1

Furthermore, /dev should contain a new fb device, likely /dev/fb1 if you already had a framebuffer for your primary display.

To automatically load udl at boot, create the file udl.conf in /etc/modules-load.d/ with the following contents:

/etc/modules-load.d/udl.conf
udl

For more information on loading kernel modules, see Kernel modules#Automatic module handling.

Configuring X Server

Use xrandr or your Desktop Environment's display setup UI to configure your USB monitors running either the udl or displaylink driver.

xrandr

Once the driver is loaded, the DisplayLink monitor is listed as an output provider:

$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x43 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 2 outputs: 2 associated providers: 1 name:Intel
Provider 1: id: 0xcb cap: 0x2, Sink Output crtcs: 1 outputs: 1 associated providers: 1 name:modesetting

In the above example, provider 1 is the DisplayLink device, and provider 0 is the default display. Running xrandr --current gives a list of available screens:

$ xrandr --current
Screen 0: minimum 320 x 200, current 1600 x 900, maximum 8192 x 8192
LVDS1 connected 1600x900+0+0 (normal left inverted right x axis y axis) 309mm x 174mm
   1600x900       60.0*+   40.0  
   1440x900       59.9  
   1360x768       59.8     60.0  
   1152x864       60.0  
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
VGA1 disconnected (normal left inverted right x axis y axis)
DVI-1-0 connected (normal left inverted right x axis y axis)
   1366x768       60.0 +
   1368x768_59.90   59.9  
  1368x768_59.90 (0xd0)   85.7MHz
        h: width  1368 start 1440 end 1584 total 1800 skew    0 clock   47.6KHz
        v: height  768 start  769 end  772 total  795           clock   59.9Hz

If the above does not list the DisplayLink screen, then you will need to offload DisplayLink to the main GPU:

xrandr --setprovideroutputsource 1 0

Once the screen is available, refer to Xrandr for info on setting it up. For automating the configuration process, see displaylink.sh.

Enabling DVI output on startup

The DisplayLink provider will not be automatically connected to the main provider in most cases, therefore the DVI output device will not be available. It can be helpful to automatically do this when X starts to facilitate automatic display configuration by the window manager.

Edit your desktop manager's startup configuration and add commands similar to:

$(xrandr --listproviders | grep -q "modesetting") && xrandr --setprovideroutputsource 1 0

For example, the appropriate startup configuration file for SDDM is /usr/share/sddm/scripts/Xsetup.

Avoid placing these commands in ~/.xprofile as this breaks the display configuration of some window managers. Instead these commands should be run prior to any display output or setup.

Note: If you have additional providers, specify the name of the provider instead of using indexes. The name of the DisplayLink device will be modesetting

Troubleshooting

Not working configuration

These are tested on XFCE4 using Display settings (included in XFCE4 package) and external tool - arandr. XFCE4 Display settings are likelly to crash, so ARandR might help.

When you connect display link device via USB to your computer, the computer should show monitors in Display settings. There are few troubleshooting steps that you should try:

  • Check #Setting up X Displays. If you can find any external monitors recognized, you should try to make them visible by the following commands:
xrandr --setprovideroutputsource 1 0
xrandr --setprovideroutputsource 2 0
xrandr --setprovideroutputsource 3 0
...

This will make them visible and recognized in Display settings.

  • Restart displaylink.service.
  • Re-connecte USB cable.
  • Check if udl driver is loaded and monitors are connected.

Screen redraw is broken

If you are using udl as your kernel driver and the monitor appears to work, but is only updating where you move the mouse or when windows change in certain places, then you probably have the wrong modeline for your screen. Getting a proper modeline for your screen with a command like

gtf 1366 768 59.9

where 1366 and 768 are the horizontal and vertical resolutions for your monitor, and 59.9 is the refresh rate from its specs. To use this, create a new mode with xrandr like follows:

xrandr --newmode "1368x768_59.90"  85.72  1368 1440 1584 1800  768 769 772 795  -HSync +Vsync

and add it to Xrandr:

xrandr --addmode DVI-0 1368x768_59.90

Then tell the monitor to use that mode for the DisplayLink monitor, and this should fix the redraw issues. Check the Xrandr page for information on using a different mode.

If this does not solve the problem (or if the correct modeline was already in place because of correct DDC data), it can help to run a compositor. E.g. when using plain i3, running xcompmgr or compton can mitigate the problem.

DisplayLink refresh rate is extremely slow with gnome 3

If once you set up your DisplayLink your entire desktop becomes slow, try setting a "simpler" background image, such as complete black.

See Also