8

Ubuntu does not switch back automatically to only monitor present when booting after disconnecting external monitor.

Here's a video showing what happens. I get to the login window and everything looks ok, then I type my password, the desktop image shows up and... everything goes blank. It does not happen when I just login as a guest.

When possible I work with my laptop connected to an external screen via the VGA port. The problem comes when I boot the computer without that secondary screen connected:

  • The login screen comes out ok.
  • After login the screen goes black, but I can hear the login sound.
  • If I hit ctr + alt + backwards-delete and login again sometimes it is fixed, but not all.
  • If I log in as a different user everything is OK. Then I log in as my user and sometimes it works.

To have a screen I have to plug a monitor. Although I have turned on the laptop display with that monitor on, if I reboot it goes blank again after login, even if I turn off the external monitor before turning off the computer.

I've managed to get my screen back with my username after going into recovery mode, but only sometimes. Failsafe would not load after second screen asking me what I wanted to do (no mouse to click nor keyboard working).

My computer is a LDLC Aurore BB1-i5 -8 -S1.

Which is the configuration file that keeps the information about the monitors using Displays under lightgdm and where is it? I guess if I could edit it I may have a chance :)

One of the things I tried following a solution in another post was removing my monitors.xml file, but it does not work and I don't know how to create a good one that I could use now.

When doing DISPLAY=:0 xrandrI get:

Screen 0: minimum 320 x 200, current 320 x 200, maximum 8192 x 8192
LVDS1 connected (normal left inverted right x axis y axis)
   1366x768       60.0 +
   1360x768       59.8     60.0  
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)

This is the full dmesg after activating sudo xdiagnoseas Bryce sugested. (If you tell me the relevant parts I will paste them here)

When conecting the external monitor, only the external will work, although I can see using Displays that the computer thinks that both are working.

I've asked the question in Launchpad but have it keeps on expiring without any feedback. In my opinion Ubuntu should be able to detect automatically that there is no external monitor present and switch to the laptop monitor.

There's a similar question here, but it does not apply to my case External monitor set as primary even when disconnected from laptop

Update: For clarification, the problem happens only with my user and once I log in. I even get to see the screensaver for about a second, and then it goes blank. Tried Bryce's example (see his answer below), but it did not work. This is the info I get from tty1 with Display=:0 xrandr: – Ramon Suarez Jul 9 at 16:36

Screen 0: minimum 320 x 200, current 320 x 200, maximum 8192 x 8192 LVDS1 connected (normal left inverted right x axis y axis) 1366x768 60.0 + 1360x768 59.8 60.0 1024x768 60.0 800x600 60.3 56.2 640x480 59.9 VGA1 disconnected (normal left inverted right x axis y axis) HDMI1 disconnected (normal left inverted right x axis y axis) DP1 disconnected (normal left inverted right x axis y axis)
Ramon Suarez
  • 1,841

6 Answers6

4

To issue X commands from vt1, you need to specify the display. E.g.:

DISPLAY=:0 xrandr --auto

The monitors.xml config file is what GNOME uses to set up your multihead layout, however it's unlikely to be the source of your trouble. Theoretically deleting it and rebooting would force GNOME to go back to its defaults, if it was a bug in the GNOME config tool.

/etc/X11/xorg.conf is what X uses to configure itself. With your Intel HD graphics system you shouldn't need an xorg.conf at all; if there is one present, you can try deleting it and rebooting. But I don't think that's the source of your trouble either.

I don't think your .dmrc is relevant. You could test going into a guest session and see if you can reproduce it there; if you can then it's not going to be any of your user config files.

Beyond that, there's a variety of things that can cause this, but without seeing some logs or more test results it's hard to guess what it could be.

With Intel video cards, only two of your outputs can be live at one time. Especially with these newer systems they have a lot more than two possible outputs (HDMI, DVI, VGA, LVDS, ...) and there are various ways the linux kernel can get confused and hook up to the wrong thing. Sometimes it's a bit of a race condition what outputs get enabled. Some of the outputs that the video card is capable of aren't even hooked up to a physical port on your computer.

If the system were in front of me, the things I'd start looking at would be xrandr to see what possible outputs were present and what ones X thinks are connected. Next I'd enable graphics debugging (sudo xdiagnose, first option), and then reboot and study dmesg from with and without the problem to see how the kernel was picking which outputs to turn on.

Hopefully that gets you on a productive path. Blank screen bugs can be caused by a lot of different things and it's hard to diagnose it merely based on symptoms, but the above steps should get you far enough into the problem that it'll become diagnosable.

jokerdino
  • 41,320
Bryce
  • 4,710
  • Thank you Bryce. Will try on Monday when I get back to the office where my laptop is at. I guess that the display number for the gui in ctrl+alt+f7 is DISPLAY=:7 – Ramon Suarez Jun 16 '12 at 06:57
  • 1
    That would make sense but no, it should be just "DISPLAY=:0". It's possible to run more than one X-server at the same time, in which case each would have a different DISPLAY number for each server. But when you're running just one, as you do in an ordinary desktop, it's just display number 0, so DISPLAY=:0. – Bryce Jun 16 '12 at 23:53
  • Thanks Bryce. I really liked the "That would make sense but no" :) – Ramon Suarez Jun 18 '12 at 07:16
  • Hi Bryce. I have not had the time to test it yet. Will get back to you in a couple weeks. Leaving for my summer break right now ! (with another laptop, of course) – Ramon Suarez Jun 21 '12 at 07:45
  • Hi Bryce, I'm back from my summer break. Just to be clear, the problem happens only with my user and once I log in. I even get to see the screensaver for about a second, and then it goes blank. Tried your example, but it did not work. This is the info I get from tty1 with Display=:0 xrandr: – Ramon Suarez Jul 09 '12 at 16:36
  • Screen 0: minimum 320 x 200, current 320 x 200, maximum 8192 x 8192 LVDS1 connected (normal left inverted right x axis y axis) 1366x768 60.0 + 1360x768 59.8 60.0 1024x768 60.0 800x600 60.3 56.2 640x480 59.9 VGA1 disconnected (normal left inverted right x axis y axis) HDMI1 disconnected (normal left inverted right x axis y axis) DP1 disconnected (normal left inverted right x axis y axis) – Ramon Suarez Jul 09 '12 at 16:37
2

Refresh your monitor config using the xrandr command line tool:

xrandr --auto

According to xrandr manpage, this will enable all screens that are connected but not displayed; and it will disable all screens that are 'enabled' but not actually connected.

For me, my laptop screen didn't wake up after sleep. My dual monitor was literally half awake. When I tried to open settings manager, it opened on my sleeping laptop screen, so was not visible. Fortunately, I was able to open terminal using a keyboard shortcut, and this displayed where I could see it, on the half-awake dual monitor. xrandr --auto restored the screens to their prior state.

markling
  • 582
  • 8
  • 34
  • Thank you so much for this! I switched on my laptop today and it refused to show anything on the built-in monitor. Only the external monitor worked. I tried everything (even upgraded Ubuntu and installed Nvidia drivers). Nothing helped, till I found this post and after entering the command everything is fine! – stefitz Feb 26 '24 at 17:10
1

on Xubuntu 13.10 the file you want to delete is ~/.config/xfce/xfconf/xfce-perchannel-xml/displays.xml have a look for a similar file on your distribution. maybe it is named monitors.xml

anon
  • 11
0

I used the FN + F8 key on my laptop. It could be different for your but look for the Function + F key that matches displays.

You can then go into settings and in "Displays" click on "Primary Display" and a dropdown appears where you can click "Built-in display".

warhansen
  • 222
0

Similar problems...

Monitor goes blank with "no signal", but xrandr shows it connected...

If I tell xrandr make any sort of change (it must be a change) then the display is reset and it all comes back.

For example, have xrandr turn it off and on...

xrandr --output DP-1-1 --off
xrandr --output DP-1-1 --auto

However it losses its position information and just becomes a clone, until I again reset the position. Any windows on that display get moved to make them at least partially visible in the other display, though I have found it shift a LOT of windows which should not have been effected too. Basically it is a horrible fix.

This fixes the problem some of the time...

xset dpms force suspend # or standby or off (same result)
xset dpms force on

This is the best solution I found so far, but depends on your setup...

Move the display just a little (one pixel), then moving it back! It is enough of a change to get xrandr to resurect the monitor and does not cause my application windows to suddenly change position.

xrandr --output DP-1-2 --pos 1921x0;    # shift one pixel
xrandr --output DP-1-2 --pos 1920x0;    # shift it back
anthony
  • 334
0

The symptoms in my case were similar to what you have described. Mine went wrong because I turned off the Laptop display. Here's how I solved it(sounds simpler):

  1. In Display, first I tick the mirror displays and apply the configuration. and automagically, my laptop screen goes visible (maybe the config is rewritten).
  2. I rebooted it (Might be an optional step).
  3. Then I untick back the mirror display, and the previous configuration goes back as I wanted.
Oyibo
  • 1,919