Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
xrandr activating 3rd screen takes long time
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1771
Location: PB, Germany

PostPosted: Mon Nov 07, 2016 2:41 pm    Post subject: xrandr activating 3rd screen takes long time Reply with quote

Hi,

I have a Laptop with 3 display connectors like DVI-D, Display-Port and VGA. Using all 3 the builtin LCD does turn off.

When X does start with the Login screen (lightdm), 2 screens are active. Inside Xfce I have configured the 3rd screen (VGA) which is configured via xrandr I guess. Now every login takes very long about 3-4 minutes, until the 3rd screen (VGA) becomes active and configured. In the log I found these lines:
Code:
Nov 07 10:39:31 [kernel] [drm:0xffffffff81303ce9] *ERROR* unable to allocate a PPLL
Nov 07 10:39:31 [kernel] [drm:0xffffffff812bc8a6] *ERROR* failed to set mode on [CRTC:40:crtc-3]
Nov 07 10:39:31 [kernel] [drm:0xffffffff81303ce9] *ERROR* unable to allocate a PPLL
Nov 07 10:39:31 [kernel] [drm:0xffffffff812bc8a6] *ERROR* failed to set mode on [CRTC:40:crtc-3]
Nov 07 10:39:31 [kernel] [drm:0xffffffff81303ce9] *ERROR* unable to allocate a PPLL
Nov 07 10:39:31 [kernel] [drm:0xffffffff812bc8a6] *ERROR* failed to set mode on [CRTC:40:crtc-3]
Nov 07 10:39:31 [kernel] Console: switching to colour frame buffer device 200x56
Nov 07 10:39:31 [kernel] [drm:0xffffffff81303ce9] *ERROR* unable to allocate a PPLL
Nov 07 10:39:31 [kernel] [drm:0xffffffff812bc8a6] *ERROR* failed to set mode on [CRTC:40:crtc-3]
Nov 07 10:39:31 [kernel] radeon 0000:01:00.0: fb0: radeondrmfb frame buffer device
Nov 07 10:39:31 [kernel] [drm] Initialized radeon 2.46.0 20080528 for 0000:01:00.0 on minor 0

Why is the cause and how can I solve this?

Hardware is
Code:
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Whistler [Radeon HD 6730M/6770M/7690M XT]

_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3342
Location: Rasi, Finland

PostPosted: Mon Nov 14, 2016 2:10 pm    Post subject: Reply with quote

I've had similar problems with my laptop before. My solution was to have a script that was run at the start of the wm. The script would first disable the laptop's own panel by
Code:
xrandr --output <LAPTOP_MONITOR> --off
... and then turn on the external monitors using --auto -switch.
Although you can also turn on and off more monitors with just one xrandr -command, it still may need a small sleep between turning off the first display and turning on the external display(s).

Anyway... If you turn off the third monitor (inside wm) using xrandr and then back on, does any error get printed to the terminal?
_________________
..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1771
Location: PB, Germany

PostPosted: Mon Dec 05, 2016 9:36 am    Post subject: Reply with quote

Hi, I tried some stuff manually:

--listmonitors and --listactivemonitors are always equal. Initially looks like that:
Code:
Monitors: 3
 0: +*DisplayPort-1 1920/518x1200/324+1680+0  DisplayPort-1
 1: +VGA-0 1680/474x1050/296+0+0  VGA-0
 2: +DisplayPort-2 1680/433x1050/271+0+0  DisplayPort-2
Switching the VGA off the VGA disappears from list:
Code:
$ xrandr --output VGA-0 --off
$ xrandr --listmonitors
Monitors: 2
 0: +*DisplayPort-1 1920/518x1200/324+1680+0  DisplayPort-1
 1: +DisplayPort-2 1680/433x1050/271+0+0  DisplayPort-2
Switching on again works fine without delay:
Code:
$ xrandr --output VGA-0 --auto


You are right, starting X with lightdm, the internal display (LVDS) is on eventhough the lid was closed. Where should I place such a script turning off LVDS when logging in?
I would like to have the same setup configured within WM using some xrandr gui also in the initial X with lightdm. But I did not find a way to export the xrandr calls from Xfce to some xorg.conf if not writing my own xorg.conf.
But using the xrandr GUIs it's always easy to setup and place very different monitors with different resultions side by side.

Testing further:
Turning on the internal display while VGA is still active does not work:
Code:
$ xrandr --output LVDS --auto
xrandr: Configure crtc 3 failed
Too bad, that would mean 4 active monitors including the internal one. I would like that. But maybe restricted by hardware. This wasn't possible in the original operating system (MS) with manufacturer drivers either.
So this is working without delay:
Code:
$ xrandr --output VGA-0 --off --output LVDS --auto
And this as well:
Code:
$ xrandr --output LVDS --off --output VGA-0 --auto


So why is this failing at WM login? And if I do it as you proposed, what happens if I'm on the road without screens, I like to have that all automatically, also by hotplugging with running X as I need to move the laptop from 3 screens desktop to the presentation with VGA beamer. Next thing will be if Xfce will be able to setup the same panels on every screen when switching between those environments.
_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3342
Location: Rasi, Finland

PostPosted: Mon Dec 05, 2016 3:21 pm    Post subject: Reply with quote

Massimo B. wrote:
You are right, starting X with lightdm, the internal display (LVDS) is on eventhough the lid was closed. Where should I place such a script turning off LVDS when logging in?
I would like to have the same setup configured within WM using some xrandr gui also in the initial X with lightdm. But I did not find a way to export the xrandr calls from Xfce to some xorg.conf if not writing my own xorg.conf.
But using the xrandr GUIs it's always easy to setup and place very different monitors with different resultions side by side.
I've left my xorg.configs pretty empty, but as this PC is dual seated I have something there, but not relevant to the issue here.
Instead of xorg.configs I use plain xrandr to set up my monitors correctly.
Well not exatly plain xrandr but bash, awk and xrandr to set my monitor settings automatically.

You need to edit /etc/lightdm/lightdm.conf. And put under the [Seat:*] -section somelike this:
snippet of /etc/lightdm/lightdm.conf:
display-setup-script=/etc/lightdm/display-setup.sh

You can then probe with the script which monitors (the physical ones) are connected.
I'm not sure how I'd do it on-the-fly without first locking the session or logging out.

Here's a function I use commonly when I need to list the monitors.
bash function to list monitors:
function list-monitors {
    # first argument to this function should only have values "connected", "disconnected", "" or NULL.
    xrandr | awk '/^[[:alnum:]-]+ '$1'/ {if ($1 != "Screen") print $1}'
}


And here's an exaple you you can use it:
shell session:
zucca@wren ~ $ list-monitors
DisplayPort-0
DisplayPort-1
DisplayPort-2
HDMI-A-1
zucca@wren ~ $ list-monitors connected
DisplayPort-2
HDMI-A-1
zucca@wren ~ $ list-monitors disconnected
DisplayPort-0
DisplayPort-1
Now with that you can easily:
  • Turn off all the disconnected monitors:
    Code:
    xrandr $(list-monitors disconnected | awk '{print "--output " $1 " --off"}')

  • Turn on all monitors except the laptop display:
    Code:
    xrandr $(list-monitors connected | grep -v LAPTOPDISP | awk '{print "--output " $1 " --auto"}')
    LAPTOPDISP being the name for your internal laptop display (LVDS?).
  • Both above combined:
    Code:
    xrandr $(list-monitors disconnected | awk '{print "--output " $1 " --off"}') --output LAPTOPDISP --off $(list-monitors connected | grep -v LAPTOPDISP | awk '{print "--output " $1 " --auto"}')
I hope those code snippets made any sense. :D But yeah. I'm using those in various ways to automatically turn on and off displays in different situations.

I hope this gets you started and you get the problem fixed.
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1771
Location: PB, Germany

PostPosted: Tue Dec 06, 2016 9:16 am    Post subject: Reply with quote

Thank you for the scripts, I'm going to test that...
I first try with some hard switchoff:
Code:
# grep display-setup /etc/lightdm/lightdm.conf
display-setup-script=/usr/local/bin/2xrandr_singleScreen

# cat /usr/local/bin/2xrandr_singleScreen
#!/usr/bin/env bash
xrandr --output VGA-0 --off --output LVDS --off --output DisplayPort-0 --off


What does disconnected mean? Does X remember screens that have been connected some day before?
_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3342
Location: Rasi, Finland

PostPosted: Tue Dec 06, 2016 9:23 am    Post subject: Reply with quote

Massimo B. wrote:
What does disconnected mean? Does X remember screens that have been connected some day before?
Nah. Those are actutally just display connectors.
With laptops the internal one is always seen as connected of course. And that needs to be taken into account when probing connected monitors. That's where I use grep -v.
_________________
..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1771
Location: PB, Germany

PostPosted: Mon Jan 02, 2017 8:08 am    Post subject: Reply with quote

Happy new year, I have my scripts working. I startup lightdm with
Code:
# grep setup-script /etc/lightdm/lightdm.conf
display-setup-script=/usr/local/bin/1xrandr_externalSingleHead

# cat /usr/local/bin/1xrandr_externalSingleHead
#!/usr/bin/env bash
xrandr --output VGA-0 --off --output LVDS --off --output DisplayPort-2 --off --output DisplayPort-1 --auto

But starting Xfce with the 3 monitor setup still takes minutes. After that I can switch the displays by xrandr very fast. I would need to start Xfce with 1 monitor only and switch it later by xrandr to the 3 monitor setup. But why does Xfce take so long to switch it? We were guessing it is caused by the internal screen taking long to disable, but the problem is still there when starting lightdm with only 1 external screen enabled.

Then I wonder that at boot time I see some kernel error messages I can still lookup in dmesg later:
Code:
[    3.246458] fbcon: radeondrmfb (fb0) is primary device
[    3.494585] [drm:0xffffffff81302ac2] *ERROR* unable to allocate a PPLL
[    3.494587] [drm:0xffffffff812bb697] *ERROR* failed to set mode on [CRTC:40:crtc-3]
[    3.494612] [drm:0xffffffff81302ac2] *ERROR* unable to allocate a PPLL
[    3.494613] [drm:0xffffffff812bb697] *ERROR* failed to set mode on [CRTC:40:crtc-3]
[    3.497539] [drm:0xffffffff81302ac2] *ERROR* unable to allocate a PPLL
[    3.497540] [drm:0xffffffff812bb697] *ERROR* failed to set mode on [CRTC:40:crtc-3]
[    3.500447] Console: switching to colour frame buffer device 200x56
[    3.500453] [drm:0xffffffff81302ac2] *ERROR* unable to allocate a PPLL
[    3.500454] [drm:0xffffffff812bb697] *ERROR* failed to set mode on [CRTC:40:crtc-3]
[    3.503417] radeon 0000:01:00.0: fb0: radeondrmfb frame buffer device
Is this the same issue?
_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1771
Location: PB, Germany

PostPosted: Mon Jan 02, 2017 8:42 am    Post subject: Reply with quote

Something similar: https://bugzilla.kernel.org/show_bug.cgi?id=54381 However that is a hardware with 2 PLLs, but I'm able to run 3 independent screens, so my hardware should have 3 PLLs.
_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3342
Location: Rasi, Finland

PostPosted: Mon Jan 02, 2017 11:27 am    Post subject: Reply with quote

Looking at the log... It could be that frame buffer driver is messing something up.
Radeon Wiki page has CONFIG_FB_RADEON unselected on kernel configuration.
You could try to disable that (if you have it enabled) and see if the problem vanishes...
_________________
..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1771
Location: PB, Germany

PostPosted: Mon Jan 02, 2017 2:40 pm    Post subject: Reply with quote

Same here:
Code:
# zgrep RADEON /proc/config.gz
CONFIG_DRM_RADEON=y
# CONFIG_DRM_RADEON_USERPTR is not set
# CONFIG_FB_RADEON is not set

_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3342
Location: Rasi, Finland

PostPosted: Wed Jan 04, 2017 1:41 pm    Post subject: Reply with quote

Does this delay occur only when turning on displays inside xfce? Or does it happen also when in LightDM or some other WM/DE?
_________________
..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1771
Location: PB, Germany

PostPosted: Thu Jan 05, 2017 12:46 pm    Post subject: Reply with quote

Turning displays inside Xfce is no issue. Just the login.
I tried now to startup lightdm with my tripleHead script, that works fine. Lightdm then has the same setup that Xfce tries to set up. but the login still takes as long as before. Another drawback, having lightdm with 3 monitors set up, I'm not possible to switch to plain terminal (F1) anymore, switching back to F7 works at once and brings lightdm back. Maybe the plain terminal would appear after minutes as well, I didn't try.
It looks like I need to start Xfce with a single screen always and do the switching later by calling my xrandr script. The configured panels are already there in Xfce, even if the monitor doesn't exist at startup...
_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3342
Location: Rasi, Finland

PostPosted: Thu Jan 05, 2017 4:57 pm    Post subject: Reply with quote

If you use systemd you need to specifically tell systemd to start login on vt. Otherwise it starts the login when the vt has been activated. I've encountered some (sometimes long) delays when I have let systemd to start the login.

Anyway that does not still explain the delay when activating the monitor.

So if you force TripleHead via lightdm script that runs xrandr it works. But if xfce tries to set it up for you at the startup of xfce it takes a long time? Right?
_________________
..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1771
Location: PB, Germany

PostPosted: Fri Jan 06, 2017 8:41 am    Post subject: Reply with quote

Zucca wrote:
So if you force TripleHead via lightdm script that runs xrandr it works. But if xfce tries to set it up for you at the startup of xfce it takes a long time? Right?
Yes. The TripleHead script turns off the internal screen and turns on all 3 external screens. That works and Lightdm comes up at once with the correct monitor setup. Then I guess Xfce tries to set up what is saved there, actually the same setup. I could try to delete the setup so that Xfce doesn't try to change it again.

Then it is unclear why switching to the VT is blocked when lightdm runs in 3 screen setup.
What do you mean by "systemd by default starts the login when vt has been activated"? The VTs are setup, but the login (running pam scripts and so on) only starts after passing user/pass... That all doesn't matter for the screen resolution.

Something else I changed, maybe related: Without passing a video= to the kernel I had monitors #1 and #2 up on booting, but only half of the screen was used. Passing video=1920x1200 switches the main screen into full range, the complete screen is used, while the second screen is blurred while having a resolution different from native.. but ok, I can live with it if at least the bigger main screen is ok.

Finally there's something weird with that laptop and docking station driving 3 external screens. As I don't restart that machine often, most time in S3 suspend, I don't see the delay at login that often..
_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3342
Location: Rasi, Finland

PostPosted: Fri Jan 06, 2017 9:38 am    Post subject: Reply with quote

You can change the number of VTs etc via logind.conf. But I think I read somewhere that it may be impossible to switch to a VT if you have already reserved many monitors for X use. It's a limitation of the GPU in use.

You could try to disable xfce from changing the resolution at the startup. At this point a suspect thta theres sometihng "lagging" in the xfce's way to set up this TripleHead setup.
_________________
..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum