Skip to content

Instantly share code, notes, and snippets.

@spikespaz
Last active December 5, 2023 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spikespaz/8d478b01527d3257e3326b40cddb2785 to your computer and use it in GitHub Desktop.
Save spikespaz/8d478b01527d3257e3326b40cddb2785 to your computer and use it in GitHub Desktop.
Monitor Connection Ordering Issue Recount

Summary

I have multiple monitors connected to a Thunderbolt 4 hub, and the monitors must be connected in a specific order to ensure that their respective profiles (position, refresh rate, resolution) are applied.

Setup

DEVICE NAME Description
HOST ThinkPad P14s Gen 4 (AMD).
MASTER_HUB Anker PowerExpand 5-in-1. Has one THUNDERBOLT4_HOST and 10gb/s USB-A on the front, and 3x Thunderbolt 4 (USB-C) split passthru and a DC power jack on the back.
DP_ADAPT CableMatters Thunderbolt 4 to DisplayPort 1.4. Connected via the middle thunderbolt passthru on MASTER_HUB.
PORTABLE_MON Arzopa 14" Portable Monitor. Connected to the leftmost passthru on MASTER_HUB.
DESK_MON Koorui 2K 165hz 16:9 Monitor. Connected to DP_ADAPT (middle MASTER_HUB passthru).

My Hyprland config contains the lines:

monitor = DP-5,2560x1440@165,1600x0,1.000000,bitdepth,10,transform,0
monitor = HDMI-A-1,preferred,3840x1440,1.000000,bitdepth,8,transform,0
monitor = eDP-1,2880x1800@90,1920x1440,1.500000,bitdepth,10,transform,0
monitor = DP-6,1920x1080,0x1440,1.000000,bitdepth,10,transform,0
monitor = , preferred, auto, 1

This expects that DESK_MON should be on DP-5 and PORTABLE_MON on DP-6.

Because the "names" (DP-5, HDMI-A-1, etc.) are not deterministic (i.e. MASTER_HUB middle passthru with DP_ADAPT is not guaranteed to be named DP-6), they must be connected in a certain temporal order.

Behavior before reboot on 04/12/23:

With the system booted and unlocked (to prevent crashes), I first disconnect PORTABLE_MON on the device end. I then connect THUNDERBOLT4_HOST to HOST. Wait for DESK_MON to display, and then connect PORTABLE.

This ensures that DESK_MON is named DP-5 and PORTABLE_MON is named DP-6.

Behavior after reboot on 04/12/23:

With the system booted and unlocked, and PORTABLE_MON disconnected, I connect THUNDERBOLT4_HOST to HOST.

DESK_MON connects and is assigned the name DP-6(!). It takes the configuration intended for PORTABLE_MON.

I connect PORTABLE_MON to MASTER_HUB (at the device end) and it names the name DP-5, with the configuration intended for DESK_MON. It cannot display an image.

Workarounds

  1. Connect PORTABLE_MON to MASTER_HUB before THUNDERBOLT4_HOST to HOST.
  • I did not have to disconnect DESK_MON beforehand.
  • This is acceptable behavior, but it does mean that I must always remove PORTABLE_MON from my bag and attach it.
  1. Swap DP-5 and DP-6 in Hyprland's configs.
  • Not guaranteed to remain this way, may have to swap again.
  • Will do this and observe over time if the names switch again.
  1. Put Precious Time into hyprland-workspace-profiles.
  • Which is also intended to fully configure monitor profiles and select one when monitor identifiers change, irrespective of the names assigned
  1. Invesitigate udev and see if it can do something about this (???).
  2. Fix in Hyprland (???).
  3. Fix in hardware, probably firmware for MASTER_HUB (???).

Update 05/12/23

I have been paying closer attention over the last day and a half, and have noticed that the monitor names appear to switch often. Sometimes after a reboot, but also after resuming from suspend or hibernation. I am continually guessing at the order which to connect the displays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment