Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DisplayLink monitors not working in hyprland #2752

Closed
clementpoiret opened this issue Jul 20, 2023 · 21 comments
Closed

DisplayLink monitors not working in hyprland #2752

clementpoiret opened this issue Jul 20, 2023 · 21 comments

Comments

@clementpoiret
Copy link

clementpoiret commented Jul 20, 2023

Hyprland Version

v0.27.0

Bug or Regression?

Bug

Description

I have an external DisplayLink monitor for my laptop (endeavouros, base arch linux).

It works with:

  • i3,
  • Plasma (X11),
  • Plasma (Wayland)

I all of them, I can activate the display with xrandr.

In hyprland, it doesn’t. The screen stay black forever.
I tried to install hyprland-displaylink-git, which patches hyprland to detect displaylink monitors: it has the same behavior, a black screen on the displaylink screen.

I currently have linux-lts, and use evdi-compat-git, but the behavior is the same with evdi-git.

I tried with the following drivers:

  • nvidia 525.X, 530.X and 535.X
  • nouveau

The behavior is exactly the same.

systemctl status displaylink says enabled and active

dmesg | grep -E 'usb|evdi' says: https://pastebin.com/u0fVAgVV 1

inxi -Ga:

  Device-1: Intel CometLake-H GT2 [UHD Graphics] vendor: Dell driver: i915
    v: kernel arch: Gen-9.5 process: Intel 14nm built: 2016-20 ports:
    active: eDP-1 empty: DP-1, DP-2, DP-3, HDMI-A-1, HDMI-A-2 bus-ID: 00:02.0
    chip-ID: 8086:9bc4 class-ID: 0300
  Device-2: NVIDIA GP107GLM [Quadro P620] vendor: Dell driver: nvidia
    v: 525.89.02 alternate: nouveau,nvidia_drm non-free: 535.xx+
    status: current (as of 2023-07) arch: Pascal code: GP10x
    process: TSMC 16nm built: 2016-21 pcie: gen: 1 speed: 2.5 GT/s lanes: 16
    link-max: gen: 3 speed: 8 GT/s bus-ID: 01:00.0 chip-ID: 10de:1cbd
    class-ID: 0302
  Device-3: Realtek Integrated_Webcam_HD driver: uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-11:3 chip-ID: 0bda:5539
    class-ID: 0e02 serial: 200901010001
  Display: wayland server: X.org v: 1.21.1.8 with: Xwayland v: 23.1.2
    compositor: Hyprland driver: X: loaded: modesetting,nvidia
    alternate: fbdev,intel,nouveau,nv,vesa dri: iris gpu: i915,nvidia
    display-ID: 1
  Monitor-1: eDP-1 res: 1920x1080 size: N/A modes: N/A
  API: OpenGL v: 4.6.0 NVIDIA 525.89.02 renderer: Quadro P620/PCIe/SSE2
    direct-render: Yes

hyprctl monitors:

Monitor eDP-1 (ID 0):
	[email protected] at 1080x1080
	description: BOE 0x0869 (eDP-1)
	make: BOE
	model: 0x0869
	serial: 
	active workspace: 1 (1)
	special workspace: 0 ()
	reserved: 0 39 0 0
	scale: 1.00
	transform: 0
	focused: yes
	dpmsStatus: 1
	vrr: 0

Monitor DVI-I-1 (ID 1):
	[email protected] at 0x0
	description: ASUSTek COMPUTER INC MB16A R2LMQS067280 (DVI-I-1)
	make: ASUSTek COMPUTER INC
	model: MB16A
	serial: R2LMQS067280
	active workspace: 2 (2)
	special workspace: 0 ()
	reserved: 0 0 0 0
	scale: 1.00
	transform: 3
	focused: no
	dpmsStatus: 1
	vrr: 0

hyprland.conf monitor config:

monitor = eDP-1,	1920x1080@60, 1080x1080,	1				# Main
monitor = DVI-I-1,	1920x1080@60, 0x0,		1,	transform,	3	# DisplayLink
monitor = DP-1,		1920x1080@60, 0x0,		1,	transform,	3	# Station F
monitor = DP-3,		1920x1080@60, 3000x1080,	1				# NS
monitor = DP-4,		1920x1080@60, 0x0,		1,	transform,	3	# Station F
monitor = DP-5,		1920x1080@60, 0x0,		1,	transform,	3	# Station F

I’m a bit clueless…
Do you have any idea?

Thank you,
Clément

How to reproduce

Connect any DisplayLink screen using hyprland-displaylink-git on arch. (same behavior with hyprland-nvidia-git).

Crash reports, logs, images, videos

No response

@vaxerski
Copy link
Member

does it work in sway?

if anything this would be a wlroots issue, hyprland does not handle drm

@clementpoiret
Copy link
Author

Okay that's weird, I have another kernel (xanmod, based on Linux 6.4.4), and switching from LTS to this one, DisplayLink now work on hyprland. So I believe this might be a compatibility issue between evdi and linux lts?

I'm very sorry to have bothered you for such a dumb issue, I should have checked with another kernel earlier...

I hope it'll help other people :)

@danielkrajnik
Copy link

danielkrajnik commented Oct 15, 2023

@clementpoiret could you please share your .config/hypr/hyprland.conf file? Did you do anything extra to get the aur/hyprland-displaylink-git package to work? I can't get it to work at all. no monitors listed, no output. It doesn't even always start on the integrated GPU and trying to debug this is awful - any advice would be really appreciated.

@clementpoiret
Copy link
Author

clementpoiret commented Oct 17, 2023

@danielkrajnik I personally had to downgrade nvidia drivers to 521 or less, also, merging the patches from both aur/hyprland-displaylink-git and aur/hyprland-nvidia-git helped. Unfortunately I changed my laptop, and 521.x drivers are completely broken for it, so I switched to the nouveau drivers as I do not play games nor use CUDA. Everything is much simpler and works very well with the nouveau drivers :)

edit: you can also try evdi-compat, maybe it'll help :)
edit2: to check if it works, you can first try on the nouveau driver, to avoid nvidia-related issues. Then, if it works, come back on the nvidia drivers and play with the version, and the patches.

@danielkrajnik
Copy link

danielkrajnik commented Oct 17, 2023

@clementpoiret Thank you, I'm trying not to use nvidia and render everything on Intel integrated GPU (only selected applications get offloaded via Prime), so the aur/hyprland-nvidia-git package shouldn't be necessary?

Are you saying then that you didn't have to add anything else to the hyperland.conf? Like:

env = WLR_DRM_DEVICES,/home/user/.config/hypr/displaylink-DRI-card (symlink to /dev/dri/by-path/platform-evdi.0-card)

Did it just work right after installing the aur/hyprland-displaylink-git package and starting hyprland from tty? Because all I'm getting is a black screen:

  25   │ 00:00:00.036 [ERROR] [types/wlr_linux_dmabuf_v1.c:1061] Failed to get renderer DRM FD
  26   │ MESA-LOADER: failed to open evdi: /usr/lib/dri/evdi_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/dri, suffix _dri)
  27   │ kmsro: driver missing

try evdi-compat

using the aur/evdi-compat-git package already

@clementpoiret
Copy link
Author

Yes, I believe that you do not need the nvidia patch. Why not trying the nouveau driver if you plan to let your gpu alone?
I didn't added anything related to DRM devices, here are my hyprland dotfiles :

https://github.com/clementpoiret/dotfiles/tree/main/dot_config/hypr

Look at both hyprland.conf and hypr/scripts/startup.sh

Also, I use ly as my display manager, previously I used lightdm, maybe using one can help you?

@danielkrajnik
Copy link

danielkrajnik commented Oct 17, 2023

Thank you, sadly any combination of environment variables, monitors and even trying to remove nvidia drivers doesn't seem to make any difference. Hyprland is trying to activate the displaylink connected monitor, but keeps quitting. At the same time witching to plasma Wayland starts is just fine.

Adding export HYPRLAND_LOG_WLR=1 to the startup script seems to add useful log information:

 134   │ [wlr] [render/egl.c:588] Failed to initialize EGL context
 135   │ [wlr] [render/gles2/renderer.c:804] Could not initialize EGL
 136   │ [wlr] [render/wlr_renderer.c:346] Failed to create a GLES2 renderer. Skipping!

Line 134 isn't preceded by any of the other three possible wlr_log calls that use goto error so the issue must be in the snippet below - egl_init function returns 0:

	if (egl->exts.EXT_platform_device) {
		/*
		 * Search for the EGL device matching the DRM fd using the
		 * EXT_device_enumeration extension.
		 */
		EGLDeviceEXT egl_device = get_egl_device_from_drm_fd(egl, drm_fd);
		if (egl_device != EGL_NO_DEVICE_EXT) {
			if (egl_init(egl, EGL_PLATFORM_DEVICE_EXT, egl_device)) {
				wlr_log(WLR_DEBUG, "Using EGL_PLATFORM_DEVICE_EXT");
				return egl;
			}
			goto error;
		}

Do you know by any chance how to start some interactive debugger to trace this logic further?

@clementpoiret
Copy link
Author

Hmm so I have no clue... But when I had issues, I posted a comment on this page: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1823

Julian Poidevin (the maintainer of the patched version of hyprland) has been very helpful

@danielkrajnik
Copy link

danielkrajnik commented Oct 17, 2023

I've posted the issue there, hopefully someone may pick it up. I'm also trying to debug it with gdb, but not sure where to find debug symbols (debuginfod doesn't seem to have Hyprland).

@simaotwx
Copy link

I'm having the same issue.

Both hyprland from Arch packages as well as patched hyprland for displaylink (used original PKGBUILD and extended with patch from hyprland-displaylink-git) have no output on DisplayLink.

Works fine on GNOME with Wayland.

I'm using evdi-git and displaylink service is running.

Hardware:

Host: ROG Zephyrus G14 GA401II_GA401II 1.0
CPU: AMD Ryzen 7 4800HS with Radeon Graphics (10) @ 2.900GHz
GPU: NVIDIA GeForce GTX 1650 Ti Mobile
GPU: AMD ATI Radeon RX Vega 6
Memory: 10494MiB / 23448MiB

Software:

OS: Arch Linux x86_64
Kernel: 6.6.7-nitrous-1
NVRM: loading NVIDIA UNIX x86_64 Kernel Module  545.29.06  Thu Nov 16 01:59:08 UTC 2023
nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  545.29.06  Thu Nov 16 01:47:29 UTC 2023
amdgpu: ATOM BIOS: 113-RENOIR-025
[drm] amdgpu kernel modesetting enabled.
[drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 0
[drm] Initialized amdgpu 3.54.0 20150101 for 0000:04:00.0 on minor 1
fbcon: amdgpudrmfb (fb0) is primary device

Login manager is GDM

@GersiD
Copy link

GersiD commented Mar 20, 2024

This issue persists, sway also doesn't work and I have tried the different display link packages on the AUR (displaylink-beta, git, and all available evdi packages). However other wayland DE / WMs work (KDE Plasma, and Gnome are the only ones I have tested so far). I will update if I find a fix however it is unlikely as the relevant fix is not available in WLRoots yet https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1823. I will update if I find something that fixes it for me.

edit : It appears there is a patch that can be applied to the pre-packaged wlroots that comes with hyprland in the above gitlab link, its seems there are 2 possible patches however. So there are 2 difficulties, which patch actually works, and can we add support in hyprland without breaking other things. Further I don't think that @vaxerski is willing to possibly break other things to apply these packages for displaylink devices. It seems that the creator of WLroots is not keen on supporting display link displays anytime soon (the above gitlab issue has been open for 4 years) so maybe tiling window managers weren't meant for display link users.

@pjhfggij
Copy link

Displaylink is what's kept me from jumping on the hyprland bandwagon, or specifically a solution that provides displaylink without breaking nvidia prime rendering offload - it's still on my list though.

@clementpoiret
Copy link
Author

Just updated my PKGBUILD to support hyprland 0.37.1 https://gist.github.com/clementpoiret/992d7b4c8cd3707b21461366c817db4d

it doesn't have the nvidia patch, but you could apply it in the PKGBUILD similarly to displaylink.patch

@clementpoiret
Copy link
Author

Disclaimer: the displaylink patch is not mine, it comes from https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1823 from matt1606.

@topaxi
Copy link

topaxi commented Jun 17, 2024

DisplayLink seems to be working out of the box using the evdi driver and Hyprland 0.40.1 🥳

@simaotwx
Copy link

DisplayLink seems to be working out of the box using the evdi driver and Hyprland 0.40.1 🥳

For some reason, for like 2 weeks Wayland does not work anymore on DisplayLink for me. I can't select it in GDM and if I connect a monitor while in a session it'll just crash and bring me back to the login screen. Really weird.

@mattydebie
Copy link

I have the same issue where the monitors will show up using hyprctl monitors all but trying to 'enable' them does nothing at all.

@nktnet1
Copy link
Contributor

nktnet1 commented Jul 1, 2024

Update 26th July 2024

The patch below has since been merged.

Update 24th July 2024

Made a slightly more robust aquamarine patch here:

Update 22nd July 2024

With the aquamarine transition merged in today (#6608) and wlroots-hyprland archived, an equivalent hack is:

i.e. changing aquamarine's src/backend/drm/DRM.cpp, line 208 of commit 601f6cf95cbe4fef02dc7faf34bba58566c914e9, from

if (!drmBackend->registerGPU(gpu, newPrimary)) {

to

if (!drmBackend->registerGPU(gpu, {})) {

Caveat is the same as mentioned by Kacper Żuk on gitlab.freedesktop.org:

Tracking this topic in aquamarine issue 22:

Original Response

@mattydebie I had the same issue and was able to fix it by manually patching wlroots as mentioned by @clementpoiret and @GersiD above.

Left the steps/instructions here if you're still interested:

I'd also recommend looking into USB-C DisplayPort (DP Alt Mode) instead of DisplayLink if that's a possibility for you.

@mattydebie
Copy link

@mattydebie I had the same issue and was able to fix it by manually patching wlroots as mentioned by @clementpoiret and @GersiD above.

Left the steps/instructions here if you're still interested:

I'd also recommend looking into USB-C DisplayPort (DP Alt Mode) instead of DisplayLink if that's a possibility for you.

Alright I'll try checking it out! Thanks for the feedback 😁

@mattydebie
Copy link

Update 22nd July 2024

With the aquamarine transition merged in today (#6608) and wlroots-hyprland archived, an equivalent hack is:

i.e. changing aquamarine's src/backend/drm/DRM.cpp, line 208 of commit 601f6cf95cbe4fef02dc7faf34bba58566c914e9, from

if (!drmBackend->registerGPU(gpu, newPrimary)) {

to

if (!drmBackend->registerGPU(gpu, {})) {

Caveat is the same as mentioned by Kacper Żuk on gitlab.freedesktop.org:

For the arch users among us, adding the following line (annotated with >>>) in the PKGBUILD and rebuilding it with makepkg -sif makes it work for me again

# Maintainer: dawfukfr <[email protected]>

_pkgname="aquamarine"
pkgname="${_pkgname}-git"
pkgver=0.1.0_r148.g601f6cf
pkgrel=1
pkgdesc="Aquamarine is a very light linux rendering backend library "
arch=(any)
url="https://github.com/hyprwm/aquamarine"
license=('BSD-3-Clause')
depends=('pugixml' 'seatd' 'wayland-protocols' 'pixman' 'libdisplay-info' 'opengl-driver' 'hyprutils-git' 'libinput')
makedepends=('git' 'cmake' 'gcc' 'hyprwayland-scanner-git')
source=("${_pkgname}::git+https://github.com/hyprwm/aquamarine.git")
provides=("aquamarine")
conflicts=("aquamarine")
sha256sums=('SKIP')

pkgver() {
  cd ${_pkgname}
  _ver="$(cat VERSION)"
  echo "${_ver}_r$(git rev-list --count HEAD).g$(git rev-parse --short HEAD)"
}

build() {
  cd "${srcdir}/${_pkgname}"
  >>> sed -i -e 's/if (!drmBackend->registerGPU(gpu, newPrimary)) {/if (!drmBackend->registerGPU(gpu, {})) {/' src/backend/drm/DRM.cpp
  cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
  cmake --build ./build --config Release --target all -j$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)
}

package() {
  cd "${srcdir}/${_pkgname}"
  DESTDIR="${pkgdir}" cmake --install build

  install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

@nktnet1
Copy link
Contributor

nktnet1 commented Jul 24, 2024

Thanks @mattydebie - I've made a slightly more robust (less hacky) patch here:

For AUR, place the diff file in the same directory as the PKGBUILD, then replace the sed command to one that applies the diff, e.g. using patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants