Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching between profiles failing: "cannot find crtc for output LVDS-1" #149

Open
matedealer opened this issue Apr 17, 2019 · 10 comments · May be fixed by #178
Open

Switching between profiles failing: "cannot find crtc for output LVDS-1" #149

matedealer opened this issue Apr 17, 2019 · 10 comments · May be fixed by #178
Assignees
Labels

Comments

@matedealer
Copy link

If I switch from docked config to mobile config autorandr failed with following error

$ autorandr -c
mobile (detected)
docked
xrandr: specified screen 1600x900 not large enough for output VGA-1 (1920x1080+1920+0)
xrandr: specified screen 1600x900 not large enough for output HDMI-3 (1920x1080+0+0)
xrandr: cannot find crtc for output LVDS-1
Failed to apply profile 'mobile' (line 762):
  Command failed: xrandr --fb 1600x900 --output LVDS-1 --gamma 1.0:1.0:1.0 --mode 1600x900 --pos 0x0 --primary --rate 60.01 --reflect normal --rotate normal (line 762)

My mobile config looks as followed:

output VGA-1
off
output HDMI-1
off
output DP-1
off
output HDMI-2
off
output HDMI-3
off
output DP-2
off
output DP-3
off
output LVDS-1
mode 1600x900
pos 0x0
primary
rate 60.01

My docked config:

output HDMI-1
off
output DP-1
off
output HDMI-2
off
output DP-2
off
output DP-3
off
output LVDS-1
off
output HDMI-3
mode 1920x1080
pos 0x0
rate 60.00
output VGA-1
mode 1920x1080
pos 1920x0
rate 60.00

Autorandr is installed from the Arch Repo.

@phillipberndt
Copy link
Owner

phillipberndt commented Apr 17, 2019

Could you run autorandr in --dry-run mode after detaching and before running it without? I want to know whether it correctly tries to disable the other outputs (--output VGA-1 --off etc.). In the case you quoted it might either be that it did run these, and there was no failure, or that it didn't try to run them. The output of xrandr --verbose after disconnecting / before running autorandr would help, too. Thanks!

@phillipberndt phillipberndt self-assigned this Apr 17, 2019
@matedealer
Copy link
Author

xrandr --verbose in docking station
xrandr --verbose (undocked but autorandr did not activate laptop screen LVDS-1)

Running in docking station

$ autorandr --dry-run   
mobile
docked (detected) (current)

after undocking

$ autorandr --dry-run
mobile
docked

if I enable LVDS-1 and disable VGA-1 & HDMI-3 beforehand and undock then

$ autorandr --dry-run
mobile (detected) (current)
docked

@phillipberndt
Copy link
Owner

You'll need both --dry-run and -c, sorry

@matedealer
Copy link
Author

no problem.

Running in docking station

$autorandr --dry-run -c
mobile
docked (detected) (current)
Config already loaded

after undocking

$ autorandr --dry-run -c
mobile
docked

@travs
Copy link

travs commented Nov 9, 2019

@phillipberndt
I also get this error.

Error:

$ autorandr --load docked 
xrandr: Configure crtc 1 failed
Failed to apply profile 'docked' (line 762):
  Command failed: xrandr --fb 3840x1080 --output eDP-1 --gamma 1.0:1.0:1.0 --mode 1920x1080 --pos 0x0 --primary --rate 59.93 --reflect normal --rotate normal --output DP-1-1 --gamma 1.0:1.0:1.0 --mode 1920x1080 --pos 1920x0 --rate 60.00 --reflect normal --rotate normal (line 762)

Config:

$ cat ~/.config/autorandr/docked/config
output DP-1
off
output HDMI-1
off
output DP-2
off
output HDMI-2
off
output DP-1-2
off
output DP-1-3
off
output eDP-1
mode 1920x1080
pos 0x0
primary
rate 59.93
output DP-1-1
mode 1920x1080
pos 1920x0
rate 60.00

xrandr --verbose outputs: undocked, and docked.

Commands:

# while docked
$ autorandr --load docked --dry-run    

xrandr --fb 3840x1080 --output eDP-1 --gamma 1.0:1.0:1.0 --mode 1920x1080 --pos 0x0 --primary --rate 59.93 --reflect normal --rotate normal --output DP-1-1 --gamma 1.0:1.0:1.0 --mode 1920x1080 --pos 1920x0 --rate 60.00 --reflect normal --rotate normal

# while undocked

xrandr --fb 3840x1080 --output eDP-1 --gamma 1.0:1.0:1.0 --mode 1920x1080 --pos 0x0 --primary --rate 59.93 --reflect normal --rotate normal --output DP-1-1 --gamma 1.0:1.0:1.0 --mode 1920x1080 --pos 1920x0 --rate 60.00 --reflect normal --rotate normal

So

It looks like the other outputs are not being disabled. I tried adding to the command to disable them manually, and this happened:

$ xrandr --fb 3840x1080 --output eDP-1 --gamma 1.0:1.0:1.0 --mode 1920x1080 --pos 0x0 --primary --rate 59.93 --reflect normal --rotate normal --output DP-1-1 --gamma 1.0:1.0:1.0 --mode 1920x1080 --pos 1920x0 --rate 60.00 --reflect normal --rotate normal --output DP-1-2 --off --output DP-1-3 --off --output DP-2 --off --output HDMI-2 --off --output HDMI-1 --off --output DP-1 --off
xrandr: Configure crtc 1 failed

@madduck
Copy link
Contributor

madduck commented Jan 6, 2020

For the record: I always get this crtc error at my workplace, and I found that running xrandr --auto and then retrying makes it work in 100% of times I tried this now.

madduck added a commit to madduck/autorandr that referenced this issue Jan 6, 2020
This patch causes `autorandr` to call `xrandr --auto` before making
other changes. This has no discernable side-effects, but it seems to fix
[issues where `xrandr` would report an
error](phillipberndt#149) like

```
cannot find crtc for output HDMI-1
```

Closes: phillipberndt#149
Signed-off-by: martin f. krafft <madduck@madduck.net>
@madduck
Copy link
Contributor

madduck commented Jan 8, 2020

As suggested by @phillipberndt over in #178, I now created a .config/autorandr/myprofile/preswitch file that calls xrandr --auto in this context, and that fixes the problem for me, without requiring code changes.

@NorfairKing
Copy link

I'm having the same problem, xrandr --auto in a preswitch hook doesn't solve it, and just running the xrandr commands myself does work.

@madduck
Copy link
Contributor

madduck commented Apr 13, 2020

I am now calling

exec xrandr --output DP2-1 --crtc 2 --auto --output DP2-2 --crtc 1 --auto --output eDP1 --crtc 0 --auto

in the profile's preswitch hook. Try something similar?

@NorfairKing
Copy link

@madduck At that point I can just use xrandr myself, but thanks for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants