I have an external monitor attached to my laptop HDMI port. When I boot my laptop, both the laptop screen and Monitor successfully turns on and works perfectly. However, whenever I unplug the external monitor, and then plug it back in, Ubuntu fails to detect that the monitor is plugged in again, and shows it as disconnected. The only way to get the external monitor to turn on again, is to reboot my laptop.
Laptop specs: Dell Inspiron 15 Gaming
Nvidia GeForce GTX 960M
Output of lshw Display section:
*-display
description: 3D controller
product: GM107M [GeForce GTX 960M]
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:01:00.0
version: a2
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list rom
configuration: driver=nvidia latency=0
resources: irq:130 memory:e2000000-e2ffffff memory:d0000000-dfffffff memory:e0000000-e1ffffff ioport:e000(size=128) memory:e3000000-e307ffff
Here is my xrandr output when both screens are attached:
Screen 0: minimum 8 x 8, current 3840 x 1113, maximum 16384 x 16384
eDP-1-1 connected primary 1920x1080+0+33 344mm x 193mm
1920x1080 60.00*+ 59.93 48.00
1680x1050 59.95 59.88
1600x1024 60.17
1400x1050 59.98
1280x1024 60.02
1440x900 59.89
1280x960 60.00
1360x768 59.80 59.96
1152x864 60.00
1024x768 60.04 60.00
960x720 60.00
928x696 60.05
896x672 60.01
960x600 60.00
960x540 59.99
800x600 60.00 60.32 56.25
840x525 60.01 59.88
800x512 60.17
700x525 59.98
640x512 60.02
720x450 59.89
640x480 60.00 59.94
680x384 59.80 59.96
576x432 60.06
512x384 60.00
400x300 60.32 56.34
320x240 60.05
DP-1-1 connected 1920x1080+1920+0 510mm x 290mm
1920x1080 60.00*+
1680x1050 59.88
1280x1024 75.02 60.02
1280x960 60.00
1152x864 75.00
1024x768 75.03 60.00
832x624 74.55
800x600 75.00 60.32 56.25
640x480 75.00 59.94
720x400 70.08
HDMI-1-1 disconnected
After unplugging and plugging back in, DP-1-1 shows up as disconnected.
Also, xrandr –auto does not turn the screen back on. Also tried restarting lightdm and unity but to no avail.
I have tried with the following display drivers, and none solves the problem:
- noveau open source driver
- nvidia-375.26 (recommended by nvidia)
Note that in Windows 10, the monitor is redetected when after the unplug, plug in cycle so this should not be an issue with the motherboard.
I need to unplug my screen a lot as I have to go to meetings etc and use my laptop there. Basically, the above issue is causing me to reboot my laptop up to 5 times a day. Please help!
Note this is not the same as Second Monitor Not Detected After HDMI unplugged and plugged back in
Best Answer
The closest I could find to your problem is this thread (ubuntuforums.org - Nvidia GTX 950 and TV not seeing signal after input change or power off/on) which references solutions for nVidia 970/980. It would seem your 960 is in between.
The solution proposed there is to reset the monitor to a bad mode and then a good mode using this code:
I think this script can be improved but wanted to post it in it's original incarnation.
One of the authors in the link wanted to setup
udev
to automatically call the script on hot-plug event. I've done this for HDMI with this code (hotplugtv
) in the past to fix Ubuntu 16.04 pulseaudio 8 bug:You will need to modify the if test with your
/sys/class/drm/...
directory. Then modify the true side of the if test with your script file that resets hdmi screen. On the false side of the if test simply replace the code with a:
(noop) if there is nothing to do when thehdmi
device is unplugged.In order to call this scrip from
udev
during hot-plug events create the file/etc/udev/rules.d/99-hotplugtv.rules
containing:Change
/path/to/
to the path where you placedhotplugtv
script.