You are not logged in.

#1 2019-07-15 01:31:15

alexjan
Member
Registered: 2019-07-10
Posts: 3

Sway/wayland showing two outputs on one physical monitor?

Dear all,

I'm new to Arch Linux and Sway/Wayland. I have struggled to get my Thinkpad T440p / Intel HD4600 and an external monitor Dell UP2414Q (native resolution 3840x2160) to work with Sway/Wayland. Here is some relevant info.

$ sway -v
sway version 1.1-rc1-63-ge3a3917d (Jul 15 2019, branch 'makepkg')

I have tried with 'sway' included in Arch, and then switched to AUR 'sway-git' but the outcomes are the same.

$ swaymsg -t get_outputs
Output eDP-1 'Unknown 0x03FC 0x00000000'
  Current mode: 1600x900 @ 59.994999 Hz
  Position: 3840,0
  Scale factor: 1.000000
  Subpixel hinting: unknown
  Transform: normal
  Workspace: 1
  Available modes:
    1600x900 @ 59.994999 Hz

Output DP-3 'Dell Inc. DELL UP2414Q 6MGJ945T004L'
  Current mode: 1920x2160 @ 59.987999 Hz
  Position: 1920,0
  Scale factor: 1.000000
  Subpixel hinting: unknown
  Transform: normal
  Workspace: 2
  Available modes:
    1920x2160 @ 59.987999 Hz

Output DP-4 'Dell Inc. DELL UP2414Q 6MGJ945T004L' (focused)
  Current mode: 1920x2160 @ 59.987999 Hz
  Position: 0,0
  Scale factor: 1.000000
  Subpixel hinting: unknown
  Transform: normal
  Workspace: 3
  Available modes:
    720x400 @ 70.082001 Hz
    640x480 @ 59.939999 Hz
    640x480 @ 75.000000 Hz
    800x600 @ 60.317001 Hz
    800x600 @ 75.000000 Hz
    1024x768 @ 60.004002 Hz
    1024x768 @ 75.028999 Hz
    1152x864 @ 75.000000 Hz
    1280x800 @ 59.810001 Hz
    1280x1024 @ 60.020000 Hz
    1280x1024 @ 75.025002 Hz
    1680x1050 @ 59.953999 Hz
    1600x1200 @ 60.000000 Hz
    1920x1080 @ 60.000000 Hz
    1920x1200 @ 59.884998 Hz
    1920x2160 @ 59.987999 Hz

It seems Sway/Wayland automatically divide one physical external monitor into two virtual halves and assign each half an output ID. As a result, Sway sees and organizes each output as a separate workspace.

My question is: How could this happen and how could I merge these two outputs DP-3 and DP-4 into one as a big workspace/screen?

It puzzles me because I have tried another options and they worked without any tweaks.

- GNOME 3 on Wayland works fine, only one workspace,  zoom 200% offers clear HiDPI.
- GNOME 3 on Xorg works fine, one workspace, zoom 200% offers clear HiDPI.

Others not-working options:
- i3wm (seems to be on Xorg): does not automatically recognize the external monitor (xrandr output also does not show the external monitor).

Any hints would be truly appreciated.

Alex

Updated 1 - 2019-07-15 11:35
- My apologies. I was mistaken about xrandr in i3wm. After rechecking, xrandr in i3/Xorg detects the external monitor and shows two outputs sad

$ xrandr            
Screen 0: minimum 8 x 8, current 3840 x 2160, maximum 32767 x 32767
eDP1 connected primary 1600x900+0+0 (normal left inverted right x axis y axis) 310mm x 170mm
   1600x900      60.00*+  59.82  
   1400x900      59.88  
   1368x768      60.00    59.88    59.85  
   1280x800      59.81    59.91  
   1280x720      59.86    60.00    59.74  
   1024x768      60.00  
   1024x576      60.00    59.90    59.82  
   960x540       60.00    59.63    59.82  
   800x600       60.32    56.25  
   864x486       60.00    59.92    59.57  
   800x450       60.00  
   640x480       59.94  
   720x405       59.51    60.00    58.99  
   640x360       59.84    59.32    60.00  
DP1 disconnected (normal left inverted right x axis y axis)
DP1-8 connected 1920x2160+1920+0 (normal left inverted right x axis y axis) 530mm x 300mm
   1920x2160     59.99*+
DP1-9 connected 1920x2160+0+0 (normal left inverted right x axis y axis) 530mm x 300mm
   1920x2160     59.99*+
   1920x1200     59.88  
   1920x1080     60.00  
   1600x1200     60.00  
   1680x1050     59.95  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   640x480       75.00    59.94  
   720x400       70.08  
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
VGA1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

So, it seems they are similar to Sway/Wayland. But the main question remains the same: How could I merge two outputs into one?

Update 2
- I have tried cvt/gtf and xrandr on i3/Xorg with different mode ranging from 3840x2160 or 2048x1440 at 60, 59.99, or 30Hz but they all didn't work (error like "xrandr: Configure crtc 1 failed")

Last edited by alexjan (2019-07-15 01:45:03)

Offline

#2 2019-07-15 08:42:11

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: Sway/wayland showing two outputs on one physical monitor?

I don't know to much about this monitor but it sounds like it consists of 2 segments/tiles internally which are detected as unique outputs. This is why the maximum resolution for each shows as 1920x2160; half of 3840.
In Xorg (xrandr) it's relatively simple to merge the two outputs together into a single screen and it would seem Gnome already does this for you (and also has something implemented for this on Wayland) but with Sway, these advanced output configurations are not yet available/implemented.
There is an issue open on GitHub for this though; https://github.com/swaywm/sway/issues/1666

EDIT: You can actually check for monitor tiling info with `xrandr --props`. It should then show a 'TILE' property for both outputs.
Assuming they are ordered correctly (left half is on the left and vice-versa), with a bit of luck it should be enough to do `xrandr --setmonitor UP2414Q auto DP1-8,DP1-9` to get i3 to be correct (you probably need to do so before starting i3).

EDIT2: It would seem there is already a feature request on this issue for xrandr to automatically do this based on the 'TILE' property; https://gitlab.freedesktop.org/xorg/xserver/issues/232

Last edited by Omar007 (2019-07-15 08:56:31)

Offline

#3 2019-07-15 09:03:05

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: Sway/wayland showing two outputs on one physical monitor?

See if you can find something interesting by searching for "MST" = "Multi-Stream Transport". That MST thing is where those two weird 1920x2160 displays come from.

Offline

#4 2019-07-15 11:16:11

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: Sway/wayland showing two outputs on one physical monitor?

Ropid wrote:

See if you can find something interesting by searching for "MST" = "Multi-Stream Transport". That MST thing is where those two weird 1920x2160 displays come from.

MST is not where those resolutions comes from and it will not help you find a solution. MST is just a technique that allows multiple streams to go over a single DP cable. This is what allows display chaining to work or how DisplayPort hubs work.
That display manufacturers (ab)used this feature and technically created 2-in-1 displays (and some even 4-in-1) is the reason for the split. Whether this is a good or bad thing I'll leave up to whoever reads this and his/her workflow. I'm personally not a fan so I avoided these monitors (cross-tile tearing issues, at least in the early days, for instance).

To get technical on why this is:
Basically the scaler used in those monitors just can't handle 4K@60Hz which is why they used 2 or more scalers to get to the desired resolution and refresh rate capability. Normally this would require multiple cables (1 cable per scaler) but with MST they could work around that for DisplayPort monitors by demultiplexing the signal before feeding it to the individual scalers.
More recent monitors (scalers) can handle 4K@60Hz natively without taking this route.

What you will find is that when you put the display in 1.1 mode (MST is not supported in this revision) instead of 1.2 mode (if at all possible with this model), it will disable the tiling and drive it as a single display but obviously only at a maximum of 4K@30Hz due to the bandwidth limit of DP1.1

Last edited by Omar007 (2019-07-15 11:35:10)

Offline

#5 2019-07-15 12:59:48

alexjan
Member
Registered: 2019-07-10
Posts: 3

Re: Sway/wayland showing two outputs on one physical monitor?

Omar007 wrote:

I don't know to much about this monitor but it sounds like it consists of 2 segments/tiles internally which are detected as unique outputs. This is why the maximum resolution for each shows as 1920x2160; half of 3840.
In Xorg (xrandr) it's relatively simple to merge the two outputs together into a single screen and it would seem Gnome already does this for you (and also has something implemented for this on Wayland) but with Sway, these advanced output configurations are not yet available/implemented.
There is an issue open on GitHub for this though; https://github.com/swaywm/sway/issues/1666

EDIT: You can actually check for monitor tiling info with `xrandr --props`. It should then show a 'TILE' property for both outputs.
Assuming they are ordered correctly (left half is on the left and vice-versa), with a bit of luck it should be enough to do `xrandr --setmonitor UP2414Q auto DP1-8,DP1-9` to get i3 to be correct (you probably need to do so before starting i3).

EDIT2: It would seem there is already a feature request on this issue for xrandr to automatically do this based on the 'TILE' property; https://gitlab.freedesktop.org/xorg/xserver/issues/232

Many thanks @Omar007. It was so informative. It seems the feature request by Michael Stapelberg is truly relevant as my monitor is also the same. I have tried two commands proposed by Michael and the command you suggest. It looked like the two outputs are merged into one when I use `xrandr --listmonitors`

$ xrandr --listmonitors
Monitors: 2
 0: +*eDP1 1600/310x900/170+0+0  eDP1
 1: UP2414Q 3840/530x2160/300+0+0  DP1-8 DP1-9

Nonetheless, as I am using GDM to start i3, `~/.xsession` seems to be ignored. Please excuse my ignorant and advice how to start `xrandr`  to merge the outputs before i3 starts.

Thanks a lot.

Last edited by alexjan (2019-07-15 13:00:13)

Offline

#6 2019-07-15 13:08:25

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: Sway/wayland showing two outputs on one physical monitor?

Perhaps try "~/.xprofile". At least with LightDM that file gets run before it starts the desktop. I think I remember when I tried GDM, it also ran ".xprofile".

Offline

#7 2019-07-15 13:46:29

alexjan
Member
Registered: 2019-07-10
Posts: 3

Re: Sway/wayland showing two outputs on one physical monitor?

Ropid wrote:

Perhaps try "~/.xprofile". At least with LightDM that file gets run before it starts the desktop. I think I remember when I tried GDM, it also ran ".xprofile".

Great, thanks Ropid. It works i.e. the virtual screens are merged into one. Nonetheless, the main issue with i3wm tiling is still there, the merged screen looks weird. It's either like two screens get mirrored or displacement/wrong scaling (depending on the merging order of the virtual screens). I gotta dig a little more.

Last edited by alexjan (2019-07-15 13:47:49)

Offline

#8 2019-07-15 14:13:40

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: Sway/wayland showing two outputs on one physical monitor?

alexjan wrote:

Nonetheless, as I am using GDM to start i3, `~/.xsession` seems to be ignored.

Iirc, GDM ignores this one by default. Some DMs may expose a custom session which runs that file but GDM does not.

Ropid wrote:

Perhaps try "~/.xprofile". At least with LightDM that file gets run before it starts the desktop. I think I remember when I tried GDM, it also ran ".xprofile".

Afaik, GDM should indeed respect ~/.xprofile. It is run for every X session though so you might want to add some checks so it doesn't run for all the other sessions (e.g. Gnome, KDE, ...) but only for i3. The arguments for the session should available to check on.

alexjan wrote:

Nonetheless, the main issue with i3wm tiling is still there, the merged screen looks weird. It's either like two screens get mirrored or displacement/wrong scaling (depending on the merging order of the virtual screens). I gotta dig a little more.

If they are mirrored, you might need to ensure they are aligned properly before merging. Also, make sure your i3 output config does not directly make use of the DP1-* ports of the individual tiles.


EDIT:
Short update on the Xorg bug report:

Adam Jackson at gitlab.freedesktop.org/xorg/xserver/issues/232 on Jul 23, 2019 4:14pm UTC wrote:

Some amount of MST support is dependent on the kernel actually setting up the tile property, but the modesetting driver will honor it as of 8fb8bbb3.

So if you're using the modesetting driver with that version, you should no longer need to manually merge the tiles.

Last edited by Omar007 (2019-08-10 11:13:17)

Offline

Board footer

Powered by FluxBB