5

I have two 4k monitors one called DP-4, the other DP-2 (plus the Laptop's internal display). Using xrandr (or another command line tool) I would like to arrange them as in the following and also set the scaling to 200%:

screenshot showing monitors as I want them

This almost works with this command:

xrandr \
  --output "DP-4" --primary --pos "0x0"  \
  --output "DP-2" --pos "3840x0" \
  --output eDP-1-1 --off

The only thing not working is setting the scaling of both DP-4 and DP-2 to 200% with xrandr. How can I do this?

PS: I am on Ubuntu 19.10 with Gnome and X (not Wayland, because I use an NVIDIA card).

3 Answers3

2

Adding on @WinEunuuchs2Unix's answer, use --scale 0.5x0.5 command

Like this:

xrandr \
  --output "DP-4" --primary --pos "0x0" --scale 0.5x0.5 \
  --output "DP-2" --pos "3840x0" \
  --output eDP-1-1 --off
  • 1
    If I use --scale 0.5 the result gets very blurry, how can I force that in upscaling 1pixel get rendered by 2x2 Pixel without any smoothing. So a black-white image should still not contain any gray. – JoKalliauer Jul 24 '21 at 18:55
  • 1
    --scale 0.5 --filter nearest Source: https://www.reddit.com/r/GPDPocket/comments/90bras/tip_nearestneighbor_xrandr_display_scaling/?utm_source=share&utm_medium=web2x&context=3 – JoKalliauer Jul 24 '21 at 19:02
2

Why you should use Wayland (with noveau) instead of x11 on Nvidia Graphics cards

I personally recommend to use wayland (with noveau) instead of x11 (with nvidia), because on wayland you do not have any quality-losses as with xranxr --scale, see https://gitlab.freedesktop.org/xorg/app/xrandr/-/issues/56 .

Why --scale of xrandr leads to a blurry results

If you are using "--scale 0.5" you send one frame-buffer-pixel to four real pixels, and it adds a bilinear filter making it blurry. If you are using "--scale 2" you render 4 frame-buffer-pixels for one physical pixel, leading to (1) an useless overload the graphics card and (2) because of the bilinear filtering it is blurry and worsens the result. With --filter nearest you can avoid the blurriness, however the result is much better, but still unacceptable for reading fonts or graphics design.

Further advantages of Wayland

Wayland (with nouveau) has many advantages such as (a) factural scaling 100%,125%,150%,175%,200% (b) screenwise scaling (c) a lossless-scaling, see https://unix.stackexchange.com/a/660345/241592 for details.

JoKalliauer
  • 1,575
  • 2
  • 17
  • 26
  • 1
    Thanks, I did not know. I'd love to switch to Wayland but as far as I know performance of noveau is much poorer than the closed nvidia version. And the closed nvidia version does not (yet) support wayland. Or has this changed? – nachtigall Aug 08 '21 at 09:01
  • @nachtigall Yes, Nvidia performs better than Noveau (iff no scaling), however Nvidia is also buggier than Noveau. If you do not need any scaling I would use X11 (with Nvidia) because X11 is more stable/compatible to most applications. However if you need scaling you have to switch to Wayland (with noveau), otherwise you will have drastic performance and quality-losses. (1) If you want scaling use Wayland (2) If you want stability use X11 with Noveau (3) If you don't need scaling and prefer performance over stability use Nvidia – JoKalliauer Mar 04 '22 at 10:09
1

You are just missing the --scale 2x2 argument. So use:

xrandr \
  --output DP-4 --primary --pos 0x0 --scale 2x2 \
  --output DP-2 --pos 3840x0 --scale 2x2 \
  --output eDP-1-1 --off

Note: Double quoting the monitor and position is unnecessary so I removed the ".

  • 1
    Does this work for you? My desktop goes crazy when I enter this command. Everything is very small and I have to restart/kill X, see these two screenshots: https://imgur.com/a/MejnKwP

    Not sure this is just a nvidia driver issue because when entering via Ubuntu's display settings manually it works fine (Problem is just that these settings are always forgotten once entered)

    – nachtigall Dec 05 '19 at 16:04
  • @nachtigall It works for others but personally I use scaling of 1.38 setup in tweak tool. As far as persistence of xrandr settings see: How to run xrandr commands at startup in Ubuntu – WinEunuuchs2Unix Dec 06 '19 at 03:53
  • yeah, running xrandr at startup is my goal if it would only be working. Thanks for the link. – nachtigall Dec 06 '19 at 06:37
  • "I use scaling of 1.38 setup in tweak tool" – do you mean font scaling? This seems different from whole desktop/monitor scaling. My font scaling in the Tweaks tools is still 1,00 besides my Display settings being 200% (set manually). – nachtigall Dec 06 '19 at 06:41
  • 1
    Yes font, scaling set to 1.38. I leave my monitor set at 3840x2160 so 4K video can be displayed and 4K wallpaper, etc. I've also made my cursor, icons and title bars larger. In Chrome and Firefox I have web pages zoomed at 110%. Then a separate app gradually adjusts brightness and gamma individually for three monitors at dawn and dusk over 1 to 2 hour period. It's perfect for me but others might not be so picky... – WinEunuuchs2Unix Dec 06 '19 at 11:32
  • 2
    Using 2x2 seems the correct answer, but either Gnome or NVIDIA drivers are buggy. So it still does not work for me. – nachtigall Mar 26 '20 at 06:30
  • --scale 0.5 is a similar result as setting Settings>Display>Scale to 200%, however using something different than --scale 1 always leads to blurry results, so use the Settings-dialog, this does not blur the result – JoKalliauer Jul 24 '21 at 18:52