Introduction
I have a HP laptop that I’ve installed Gentoo on. However, the only HDMI port on it appears to be connected to the onboard NVIDIA card or some other strange arrangement. Everyone knows how well Linux and NVIDIA work together, so I’ve given up on getting it to work. But I wanted more monitors for my laptop, so I decided to get a Dell dock. For work, I have an Ubuntu Linux laptop which uses a Dell dock quite nicely, so I knew it was at least possible. So I decided to pick up a Dell docker open box from Best Buy. I looked around and picked out an open-box Dell D3100 dock.
Getting the Dock
When I got it, I started by looking at the wiki page for DisplayLink, the protocol the dock says it uses to provide the displays over USB. I reconfigure my kernel to have those features enabled and reboot…. it doesn’t work. Turns out, (not specifically mentioned, but can be implied) the Gentoo wiki is talking about DisplayLink 2.0, which runs on USB 2.0 devices. The dock I got uses USB 3 and DisplayLink 3.0. With some research, I soon find out I need to install a new kernel module and management software. However, the installer is only built for Ubuntu. Given I’m using Gentoo with openrc instead of systemd, I had to adapt the contents of the installer to my use. At least Linux support exists.
Getting the Dock to Work
Note: Some files I used are available in this repo so you don’t have to run the scripts in the installer every time and modify them.
- Cloned the
evdi
module repo from GitHub. This contains both the library and kernel module. I ranmake
, which builds everything. Pretty easy. - Copied the
.so
library in thelibrary
directory to/usr/x86_64-pc-linux-gnu/lib/
(at least on my box) - Copied the
.ko
kernel module in themodule
directory to/lib/modules/<KERNEL_VERSION>-gentoo/kernel/extra
(I had to createextra
). I randepmod
andmodprobe
and the module loaded without issue. - Downloaded the ZIP with the DisplayLink installer from here. The version I had was
DisplayLink USB Graphics Software for Ubuntu (Beta)5.5 Beta-EXE.zip
. I used the--noexec
flag to extract the files from it (from instructions from here). I did not use the install script (displaylink-installer.sh
), but looked at it to determine what else I needed, and I got the following:- uDev Rules: This is generated by the install script with the
udev-installer.sh
script. - udev.sh: Script called by the Udev rules script to do setup, also generated by the install script with the
udev-installer.sh
script. - DisplayLinkManager: The management binary, sadly a non-open-source binary. Used the one from the
x64-ubuntu-1604
subdirectory. - *.spkg: These are firmware files I think.
- suspend.sh: Script called when the system goes to sleep. This is also generated by the install script.
- The module configuration that went into
/etc/modprobe.d/evdi.conf
- uDev Rules: This is generated by the install script with the
- I copied the
DisplayLinkManager
and*.spkg
files to/opt/displaylink/
. - I copied the generated
udev.sh
andsuspend.sh
scripts to/opt/displaylink
/ and ensured they were executable. These files are available in the repo,suspend.sh
in thepm
directory andudev.sh
in theudev
directory. - I copied the generated udev rules files to
/etc/udev/rules.d/
. This file is available in the repo in theudev/99-displaylink.rules
file. - I created a OpenRC service file in
/etc/init.d/dlm
, which I derived from this DisplayLink forum post. This is in the repo as theservice/dlm
file. I also made sure thedlm
script was executable. - I added the configuration
options evdi initial_device_count=4
into/etc/modprobe.d/evdi.conf
. The contents are available in the repo in themodprobe.d/evdi.conf
file. - I linked the
suspend.sh
script into the elogind sleep script directory with
ln -s /opt/displaylink/suspend.sh /lib64/elogind/system-sleep/displaylink-suspend.sh
Then I started the service with
rc-service dlm start
which start without an error.
However, there was still no change from the monitor. Using info hinted here, I ran:
xrandr --setprovideroutputsource 1 0
Still nothing. But then I remembered that we added 4 devices in the module configuration (options evdi initial_device_count=4
), I tried other numbers, and when I ran:
xrandr --setprovideroutputsource 4 0
the screen popped to life! Success!
I could then configure it like a normal other monitor and now have a lot of extra screen space for my coding and excess of browser tabs.
Issues
Different Output Numbers
Sometimes,
xrandr --setprovideroutputsource 4 0
didn’t work but
xrandr --setprovideroutputsource 3 0
did. I usually try different numbers and one will eventually work.
Screen Glitches
Sometimes, I’ll start getting screen tearing and glitchy mouse movements when I activate a new screen. I restarted by display manager with:
rc-service display-manager restart
and after a re-login, then running the xrandr
command again, the glitches went away. I think it has something to do with the order of what is loaded with the module, driver, and display manager.
Other Resources
Other resources I referenced during my journey: