8

I look thoroughly and I saw that this kind of question was not solved before in the AskUbuntu community. My problem is pretty simple and am sure a lot of Ubuntu users have it:

  • Simply explained, Ubuntu is not able to run multiple monitors with different resolution, size and dpi.

Having the same size full hd monitors works flawlessly, but I have a laptop that has 4K display and a monitor that has 2560x1080 resolution (21:9) and I cannot use the second monitor because everything is scaled and zoomed. Here are some screenshots of my settings (am using Ubuntu 20.04.1 LTS):

enter image description here

enter image description here

Enabling "Fractional Scaling" does not work as expected - the scaling on the second monitor (2560x1080) is kind of blurry and my PC is lagging, the mouse is blinking and so on. Just for information, I have i7 9750H, 16gb of ram and dedicated gtx 1650 gpu, but it seems that the PC starts to lag a log as soon as I enable "Fractional Scaling".

I found an article that might help me: https://techknowfile.dev/using-a-hidpi-monitor-with-a-low-resolution-external-monitor-ubuntu-i3/ but because I have played with xrandr before and messed up stuff so badly without understanding them I decided to call for help here.

I would be really grateful if you help me solve this problem. This should help many other users as well, having a similar problem.

2

5 Answers 5

4
+200

First off I will say that I am no expert at this and anyone else is welcome to provide insight or correction...

I was able to somewhat duplicate the scenario. I have a laptop-->1920x1080 and a TV-->1280x720

My first "answer" is, I was able to push the TV to 1920x1080i without a lot of extra wizardry involved, so have you tried just moving your 34" LG up to a different resolution?

...but with me using the resolutions that were "auto" selected, this is what worked for me:

xrandr --output eDP --auto --verbose --output HDMI-A-0 --auto --scale 2x2 --panning 2560x1440+1920+0 --right-of eDP

This the part where I can use some input... In the panning, I took my TV H-resolution and subtracted it from the H-resolution of the laptop... and added that to the laptop resoultion:
1920 - 1280 --> 640 + 1920 = 2560 .... and then the same with the V-resolution 1080 - 720 --> 360 + 180 = 1440

This was the only way I could get the scaling to behave properly on the TV, otherwise it would be limited to a small portion of the screen and the rest of the screen was not accessible by the cursor.
I am positive that there is a more elegant way of coming up with this, and I am really don't even think it is fully correct, because when crossing between the screens the bottom of the TV doesn't exactly line up with the bottom of the laptop screen. Exactness is going to take more experimenting.

I ran a Transformers action scene on youtube (on the TV) for a few minutes to see if it would behave... unfortunately I didn't realize my laptop wasn't plugged in and it shut off so I only got about 3-4 minutes of testing...

In your case:
With respect to your hesitation to use xrandr... there are a couple of things you can do...

  1. First grab the current settings and put them in the command line or even a script and call it with a launcher.
    xrandr --current will show your current config.
    You could type out xrandr output eDP-1-1 --auto --verbose --output DP-1-3 --auto --right-of EDP-1-1 and execute it. Nothing should happen, this is your current config... but once you start testing, if you end up screwing up the display you could always "up-arrow" to this command and get back to this config. (A while ago, when I was having a similar problem, out of laziness I made a launcher on the panel and put this command in it... so I would just log in and hit the launcher and fix my screens)
  2. If you find that your screen blows up and you can't move your mouse or get back to your terminal, then CTRL+ALT+F4... log in... sudo init 3 to kill your graphical log in... and then sudo init 5 to start it back up again. I believe it takes you back to the graphical login, if not, then either CTRL+ALT+F1 or CTRL+ALT+F7 will. Log back in and continue testing. I haven't been able to cause any permanent damage with xrandr yet...

You may want to check my math but I think your command will be:

xrandr --output eDP-1-1 --auto --verbose --output DP-1-3 --auto --scale 2x2 --panning 5120x3240+3840+0 --right-of EDP-1-1

If you wanted to use a specific resolution instead of "auto", you would remove --auto and replace it with --mode ####x####(an available resolution)... but if there is multiple of the same resolution (ie 1080pvs1080i) you may want to use the register that it has assigned to it, like --mode 0x254 (be aware these may not be persistent).... refer to your xrandr --verbose output.

Again, I am no expert on this, but you can experiment with those numbers, the same way I did until I found a working set. It seemed that the panning was the key when I added the 2x2 scale.

I have read that scaling doesn't always work well with NVIDIA cards.

4
  • Last time I experimented with xrandr I barely recovered the default settings, is there a manual or tutorial how I can use this tool? I have the feeling this might help me, otherwise I stick with both screens at 1080p resolution Aug 19, 2020 at 2:04
  • Every command has a man page man xrandr. I showed you how to get to the default settings(which you are not using by the way)... And even then, I showed you how to get back to 1080p by manually entering a mode. or just REBOOT... xrandr is not persistent by itself. It almost seems as if you did not read through the answer??? for which I will caution, If you just glance at it and type the very first thing you see highlighted in blue, it will not be pleasant. There is an explanation/research there for what I did, that does not apply to your machine.
    – WU-TANG
    Aug 19, 2020 at 3:16
  • You deserve the bounty, for a most detailed answer, thank you for the help. I will try it out soon! Aug 19, 2020 at 6:23
  • thanks, but I would really suggest you check it out first... There's no telling what can make someone's system different from another. It doesn't help you or anyone else who sees this in the future if my answer only worked on my machine, or if i misinterpreted your question. Come back with what you find.
    – WU-TANG
    Aug 19, 2020 at 8:54
1

I came across that problem too, and found my fix here: https://news.itsfoss.com/ubuntu-21-04-multi-monitor-support/

Activating Fractionnal scaling makes it work way better, even without changing the scaling values.

I tried and it did the trick, after closing and opening my session again.

0

You might be able to resize the DPI on one of the monitors so that it works as normal. Try clicking on the "Resolution" dropbox and seeing if it gives you an option that allows you to turn the DPI to the same number.

2
0

What do you mean that "everything" is scaled and zoomed? How do you know everything is scaled and zoomed? Whenever you have a small screen with a high resolution and a big screen with a low resolution, things will just be bigger on the bigger screen.

2
  • Well I just compared the two screens. I had the laptop running 4k without my external monitor and than I had the monitor with the laptop lid closed. This looked fine, until I enabled both, my 4k laptop screen and my 1080p monitor. The external monitor had 200% scaling and had everything zoomed because of the main screen Aug 19, 2020 at 2:00
  • No they won't. Not if the displays are properly configured. Hence the Q. Of course, the Q hasn't really mentioned DPI which is another factor that needs to be considered in the scaling,
    – RichieHH
    Feb 12, 2021 at 21:50
0

Works out of the box on Wayland

but this feature is not available in Xorg

You need to log out and switch to running a Wayland session at the Ubuntu login screen.

enter image description here

Once logged in you can see that the application will resize when fully moved from one display to another.

Unfortunately not all applications are Wayland native yet. Applications not yet ported will not resize on different monitors.

All gnome components (that Ubuntu bases unity on) like calculator, files etc work out of the box. Firefox in Ubuntu requires the MOZ_ENABLE_WAYLAND=1 to be set for it to work.

Wayland also doesn't work with the proprietary NVIDIA because it's a hack specific for Xorg, so you need to switch to the Nouveau driver or get a supported graphics card.

3
  • Well to be honest the functionality may be there, but the support is so poor and so few applications work (+ nvidia causing problems) that it does not work out of the box actually. Not ready for daily use yet Aug 19, 2020 at 1:57
  • Wayland has been the default option on Fedora for the last 4 years, so I would say the technology is ready & stable , but ofc application developers need to build support for it
    – tomodachi
    Aug 19, 2020 at 8:41
  • I just tried Ubuntu on Wayland in Ubuntu 20.04.3 LTS, and while the display settings now allow for different scalings, it is still not possible to scale monitors differently (monitors A and B at 100% + scale monitor B to 200% = both monitors scaled to 200% while settings claim monitor A is still at 100%).
    – jpb
    Sep 8, 2021 at 7:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .