Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
11
rated 0 times [  11] [ 0]  / answers: 1 / hits: 3043  / 1 Year ago, thu, april 6, 2023, 2:09:14

I guess this is more of a question of where do I go to find out when xrandr version 1.5.1 will be published in Ubuntu? It's already available in Arch Linux and was released in August 2019. There is a bug from 2010 I want to have fixed.


Ubuntu 16.04.6 LTS current version is:


$ xrandr --version
xrandr program version 1.5.0
Server reports RandR version 1.5

I'm not well-versed on the subject but could I simply get 1.5.1 source code and compile it? Or should such a mission critical app such as xrandr never be compiled from source?




TL;DR Why it matters


Everyone can try these short little tests on their platform to see the importance of xrandr version and the gamma bug.


The current Ubuntu version has the bug that's been around for 9 years:


$ xrandr --version
xrandr program version 1.5.0
Server reports RandR version 1.5

Basic problem is xrandr reports the wrong gamma values:


$ xrandr --verbose | grep ^DP-1-1 -A5
DP-1-1 connected 3840x2160+1920+0 (0xa5) normal (normal left inverted right x axis y axis) 1600mm x 900mm
Identifier: 0x43
Timestamp: 538179391
Subpixel: unknown
Gamma: 1.0:1.1:1.3
Brightness: 0.63

My "redshift-like" application has set gamma to Red = 1.0, Green = .88 and Blue = .77 but RGB is incorrectly reported as 1.0:1.1:1.3. Now imaging we want to increase brightness to .65. If we don't change gamma at the same time existing settings for gamma are reset to 1:1:1. So we pass what we think are the current values:


$ xrandr --output DP-1-1 --brightness .65 --gamma 1.0:1.1:1.3

Low and behold the screen goes super bluish-greenish and kills our nighttime settings for reddish hue. When we check current settings again we find the values are inverted again:


$ xrandr --verbose | grep ^DP-1-1 -A5
DP-1-1 connected 3840x2160+1920+0 (0xa5) normal (normal left inverted right x axis y axis) 1600mm x 900mm
Identifier: 0x43
Timestamp: 541629314
Subpixel: unknown
Gamma: 1.0:0.91:0.77
Brightness: 0.65

So no matter what value xrandr --verbose is reporting we always have to use 1 / gamma to get real gamma on Red, Green and Blue channels. After correcting our code, we have to put in a test for version 1.5.1 to not correct our code and use the gamma values returned. Assuming the bug has been fixed in version 1.5.1 which I have yet to compile and test.


More From » xrandr

 Answers
4

Actually, unlike libXrandr.so.2, the xrandr program is far from being mission-critical. It's just an X client — an unprivileged app you could install into your home directory to avoid clobbering the system one. Here's how you could do it (as a normal, non-root user!):



cd ~/Downloads
wget https://xorg.freedesktop.org/archive/individual/app/xrandr-1.5.1.tar.xz
tar xvf xrandr-1.5.1.tar.xz
cd xrandr-1.5.1
./configure --prefix=$HOME/opt/xrandr/
make install


For the compilation to work, you have to have installed the build dependencies: namely, the following command should do it.



sudo apt build-dep x11-xserver-utils


Then you can just launch it from the install directory:



$ ~/opt/xrandr/bin/xrandr --version
xrandr program version 1.5.1
Server reports RandR version 1.5


Or you can prepend $HOME/opt/xrandr/bin to your PATH and launch it as you normally launched the system xrandr. Once you are sure it works as you need, you can replace the system /usr/bin/xrandr (maybe having backed up it), so that any other users run it by default.



If you do replace the system binary, don't forget to hold corresponding package (on Ubuntu 16.04 it's x11-xserver-utils) to prevent updates from replacing it with an (most likely) earlier version.


[#4492] Saturday, April 8, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
shionnky

Total Points: 276
Total Questions: 104
Total Answers: 108

Location: Montenegro
Member since Thu, Jun 16, 2022
2 Years ago
;