# Screen turns off when exiting Xorg



## cellini (Aug 12, 2015)

The screen shuts off when logging out from XFCE or KDE or killing Xorg.

FreeBSD 10.1-RELEASE
nvidia-driver-346.47
xorg-7.7_2

I tried Googling but haven't found any thing that works. Any ideas?

Thanks for any reply.


----------



## protocelt (Aug 12, 2015)

Do you have a xorg.conf file and if so could you post it?


----------



## cellini (Aug 12, 2015)

```
cat /etc/X11/xorg.conf
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 340.24  (root@101amd64-default-job-17)  Sat Apr  4 04:02:38 UTC 2015

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 310.14  (root@101amd64-default-job-24)  Thu Mar 26 22:21:04 UTC 2015

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
    FontPath        "/usr/local/lib/X11/fonts/misc/:unscaled"
    FontPath        "/usr/local/lib/X11/fonts/100dpi/:unscaled"
    FontPath        "/usr/local/lib/X11/fonts/75dpi/:unscaled"
    FontPath        "/usr/local/lib/X11/fonts/misc/"
    FontPath        "/usr/local/lib/X11/fonts/Type1/"
    FontPath        "/usr/local/lib/X11/fonts/100dpi/"
    FontPath        "/usr/local/lib/X11/fonts/75dpi/"
    FontPath        "/usr/local/lib/X11/fonts/cyrillic/"
    FontPath        "/usr/local/lib/X11/fonts/TTF/"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/sysmouse"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "keyboard"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "BenQ G2420HD"
    HorizSync       24.0 - 83.0
    VertRefresh     50.0 - 76.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 970"
    Option         "TwinView"
EndSection

Section "Screen"

# Removed Option "metamodes" "DVI-I-1: nvidia-auto-select +0+0, HDMI-0: nvidia-auto-select +1920+0"
# Removed Option "metamodes" "DVI-I-1: nvidia-auto-select +1920+0, HDMI-0: nvidia-auto-select +0+0"
# Removed Option "nvidiaXineramaInfoOrder" "DFP-1"
# Removed Option "metamodes" "DVI-I-1: nvidia-auto-select +0+0, HDMI-0: nvidia-auto-select +1920+0"
# Removed Option "SLI" "Off"
# Removed Option "BaseMosaic" "off"
# Removed Option "nvidiaXineramaInfoOrder" "DFP-0"
# Removed Option "metamodes" "GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: nvidia-auto-select +0+0, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +1920+0"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-1"
    Option         "metamodes" "GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: nvidia-auto-select +0+0, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +1920+0; GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: nvidia-auto-select +0+0, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +0+0; GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: 1920x1080_60_0 +0+0, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +0+0; GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: 1680x1050 +0+0, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +0+0; GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: 1600x900 +0+0, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +0+0; GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: 1280x1024 +0+0, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +0+0; GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: 1280x1024_60 +0+0, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +0+0; GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: 1280x960 +0+0, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +0+0; GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: 1280x720 +0+0, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +0+0; GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: 1152x720 +0+0, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +0+0; GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: 1024x768 +0+0, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +0+0; GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: 1024x768_60 +0+0, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +0+0; GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: 800x600 +0+0, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +0+0; GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: 800x600_60 +0+0, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +0+0; GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: 640x480 +0+0, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +0+0; GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: 640x480_60 +0+0, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +0+0; GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: nvidia-auto-select +0+0 {viewportin=1440x900, viewportout=1728x1080+96+0}, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +0+0; GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: nvidia-auto-select +0+0 {viewportin=1366x768, viewportout=1920x1079+0+0}, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +0+0; GPU-ce91c341-6294-3cd3-1490-89adca2c8118.DVI-I-1: nvidia-auto-select +0+0 {viewportin=1280x800, viewportout=1728x1080+96+0}, GPU-ce91c341-6294-3cd3-1490-89adca2c8118.HDMI-0: nvidia-auto-select +0+0"
    Option         "MultiGPU" "Off"
    Option         "SLI" "off"
    Option         "BaseMosaic" "on"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
```

here you go


----------



## protocelt (Aug 12, 2015)

Try removing everything but the following in the xorg.conf file:

```
Section "Device"
Identifier "Device0"
Driver "nvidia"
EndSection
```
then reboot and see if that helps.

I think I remember a problem report being filed for this exact issue at some point not too long ago. I'll see if I can find it and post it here.

Edit: It's PR 201461.


----------



## cellini (Aug 14, 2015)

I tried that. Sorry I haven't replied, when I rebooted the machine wouldn't run. It was complaining about data corruption, figured it out to be a bad SATA connection. But sorry to report that minimizing the xorg.conf did not work. It's still the same problem


----------



## protocelt (Aug 14, 2015)

I honestly don't have any idea what may be causing this problem. I've never run into it before myself even on the CURRENT branch. Do you have any errors logged in /var/log/messages that look they may be related to this?


----------



## cellini (Aug 14, 2015)

Not sure, this is when iI log out of KDE and the blindly `startx`


```
Aug 14 22:32:19 aasennas devd: notify_clients: send() failed; dropping unresponsive client
Aug 14 22:32:34 aasennas devd: notify_clients: send() failed; dropping unresponsive client
Aug 14 22:33:08 aasennas devd: check_clients:  dropping disconnected client
Aug 14 22:33:10 aasennas kernel: pid 4783 (kwin_opengl_test), uid 1001: exited on signal 11 (core dumped)
```

Could the last line be something?


----------



## jrm@ (Aug 14, 2015)

What does `sysctl kern.vty` say?  If it's not vt try `sysctl kern.vty=vt` and put kern.vty=vt in /boot/loader.conf.


----------



## protocelt (Aug 14, 2015)

cellini said:


> could the last line be something?


Unfortunately, no. That kwin error is harmless and happens when you log into KDE.


----------



## cellini (Aug 14, 2015)

sysctl(8) is already set to vt(4)


```
anders@aasennas:~ % sysctl kern.vty
kern.vty: vt
```

Ah, ok. Hmm, also tried changing the nsswitch.conf read it somewhere  but cant find the post now, anyway it did not change the behavior.


```
anders@aasennas:~ % cat /etc/nsswitch.conf
#
# nsswitch.conf(5) - name service switch configuration file
# $FreeBSD: release/10.0.0/etc/nsswitch.conf 224765 2011-08-10 20:52:02Z dougb $
#
#group: compat
#group_compat: nis
#hosts: files dns
#networks: files
#passwd: compat
#passwd_compat: nis
#shells: files
#services: compat
#services_compat: nis
#protocols: files
#rpc: files
#hosts: files dns mdns

group: files
hosts: files mdns_minimal [NOTFOUND=return] dns mdns
networks: files
passwd: files
shells: files
services: files
protocols: files
rpc: files
```


----------



## protocelt (Aug 15, 2015)

cellini, can you try using the syscons(4) driver and see if you have the same problem? Both the vt(4) and sc(4) console drivers are available in FreeBSD 10.1-RELEASE and you _should_ be able to switch freely between them. You can add 
	
	



```
kern.vty=sc
```
 to your /boot/loader.conf file to switch to the sc(4) console driver. If you already have 
	
	



```
kern.vty=vt
```
 in your /boot/loader.conf file, just replace it. If your problem goes away after switching console drivers, you can add your name to the problem report(PR) I posted a link to above.


----------



## cellini (Aug 15, 2015)

Thanks I'll try it tomorrow, I set the machine to update to 10.2 and I will also try before I change the sysctl(8) setting but I guess the update wont have much effect on the issue alone.


----------



## protocelt (Aug 15, 2015)

The problem could be fixed 10.2-RELEASE. Upgrading certainly can't hurt.


----------



## cellini (Aug 15, 2015)

No change in behavior after update and no change after changing kern.vty=sc either. Hmm very strange 


protocelt said:


> The problem could be fixed 10.2-RELEASE. Upgrading certainly can't hurt.


----------



## PackRat (Aug 23, 2015)

jrm said:


> What does `sysctl kern.vty` say?  It's it's not vt try `sysctl kern,vty=vt` and putting kern.vty=vt in /boot/loader.conf.



thanks, this fix worked for my system - 10.2 on an HP laptop.


----------

