How I set up my 3840x2160 monitor via HDMI

TL;DR: The /etc/X11/xorg.conf.d/10-monitor.conf I’m using is at the bottom.

What I’ve got: Librem 13v3, external 3840x2160 monitor (Acer ET430K) via HDMI

By default, the highest resolution shown is 1920x1080. That’s kind of expected; it’s just a Linux thing. The monitor will support up to 3840x2160 at 60Hz, but of course only with display port. It’s capped at 30Hz for full resolution over HDMI. Anyway, I wanted to be able to switch to 3840x2160@30Hz occasionally but mostly run under 2560x1440@60Hz, or as near to these settings as possible.

I fiddled around with cvt and xrandr a bunch, trying out different settings. The hardest one to get working was, of course, the one I wanted to use most, 2560x1440.

My basic debug loop was, for example:

$ cvt 2560 1440 55
# 2560x1440 54.93 Hz (CVT) hsync: 81.80 kHz; pclk: 284.00 MHz
Modeline "2560x1440_55.00"  284.00  2560 2744 3016 3472  1440 1443 1448 1489 -hsync +vsync
$ xrandr --newmode "2560x1440_55.00"  284.00  2560 2744 3016 3472  1440 1443 1448 1489 -hsync +vsync
$ xrandr --addmode HDMI-1 2560x1440_55.00
$ xrandr --output HDMI-1 --mode 2560x1440_55.00

And then wait to see how it’d hold up. I initially tried the best theoritical option, which would be cvt -r 2560 1440 giving as near as 60Hz as possible. But that resulting Modeline would blink the screen every ten minutes or so and was pretty maddening.

After many experiments, I did get it use 3840x2160 at around 30Hz, and 2560x1440 at around 55Hz. Follows is my /etc/X11/xorg.conf.d/10-monitor.conf I created. Obviously, no guarantees or warranties from me; this just happens to work for me and maybe it will for others as well. If not, perhaps the debug loop I’ve shown above will help you get what you need.

Section "Monitor"
    Identifier "HDMI-1"

    # Auto detected
    Modeline "1920x1080"   148.50   1920 2008 2052 2200   1080 1084 1089 1125 +hsync +vsync

    # 2560x1440 54.93 Hz (CVT) hsync: 81.80 kHz; pclk: 284.00 MHz
    Modeline "2560x1440knoqi"  284.00  2560 2744 3016 3472  1440 1443 1448 1489 -hsync +vsync

    # 3840x2160x29.98 @ 65.688kHz
    Modeline "3840x2160knoqi"  262.750000  3840 3888 3920 4000  2160 2163 2167 2191  +HSync -VSync

    Option "PreferredMode" "2560x1440knoqi"
EndSection
1 Like

As @knoqi mentioned, this is a Linux kernel + Wayland issue more than anything else. We are tracking it at https://tracker.pureos.net/T298 and that post has the workaround I used which is similar to this one, but just for one resolution.

1 Like

So to clarify, did you switch puros to use Xorg, or was that test in another OS ( the link to https://tracker.pureos.net/T298 mentions Ubuntu live cd )… just looking to whatever I need to achieve a better resolution on an external monitor.

This should work fine with PureOS as long as you are “switching to GNOME on Xorg at the GDM login prompt”. I happen to use Debian sid and Xorg, but the Xorg is the important part, for now. I expect they will get Wayland sorted out in time.

The main challenge with Wayland is that unlike with X, it relies strictly on the display modes that the kernel knows about. By default that only goes up to 1080p and relies on the kernel’s strict interpretation of the EDID spec to accept new modes from a monitor. Many monitors are somewhat loose in how they communicate with the kernel so the kernel ends up rejecting those new modes. Unless I’m mistaken, it will mean adding new modelines up to 4k within the kernel itself.

2 Likes

I know this is mostly “solved” for the time being, but I have been frustrated with the solution, especially since I use two different external monitors: one at work and one at home. One is 2560x1440 and the other is 1920x1080. With the Xorg “fix” installed it works on the higher res, but when I change locations and plug in the 1080p monitor I need to log in in Wayland mode because Xorg seems to try and send 2560x1440 to that monitor as well.

Related to the “kernel’s strict interpretation of EDID” and all that, I did a bit of system exploring and found:

$ cat /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-1/edid | parse-edid
Section "Monitor"
        Identifier "HP Z27n"
        ModelName "HP Z27n"
        VendorName "HWP"
        # Monitor Manufactured week 33 of 2017
        # EDID version 1.3
        # Digital Display
        DisplaySize 600 340
    	Gamma 2.20
        Option "DPMS" "true"
        Horizsync 30-90
        VertRefresh 50-60
        ...
        #Extension block found. Parsing...
        # 15 different modelines follow, one has the working values for 2560x1440 60Hz

So it seems that something on the system was able to read the edid and figure out proper information, it just doesn’t seem to reach Xorg or Wayland. Worst case I could write a udev rule and script that reads the edid from /sys when something is plugged into the HDMI port and add the appropriate modelines. Still only valid for Xorg, but it would fix my different-resolution-external-display issue. But it seems like Xorg or something should already be doing that since the information is there?

2 Likes

Hi @hazybluedot, I also use my Purism 15v3 with 2 different monitor resolutions every day.

What works for me is to set PreferredMode in /etc/X11/xorg.conf.d/10-monitor.conf to the lower of the two resolutions to avoid the issue of setting too high a resolution for the monitor, and then use the command line (and bash aliases for more convenience) to easily toggle between the two settings. For example, I switch between 3440x1440 and 3840x1600, so I call my aliases r34 and r38. Of course, you still have to remember to drop down to the lower one before switching to the lower-res monitor in the same session.

For anyone using 21:9 format monitors, here’s my 10-monitor.conf if helpful. I mainly just code, so 26 or 30 FPS is fine for me:

Section "Monitor"
    Identifier "HDMI-1"

    # Auto detected
    Modeline "1920x1080"   148.50   1920 2008 2052 2200   1080 1084 1089 1125 +hsync +vsync

    # 3440x1440 29.95 Hz (CVT) hsync: 43.96 kHz; pclk: 196.25 MHz 
    Modeline "3440x1440_30.00"  196.25  3440 3600 3952 4464  1440 1443 1453 1468 -hsync +vsync

    # 3840x1600 25.97 Hz (CVT) hsync: 42.25 kHz; pclk: 210.25 MHz
    Modeline "3840x1600_26.00"  210.25  3840 4016 4408 4976  1600 1603 1613 1627 -hsync +vsync

    # Default to the smaller resolution
    Option "PreferredMode" "3440x1440_30.00"

    # Terminal commands to switch between them:
    #
    # xrandr --output HDMI-1 --mode "3840x1600_26.00"
    #
    # xrandr --output HDMI-1 --mode "3440x1440_30.00"
    #
EndSection
1 Like