Cut your screen resolution exactly in half!

Here you can post about your various experiences with PC hardware. You can also post about hardware that is not compatible with the linux kernel or not recommended for use with Porteus.
nanZor
Shogun
Shogun
Posts: 381
Joined: 09 Apr 2019, 03:27
Distribution: Porteus 5.01 x86-64 LXQT

Cut your screen resolution exactly in half!

Post#1 by nanZor » 30 Nov 2021, 11:06

While working in another project that needed a smaller resolution screen, a friendly dev made an amazing tip:

To keep your screen resolution nice and sharp, simply cut your /native/ screen resolution in half! Say what? Why?

In my case, I was running a pretty standard modern resolution of 1920x1080. But when using xrandr, there was NO option for exactly half the res of a non-standard 960x540 ! I thought I was limited to the monitor's built-in choices which pretty much mimicked what I'd seen everywhere else.

But something odd like 960x540 ?? Who would run that? Someone who wants exactly half the native-resolution for some reason - like keeping it all sharp and spaced properly, that's who.

(Obviously running a full Xorg in Porteus much of this is mitigated by simply changing your fonts and DE options in your native resolution)

The key was to calculate a new modeline, and get it detected by xrandr (or lxrandr gui etc), and switch to it.

So for most, this is not really news. Handy article here:
https://wiki.archlinux.org/title/Xrandr

But the real news for me was that using exactly half-your native resolution could come in handy - perhaps for those running Porteus on a super high-res TV or high-end monster monitor, and they are running out of options with fonts and DE settings, and for some reason, ALL other default choices offered up by xrandr just seem a bit "off" or uncomfortable viewing.

Moral: run your high-res native monitor at exactly HALF. You'll need to calculate the new modeline (I use CVT for that for a little extra precision as compared to the older GTF)
That's a UNIX book - cool. -Garth

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Cut your screen resolution exactly in half!

Post#2 by Rava » 01 Dec 2021, 17:08

nanZor wrote:
30 Nov 2021, 11:06
I use CVT for that for a little extra precision
Can you elaborate on that?

https://wiki.archlinux.org/title/Xrandr says
Troubleshooting
Screen Blinking

For some LCD screens (e.g. Samsung 2343NW, Acer XB280HK, iiyama ProLite XUB3490WQSU-B1...), the command cvt -r (i.e. with reduced blanking) is to be used. E.g with ProLite XUB3490WQSU-B1 and Thunderbolt HDMI 2.0 adapter on Dell XPS 13, with 60hz (59,94 selected) this screen is blinking (and the adapter+LCD screen works perfectly on Windows), you have to do :

cvt -r 3440 1440

Wich giving you :

# 3440x1440 59.97 Hz (CVT) hsync: 88.82 kHz; pclk: 319.75 MHz Modeline "3440x1440R" 319.75 3440 3488 3520 3600 1440 1443 1453 1481 +hsync -vsync

Then you have to do :

xrandr --newmode "3440x1440R" 319.75 3440 3488 3520 3600 1440 1443 1453 1481 +hsync -vsync

and

xrandr --addmode DP1 3440x1440R

Now you can select 59.97hz mode with the best screen resolution, wich (sic!) not blinking anymore.
Added in 2 hours 25 minutes 24 seconds:
Thanks so much for your article. At times one needs a smaller resolution without the X/Y ratio being messed up, just like you wrote.

As example here the info xrandr (without any options) gives me about my main FullHD monitor:

Code: Select all

HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 496mm x 292mm
   1920x1080     60.00*+
   1680x1050     59.95  
   1600x1200     60.00  
   1440x900      59.89  
   1280x1024     75.02    60.02  
   1280x960      60.00  
   1152x720      60.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   640x480       75.00    59.94
As you can see, the used resolution 1920x1080 has the 16:9 or 1.77777… ratio.
While the smallest resolution 640x480 is obviously not; that is 4:3 or 1.33333… ratio.

I try on working it out creating a setup for your 1/4th resolution (half of x and half of y) 960x540 and report here my steps and if I ran into issues.
My system: Port 5.0rc3 XFCE 4.12

It took me some minutes getting the above info since I was on my mono-core Porteus i586 3.1 kernel + 4.0 System when visiting the forum (if you guessed that this is the quite limited machine: yes, indeed.) and had to switch rooms to access my 4 core (8 threads) 5.0rc3 x86-64 main machine to get the above info.
Cheers!
Yours Rava

nanZor
Shogun
Shogun
Posts: 381
Joined: 09 Apr 2019, 03:27
Distribution: Porteus 5.01 x86-64 LXQT

Cut your screen resolution exactly in half!

Post#3 by nanZor » 02 Dec 2021, 02:26

Sure! You might recognize this system. The reason I cut mine in exactly half was because I was using a very simplistic window manager, that has no sizing control of it's own. Therefore, if one wanted things not to look um, really teeny - tiny, this is how I did it on a modern monitor.

My native hardware resolution boots up at 1920x1080. So what I needed was to create a modeline for 960x540 at 60hz since that is not part of my monitors choice of selections:

Calculate the modeline - just the first line here generates the responses.

Code: Select all

tc@box:~$ cvt 960 540 60
# 960x540 59.63 Hz (CVT 0.52M9) hsync: 33.51 kHz; pclk: 40.75 MHz

Modeline "960x540_60.00"   40.75  960 992 1088 1216  540 543 548 562 -hsync +vsync
Great, got the numbers, but now what?

I eventually decided to run a full Xorg, but with this minimal window manager environment that has no user-adjustable handles other than screen res.

So, I made it part of my xorg setup. On this *non-porteus* system, it was placed in this directory as a file "5-monitor.conf"

/usr/local/share/X11/xorg.conf.d/5-monitor.conf

Code: Select all

Section "Monitor"
     Identifier "HDMI-1"
     Modeline "960x540_60.00"  40.75 960 992 1088 1216 540 543 548 562 -HSync +vsync
     Option "PreferredMode"  "960x540_60.00"
     Option "DPMS"
EndSection
I was especially careful to get the Identifier for my screen right, HDMI-1. I've seen other systems that exclude the hyphen, so be careful if yours is actually HDMI1 for instance. Xrandr will tell you what the active screen is, but I've been bitten by missing hyphens before. :)

The Modeline was taken from the cvt calculation made earlier (cvt 960 540 60)

I was also careful about the PreferredMode line, being sure that there are TWO "r" 's in there. :) And also don't forget the underlines. Ah, xorg config files ... so much fun.

I threw the power-saving option of DPMS in because my monitor could do power saving, but not sure if it was truly necessary.

So basically this is how I made it more or less permanent. There are other ways to do this temporarily with xrandr.

What blew my mind was that I had never known that one /had/ to accept a monitors default selections, and could do a custom non-standard modeline! And by doing it exactly half the native resolution specs, it kept fonts sharp, spacing natural and so forth.
That's a UNIX book - cool. -Garth

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Cut your screen resolution exactly in half!

Post#4 by Rava » 02 Dec 2021, 03:30

^
what you quoted is the whole of /usr/local/share/X11/xorg.conf.d/5-monitor.conf ?
nanZor wrote:
02 Dec 2021, 02:26
There are other ways to do this temporarily with xrandr.
Could you explain these?

Tried deciphering man xrandr but it gets confusing how it lists options.

Code: Select all

RandR version 1.1 options

   These options are available for X servers supporting RandR version 1.1
   or older. They are still valid for newer X servers, but they don't
   interact sensibly with version 1.2 options on the same command line.
and then it lists

Code: Select all

RandR version 1.2 options
   These options are only available for X server supporting RandR version
   1.2 or newer.

RandR version 1.3 options
   Options for RandR 1.3 are used as a superset of the options for RandR
   1.2.

RandR version 1.4 options
   Options for RandR 1.4 are used as a superset of the options for RandR
   1.3.

RandR version 1.5 options
   Options for RandR 1.5 are used as a superset of the options for RandR
   1.4.
by calling it

Code: Select all

   xrandr - primitive command line interface to RandR extension
seemingly they ensured how they set up the manpage primitive not translates into easy to understand. :wall:
Cheers!
Yours Rava

nanZor
Shogun
Shogun
Posts: 381
Joined: 09 Apr 2019, 03:27
Distribution: Porteus 5.01 x86-64 LXQT

Cut your screen resolution exactly in half!

Post#5 by nanZor » 02 Dec 2021, 07:07

Oh sure. You can do it on a temporary / per session basis rather than putting into an xorg config file.

But it takes THREE steps. Four if you havent done the cvt calculation first.

1) Tell the system about the NEWMODE existence
2) Add that new mode to the system
3) Choose the new mode, and switch the output to it.

In my case of desiring to cut a native 1920x1080 exactly in half to 960x540 (from my previously calculated modeline with cvt):

Code: Select all

xrandr --newmode "960x540"   40.75  960 992 1088 1216  540 543 548 562 -Hsync +Vsync

xrandr --addmode HDMI-1 "960x540"

xrandr --output HDMI-1 --mode "960x540"
If one is using a graphical utility, like LXrandr, then once you do the first two commandline steps, you can now be pleasantly surprised at finding your newly added mode in the drop down menu you can now switch to rather than having to execute that last line.

I suppose it might be possible to make this some sort of script, rather than editing an xorg config file, or doing it by hand all the time.
That's a UNIX book - cool. -Garth

nanZor
Shogun
Shogun
Posts: 381
Joined: 09 Apr 2019, 03:27
Distribution: Porteus 5.01 x86-64 LXQT

Cut your screen resolution exactly in half!

Post#6 by nanZor » 02 Dec 2021, 07:26

For most, this is probably unnecessary, but maybe just a neat hack for those doing presentations on huge high-resolution screens, OR for those that may be running a window manager environment rather than a DE desktop environment, and just can't see the menus!

Like perhaps Fluxbox, Openbox or others that are either too much of a pain in the butt to configure, or the configuration tool has not been compiled in etc etc. Changing your res is about the only choice, and if your resolution is high enough not to blow your eyes out when you cut the res in half - might make for a pleasurable environment.
That's a UNIX book - cool. -Garth

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Cut your screen resolution exactly in half!

Post#7 by Rava » 02 Dec 2021, 16:03

nanZor wrote:
02 Dec 2021, 07:07
I suppose it might be possible to make this some sort of script, rather than editing an xorg config file, or doing it by hand all the time.
Easily done. Just put a

Code: Select all

#!/bin/sh
into the first line and then all 3 lines as well.

First make sure your HDMI (or probably VGA) output is HDMI-1 - in my case it is HDMI-0 - but on rare occasions - I never figured out why - it is HDMI-1 on the very same machine.

I presume getting back to the standard full HD resolution is just this then:

Code: Select all

xrandr --output HDMI-0 --mode "1920x1080"
Since I use XFCE I further presume the "960x540" mode also appears in XFCE's display settings.
If that's the case the script only needs its first two lines and I can use the XFCE display setting to switch - unless I want it via *.desktop file as well. (That .dektop would not work if the script not got started first, of course)
I created me already three of these for full-HD left, right and normal orientation since my monitor can be turned by 90° and it is quicker to go to the main menu / settings / select orientation than to go into XFCE's display settings and do it there. :)

Currently I am on my single-core 3.1kernel 4.0i586 Porteus again without any external monitor to it (it only has VGA anyway) so I cannot test it right away, but I will as soon as I switch machines. And then [ArnieVoice] I'll be back [/ArnieVoice] and report on it. :D
nanZor wrote:
02 Dec 2021, 07:26
if your resolution is high enough not to blow your eyes out when you cut the res in half - might make for a pleasurable environment.
Not only that, but on a 16/9 aspect monitor you can look for other smaller resolutions that work okay on your monitor, not just the half x / half y one that is "960x540".

Could be your native supported modes not have other common 16/9 resolutions, e.g. common ones for video resolutions like
1280x720
1024x576
800x450
640x360
:celebrate3:

The worst that could happen is a messed up screen. But when your desktop only has the XTerm open and you created yourself a script for resetting to a known working resolution, even they you could execute that script blindly and be back in a working environment.
Make sure to switch to another known to work resolution first (e.g. one that is natively supported by your monitor) and test the restore-resolution-script so that you know how to be able to recover - and that your restore-resolution-script is coded flawlessly.
:juggler:

Even when you use changes and your settings got auto-saved, and you not manage to execute the restore-resolution-script and have to reboot, by using a script solution the theoretically messed-up resolution would not be supported in the anew started Porteus since you would have to manually execute the script introducing the setting to the system, so by default the Porteus DE should revert to one of the standard working resolutions instead.

At least I think so. :D (I never use save-changes - I prefer to be the one who tells my system what to remember and I am fine when it reverts to that state every time I boot it up again)
Cheers!
Yours Rava

nanZor
Shogun
Shogun
Posts: 381
Joined: 09 Apr 2019, 03:27
Distribution: Porteus 5.01 x86-64 LXQT

Cut your screen resolution exactly in half!

Post#8 by nanZor » 03 Dec 2021, 00:06

Rava you made me laugh - I'm thinking of changing the motd to the /arnievoice/ . :) He was also my governor for awhile.

Thinking of having my Porteus start up like Knoppix with the voice. But my favorite if the system has an error notification would be:

/arnievoice/ Get in the chopper!
:)
That's a UNIX book - cool. -Garth

User avatar
M. Eerie
Moderator
Moderator
Posts: 620
Joined: 31 Aug 2017, 21:18
Distribution: Nemesis Xfce/MATE x64

Cut your screen resolution exactly in half!

Post#9 by M. Eerie » 03 Dec 2021, 08:47

Rava wrote:
02 Dec 2021, 16:03
Make sure to switch to another known to work resolution first (e.g. one that is natively supported by your monitor)
Indeed. Beware of mixing resolutions with unsupported frequency modes from your monitor vendor.

Great stuff!
> Does not compute_ 🖖

https://forum.porteus.org/viewtopic.php?p=94310#p94310
https://forum.porteus.org/viewtopic.php?p=84002#p84002
https://forum.porteus.org/viewtopic.php?p=77174#p77174
https://forum.porteus.org/viewtopic.php?f=39&t=8584

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Cut your screen resolution exactly in half!

Post#10 by Rava » 03 Dec 2021, 13:24

nanZor wrote:
03 Dec 2021, 00:06
I'm thinking of changing the motd to the /arnievoice/
Is there a /arnievoice/ generator?
Like vocaloid Hatsune Miku - only über manly instead of über girly.

Just imagine /arnievoice/ "All programs will be terminated"
M. Eerie wrote:
03 Dec 2021, 08:47
Indeed. Beware of mixing resolutions with unsupported frequency modes from your monitor vendor.
Better having a safe reset.

One could also code a

Code: Select all

sleep 10
and then the code to switch back to a known-to-work resolution.

If the tested resolution works just delete those lines.
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Cut your screen resolution exactly in half!

Post#11 by Rava » 07 Dec 2021, 02:16

I tried it with mode "1280x720" but failed:

Code: Select all

guest@porteus:/$ cvt 1280 720 60
# 1280x720 59.86 Hz (CVT 0.92M9) hsync: 44.77 kHz; pclk: 74.50 MHz
Modeline "1280x720_60.00"   74.50  1280 1344 1472 1664  720 723 728 748 -hsync +vsync

guest@porteus:/$ xrandr --newmode "1280x720"  74.50  1280 1344 1472 1664  720 723 728 748 -hsync +vsync

guest@porteus:/$ xrandr --addmode HDMI-0 "1280x720"
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  139 (RANDR)
  Minor opcode of failed request:  18 (RRAddOutputMode)
  Serial number of failed request:  27
  Current serial number in output stream:  28
HDMI-0 is the correct identifier as you can see by my working turn by 90° .desktop:

Code: Select all

guest@porteus:/$ grep xran /usr/share/applications/monitorrotate-left.desktop
Exec=/usr/bin/xrandr --output HDMI-0 --rotate left
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Cut your screen resolution exactly in half!

Post#12 by Rava » 07 Dec 2021, 06:06

Neither does 960x540

Code: Select all

guest@porteus:/$ cvt 960 540 60
# 960x540 59.63 Hz (CVT 0.52M9) hsync: 33.51 kHz; pclk: 40.75 MHz
Modeline "960x540_60.00"   40.75  960 992 1088 1216  540 543 548 562 -hsync +vsync

guest@porteus:/$ xrandr --newmode "960x540"   40.75  960 992 1088 1216  540 543 548 562 -hsync +vsync

guest@porteus:/$ xrandr --addmode HDMI-0 "960x540"
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  139 (RANDR)
  Minor opcode of failed request:  18 (RRAddOutputMode)
  Serial number of failed request:  27
  Current serial number in output stream:  28
Maybe it's because I use the nvidia-340.108-k.5.4.30 module and the NV driver rejects the xrandr --addmode ?
Cheers!
Yours Rava

nanZor
Shogun
Shogun
Posts: 381
Joined: 09 Apr 2019, 03:27
Distribution: Porteus 5.01 x86-64 LXQT

Cut your screen resolution exactly in half!

Post#13 by nanZor » 26 Dec 2021, 23:00

M. Eerie wrote:
03 Dec 2021, 08:47
Rava wrote:
02 Dec 2021, 16:03
Make sure to switch to another known to work resolution first (e.g. one that is natively supported by your monitor)
Indeed. Beware of mixing resolutions with unsupported frequency modes from your monitor vendor.

Great stuff!
Before I tried this, I wondered too, but when it worked, all I could think of is that this sage advice was a left-over from the glass crt days.

But I'm not a heavy hardware guy. The only thing I can think of at this point, is that all the boxes I have are using Intel video hardware. And this has only been tried on my 22-inch HP monitor. Lucky combination?

My thought is that for those where this doesn't work, it may be a driver issue, or perhaps differences in monitors that are hard-coded to NOT let any non-standard "supported resolutions" work. Driver? Monitor?
That's a UNIX book - cool. -Garth

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Cut your screen resolution exactly in half!

Post#14 by Rava » 27 Dec 2021, 09:04

nanZor wrote:
26 Dec 2021, 23:00
My thought is that for those where this doesn't work, it may be a driver issue, or perhaps differences in monitors that are hard-coded to NOT let any non-standard "supported resolutions" work. Driver? Monitor?
Good question, when I do a test run with a different kernel where no nvidia native driver exists, and I recall during that test this very thread, I could do a "Cut your screen resolution exactly in half!" test that not works with my current GPU and monitor using the native NV driver… then we know if using the generic non native display driver makes a difference.
Still, if so, I still prefer the native nvidia driver + supported kernel version combo.
Cheers!
Yours Rava

User avatar
M. Eerie
Moderator
Moderator
Posts: 620
Joined: 31 Aug 2017, 21:18
Distribution: Nemesis Xfce/MATE x64

Cut your screen resolution exactly in half!

Post#15 by M. Eerie » 27 Dec 2021, 10:22

nanZor wrote:
26 Dec 2021, 23:00
a left-over from the glass crt days
You are right. This is probably a thing of the past.

The times I have tried (using live CD's) changing the resolution on other computers, it has simply turned the screen black at worst. Back in the days of CRTs (it's been a couple of years since I've seen them around), the sum of incorrect resolution + unsupported scan rate would damage the monitor.
> Does not compute_ 🖖

https://forum.porteus.org/viewtopic.php?p=94310#p94310
https://forum.porteus.org/viewtopic.php?p=84002#p84002
https://forum.porteus.org/viewtopic.php?p=77174#p77174
https://forum.porteus.org/viewtopic.php?f=39&t=8584

Post Reply