redshift icon indicating copy to clipboard operation
redshift copied to clipboard

Multiple Monitors not working with randr mode on 16.04

Open EpochalEngineer opened this issue 7 years ago • 26 comments

I have 2 monitors and redshift is only modifying the first one. running redshift -m randr.

~$ redshift
Trying location provider `geoclue2'...
Using provider `geoclue2'.
Using method `randr'.

randr output, showing two monitors:

~$ xrandr
Screen 0: minimum 8 x 8, current 5120 x 1600, maximum 16384 x 16384
VGA-0 disconnected (normal left inverted right x axis y axis)
LVDS-0 connected (normal left inverted right x axis y axis)
   1920x1080     60.01 +
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 connected 2560x1600+0+0 (normal left inverted right x axis y axis) 641mm x 401mm
   2560x1600     59.97*+
   1920x1200     59.88  
   1920x1080     60.00    59.94    50.00    23.97    60.05    60.00    50.04  
   1680x1050     59.95  
   1600x1200     60.00  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1280x720      60.00    59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       60.01    59.94  
   640x480       75.00    59.94    59.93  
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
DP-6 connected primary 2560x1600+2560+0 (normal left inverted right x axis y axis) 641mm x 401mm
   2560x1600     59.97*+
   1920x1200     59.88  
   1920x1080     60.00    59.94    50.00    23.97    60.05    60.00    50.04  
   1680x1050     59.95  
   1600x1200     60.00  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1280x720      60.00    59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       60.01    59.94  
   640x480       75.00    59.94    59.93  

OS: Ubuntu 16.04 Version: redshift 1.10

Odd thing is on a very similar laptop running Ubuntu 14.04 with the redshift 1.10 works fine on the same monitors. and says the same thing:


Trying location provider `geoclue2'...
Using provider `geoclue2'.
Using method `randr'.

Out of curiosity I copied the binary from 14.04 over, in case it had been manually compiled with xrandr support or something... same result.

EpochalEngineer avatar Sep 21 '17 06:09 EpochalEngineer

Is it possible that the graphics driver was updated between 14.04 and 16.04? In any case, it doesn't seem directly related to how Redshift is working. Can you get xgamma to change the gamma ramps on both screens?

jonls avatar Sep 26 '17 22:09 jonls

I am not sure how to do this with xgamma. I have tried to use xgamma -s 0:0 0:1 to enable two screens, but nothing changed. Can you illustrate more?

i2000s avatar Oct 19 '17 03:10 i2000s

I was just wondering if you run something like xgamma -gamma 0.5 does it affect all monitors or just the first one? Additionally, you can check to see if the xrandr tool is able to affect all monitors e.g. xrandr --output DP-3 --gamma 0.5:0.5:0.5 or xrandr --output DP-6 --gamma 0.5:0.5:0.5.

jonls avatar Oct 19 '17 05:10 jonls

The first command line doesn't change the secondary monitor.

$ xgamma -gamma 0.5
-> Red  1.000, Green  1.000, Blue  1.000
<- Red  0.500, Green  0.500, Blue  0.500

For the second command, I have tried using different numbers of DP-*, but it always gave

xrandr: Need crtc to set gamma on.

then nothing got changed.

i2000s avatar Oct 19 '17 05:10 i2000s

Ok, thanks. My guess is that this is more likely to be a driver issue than anything we can fix directly in Redshift. Have you reported these issues to your distribution?

jonls avatar Oct 19 '17 19:10 jonls

Gotcha. I am using a DisplayLink Dock station. This issue might be related to that, or Ubuntu itself. I will report to them. Thank you for looking into this issue.

i2000s avatar Oct 19 '17 19:10 i2000s

I've got a DisplayLink USB3.0 monitor as a second screen with exactly the same problem. Any news?

ghost avatar Nov 27 '17 21:11 ghost

Linux Mint 18.3 (based on 16.04.3), seeing same issue on second monitor. GTX 660 (384.90-0ubuntu0.16.04.2), first DVI works, second DVI no changes.

EDIT: xgamma -gamma 0.5 only affected the first monitor initially, but after setting second display as primary and first display again, both are controlled together. Looks like all is well now.

I have the same issue. Redshift only affects one monitor.

ArchLinux with kernel 4.14.13

@all-the-good-ones-are-gone Can you elaborate? I have one primary monitor but how does swapping the two helps?

rubik avatar Jan 21 '18 09:01 rubik

Adding my data point to the mix. I'm seeing the same issue with Ubuntu 16.04, DisplayLink USB 3.0 docking station, and Redshift. Redshift affects the laptop screen but neither if the 2 monitors I have connected via the docking station. Seems like it might have to do with the docking station, but I have no proof one way or the other.

rsaltrelli avatar Apr 16 '18 01:04 rsaltrelli

+1 here, have displaylink USB 3.0 docking station, redshift only works with the laptop screen. xrandr shows my displays though.

kaangoksal avatar May 14 '18 02:05 kaangoksal

same here, kubuntu 18, displaylink

aludwiko avatar Aug 13 '18 18:08 aludwiko

same here, Linux Mint 18 Sarah running cinnamon eDP1 is the built-in monitor which normally works with redshift, and remains the primary display at all times. DP1 is the external monitor and when it's connected, redshift works only on the 2nd monitor.

setting screen=1 results in X Error of failed request: BadValue (integer parameter out of range for operation)

adjustment-method=vidmode screen=0

$ xrandr Screen 0: minimum 8 x 8, current 4280 x 1920, maximum 32767 x 32767 eDP1 connected primary 3200x1800+0+0 (normal left inverted right x axis y axis) 294mm x 165mm 3200x1800 59.98*+ 47.99
2880x1620 60.00
2560x1440 60.00
2048x1536 60.00
1920x1440 60.00
1856x1392 60.01
1792x1344 60.01
2048x1152 60.00
1920x1200 59.95
1920x1080 60.00 59.93
1600x1200 60.00
1680x1050 59.95 59.88
1600x1024 60.17
1400x1050 59.98
1600x900 60.00
1280x1024 60.02
1440x900 59.89
1280x960 60.00
1368x768 60.00
1360x768 59.80 59.96
1152x864 60.00
1280x720 60.00
1024x768 60.00
1024x576 60.00
960x540 60.00
800x600 60.32 56.25
864x486 60.00
640x480 59.94
720x405 60.00
640x360 60.00
DP1 connected 1080x1920+3200+0 left (normal left inverted right x axis y axis) 527mm x 296mm 1920x1080 60.00*+ 50.00 59.94
1680x1050 59.88
1600x900 60.00
1280x1024 60.02
1440x900 59.90
1280x800 59.91
1280x720 60.00 50.00 59.94
1024x768 60.00
800x600 60.32
720x576 50.00
720x480 60.00 59.94
640x480 60.00 59.94
720x400 70.08
DP2 disconnected (normal left inverted right x axis y axis) HDMI1 disconnected (normal left inverted right x axis y axis) HDMI2 disconnected (normal left inverted right x axis y axis) VIRTUAL1 disconnected (normal left inverted right x axis y axis)

jerkey avatar Nov 14 '18 07:11 jerkey

Same issue. Ubuntu 18 LTS, display link drivers 4.4.24, single laptop connected to a docking station connected to two other monitors.

Laptop screen adjusts fine. No change on the other two monitors.

Worth noting for me - that the "Night Light" feature of Ubuntu 18 also does NOT affect the other 2 monitors. - implying in my case it is some kind of driver issue with the docking station.

A workaround in my situation is to set the RGB of the external monitors to 100/64/33, and then raise the brightness slightly. I believe this is roughly 2700K (based on this https://academo.org/demos/colour-temperature-relationship/). This may be useful to others.

KevTheRev13 avatar Dec 09 '18 06:12 KevTheRev13

Same issue here, very similar settings as KevTheRev13. Linux Mint 19.1 (thus Ubuntu 18.04 LTS), display link drivers 4.4, single laptop connected to a docking station, but with a single monitor. Laptop screen also adjusts fine, but not the monitor connected to the docking station.

gusbrs avatar Jan 09 '19 23:01 gusbrs

Same here, I have a USB 3 screen in Linux Mint 19.1, works flawless but redshift won't update the plugged screen with the main one.

RickSlashee avatar Feb 26 '19 10:02 RickSlashee

Same here, two external monitors over USB docking station. Xubuntu 18.04.2 LTS, 4.15.0-47-generic

moobsen avatar Apr 16 '19 21:04 moobsen

Same issue for me with the Monitor connected through DisplayLink. This needs to be fixed in the DisplayLink driver, as it currently doesn't support gamma correction: https://displaylink.org/forum/showthread.php?t=65641

andlpd avatar Apr 25 '19 19:04 andlpd

Any update on this? I'm getting really eye-fatigated lately and I really need this to work.

Ury18 avatar Jun 05 '19 16:06 Ury18

#311 is the issue for displaylink AFAIU the issue here.. is just the program seemingly "always referring back" to a single monitor?

mirh avatar Jun 24 '19 13:06 mirh

I was also observing this when I plugged in a new monitor (and made it the primary) with Redshift already running. My old monitor is DP-0 and new monitor is HDMI-0. Here's what worked for me:

  1. I killed the running redshift.
  2. Reset my older monitor's gamma to 1:1:1 (xrandr --output DP-0 --gamma 1:1:1 (-P flag to redshift may do the same thing)).
  3. I ran redshift -m randr:screen=0,1 -b 0.4 to confirm it would adjust both monitors. Ctrl-C'd that.
  4. Restarted background redshift: nohup redshift -m randr:screen=0,1 &. (I don't know if that is even a valid screen option or if it is just parsing that as X screen 0, and Xinerama is presenting both inputs as a single X composite screen... either way, it "works for me.")

cemeyer avatar May 05 '20 15:05 cemeyer

From what I can tell there are at least two issues here. One is DisplayLink which I don't think is an issue that can be fixed in any way in Redshift. The second is dynamically discovering screens when they are plugged in/out. This is something I've been working on but haven't had a chance to finish. Are there any other issues where things like xgamma works but Redshift doesn't?

jonls avatar Jun 14 '20 03:06 jonls

@jonls I think the issue is that Redshift aims only "Main|Primary" screen monitor After disconnecting HDMI-1 one USB-3.0 port monitor becomes manageable from Redshift (Both are connected directly)

There is also weird issue with on Mint 19.3 in which USB 3.0 connected monitor is detected as DP-1|2 -> Display Port viewable from Display Manager menu while monitor has HDMI input connected to USB on the laptop Nevertheless, it is consistent with xrandr info

Not sure whether it helps you

navaare avatar Jun 21 '20 12:06 navaare

Any update on this? I'm getting really eye-fatigated lately and I really need this to work.

I feel you.

Mint 19.3, main display on DP and secondary on HDMI. Using an AMD RX580, running mesa, if that helps (not seen any talk of hardware related possibilities).

Zobbster avatar Jan 11 '21 03:01 Zobbster

I have two of the same monitors. When I accidentally switched off the secondary, RedShift no longer worked on the secondary monitor; a reboot did not fix the issue. While it is nice to look at a crisp-clear screen, it really hurts my eye after dark.

System info:

System:
  Host: x570 Kernel: 5.19.0-38-generic x86_64 bits: 64
    Desktop: Cinnamon 5.6.8 Distro: Linux Mint 21.1 Vera
Machine:
  Type: Desktop Mobo: ASUSTeK model: ROG STRIX X570-F GAMING v: Rev X.0x
    serial: <superuser required> UEFI: American Megatrends v: 4021
    date: 08/09/2021
CPU:
  Info: 8-core model: AMD Ryzen 7 5700G with Radeon Graphics bits: 64
    type: MT MCP cache: L2: 4 MiB
  Speed (MHz): avg: 1398 min/max: 1400/4672 cores: 1: 1396 2: 1397 3: 1397
    4: 1400 5: 1400 6: 1400 7: 1397 8: 1397 9: 1400 10: 1397 11: 1400 12: 1400
    13: 1397 14: 1400 15: 1397 16: 1400
Graphics:
  Device-1: AMD Cezanne driver: amdgpu v: kernel
  Device-2: Realtek RTL2838 DVB-T type: USB
    driver: dvb_usb_rtl28xxu,rtl2832_sdr
  Device-3: Logitech C922 Pro Stream Webcam type: USB
    driver: snd-usb-audio,uvcvideo
  Display: x11 server: X.Org v: 1.21.1.3 driver: X: loaded: amdgpu,ati
    unloaded: fbdev,modesetting,vesa gpu: amdgpu resolution: 1: 2560x1440~60Hz
    2: 2560x1440~60Hz
  OpenGL: renderer: RENOIR (renoir LLVM 15.0.6 DRM 3.47 5.19.0-38-generic)
    v: 4.6 Mesa 22.2.5
Audio:
  Device-1: AMD Renoir Radeon High Definition Audio driver: snd_hda_intel
  Device-2: AMD Family 17h HD Audio driver: snd_hda_intel
  Device-3: Logitech C922 Pro Stream Webcam type: USB
    driver: snd-usb-audio,uvcvideo
  Sound Server-1: ALSA v: k5.19.0-38-generic running: yes
  Sound Server-2: PulseAudio v: 15.99.1 running: yes
  Sound Server-3: PipeWire v: 0.3.48 running: yes
Network:
  Device-1: Intel I211 Gigabit Network driver: igb
  IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: 04:42:1a:95:2b:37
  IF-ID-1: br-71420eb15f24 state: up speed: 10000 Mbps duplex: unknown
    mac: 02:42:0d:7d:2a:96
  IF-ID-2: docker0 state: down mac: 02:42:46:5b:cb:ec
  IF-ID-3: veth8afd5ed state: up speed: 10000 Mbps duplex: full
    mac: 6e:98:4a:39:1e:53
  IF-ID-4: vethf661acb state: up speed: 10000 Mbps duplex: full
    mac: 96:d5:a8:ed:58:fa
Drives:
  Local Storage: total: 1.82 TiB used: 315.78 GiB (17.0%)
  ID-1: /dev/sda vendor: Samsung model: SSD 860 EVO M.2 1TB
    size: 931.51 GiB
  ID-2: /dev/sdb vendor: Samsung model: SSD 860 EVO M.2 1TB
    size: 931.51 GiB
Partition:
  ID-1: / size: 93.31 GiB used: 30.09 GiB (32.2%) fs: ext4 dev: /dev/sda2
  ID-2: /boot/efi size: 974.1 MiB used: 6.1 MiB (0.6%) fs: vfat
    dev: /dev/sda1
  ID-3: /home size: 562.15 GiB used: 285.69 GiB (50.8%) fs: ext4
    dev: /dev/sda3
Swap:
  ID-1: swap-1 type: partition size: 122.07 GiB used: 0 KiB (0.0%)
    dev: /dev/sda4
Sensors:
  System Temperatures: cpu: 32.0 C mobo: 39.0 C gpu: amdgpu temp: 35.0 C
  Fan Speeds (RPM): fan-1: 0 fan-2: 431 fan-3: 521 fan-4: 0 fan-5: 0
    fan-6: 0
Info:
  Processes: 441 Uptime: 1h 10m Memory: 62.1 GiB used: 6.9 GiB (11.1%)
  Shell: Bash inxi: 3.3.13

M-ax-G avatar Apr 06 '23 08:04 M-ax-G

Same issue. Ubuntu 18 LTS, display link drivers 4.4.24, single laptop connected to a docking station connected to two other monitors.

Laptop screen adjusts fine. No change on the other two monitors.

Worth noting for me - that the "Night Light" feature of Ubuntu 18 also does NOT affect the other 2 monitors. - implying in my case it is some kind of driver issue with the docking station.

A workaround in my situation is to set the RGB of the external monitors to 100/64/33, and then raise the brightness slightly. I believe this is roughly 2700K (based on this https://academo.org/demos/colour-temperature-relationship/). This may be useful to others.

With the DisplayLink docking station connected to two monitors messing up the functionality of Redshift, this seemed to be the perfect workaround! Thanks for the tip @KevTheRev13!

As an example, the 4200K is my preferred day setting, which converts to rgb(255,211, 175), you can do the following math to convert it to the 100/82/68 settings for your monitor: 211x100/255=82 175x100/255=68

This would give the same result as when you would do redshift -O 4200.

Comfortable nighttime settings would be redshift -O 3400 190x100/255=75 135x100/255=53 100/75/53

Mithlonde avatar Aug 09 '23 09:08 Mithlonde