phillipberndt / autorandr

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

`Failed to apply profile` error when connecting to an external display through USB-C port [Dell] #299

Closed Antikyth closed 1 year ago

Antikyth commented 2 years ago

I'm creating a new issue to summarize the problems encountered by myself and gforgas in issue #297. Notably, both of these issues are occurring with Dell USB-C display connections. Specifically, I am connecting with Dell's stock USB-C to HDMI (DisplayLink) adapter to an external LG 4K monitor on my Dell XPS 17 9710. gforgas is connecting from a Lenovo ThinkPad T14 Gen 2a to a Dell monitor with a USB-C port on that monitor.

The error that I'm encountering might not specifically be related to the fact they are Dell USB-C connections, but it is a hell of a coincidence that this is the case for both issues. The error I get is:

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 --reflect 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)

When I copy/paste the command to see the real error, it is this:

xrandr: unrecognized option 'Automatic'
Try 'xrandr --help' for more information.

So I am imagining the error is something to do with these --set modes. I tried to skip the --set options by running autorandr --skip-options set, but it didn't do anything.

Antikyth commented 2 years ago

Neofetch reports my specs as:

                   -`                    antikyth@arch-xps
                  .o+`                   -----------------
                 `ooo/                   OS: Arch Linux x86_64
                `+oooo:                  Host: XPS 17 9710
               `+oooooo:                 Kernel: 5.19.2-arch1-1
               -+oooooo+:                Uptime: 3 hours, 3 mins
             `/:-:++oooo+:               Packages: 474 (pacman)
            `/++++/+++++++:              Shell: bash 5.1.16
           `/++++++++++++++:             Resolution: 3840x2400, 3840x2160
          `/+++ooooooooooooo/`           DE: LeftWM
         ./ooosssso++osssssso+`          Theme: Adwaita [GTK3]
        .oossssso-````/ossssss+`         Icons: Adwaita [GTK3]
       -osssssso.      :ssssssso.        Terminal: alacritty
      :osssssss/        osssso+++.       CPU: 11th Gen Intel i7-11800H (16) @ 4.600GH
     /ossssssss/        +ssssooo/-       GPU: Intel TigerLake-H GT1 [UHD Graphics]
   `/ossssso+/:-        -:/+osssso+-     GPU: NVIDIA GeForce RTX 3060 Mobile / Max-Q
  `+sso+:-`                 `.-/+oso:    Memory: 2545MiB / 31832MiB
 `++:.                           `-/+/
 .`                                 `/

gforgas's specs are reported as:

                    '                     
                   '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'
 '                                     '
aleDVirgo commented 2 years ago

I'm having this kind of issue too, I've got a Latitude 5420 and every time I disconnect the usb-c hub I've to manually switch to the laptop profile (only the internal monitor), when i reconnect the hub I received the "Fail to apply profile". This issue never occurred with my old work ThinkPad T14s model.

I've installed the last autorandr version building a deb file from source

        _,met$$$$$gg.               ale@ITFLO1L22009
    ,g$$$$$$$$$$$$$$$P.       ----------------
  ,g$$P"     """Y$$.".                OS: Debian GNU/Linux bookworm/sid x86_64
 ,$$P'              `$$$.                Host: Latitude 5420
',$$P       ,ggs.     `$$b:           Kernel: 6.0.0-2-amd64
`d$$'     ,$P"'   .    $$$             Uptime: 3 hours, 49 mins
 $$P      d$'     ,    $$P             Packages: 1735 (dpkg)
 $$:      $$.   -    ,d$$'               Shell: zsh 5.9
 $$;      Y$b._   _,d$P'             Resolution: 1920x1080, 1920x1080
 Y$$.    `.`"Y$$$$P"'                WM: dwm
 `$$b      "-.__                          Theme: Nordic [GTK3]
  `Y$$                                     Icons: Adwaita [GTK3]
   `Y$$.                                   Terminal: st
     `$$b.                                 Terminal Font: Noto Color Emoji
       `Y$$b.                            CPU: 11th Gen Intel i7-1185G7 (8) @ 1.800GHz
          `"Y$b._                        GPU: Intel TigerLake-LP GT2 [Iris Xe Graphics]
              `"""                           Memory: 3443MiB / 15393MiB
billbrod commented 1 year ago

I was having this issue as well on a Thinkpad Carbon X1 on Fedora 36, when connected to a usb-c hub.

I found a workaround, where I pasted the manual command removed options until the xrandr command ran as expected. That required removing: --set Broadcast RGB Automatic, --set max bpc 12, --set scaling mode Full aspect (and, weirdly, the --rate options, but that might be a different issue).

Once I figured that out, I opened up the config file for the profile, in ~/.config/autorandr/{profile_name}/config and removed the corresponding lines (x-prop-max_bpc, x-prop-broadcast_rgb, x-prop-scaling_mode, rate) and saved it. Then, autorandr works as expected.

ByteDrummer commented 1 year ago

I'm also having this issue with loading the virtual common profile. Unfortunately, the xrandr command is automatically generated, so I can't use @billbrod's workaround.

autorandr --load default --force
Failed to apply profile 'common' (line 930):
  Command failed: xrandr --fb 1920x2520 --output HDMI-A-0 --crtc 1 --gamma 1.0:1.0:1.0 --mode 2560x1440 --panning 0x0 --pos 0x0 --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 0 --gamma 1.0:1.0:1.0 --mode 1920x1080 --pos 0x1440 --primary --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 930)

xrandr --fb 1920x2520 --output HDMI-A-0 --crtc 1 --gamma 1.0:1.0:1.0 --mode 2560x1440 --panning 0x0 --pos 0x0 --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 0 --gamma 1.0:1.0:1.0 --mode 1920x1080 --pos 0x1440 --primary --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: unrecognized option '8'
Try 'xrandr --help' for more information.
phillipberndt commented 1 year ago

Doing investigation in #297.