[mythtv-users] Messed up xorg configuration

Stephen Worthington stephen_agent at jsw.gen.nz
Sun May 22 07:29:20 UTC 2022


On Sat, 21 May 2022 19:16:49 -0500, you wrote:

>While trying to solve another issue, I've created a new one for myself.
>While playing with different themes, I forgot that I had made a custom
>theme from one of the existing ones.  When I tried to upgrade and/or change
>the theme I ended up in a deep hole.  Nothing would work except the
>myth-center-wide.  Every other one gave me errors regarding the video.
>
>In trying to fix this, thinking it really was a video issue, I upgraded my
>Nvidia driver, which worked (the driver did) but of course, it didn't solve
>the problem.  Once I got my head out of my arse, I realized what I had done
>and restored the custom theme in my home directory.  That fixed theme
>problem and then the problem I currently have:
>
>The frontend works fine when the TV is turned on and the AVR is switched to
>the correct HDMI input (the mythtv server).  But as soon as I either turn
>off the TV or the AVR, the NVIDIA driver or the GUI kills the HDMI output
>and my only recourse is to restart the GUI (I'm using lightdm). I've set up
>what I thought used to work in the xorg.conf file:
>
>Section "ServerLayout"
>    Identifier     "Layout0"
>    Screen      0  "Screen0" 0 0
>    InputDevice    "Keyboard0" "CoreKeyboard"
>    InputDevice    "Mouse0" "CorePointer"
>    Option         "StandbyTime" "0"
>    Option         "SuspendTime" "0"
>    Option         "OffTime" "0"
>    Option         "BlankTime" "0"
>    Option         "Xinerama" "0"
>EndSection
>
>Section "Files"
>EndSection
>
>Section "InputDevice"
>
>    # generated from default
>    Identifier     "Mouse0"
>    Driver         "mouse"
>    Option         "Protocol" "auto"
>    Option         "Device" "/dev/psaux"
>    Option         "Emulate3Buttons" "no"
>    Option         "ZAxisMapping" "4 5"
>EndSection
>
>Section "InputDevice"
>
>    # generated from default
>    Identifier     "Keyboard0"
>    Driver         "kbd"
>EndSection
>
>Section "Monitor"
>
>    # HorizSync source: edid, VertRefresh source: edid
>    Identifier     "Monitor0"
>    VendorName     "Unknown"
>    ModelName      "DENON, Ltd. DENON-AVR"
>    HorizSync       30.0 - 255.0
>    VertRefresh     24.0 - 120.0
>#   ModeLine       "3840x2160_60" 593.41 3840 4016 4104 4400 2160 2168 2178
>2250 +hsync +vsync
>    Option         "DPMS"
>EndSection
>Section "Device"
>
>    Option         "ConnectedMonitor" "DFP-1"
>    Option         "CustomEDID" "DFP-1:/etc/X11/edid.bin"
>    Option         "IgnoreEDID" "FALSE"
>    Option         "UseEDID" "TRUE"
>    Identifier     "Device0"
>    Driver         "nvidia"
>    VendorName     "NVIDIA Corporation"
>    BoardName      "GeForce GT 1030"
>EndSection
>
>Section "Screen"
>    Identifier     "Screen0"
>    Device         "Device0"
>    Monitor        "Monitor0"
>    DefaultDepth    24
>    Option         "Stereo" "0"
>    Option         "nvidiaXineramaInfoOrder" "DFP-1"
>    Option         "metamodes" "3840x2160 +0+0"
>    Option         "SLI" "Off"
>    Option         "MultiGPU" "Off"
>    Option         "BaseMosaic" "off"
>#    Option         "ModeDebug" "TRUE"
>    SubSection     "Display"
>        Depth       24
>    EndSubSection
>EndSection
>
>I've tried several different drivers (430, 450, 470, 510) and currently
>have 470 installed, but they all produced the same problem.  So the
>configuration is a PC with a GT 1030 video card, HDMI out to a Denon AVR
>and HDMI from Denon to an LG TV capable of 3840x2160.  I've set the power
>options in lightdm to all off for the monitor (no sleep, no auto off,
>etc).  Either turn off the TV or the Denon and I cannot get a signal out of
>the GT 1030 card that either the Denon or the TV sees ( I'm assuming it's
>the Denon that needs to see the signal and if the TV is turned off, the
>Denon switches off the HDMI input.  There are no errors shown in the
>Xorg.0.log and it does show the DFP-1 is connected to the LG even if they
>are turned off (both DVR and TV) which, I assume, is because I am using a
>custom edid.bin file.
>
>Any thoughts as to what I'm forgetting to do?
>
>Regards,
>
>Ken Emerson

I am also using an Nvidia GT1030 card, with the 470 drivers and
updated to the 510 drivers today.

The usual cause for your problem is that X is trying to read the EDID
data and is unable to when the AVR is off or switched to a different
video output, or the TV is off.  If the AVR is doing its job properly,
it will be doing EDID passthrough and emulation where it reads and
saves the EDID data whenever it is read from the TV and when the TV is
unavailable, will provide that saved EDID data instead.  However, it
looks like the AVR is not doing that.  The next thing is the TV.  Good
TVs (like my Sony Bravia KDL-32V5500) will provide the EDID data even
when they are switched off completely (and unplugged from the wall).
They do this by taking power from  the HDMI input and using that to
power the EDID circuit.  However, there are lots of TVs (and most
monitors) that do not do this and will only provide EDID data when
they are on.  Some will not even provide EDID data when they have
power but are in standby.  And for everything to work properly, when
the AVR is in standby, it should also be providing the EDID data, or
connecting to the TV to get it to provide it.

The solution to EDID problems is normally to take a copy of the EDID
data and use the CustomEDID option in xorg.conf.  However, you seem to
already have done that, but you should check that it is working by
checking the /var/log/Xorg.0.log file to see where the EDID is coming
from.  I am not exactly sure how you tell that, but if it is working,
you should be able to unplug the HDMI cable from the PC to the AVR and
boot and it should boot up correctly with a full desktop and you
should be able to use VNC (if you have that set up) to see that
desktop from another machine.  My guess is that, despite your
CustomEDID option, the custom EDID is not actually working - maybe
there is a permissions problem on the EDID file, or something like
that.

One other thing to check for is screensaver problems.  I have a
problem at the moment that my video is going into a screensaver mode
(blank screen) after a timeout.  This did not used to happen before a
couple of months ago, so it is likely some recent change in the Nvidia
drivers or Xorg that is causing it.  My guess is Xorg, as I saw a new
version of it being installed around the time the problem started.  In
my case, the screen unblanks if I use the keyboard (the shift key is
sufficient).  I can disable this screensaver using this command:

xset s off

If I do the "xset q" command before "xset s off", I see that the
"Screen Saver: timeout:" setting is 600.  After "xset s off" it is 0.

I have not found any setting for xorg.conf that affects this screen
saver, so I have just now set up a systemd user service to run the
"xset q" command at user startup:

root at mypvr:~# cat /home/stephen/.config/systemd/user/startup.service
[Unit]
Description=JSW user startup

[Service]
ExecStart=/home/stephen/bin/jsw-user-startup.sh

[Install]
WantedBy=multi-user.target

root at mypvr:~# cat /home/stephen/bin/jsw-user-startup.sh
#!/bin/bash

##############################################################################
# Commands to be run at startup by a systemd user service.
##############################################################################

# Prevent screensaver from blanking screen.
xset s off

# Show that this file has been run.
echo "$(date) $0 ran" >>/tmp/$(basename "$0").log

To do this fix, create files equivalent to the above and make sure
they have the correct permissions.  Then do:

sudo systemctl daemon-reload
systemctl --user enable --now startup.service

I have not tested this by rebooting yet, but it works when the unit is
run manually (systemctl --user start startup) and should work at boot
time or when the desktop is restarted.

There appear to be three different screensavers that can blank the
screen.  The other two are the xscreensaver program, and DPMS.

To disable xscreensaver, you can just stop it from being started. With
the XFCE4 desktop, go to Applications > Settings > Session and Startup
> Application Autostart and find the Screensaver line and untick it.

To disable DMPS, you can do "xset -dpms", or you can put:

Option "DPMS"   "false"

in xorg.conf in Section "Monitor".  However, there seems to be
something the re-enables DPMS periodically, so I have found it better
to do as you have already done and put:

Section "ServerFlags"
        Option "BlankTime"      "0"
        Option "StandbyTime"    "0"
        Option "SuspendTime"    "0"
        Option "OffTime"        "0"
EndSection

in xorg.cong and leave DPMS enabled.  Those settings turn off all the
timeouts that control DPMS.


More information about the mythtv-users mailing list