phillipberndt / autorandr

Auto-detect the connected display hardware and load the appropriate X11 setup using xrandr
2.48k stars 122 forks source link

Failed to apply profile due to `--crtc` option #380

Open aimoff opened 7 months ago

aimoff commented 7 months ago

Hi,

My PC has iGPU and dGPU. The dGPU is connected to a monitor directly via HDMI, and the iGPU is connected to another monitor through USB dock by DisplayPort over Alternative Mode. On this environment, autorandr fails to apply profile as:

$ autorandr mix
Failed to apply profile 'mix' (line 1017):
  Command failed: xrandr --fb 3840x1200 --output DisplayPort-1-4 --crtc 0 --gamma 1.0:1.0:1.0 --mode 1920x1200 --pos 0x0 --primary --rate 59.95 --reflect normal --rotate normal --set Colorspace Default --set 'max bpc' 16 --set non-desktop 0 --set 'scaling mode' None --set TearFree auto --set underscan off --set 'underscan hborder' 0 --set 'underscan vborder' 0 --output HDMI-A-1 --crtc 1 --gamma 1.0:1.0:1.0 --mode 1920x1080 --pos 1920x120 --rate 59.94 --reflect normal --rotate normal --set Colorspace Default --set 'max bpc' 16 --set non-desktop 0 --set 'scaling mode' None --set TearFree auto --set underscan off --set 'underscan hborder' 0 --set 'underscan vborder' 0 (line 1017)

When I ran xrandr manually with same options, the xrandr failed as:

$ xrandr --version
xrandr program version       1.5.1
Server reports RandR version 1.6
$ xrandr --fb 3840x1200 --output DisplayPort-1-4 --crtc 0 --gamma 1.0:1.0:1.0 --mode 1920x1200 --pos 0x0 --primary --rate 59.95 --reflect normal --rotate normal --set Colorspace Default --set 'max bpc' 16 --set non-desktop 0 --set 'scaling mode' None --set TearFree auto --set underscan off --set 'underscan hborder' 0 --set 'underscan vborder' 0 --output HDMI-A-1 --crtc 1 --gamma 1.0:1.0:1.0 --mode 1920x1080 --pos 1920x120 --rate 59.94 --reflect normal --rotate normal --set Colorspace Default --set 'max bpc' 16 --set non-desktop 0 --set 'scaling mode' None --set TearFree auto --set underscan off --set 'underscan hborder' 0 --set 'underscan vborder' 0
xrandr: output DisplayPort-1-4 cannot use crtc 0x4e

As the result, I found autorandr with --skip-options crtc works fine.

$ autorandr --skip-options crtc mix

I'm not sure if it is caused by xrandr version.

Are there any way to apply --skip-options crtc automatically at login or udev trigger? Sorry, I found it.

imLew commented 6 months ago

I have the same issue using autorandr 1.14 and

xrandr program version       1.5.2
Server reports RandR version 1.6

The saved profile of laptop display + one external display with DP over USB-C applies the command

xrandr --fb 3840x3760 --output DP-1-3 --crtc 0 --gamma 1.0:1.0:1.0 --mode 3840x2160 --pos 0x0 --primary --rate 60.00 --reflect normal --rotate normal --set non-desktop 0 --output eDP-2 --crtc 1 --gamma 1.0:1.0:1.0 --mode 2560x1600 --pos 582x2160 --rate 240.00 --reflect normal --rotate normal --set 'Broadcast RGB' Automatic --set Colorspace Default --set 'max bpc' 12 --set non-desktop 0 --set 'scaling mode' 'Full aspect'

which fails. Entering the command manually it fails with

xrandr: output DP-1-3 cannot use crtc 0x3e

while the external display is not active.

Running it without --crtc 0 works and afterwards running the command with --crtc 0 works as well.

Are there any way to apply --skip-options crtc automatically at login or udev trigger? Sorry, I found it.

Where did you find it?

Found it as well, in case anyone else has this issue, add

[config]
skip-options=crtc

to your autorandr/settings.ini.

aimoff commented 6 months ago

Thanks for supplementary comments. On my environment, the interface names are sometimes changed. Thus, my current autorandr/settings.ini is:

[config]
skip-options=crtc
match-edid=true
LeoDroves commented 3 months ago

Same problem here. Adding the skip-options=crtc in config file works as well. Thanks.