Page MenuHomePhabricator

Dual display monitor isssues with resolution and displays being on/off
Closed, ResolvedPublic

Description

I mentioned this on the edevelop mailing list. I will copy and paste much of what I said there, as it is basically the same. Rather than use slides, I have a video of a presentation that shows the issues first hand.

Here is a link to the presentation
https://www.youtube.com/watch?v=jbDpKjznI3M

You can see the issue with E at 1:25:00 roughly. Does cover some KDE stuff for a bit, but not bad to see.

E seems to be remembering settings for external display and at times applying them when not wanted. At my desk, when I plug in my laptop to external monitor. I have it set to keep that off. I use a script I click on a icon on my desktop to toggle the displays. Turn off laptop, turn on external. This works fine except E does spit out some error every time, but works fine.

Now on occasion I plug my laptop in, and wake it up from sleep and it has the external monitor on, and internal off. When it was not using an external at first. Seems to handle "hot" plugging when logged in better than when logged out, and doing your first log in with new external display attached.

In the case of my presentation. It would not activate the external monitor. When it did, it changed the resolution of BOTH my laptop display and the external to the lowest. When they were both capable of the highest, 1920x1080.

In this situation what I was expecting, like I got with KDE/Kwin. With a new external monitor connected. When first logging into E, both displays should be active, and at their highest resolution. The only time a display should be off. Is when it is the exact display that was connected before.

At my desktop I have it set to be off when plugged in. But if I plug in any other monitor, it should be activated. Ideally settings per monitor rather than globally. Or something along those lines. If monitors had UUID it would be great. I think things are limited to Vendor/Make/Model. Which does not help if using 2 of the same displays in different configurations.

Either way I expected E to have both displays activated. In the case where that does not happen. When I do activate and external display, it should not effect the resolution of the primary display. When it does activate the external. That should be at its highest resolution vs lowest.

this is quite hard to comprehend as you are mixing different issues. it would be really helpful if you would open a ticket per issue and be brief.

so one ticket for (i hope these are all of them)

  • resolution change of the primary display when hot plugging a new monitor
  • hot plugging and remembering monitors
  • setting the highest resolution for new monitors
  • wakeup from sleep -> wrong monitor active

also

I use a script I click on a icon on my desktop to toggle the displays

please upload this script

# killall -9 X

is very, very bad, because -9 is SIGKILL, meaning it's not giving X and its children time to shutdown. so please don't.

Seems to handle "hot" plugging when logged in better than when logged out

when you are logged out, e is not active and cannot respond to hot plugging of any monitor nor can it do anything else.

additionally please post your graphic card details (lspci | grep VGA) and the driver you are using.

thank you.

this is quite hard to comprehend as you are mixing different issues. it would be really helpful if you would open a ticket per issue and be brief.

so one ticket for (i hope these are all of them)

  • resolution change of the primary display when hot plugging a new monitor
  • hot plugging and remembering monitors
  • setting the highest resolution for new monitors
  • wakeup from sleep -> wrong monitor active

I can open different tasks, but they are all about display sessions basically. Remember some state, and that causes the individual issues.

Script per request

$ cat ./scripts/display_toggle.sh
#!/bin/bash

LDSP="eDP1"
HDMI="HDMI2"

if [[ -n "$(xrandr | grep ${HDMI}\ connected)" ]] &&
[[ -n "$(xrandr | grep ${LDSP}\ connected | grep 1920)" ]]; then
        xrandr  --output "${HDMI}" --auto --output "${LDSP}" --off
        sudo /etc/X11/xinit/99-synergyc
else
        xrandr  --output "${LDSP}" --auto --output "${HDMI}" --off
        sudo killall -9 synergyc
fi

return 0

Called from desktop file I click on

[Desktop Entry]
Comment[en_US]=
Comment=
Exec=/home/wlt/scripts/display_toggle.sh
GenericName[en_US]=Turns on/off either LVDS/HDMI-0
GenericName=Turns on/off either LVDS/HDMI-0
....
# killall -9 X

is very, very bad, because -9 is SIGKILL, meaning it's not giving X and its children time to shutdown. so please don't.

Not sure where you got the killall -9 X from, I guess the presentation. That happened when switching from SDDM to Entrance, and X was abandoned. The init scripts did their thing. I just need to stop it so I can start via the other log in manager. Entrance has a good deal of issues I am still working on. At the time I did not care about shutting it down properly. Just what ever was fastest. It worked fine.

Seems to handle "hot" plugging when logged in better than when logged out

when you are logged out, e is not active and cannot respond to hot plugging of any monitor nor can it do anything else.

You missed my point there. If I log into E with a new display. That display should be activated at its highest resolution. I have not confirmed this. But seems like that is the case if I plug in a new monitor while logged into it. That is not the case when logging into E. Like at the presentation where I logged in and the external project was immediately turned off.

Had I already been logged in and I connected that same project. I think it would have activated it at the proper resolution. But E does not do that on first log in. Thus it was shut off.

additionally please post your graphic card details (lspci | grep VGA) and the driver you are using.

I really do not think that matters. I had 2 laptops for that presentation, totally different. The Thinkpad I did not use is Intel. The HP I did use is Radeon. The problem is the exact same on both. The OS is a clone of the Thinkpad on the HP.

Thinkpad
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 520 (rev 07)
HP
00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] BeaverCreek [Radeon HD 6620G]

By the way regarding the script. I had no return in it before. I think E complained and I added return 1, and it did not change error, so tried return 0, and still get error message.

In T5707#91148, @wltjr wrote:

By the way regarding the script. I had no return in it before. I think E complained and I added return 1, and it did not change error, so tried return 0, and still get error message.

use exit not return, as the latter only returns function values. however i'm not sure how desktop entries work internally.

In T5707#91137, @wltjr wrote:

this is quite hard to comprehend as you are mixing different issues. it would be really helpful if you would open a ticket per issue and be brief.

so one ticket for (i hope these are all of them)

  • resolution change of the primary display when hot plugging a new monitor
  • hot plugging and remembering monitors
  • setting the highest resolution for new monitors
  • wakeup from sleep -> wrong monitor active

I can open different tasks, but they are all about display sessions basically. Remember some state, and that causes the individual issues.

as i said, your original post is really hard to understand.

# killall -9 X

is very, very bad, because -9 is SIGKILL, meaning it's not giving X and its children time to shutdown. so please don't.

Not sure where you got the killall -9 X from, I guess the presentation. That happened when switching from SDDM to Entrance, and X was abandoned. The init scripts did their thing. I just need to stop it so I can start via the other log in manager. Entrance has a good deal of issues I am still working on. At the time I did not care about shutting it down properly. Just what ever was fastest. It worked fine.

yep, from the presentation

use exit not return, as the latter only returns function values. however i'm not sure how desktop entries work internally.

Total rookie mistake. I have been around bash and shell scripts for to long to not have caught such... Thanks! Funny I asked in IRC a couple times and pretty sure I showed the script...

as i said, your original post is really hard to understand.

Sorry it was not clearer, but your break down pretty much covered it all.

yep, from the presentation

It was just a rush at the time. Having any issues in front of an audience is not really fun. Doing things properly is a after thought to getting things functional to continue with presentation.

This comment was removed by ProhtMeyhet.
In T5707#91196, @wltjr wrote:

use exit not return, as the latter only returns function values. however i'm not sure how desktop entries work internally.

Total rookie mistake. I have been around bash and shell scripts for to long to not have caught such... Thanks! Funny I asked in IRC a couple times and pretty sure I showed the script...

sorry, i misread this yesterday. it was quite late...

No worries, leave this open for now. I will close and split into multiple display session bugs. Hopefully giving a clear path to each issue, and from there can work on resolutions one by one. Though fixing one may fix the others not sure.

zmike closed this task as Resolved.Aug 21 2017, 1:43 PM

I think this should be resolved with the new policy handling? Reopen if not fixed.

Sure, I needed to split this into many ticket only reason I left open. I will re-file individual ones as needed.