PDA

View Full Version : Gentoo - DisplayLinkManager crash


corrmaan
06-02-2020, 01:27 AM
Hello,

I'm wondering if someone could please decode the log files I have and shed some light on the issue I'm having.

I'm trying to get DisplayLink working on my Gentoo system for a D6000 dock. I managed to piece together some ebuilds that seem to install evdi and displaylink-driver correctly. They are attached along with the DLSupportTool output.

For displaylink-driver, I think all the important files are installed to /opt/displaylink:
# ls -la /opt/displaylink
total 12264
drwxr-xr-x 2 root root 4096 Jun 1 21:44 .
drwxr-xr-x 11 root root 4096 May 31 23:48 ..
-rwxr-xr-x 1 root root 10900824 May 31 23:48 DisplayLinkManager
prwxr-xr-x 1 root root 0 Jun 1 21:44 DisplayLinkManagerDirLock
-rw-r--r-- 1 root root 632688 May 31 23:48 ella-dock-release.spkg
-rw-r--r-- 1 root root 336448 May 31 23:48 firefly-monitor-release.spkg
-rw-r--r-- 1 root root 667104 May 31 23:48 ridge-dock-release.spkg
-rwxr-xr-x 1 root root 2106 May 31 23:48 udev.sh
The udev.sh file is modified by my ebuild, using the systemd-generated one as the template. All that's changed are the start_service() and stop_service() functions from their systemd versions to OpenRC style: rc-service dlm start/stop. The service name was changed from displaylink-driver to dlm, here is what the dlm OpenRC init script looks like:
# cat /etc/init.d/dlm
#!/sbin/openrc-run

command="/opt/displaylink/DisplayLinkManager"
command_background=true
directory="/opt/displaylink"
pidfile="/run/${RC_SVCNAME}.pid"

depend() {
after xdm
}

start_pre() {
modprobe evdi
}

So these options tell openrc-run to change to $directory, run $command, background it, and record it's PID in $pidfile. And before starting dlm, evdi is loaded.

The udev rules file is also installed in the right place and it does start the dlm service when the dock is plugged in to the system.

For evdi, the module and library appear to be in the right places:
# ls -la /lib/modules/5.6.14-gentoo-x86_64/video | grep evdi
-rw-r--r-- 1 root root 708440 May 31 23:51 evdi.ko
# ls -la /usr/lib64 | grep evdi
lrwxrwxrwx 1 root root 12 May 31 23:51 libevdi.so -> libevdi.so.0
lrwxrwxrwx 1 root root 16 May 31 23:51 libevdi.so.0 -> libevdi.so.1.7.0
-rwxr-xr-x 1 root root 18408 May 31 23:51 libevdi.so.1.7.0

When the dlm service is started by udev, the evdi module is also loaded at the same time, although without any indication in dmesg:
# lsmod | grep evdi
evdi 12288 0
# ls -la /sys/module/evdi
total 0
drwxr-xr-x 5 root root 0 Jun 1 21:44 .
drwxr-xr-x 180 root root 0 Jun 1 21:42 ..
-r--r--r-- 1 root root 4096 Jun 1 21:49 coresize
drwxr-xr-x 2 root root 0 Jun 1 21:49 holders
-r--r--r-- 1 root root 4096 Jun 1 21:50 initsize
-r--r--r-- 1 root root 4096 Jun 1 21:50 initstate
drwxr-xr-x 2 root root 0 Jun 1 21:50 notes
-r--r--r-- 1 root root 4096 Jun 1 21:49 refcnt
drwxr-xr-x 2 root root 0 Jun 1 21:50 sections
-r--r--r-- 1 root root 4096 Jun 1 21:50 taint
--w------- 1 root root 4096 Jun 1 21:44 uevent

The problem I'm having is that the dlm service crashes due to DisplayLinkMonitor dying for some reason. The log and edid files are created, my monitors indicate some kind of activity, and then DisplayLinkMonitor crashes.

Does anyone see anything immediately and obviously wrong with this setup?

Thanks,

Cory

lspintzyk
06-02-2020, 05:55 AM
Hi corrmaan,

DisplayLinkManager is failing on access to the /sys/devices/evdi/add file.

When writing 1 to that file evdi module is adding one new drm device in /dev/dri/ directory.

corrmaan
06-02-2020, 04:04 PM
Hi lspintzyk,

Thanks for your quick reply.

Although lsmod shows the evdi module as loaded, there is no evdi device appearing:
# ls -la /sys/devices/evdi
ls: cannot access '/sys/devices/evdi': No such file or directory

So this is probably related to why I'm not seeing any evdi logging in dmesg.

I'll play around with getting the module to work and let you know how I make out.

corrmaan
06-03-2020, 04:24 AM
It turns out my aggressive CFLAGS were causing the module to not work properly. If I can narrow down which ones are the culprit then I'll open an issue at the evdi repo.

Thanks again!

corrmaan
07-02-2020, 03:53 PM
Turns out the module fails to initialise when compiled with LTO

https://github.com/DisplayLink/evdi/issues/212