phillipberndt / autorandr

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

Failed to apply profile #297

Open gforgas opened 2 years ago

gforgas commented 2 years ago

Hello,

Sometimes autorandr fails to apply profile when pluggin my usb-c dock screen (dell 34" U3421WE). To fix this I have to plug the usb-c DP cable to another DP usb-c port on my laptop then connect again to the autorandr configured usb-c DP port.

Below some outputs that might be relevant.

               '                     
              'o'                     ------------- 
             'ooo'                    OS: Artix Linux x86_64 
            'ooxoo'                   Host: 20XK002SMH ThinkPad T14 Gen 2a 
           'ooxxxoo'                  Kernel: 5.18.5-artix1-1 
          'oookkxxoo'                 Uptime: 3 days, 20 hours, 17 mins 
         'oiioxkkxxoo'                Packages: 814 (pacman) 
        ':;:iiiioxxxoo'               Shell: zsh 5.9 
           `'.;::ioxxoo'              Resolution: 3440x1440 
      '-.      `':;jiooo'             WM: bspwm 
     'oooio-..     `'i:io'            Theme: Adwaita [GTK2/3] 
    'ooooxxxxoio:,.   `'-;'           Icons: Adwaita [GTK2/3] 
   'ooooxxxxxkkxoooIi:-.  `'          Terminal: gnome-terminal 
  'ooooxxxxxkkkkxoiiiiiji'            CPU: AMD Ryzen 7 PRO 5850U with Radeon Graphics (16) @ 1.900GHz 
 'ooooxxxxxkxxoiiii:'`     .i'        GPU: AMD ATI 07:00.0 Cezanne 
'ooooxxxxxoi:::'`       .;ioxo'       Memory: 4027MiB / 14813MiB 

'ooooxooi::'.:iiixkxxo' 'ooooi:' '';ioxxo' 'i:' '':io'
' '


❯ autorandr -fl dell34
Failed to apply profile 'dell34' (line 937; /usr/lib/python3.10/site-packages/autorandr-1.12.1.post1-py3.10.egg/autorandr.py):
  Command failed: xrandr --fb 3440x1440 --output eDP --off --output DisplayPort-0 --crtc 0 --gamma 1.0:1.0:1.0 --mode 3440x1440 --pos 0x0 --primary --rate 59.97 --reflect normal --rotate normal --set max bpc 8 --set non-desktop 0 --set scaling mode None --set TearFree auto --set underscan off --set underscan hborder 0 --set underscan vborder 0 (line 937; /usr/lib/python3.10/site-packages/autorandr-1.12.1.post1-py3.10.egg/autorandr.py)
Antikyth commented 2 years ago

I have the exact same error as this, though obviously a different setup:

Failed to apply profile 'hrz-adjacent' (line 930):
  Command failed: xrandr --fb 7680x2400 --output eDP-1 --crtc 1 --gamma 1.0:1.0:1.0 --mode 3840x2400 --pos 0x0 --rate 59.99 --reflext normal --rotate normal --set Broadcast RGB Automatic --set Colorspace Default --set max bpc 12 --set non-desktop 0 --set scaling mode Full aspect --output  DP-1-6 --crtc 0 --gamma 1.0:1.0:1.0 --mode 3840x2160 --pos 3840x0 --primary --rate 60.00 --reflect normal --rotate normal --set non-desktop 0 (line 930)

I copy/pasted the command and ran it myself to see what the actual error is when running it; the actual problem is:

xrandr: unrecognized option 'Automatic'

I've tried using autorandr --skip-options set to not apply any of the --set options (as I don't need them and they are causing this error), but for some reason it didn't work.

Antikyth commented 2 years ago

I forgot to mention that this is also on a Dell laptop connecting to an external display with the stock Dell USB-C adapter. Would be a hell of a coincidence if it wasn't related!

Specifically, this is a Dell XPS 17 connecting to an external 4k monitor with a DisplayLink USB-C adapter to HDMI (and USB-A). The monitor is connected with an HDMI cable to the adapter.

gforgas commented 2 years ago

Would be nice to get some updates for these issues...

Is a bit puzzling that in this era where Linux is so popular, simple functionalities like display switching are still not working fine.

Even if it's not an autorandr issue per se, would be nice to report theses issues upstream to xrandr devs/mantainers.

phillipberndt commented 1 year ago

I fixed support for skipping set via --skip-options.

The error message you're seeing for the xrandr invocation isn't the same that autorandr saw. That's on me, the "Command failed" output does not properly quote arguments. I fixed that, too. Could you retry? It should now display the exact command that it tried to run, copy & pasteable, and that should then show you the correct xrandr error message.

ByteDrummer commented 1 year ago

I have two displays, eDP and HDMI-A-0. When I unplug HDMI-A-0 It should then switch from docked_home to the default, which I defined as common.

Here is what I tried:

$ autorandr --change --force --default default
docked_home
Failed to apply profile 'common' (line 988):
  Command failed: xrandr --fb 1920x2520 --output HDMI-A-0 --crtc 0 --gamma 1.0:1.0:1.0 --mode 2560x1440 --panning 0x0 --pos 0x0 --primary --reflect normal --rotate normal --transform 1,0,0,0,1,0,0,0,1 --set 'max bpc' 8 --set non-desktop 0 --set 'scaling mode' None --set TearFree auto --set underscan off --set 'underscan hborder' 0 --set 'underscan vborder' 0 --output eDP --crtc 1 --gamma 1.0:1.0:1.0 --mode 1920x1080 --pos 0x1440 --rate 60.03 --reflect normal --rotate normal --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 988)

$ xrandr --fb 1920x2520 --output HDMI-A-0 --crtc 0 --gamma 1.0:1.0:1.0 --mode 2560x1440 --panning 0x0 --pos 0x0 --primary --reflect normal --rotate normal --transform 1,0,0,0,1,0,0,0,1 --set 'max bpc' 8 --set non-desktop 0 --set 'scaling mode' None --set TearFree auto --set underscan off --set 'underscan hborder' 0 --set 'underscan vborder' 0 --output eDP --crtc 1 --gamma 1.0:1.0:1.0 --mode 1920x1080 --pos 0x1440 --rate 60.03 --reflect normal --rotate normal --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: cannot find mode 2560x1440

The update fixes the issue I was having in https://github.com/phillipberndt/autorandr/issues/299#issuecomment-1332791610. There's still another issue where it's trying to set the mode of the display that was disconnected.