Xfce resets TV mode to NULL when power cycled

Bug #1308105 reported by Mario Limonciello on 2014-04-15
454
This bug affects 79 people
Affects Status Importance Assigned to Milestone
Mythbuntu
Medium
Unassigned
xfce4-settings
Confirmed
Critical
nvidia-graphics-drivers (Ubuntu)
Undecided
Unassigned
nvidia-graphics-drivers-331 (Ubuntu)
Undecided
Unassigned
xfce4-settings (Ubuntu)
Undecided
Unassigned

Bug Description

I had an HTPC with Mythbuntu 12.04 installed. Upon upgrading a new behavior that if the TV is power cycled it no longer detects a link with the HTPC.

When this happens I can find in the xorg log that there is an accompanying log item:

[ 39829.509] (II) NVIDIA(0): Setting mode "NULL"

After debugging with NVIDIA at https://devtalk.nvidia.com/default/topic/729955/linux/tv-stops-being-detected/ we've deteremined it's a X client that reacts to the RANDR events causing the mode to be set to NULL.

Working through the list in an Xfce environment, the culprit is xfsettingsd. If xfsettingsd is running, it causes the TV to come up in a NULL mode. If it's killed, it remains in the mode it was previously running in.

Until this is fixed, this behavior can be worked around with a simple shell script:
==============================
#!/bin/sh
#Fix TV state when HDMI link is lost.
#By Mario Limonciello <email address hidden>

OUTPUT="HDMI-0"
BAD_MODE="1280x720"
GOOD_MODE="1920x1080"

for MODE in $BAD_MODE $GOOD_MODE; do
 DISPLAY=:0 xrandr --output $OUTPUT --mode $MODE
 sleep 2
done
==============================

Mario Limonciello (superm1) wrote :

For people on mythbuntu who encounter this with a mceusb remote, here's how i'm working around it:

1) Save this file to /home/user/fix_tv_state.sh and make it executable
==============================
#!/bin/sh
#Fix TV state when HDMI link is lost.
#By Mario Limonciello <email address hidden>

OUTPUT="HDMI-0"
BAD_MODE="1280x720"
GOOD_MODE="1920x1080"

for MODE in $BAD_MODE $GOOD_MODE; do
 DISPLAY=:0 xrandr --output $OUTPUT --mode $MODE
 sleep 2
done
==============================

2) Create ~/.lirc/irexec and put these contents:
==============================
begin
     remote = mceusb
     button = KEY_POWER
     prog = irexec
     repeat = 0
     config = /home/user/fix_tv_state.sh
end
==============================

3) Add to ~/.lircrc this line:
include ~/.lirc/irexec

4) Restart machine, lightdm or log out/in

Now power button on your mceusb remote will fix the HTPC video output state.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nvidia-graphics-drivers (Ubuntu):
status: New → Confirmed
Changed in nvidia-graphics-drivers-331 (Ubuntu):
status: New → Confirmed
1 comments hidden view all 123 comments
Mario Limonciello (superm1) wrote :

After some more sleuth work with NVIDIA, we've discovered that this is happening because of a RANDR event. An X client is responding to the RANDR events and forcing it to this NULL resolution.

I checked what clients were running, and it's xfsettingsd causing this problem. If I kill xfsettingsd prior to turning on/off my TV it comes back at the right resolution.

Changed in xfce4-settings (Ubuntu):
status: New → Confirmed
Changed in nvidia-graphics-drivers (Ubuntu):
status: Confirmed → Invalid
Changed in nvidia-graphics-drivers-331 (Ubuntu):
status: Confirmed → Invalid
Changed in mythbuntu:
status: New → Confirmed
importance: Undecided → Medium
summary: - HDMI Handshake fails after TV powered off
+ Xfce resets TV mode to NULL when power cycled
description: updated
Mario Limonciello (superm1) wrote :

Here is the xfsettingsd debug output when the RR events are received. When the TV comes up there is a handful of change events and the end result is that the output gets disabled but not re-enabled.

xfce4-settings(displays): RRScreenChangeNotify event received.
xfce4-settings(displays): Refreshing RandR cache.
xfce4-settings(displays): Detected CRTC 447.
xfce4-settings(displays): Detected CRTC 448.
xfce4-settings(displays): Noutput: before = 1, after = 0.
xfce4-settings(displays): Output disconnected: HDMI-0
xfce4-settings(displays): Disabling CRTC 447.
xfce4-settings(displays): No active output anymore! Attempting to re-enable the internal output.
xfce4-settings(displays): RRScreenChangeNotify event received.
xfce4-settings(displays): Refreshing RandR cache.
xfce4-settings(displays): Detected CRTC 447.
xfce4-settings(displays): Detected CRTC 448.
xfce4-settings(displays): Noutput: before = 0, after = 0.
xfce4-settings(displays): RRScreenChangeNotify event received.
xfce4-settings(displays): Refreshing RandR cache.
xfce4-settings(displays): Detected CRTC 447.
xfce4-settings(displays): Detected CRTC 448.
xfce4-settings(displays): Detected output 452 HDMI-0.
xfce4-settings(displays): Noutput: before = 0, after = 1.
xfce4-settings(displays): New output connected: HDMI-0

Jack Deslippe (jdeslip) wrote :

I'm seeing a similar issue after upgrading from mythbuntu 12.04 to 14.04. Only I'm using integrated graphics from intel sandybridge.

Stuart Matthews (mtrauts) wrote :

This issue also affects Gigabyte GA-EG45M-UD2H motherboard with Intel GMA X4500HD integrated graphics. Fresh install of mythbuntu 14.04. 13.10 was not affected.

Thomas Goerke (t-tom-w) wrote :

I have the same issue with ASUS P5E-VM HDMI motherboard. Fresh install of 14.04. Previous version (13.??) was not affected.

Trey Boudreau (trey-v) wrote :

Same problem with Intel NUC D54250WYK. I've only ever run 14.04 on it.

Ernst Sjöstrand (ernstp) wrote :

One workaround is to install gnome-settings-daemon and check the box in Xfce session settings to start gnome services on startup.

rhpot1991 (rhpot1991) wrote :

I added the following in /etc/mythtv/session-settings to work around this issue:
killall xfsettingsd

This will kill xfsettingsd when mythfrontend starts.

Gabriel Pannwitz (gabkdlly) wrote :

I think that I was experiencing this problem. I tried the workarounds mentioned above, but none of them really "worked". But I do not seem to be experiencing this issue when I switched to using DVI instead of HDMI. For what is worth, I am running Xubuntu 14.04 on a Dell Studio-XPS.

Weston (westont) wrote :

I am experiencing the same with Mythbuntu 14.04 and an AMD A10 APU. Deactivating the autorunning of xfsettingsd fixed the problem.

Bubu Fearn (bubu-fearn) wrote :

I have the same bug with Xubuntu 14.04 on AMD Radeon 6770 with a Toshiba HDTV

Turn off TV and signal is lost and can't get it back again until I restart the desktop.

Bubu Fearn (bubu-fearn) wrote :

Oops, I got linked to this bug from

http://ubuntuforums.org/showthread.php?t=2220583&page=4

I didn't realise it was registered as an Nvidia bug though.

Clearly its not as my card is an AMD.

AMD owns nVidia these days as one of their brands. You may perhaps be in
the right place.

Nick (soapduk) wrote :

^No AMD owns ATI, the other major graphics card provider.

I am also experiencing this problem on integrated Intel graphics on Xubuntu 14.04 when using HDMI. It's the first distro I have used on this system but I never had the problem on Xubuntu 12.04 on my previous sytem (which was VGA/D-sub).

I do not get 'NULL' in my /var/log/Xorg.0.log but the issue is basically the same problem. I do get null in dmesg however:

[code][ 0.152426] ACPI: SSDT (null) 0004C4 (v01 PmRef Cpu0Ist 00003000 INTL 20061109)
[ 0.153472] ACPI: SSDT (null) 000433 (v01 PmRef Cpu0Cst 00003001 INTL 20061109)
[ 0.160066] ACPI: SSDT (null) 00015F (v01 PmRef ApIst 00003000 INTL 20061109)
[ 0.163743] ACPI: SSDT (null) 00008D (v01 PmRef ApCst 00003000 INTL 20061109)[/code]

Straximus (straximus) wrote :

I downgraded xfce-settings to the 4.11.0 package from Saucy, and locked it at that version. It eliminated the issue, and everything appears to function normally.

Nick (soapduk) wrote :

Thanks Straximus, that worked for me too.

Download full text (4.3 KiB)

tl;dr - There is a bug in xfsettingsd that not only affects external monitors, but primary monitors as well.

I believe that I am encountering the same bug, but by a different scenario. This may also be the same bug as #1313539.

I am running Xubuntu 14.04 on two of my four computers. I have all four computers connected to a single keyboard, monitor and mouse via a 4port KVM switch. Prior 14.04 upgrade, this setup worked like a dream. Post 14.04 upgrade, I have found that switching to either of the Xubuntu machines results in a blank monitor. On one machine, I am usually able to get to a virtual console and reset of the video by restarting lightdm. On the other machine, I am not able to even get a virtual console, and I have to ssh into the machine in order to restart lightdm.

The dying video happens so frequently that I starting the process of migrating away to XFCE. I installed Gnome Shell on one machine and Fluxbox on the other. Neither of these WM's exhibited the dying video phenomena.

Based upon this bug report, I decided to investigate the possibility that xfsettingsd might be the problem. Here's what I did.

1) Log in to a Xubuntu session.

2) Open a terminal window. Because I needed to do part of this from the Xubuntu session and part of this via ssh, I opened a new Byobu session (screen or tmux would work too). Then,

    $ killall xfsettingsd
    $ XFSETTINGSD_DEBUG=1 xfsettingsd --replace --no-daemon 2>&1 | tee output.txt

3) After the initial output from xfsettingsd had finished,

    $ cp output.txt before.txt

4) Here's where the fun begins: I unplugged the monitor from the KVM switch. I waited a few seconds, and then I plugged the monitor back into the switch. No video. I switched the KVM to one of the other computers and verified that the monitor was corrected plugged in and working.

5) On one of the other computers with working video, I ssh'ed into the machine running the Xubuntu session and reconnected to the Byobu session. I found that xfsettingsd had crashed.

6) Executing "sleep 5; xfsettingsd" on the ssh session and switching to the Xubuntu machine restored the video.

7) I diff'ed the "before.txt" with the "output.txt". Here is the output that was generated when the monitor was unplugged and replugged.

xfce4-settings(displays): RRScreenChangeNotify event received.
xfce4-settings(displays): Refreshing RandR cache.
xfce4-settings(displays): Detected CRTC 63.
xfce4-settings(displays): Detected CRTC 64.
xfce4-settings(displays): Detected CRTC 65.
xfce4-settings(displays): Noutput: before = 1, after = 0.
xfce4-settings(displays): Output disconnected: VGA1
xfce4-settings(displays): Disabling CRTC 63.
xfce4-settings(displays): No active output anymore! Attempting to re-enable the internal output.
xfce4-settings(displays): RRScreenChangeNotify event received.
xfce4-settings(displays): Refreshing RandR cache.
xfce4-settings(displays): Detected CRTC 63.
xfce4-settings(displays): Detected CRTC 64.
xfce4-settings(displays): Detected CRTC 65.
xfce4-settings(displays): Noutput: before = 0, after = 0.
xfce4-settings(displays): RRScreenChangeNotify event received.
xfce4-settings(displays): Refreshing RandR cache.
xfce4-settings(di...

Read more...

Following Straximus's lead (comment #18), I downgraded to the xfce4-settings package from Saucy. I left the machines allow all weekend long, and this morning the video on both machines worked as expected.

There is a regression bug between xfce4-settings 4.11.0-1ubuntu1 (saucy) and 4.11.2-1ubuntu2 (trusty).

nick_s (nickstylianou) wrote :

This also affects me on Mythbuntu 14.04 x86 64bit with the open radeon driver and ATI RS880 [Radeon HD 4250] graphics controller.
The workaround for me was to disable xfsettingsd in the GUI Settings under "Session and Startup":
1) In the "Application Autostart" tab I unticked xfsettingsd.
2) In the "Session" tab I selected xfsettingsd and clicked "Quit Program".

Ahh, this issue has been driving me crazy since I did the 14.04 upgrade.

I'm using ubuntu 14.04 + xfce4 + plex connected to my yamaha receiver and panasonic hdtv (with pulse-eight cec usb dongle). (setup is years old).

The procedure above (#22) did the trick for me. Thanks!

Unfortunately, the workaround in #22 does not work form me. Since my computers are plugged in to a KVM switch, I need xfsettings running in order to reset my mouse and keyboard settings after switching computers.

Workaround #18 works for me.

Has anyone reported this bug upstream?

JeanLuke (james-jasa) wrote :

I am having the same problem. I upgraded frm Mythbuntu 12.04 to 14.04 with the Asus M3N78 motherboard (Nvidia 8200 graphics card & nvidia-304-updates driver).

Using xfce4-settings from Ubuntu 13.10 (as per post #18) fixed it for me. I have not tried using the suggestion from post #10.

There is another fix in this thread that I'll try later this week -> http://ubuntuforums.org/showthread.php?t=2221496

JeanLuke (james-jasa) wrote :

I added the options:
       Option "ConnectedMonitor" "DFP-0"
       Option "UseDisplayDevice" "DFP-0"
to the "devices" section of my /etc/X11/xorg.conf and it seems to have fixed it - even with the current xfce4-settings installed.

Tests I have done:
1/ boot with the television off, turn it on and get display
2/ boot with the television on, power cycle it (off time about 30 minutes) and have display
3/ boot with the television off, switch it on for 5 minutes, off for 30 minutes, back on and have display

As above, I have the Asus M3N78 motherboard (Nvidia 8200 onboard graphics) with nvidia-304-updates driver, using HDMI.

Bengt Nilsson (bnilsson11) wrote :

I have Ubuntustudio amd64 14.04LTS on a HTPC with a TV connected to HDMI-0 on a GA-880GMA-UD2H, Radeon mobo graphics.

Tried to follow #26, but it seems I don't have any xorg.conf in my /etc/X11.
Any advice?

JeanLuke (james-jasa) wrote :

My solution only works for Nvidia graphics cards using Nvidia drivers, sorry. Technically, it's a work-around, not a fix.

For those who do use Nvidia drivers but do not have an xorg.conf file, you can generate one with the "nvidia-xconfig" tool run as root or with sudo. See http://http.download.nvidia.com/XFree86/Linux-x86/1.0-8756/README/chapter-03.html

Patrick Stump (pstump-y) wrote :

I did the fix in #26 and it fixed my issues as well.
The only difference was that in nvidia-settings my samsung tv was coming up as "DFP-1" so I had to change it to :
        Option "ConnectedMonitor" "DFP-1"
       Option "UseDisplayDevice" "DFP-1"

JeanLuke THANK YOU! This has been an huge source of frustration.

As of today this is still not assigned, so not really sure when they will get to fixing it.

In xfsettingsd 4.11.2 there appears to be a regression that when a TV hooked up to the computer via HDMI gets power cycled, it stops displaying anything.

It happens via a RANDR event being sent to all X clients when the TV gets turned off.

xfsettingsd thinks that it should switch to an internal output, but desktops don't have one. So when the TV comes back on the bus it seems like it's an extra monitor and xfsettingsd gets confused.

xfce4-settings(displays): RRScreenChangeNotify event received.
xfce4-settings(displays): Refreshing RandR cache.
xfce4-settings(displays): Detected CRTC 447.
xfce4-settings(displays): Detected CRTC 448.
xfce4-settings(displays): Noutput: before = 1, after = 0.
xfce4-settings(displays): Output disconnected: HDMI-0
xfce4-settings(displays): Disabling CRTC 447.
xfce4-settings(displays): No active output anymore! Attempting to re-enable the internal output.
xfce4-settings(displays): RRScreenChangeNotify event received.
xfce4-settings(displays): Refreshing RandR cache.
xfce4-settings(displays): Detected CRTC 447.
xfce4-settings(displays): Detected CRTC 448.
xfce4-settings(displays): Noutput: before = 0, after = 0.
xfce4-settings(displays): RRScreenChangeNotify event received.
xfce4-settings(displays): Refreshing RandR cache.
xfce4-settings(displays): Detected CRTC 447.
xfce4-settings(displays): Detected CRTC 448.
xfce4-settings(displays): Detected output 452 HDMI-0.
xfce4-settings(displays): Noutput: before = 0, after = 1.
xfce4-settings(displays): New output connected: HDMI-0

Additional details can be found on the Ubuntu bug report located here:
https://bugs.launchpad.net/ubuntu/+source/xfce4-settings/+bug/1308105

Changed in xfce4-settings:
importance: Unknown → Medium
status: Unknown → Confirmed

I just bisected the git repository of xfce/xfce4-settings and identified the commit that introduced the issue as:

------------------------------------------

dbd76eb58bd9d7a55de753daa5572ef24867d924

Author: Lionel Le Folgoc <email address hidden> 2012-11-08 20:15:42
Committer: Simon Steinbeiss <email address hidden> 2012-11-08 20:50:40
Parent: 82ab3a355a4b7eff6cffa57ca5a8e8622feb2d31 (l10n: Updated Portuguese (pt) translation to 100%)
Child: cf67ba0d283d991c67a4e3df2de758f94cb2f7d2 (l10n: Updated Spanish (Castilian) (es) translation to 99%)
Branches: master, remotes/origin/bluesabre/display-settings, remotes/origin/bluesabre/display-settings2, remotes/origin/master, remotes/origin/ochosi/primary
Follows: xfce4-settings-4.11.0
Precedes: xfce4-settings-4.11.1

    Re-enable the internal display when the external one is disconnected

    (and add the possibility to start xfce4-display-settings --minimal when a new
    display is connected)

    Signed-off-by: Simon Steinbeiss <email address hidden>

------------------------------------------

Building and using its immediate predecessor fixes the issue for me. Can anybody confirm?

I am currently investigating the code, trying to find what's wrong. However, I have little to no experience regarding the code base, so this might take a while. Any help would be greatly appreciated.

I am using the Yocto project to build a linux image containing xfce. I have been having the same problem with a failure to detect when disconnecting and reconnecting an LCD monitor.

I reverted commit dbd76eb58bd9d7a55de753daa5572ef24867d924, and I can confirm that I can now disconnect the monitor at will with detection.

I'll have to use this workaround for now.

I am currently stuck analyzing this issue. The following considerations refer to commit dbd76eb58bd9d7a55de753daa5572ef24867d924.

After adding lots of debug output to displays.c, I noticed a potential issue in

static GPtrArray* xfce_displays_helper_list_outputs (XfceDisplaysHelper*)

which contains the line of

if (output_info->connection != RR_Connected)

When powering off a screen and powering it on again, the value of output_info->connection is always 1 (=RR_Disconnected). Hence, the rest of the surrounding loop's iteration is skipped, no modes are detected, etc.

According to my current understanding (which might be completely erroneous) of how the code works, this is wrong and it could hint to the actual cause of the issue - which I'm still unable to identify.

Further observations:

xfce_displays_helper_list_outputs is called twice in displays.c - once by xfce_displays_helper_init(...) and once by xfce_displays_helper_reload(...). In the former case, (output_info->connection != RR_Connected) is false for one of my outputs, thus modes are getting detected, etc. In the latter, it is not.

Can anybody assess whether or not I am on the right track?

Any help debugging this would still be greatly appreciated. :)

Created attachment 5681
HDMI power cycling patch

Created and attached a small patch that fixes the issue for me. It applies to any xfce4-settings version starting from dbd76eb58bd9d7a55de753daa5572ef24867d924 (contained in 4.11.1), up to the current origin/master.

Can anybody confirm this patch fixing the issue while not introducing undesirable side effects?

As I understand, it is indeed a suitable solution (cf. the implementation in 641c6c4d7dda4ac41f811c8c0f9e26738f12a732 which used a corresponding approach) but it might conceal another underlying problem:

g_ptr_array_unref(GPtrArray*) is expected to have the same effect as g_ptr_array_free(GPtrArray*, TRUE) in case there is exactly one reference to the given argument. However, in the case at hand, the effects differ, which leads to the conclusion that there is more that just one reference left to the given argument, prior to calling g_ptr_array_unref. This could indicate some bug/leak -- but as I understand, calling g_ptr_array_free with free_seg=TRUE deals with that (somebody correct me if I'm wrong).

I just tested the HDMI power cycling patch. I am able to unplug and replug the VGA connector on my motherboard and still detect it.

I've tested the patch, and noticed that without the patch xfsettingsd sometimes crashes when an external display (in this case, a TV) is unplugged. Without the patch, xfsettingsd no longer crashes.

(In reply to Sean Davis from comment #5)
> I've tested the patch, and noticed that without the patch xfsettingsd
> sometimes crashes when an external display (in this case, a TV) is
> unplugged. Without the patch, xfsettingsd no longer crashes.

Now you got me confused, "without the patch" in both cases? Just to be sure, which is it?

In , Raj B (bigwoof) wrote :

I tested this patch and it seems to have fixed the problem for me.

I have Linux machine running Ubuntu Trusty with the latest nVidia drivers (337.25-0ubuntu1~xedgers14.04.2). I used XFCE as my window manager for a mythtv/xbmc setup.

patching xfsettingsd has solved the loss of display issue for me.

My machine is connected to an Onkyo receiver which is then connected to an Epson projector.

Bengt Nilsson (bnilsson11) wrote :

I would like to try "this patch".
Please supply a link to where I can find it, and some detailed instructions on how to apply it. I am not a programmer.

Regards,

B. Nilsson

Created attachment 5723
HDMI and Screen On Event Patch

I think I figured out the failure in the logic. You are right, since we are clearing the caches in that particular function, it makes sense to make sure they are truly freed.

The above fix uncovered another issue with the order of events when the "Configure new displays when connected" feature is enabled. I found that we are clearing our caches in the middle of the screen event (thats the leftover reference you found). I reordered the code for that function, and now I think I should have a fully functional patch.

Please try the attached patch and let me know if the issue is still resolved for you.

Thomas Mashos (tgm4883) on 2015-01-12
tags: added: downstream
Changed in xfce4-settings:
status: Confirmed → Incomplete
Changed in xfce4-settings:
status: Incomplete → In Progress
Changed in xfce4-settings:
status: In Progress → Fix Released
Changed in xfce4-settings:
importance: Medium → Critical
status: Fix Released → Confirmed
43 comments hidden view all 123 comments

i'll test the latest git version without any additional patches early next week when I get back home. I'll report what I find after a day or two of testing (the bug only manifests when the display has been off for quite some time)

Thanks,

Raj

fkervin (fleckskervin) wrote :
Download full text (6.3 KiB)

 I've spent a good amount of hours researching and making tests, unfortunately I can't make it work and I'm really desperate, so I'd really thank any help.

I hope someone can lend me a hand (mainly on the procedures of patches of alexander and sean, I can't make them work).
----

The script of first solution works (in my case replacing HDMI-0 with HDMI1), I create it in ~/fixhdmi.sh and chmod 755 it.

The question here is automating the process, and in this I've not been able to, It only works running script manually from terminal (I've no try to make a shortcut, it's not valid for my needs) :(

I even added a wait time before the process (since the TV takes some time in beign ready I thought it could help) and a message after with zenity:

[code]#!/bin/sh
#Fix TV state when HDMI link is lost.
#By Mario Limonciello <email address hidden>
sleep 10
OUTPUT="HDMI1"
BAD_MODE="1280x720"
GOOD_MODE="1920x1080"

for MODE in $BAD_MODE $GOOD_MODE; do
 DISPLAY=:0 xrandr --output $OUTPUT --mode $MODE
 sleep 2
done
zenity --info --title="HDMI" --text="fixhdmi.sh has been executed"
[/code]

I've found a few entries explaining the procedure of udev, so I've create a the file /etc/udev/rules.d/hdmi.rules with this content

[code]KERNEL=="card0", SUBSYSTEM=="drm", ACTION=="change", RUN+="/home/fkervin/fixhdmi.sh[/code]

I also tryed:
[code]SUBSYSTEM=="drm", ACTION=="change", RUN+="/home/fkervin/fixhdmi.sh[/code]

I tried another ones I don't remember...

The result without the udev entry is "no signal message", with it I have cursor on screen over black for a seconds but then dissapear and "no signal" message again. It makes me think that

the udev could be working on TV disconnect but not on connect (only an idea). Later when I tried the alexander's mod I had the same effect, (cursor and blank screen), I don't how it there is any relation.

I've try udevadm in a power-off/power-on of the TV, having this result:

[code]
fkervin@fkervin:~$ sudo udevadm monitor
[sudo] password for fkervin:
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[121.525065] change /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
UDEV [135.590008] change /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
KERNEL[142.156140] change /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
UDEV [156.226634] change /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
[/code]

I can't figure out how to make udev rule work :(

-----

I've try to install Xfce 4.12 packages:

[code]
sudo add-apt-repository ppa:xubuntu-dev/xfce-4.12
sudo apt-get update
sudo apt-get upgrade
[/code]

It unfortunately doesn't solve the problem.

------

killing xfsettingsd makes it work, but since it interfere on the icons, text and many elements, it's not appropiate.

------

In the option of installing an older xfce4-settings:

by adding the saucy mirrors to you sources.list, and running apt-get update && apt-get install xfce4-settings/saucy or apt-get -t saucy install xfce4-settings

I don't know what should I add to sources.list.

------

Alexander and sean's procedures:
I've try several times with no results, for example:

...

Read more...

Glen Dragon (gdragon) wrote :

For those trying the above commands... the curl to get the patch files is likely not working.
I'm not motivated enough on curl to figure out the problem, but i was able to copy/paste with a browser.
If you are unsure, look at the patch files, git diff, the output of patch, etc...

For me the latest git did not fix the problem.
Sean's (updated) patch also did not fix the problem.
Alexander's patch *did* fix my problem.

My use case is with a single display attached to a A/V receiver. Turning the receiver off, and back on did not come pack.
Using alexander's one liner, it works great.

IMHO, this is a big issue, and i'm shocked that it's not been rectified yet.

so the original bug of the display resetting to NULL has *not* been fixed in the latest git version.

I left it for a day, came back and the display was blank when I turned on the projector.

I have applied Alexander's 1 line patch and I'm testing that now. But the git version has *not* fixed the problem.

Someone else has reported the same issue with the git version in the ubuntu version of this bug report btw

https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-331/+bug/1308105

see the last comment at the bottom

can we please include the 1 line patch to the master repo?

Thanks,

Raj

I would add the one-line patch, but then every monitor event triggers the "new monitor" signal since all previously known monitors are now forgotten.

To see this bug in action, enable the setting "Configure new displays when connected", then manipulate the monitors with the settings dialog. Move them, turn them on/off, click apply.

You'll quickly find many many display settings popping up.

So while this patch fixes this bug for you, it also creates a new bug for everyone. Please continue to explore and provide additional patches. It's difficult to provide a proper fix when the original issue does not affect me or Simon, the other active maintainer of the display settings..

Hi Sean,

interesting. I have never tried to configure the monitor as this is my projector display and not my laptop.

This is wierd as the bug you mentioned would suck for laptop / PC use where you plug in and configure external displays somewhat regularly but the bug that is the point of this bug report is terrible for anyone using a projector or LCD display that is attached to a media PC and switched off fairly regularly.

I guess I'll just continue using my patched version until a suitable "fixes all bugs" version is written.

Thanks for the explanation for why the patch has not been included yet b.t.w. It was very informative!

Raj

fkervin (fleckskervin) wrote :

Hi all,

Some days ago appeared xfce 4.12, I've made an sudo apt-get update and upgrade but problem is not solved.

Have I done something wrong or the problem is still not solved?

Regards

Sean Davis (bluesabre) wrote :

@fkervin The bug status is still not marked as fixed. There has not been a valid fix that doesn't cause a regression.

I have been having this issue on my 14.04 install for a while now (probably as long as Mario), i have been using my rPi and a button to run a command over ssh to fix it
DISPLAY=":0.0" xrandr --output HDMI-0 --auto

i upgraded me and my dad to xfce 4.12 and now he has the issue ga-a55m-ds2 motherboard and a AMD A6-3500 APU
he is running xubuntu 14.04 w/ linux 3.16.7 w/ xfce 4.12 (open source drivers, NOT fglrx/catalyst)
he is using DVI on a HP 2009M monitor
this command restores the display for him
DISPLAY=":0.0" xrandr --output DVI-0 --auto
he seems to have this issue wen the power manager turns the display off and the monitor goes into standby

I experienced this on an HDTV client, workaround and details herehttps://bbs.archlinux.org/viewtopic.php?pid=1510206#p1510206

My workaround of attaching another monitor to my desktop acting as a HDTV MythTV client is not 100% effective.

Adam Kaminski (thimslugga) wrote :

I am currently experiencing this issue with a foxconn d180s j1800 motherboard and Xubuntu 15.04. After turning off the TV and receiver I do not receive any video when turning them back on. Running the script fixhdmi.sh posted above or 'xrandr -d :0 --auto' seems to fix the issue. I just need to figure out how to trigger when TV turns back on.

Arjen (acm-tweakers) wrote :

You could probably just use 'xrandr --auto', at least that worked for me.

I have actually now a different 'fix', by simply never having the system notice the hdmi-link goes down. I used this wiki-page to fix that for my Intel Haswell-cpu graphics.

https://wiki.archlinux.org/index.php/Kernel_mode_setting

My final cmdline is now this:
video=HDMI-A-1:1920x1080@60e dmr_kms_helper.edid_firmware=HDMI-A-1:edid/tv-edid-data.edid

The tv-edid-data file is located in /usr/lib/firmware/edid/ and was derived via 'get-edid'. It actually also seemed to work with the built-in '1920x1080.edid' (saves you retrieving it from your receiver, but I thought it a bit more save to have the actual edid).
Just supplying the video-parameter wasn't enough in my case, it failed to actually set the resolution to 1920x1080 (and used 1024x768 instead). Adding the edid-data fixed that (it may even be sufficient to only force-load the edid data).

The reason this works is not because it fixes the issue, but because it prevents the hdmi-link from ever going down - as far as the kernel is concerned.

Ernst Sjöstrand (ernstp) wrote :

My best solutions to the MythBuntu/XBMC/Kodi usecase:

1) Run a MythBuntu/XBMC/Kodi-session without any desktop at all! They're in /usr/share/xsessions/
for running completely standalone.

2) Running a really minimal WM that doesn't try to manage screens at all like Openbox. Works
well with Steam big picture mode.

On my system (Linux bono 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1 (2015-05-24) x86_64 GNU/Linux) the issue appeared only cca 2 weeks ago. I don't know which package update (Debian Testing) caused it.

Everytime the monitor blanks it can't resume.

My workaround is to have this code running:
while true; do xrandr -d :0 --output HDMI1 --mode 1920x1080; sleep 10; done

My display card:
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (rev 09)

Looking at Sean's comment of 2015-02-19, it appears that a functional patch is still being sought. I am experiencing the problem of the display not coming back when it is reconnected. I'm posting this in hopes that it assists the maintainers of the code in resolving the issue. With the 4.12 branch from git, I was able to reproduce this bug with just a regular desktop (non HDMI) by disconnecting and reconnecting the monitor. When the monitor was reconnected, the screen does not resume.

In the xfce_displays_helper_screen_on_event function in the top section it has the condition of the disconnection of the monitor. In that section it is calling a forced disable of the crtc via

  crtc->mode = None;
  xfce_displays_helper_disable_crtc (helper, crtc->id);

However, in the else condition below where it is adding in new outputs, the crtc is still in a disabled status when this gets executed after the cable has been reattached. (mode = None, width=0, etc)

I think that the proper solution is to get the crtc re-enabled/refreshed upon reconnection and I'm hoping that those that actually know this code would know how to do this (I tried a couple of options across various functions but they did not work).

The interim "hack" solution that seems to work for me is to comment out the code that is disabling the crtc. This doesn't seem to spawn additional displays but may other regression problems. And since it is a true hack rather than a correct solution, I'm not attaching it as a patch.

Hope this helps, let me know if testing is needed or if you can point me to the proper method of getting the crtc information refreshed.

Erik Hovland (erik-m) wrote :

Adding my me too. I have a ECS Liva X with an intel graphics chip. When I turn off my Samsung TV the screen goes away. I added the suggestion above (killall xsettingsd) to the /etc/mythtv/session-settings and was able to confirm that it does workaround the problem.

Created attachment 6473
Patch to call xrandr --auto when a new display is connected

Ivan Kozik (ivankozik) wrote :

I have a Viewsonic VX2475Smhl-4K attached with a DisplayPort cable to a Gigabyte GTX 970 (nvidia-358 driver, ASUS Z97-A, UEFI boot with CSM disabled), and it requires `xrandr --auto` after being power cycled. That's easy to set to a keyboard shortcut when logged in, but harder in xflock4. Even less amusing, Linux text VTs don't work until an `xrandr --auto` in an X session.

There were reports that non-VESA-compliant DisplayPort cables that wire pin 20 (DP_PWR) cause this problem, but I checked my Cable Matters cable with a multimeter and it does not wire pin 20.

Microsoft has a page about this problem: https://support.microsoft.com/en-us/kb/2625567

I still get this in xfce4-settings.4.12.0-3 when I shut off the monitor via its power button, or switch to another pc via a K-V-M switch. I'm unable to resume the display when switching back to my Linux pc or turning the power back on. I have to run 4.10.1-1. For a while I used the 4.11.3-3 fix from Manjaro but that doesn't work now either since last -Syu. I'm running Archlinux 4.3.0-1-ck on an Asus M5A88-M mobo, with on-board Radeon 4250 graphics using the HDMI port. The HDMI is directly connected to an Asus VS247 lcd monitor. The K-V-M only switches the keyboard and mouse from the Linux pc, the other pc's it also switches the VGA as they are connected to the monitor VGA (the monitor default is HDMI so I manually switch the monitor by its selector button to VGA for the VGA pc's). I have to remote into the Linux pc and do a normal reboot in order to get the display to turn on else use the power button on front of the Linux pc :(.
Not sure where to look to troubleshoot. Thank you for your consideration.

Greg Fordyce (greg.fordyce) wrote :

I also struggled with this bug when doing a fresh install of Mythbuntu 14.04 this week.

I downloaded xfce4-settings 4.11.0-1 from this link.

https://launchpad.net/ubuntu/saucy/amd64/xfce4-settings/4.11.0-1ubuntu1

Then "sudo dpkg -i xfce4-settings_4.11.0-1ubuntu1_amd64.deb" to install it and synaptic to lock this version.

I can now switch off my TV connected with HDMI cable and when I switch it back on it works.

Mythbuntu is running on a Gigabyte Brix GB-BXBT-2807 with 4gb ram, 120gb ssd, DVB-T usb tuner. The machine runs both front and backend.

Hi Greg,

    Trying to follow your instructions.

     What do you mean by... and synaptic to lock this version....

     What did you do, what did you execute

Thanks

Doug
On Jan 17, 2016 1:05 PM, "Greg Fordyce" <email address hidden> wrote:

> I also struggled with this bug when doing a fresh install of Mythbuntu
> 14.04 this week.
>
> I downloaded xfce4-settings 4.11.0-1 from this link.
>
> https://launchpad.net/ubuntu/saucy/amd64/xfce4-settings/4.11.0-1ubuntu1
>
> Then "sudo dpkg -i xfce4-settings_4.11.0-1ubuntu1_amd64.deb" to install
> it and synaptic to lock this version.
>
> I can now switch off my TV connected with HDMI cable and when I switch
> it back on it works.
>
> Mythbuntu is running on a Gigabyte Brix GB-BXBT-2807 with 4gb ram, 120gb
> ssd, DVB-T usb tuner. The machine runs both front and backend.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1308105
>
> Title:
> Xfce resets TV mode to NULL when power cycled
>
> Status in Mythbuntu:
> Confirmed
> Status in xfce4-settings:
> Confirmed
> Status in nvidia-graphics-drivers package in Ubuntu:
> Invalid
> Status in nvidia-graphics-drivers-331 package in Ubuntu:
> Invalid
> Status in xfce4-settings package in Ubuntu:
> Confirmed
>
> Bug description:
> I had an HTPC with Mythbuntu 12.04 installed. Upon upgrading a new
> behavior that if the TV is power cycled it no longer detects a link
> with the HTPC.
>
> When this happens I can find in the xorg log that there is an
> accompanying log item:
>
> [ 39829.509] (II) NVIDIA(0): Setting mode "NULL"
>
> After debugging with NVIDIA at
> https://devtalk.nvidia.com/default/topic/729955/linux/tv-stops-being-
> detected/ we've deteremined it's a X client that reacts to the RANDR
> events causing the mode to be set to NULL.
>
> Working through the list in an Xfce environment, the culprit is
> xfsettingsd. If xfsettingsd is running, it causes the TV to come up
> in a NULL mode. If it's killed, it remains in the mode it was
> previously running in.
>
>
> Until this is fixed, this behavior can be worked around with a simple
> shell script:
> ==============================
> #!/bin/sh
> #Fix TV state when HDMI link is lost.
> #By Mario Limonciello <email address hidden>
>
> OUTPUT="HDMI-0"
> BAD_MODE="1280x720"
> GOOD_MODE="1920x1080"
>
> for MODE in $BAD_MODE $GOOD_MODE; do
> DISPLAY=:0 xrandr --output $OUTPUT --mode $MODE
> sleep 2
> done
> ==============================
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mythbuntu/+bug/1308105/+subscriptions
>

seeing this in 16.04 daily xubuntu

didn't get anywhere with the script in the LP bug report, nor trying to use that AND a udev rule (from xfce forum)

I am though getting success here using the one-liner (though sleeping for 3 here instead of 10) in comment #48

Alexandre ACEBEDO (aacebedo) wrote :

I have exactly the same issue on 15.10 with an intel card.
philmmanjaro on github has published a patch to solve the issue. Just applies the patch on xfce 4.12 source code
The workaround to fix this is the following:

$> sudo apt-get install xfce4-dev-tools libexo-1-dev libgarcon-1-0-dev libxfce4ui-1-dev libxklavier-dev
$> git clone git://git.xfce.org/xfce/xfce4-settings
$> git clone https://github.com/manjaro/packages-extra.git
$> cd xfce4-settings
$> git checkout xfce4-settings-4.12.0
$> patch -p1 < ../packages-extra/xfce4-settings/hdmi-power-cycling.patch
$> ./configure --prefix=/usr --enable-pluggable-dialogs --enable-libxklavier
$> make
$> sudo make install
$> sudo reboot now

Alexandre ACEBEDO (aacebedo) wrote :

I did a small mistake on my compiling instruction above, replace ./configure by ./autogen.sh and it should work.

As suggested in comment 49
I think proper solution is enable crtc upon reconnection IF it is disabled.

Here is a prototype for patch - I'm hoping maintainer (Sean?)
can suggest "correct code" to enable crtc.

diff --git a/xfsettingsd/displays.c b/xfsettingsd/displays.c
index 095e323..af70256 100644
--- a/xfsettingsd/displays.c
+++ b/xfsettingsd/displays.c
@@ -415,6 +415,7 @@ xfce_displays_helper_screen_on_event (GdkXEvent *xevent,
     XfceRROutput *output, *o;
     XEvent *e = xevent;
     gint event_num;
+ gint j;
     guint n, m, nactive = 0;
     gboolean found = FALSE, changed = FALSE;

@@ -496,9 +497,37 @@ xfce_displays_helper_screen_on_event (GdkXEvent *xevent,
                 {
                     xfsettings_dbg (XFSD_DEBUG_DISPLAYS, "New output connected: %s",
                                     output->info->name);
+ /* need to enable crtc for output ? */
+ if (output->info->crtc == None)
+ {
+ xfsettings_dbg (XFSD_DEBUG_DISPLAYS, "enabling crtc for %s", output->info->name);
+ crtc = xfce_displays_helper_find_usable_crtc (helper, output);
+ if (crtc)
+ {
+ crtc->mode = output->preferred_mode;
+ crtc->rotation = RR_Rotate_0;
+ crtc->x = crtc->y = 0;
+ /* set width and height */
+ for (j = 0; j < helper->resources->nmode; ++j)
+ {
+ if (helper->resources->modes[j].id == output->preferred_mode)
+ {
+ crtc->width = helper->resources->modes[j].width;
+ crtc->height = helper->resources->modes[j].height;
+ break;
+ }
+ }
+ xfce_displays_helper_set_outputs (crtc, output);
+ crtc->changed = TRUE;
+ }
+ }
+
                     changed = TRUE;
                 }
             }
+ if (changed)
+ xfce_displays_helper_apply_all (helper);
+
             /* Start the minimal dialog according to the user preferences */
             if (changed && xfconf_channel_get_bool (helper->channel, NOTIFY_PROP, FALSE))
                 xfce_spawn_command_line_on_screen (NULL, "xfce4-display-settings -m", FALSE,

Created attachment 6590
Enable crtc if it is disabled after power cycle

Added prototype patch to enable crtc after power cycle of displayport monitor.
I hope maintainer can suggest improvements.

The patch in #53 is working for me. Arch Linux 4.3.3.2-ck. Asus Radeon R7-240 video card (using the hdmi port), Asus M5A88-M computer. I can now switch via k-v-m to other pc's, can turn off power to monitor for extended periods and all resumes when power is back on or k-v-m is switched back to the Arch pc (other pc's are vga).

Fabian Mathews (supagu) wrote :

Any update on this issue?

Im getting it on the latest xubuntu nightly.

I can still access the console via Ctrl+Alt + F1. But cannot get back to the xfce desktop.

Andy Wood (ahwood-9) wrote :

Reproducible on HP Pavilion SE a6655f, AMD x64, with Asus brand Geforce GT-220 (ENGT220) video card, only connected output is HDMI to surround receiver, then HDMI to Panasonic LED TV.
Unused workaround from comment #22 (disable xfsettingfsd) and has been solid since. I switched inputs on the TV away from the surround to a digital cable box, watched a little TV, then back without issue. I turned off TV and surround, turned back on, and I can still see the output from the HP.

Mythbuntu 14.0.4 LTS (fresh install of 14.04.4 actually).

A side-effect was that sometimes the mouse pointer would also disappear if I switched away and back again. I'll be watching that problem closely on this HP PC now that I've worked around the current problem.

Just a minor point: Glen pointed out in comment #86 that the curl command to get the patch files doesn't work.

I've done some playing around. For some reason 'curl https://bugzilla.xfce.org/attachment.cgi?id=5681' doesn't work - but 'curl -L http://bugzilla.xfce.org/attachment.cgi?id=5681', which follows the 302 redirect from 'http://bugzilla.xfce.org/...' to 'https://bugzilla.xfce.org/...', does work.

So it's possible to get the patches by issuing:

curl -L http://bugzilla.xfce.org/attachment.cgi?id=5681 > alexander-patch.diff
curl -L http://bugzilla.xfce.org/attachment.cgi?id=5723 > sean-patch.diff

Jan (jan-hendrik) wrote :

The patch by jkampe68 (#109) did it for me. Here is my flow chart:

Downloaded the xfce4-settings_4.12.0.orig.tar.bz2 (https://launchpad.net/ubuntu/+archive/primary/+files/xfce4-settings_4.12.0.orig.tar.bz2) and unpacked it.

Saved the Patch by jkampe68 (http://bug-attachment.xfce.org/attachment.cgi?id=6590) as .patch file.

Navigated to xfce4-settings-4.12.0-orig/xfsettingsd/ and used the patch command to patch the displays.c file.

Now "./configure --prefix=/usr --sysconfdir=/etc" until all dependencies were fulfilled.
Garcon can be found here: https://mirror.netcologne.de/xfce/src/xfce/garcon/0.5/garcon-0.5.0.tar.bz2

"make"

"sudo make install"

Now the /usr/bin/xfsettingsd was replaced and everything worked well after reboot.

Jan (jan-hendrik) wrote :

The attachment "Patch by jkampe68" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Chuck McManis (chuck-mcmanis) wrote :

Trying to implement the suggestion in #115, I've got the git repo from xfce.org and applied the patch, did the configure which ends with:

Build Configuration:

* Installation prefix: /usr
* Debug Support: full
* Xrandr support: yes
* UPower support: no
* Libnotify support: no
* Xcursor support: yes
* Xorg libinput support: no
* Embedded settings dialogs no
* Sounds settings support no
* Libxklavier support: yes
* Mime settings (gio-unix): yes

But attempting a build gives the error:

make[4]: Entering directory '/home/cmcmanis/src/xfce4-settings/dialogs/appearance-settings'
  CC xfce4_appearance_settings-main.o
main.c:44:34: fatal error: appearance-dialog_ui.h: No such file or directory
compilation terminated.
Makefile:667: recipe for target 'xfce4_appearance_settings-main.o' failed

So presumably there is a missing step here somewhere.

Chuck McManis (chuck-mcmanis) wrote :

Scratch that, forgot to autogen.sh first, did it earlier but did not repeat after resolving the last dependency. So not it compiled, on to testing.

Chuck McManis (chuck-mcmanis) wrote :

Ok I have confirmed that the patch in #115 (Saved the Patch by jkampe68 (http://bug-attachment.xfce.org/attachment.cgi?id=6590) as .patch file.) fixes the issue on NUC derived systems (Intel graphics, I've got a NUC5i7RYH and a Gigabyte BRIX) where the screen attached to the display port output does not come back on when power is re-applied to the monitor. The next step is validating that the screen can recover after a "sleep state" which has been initiated by light-lock.

I pulled the git repo applied the patch, ran autogen.sh then make, then make install. Rebooted and verified the new settingsd was running (

cmcmanis@charliehorse:~$ xfsettingsd --version
xfsettingsd 4.12.0git-56abfbd (Xfce 4.12)

Copyright (c) 2008-2011
 The Xfce development team. All rights reserved.

Please report bugs to <http://bugzilla.xfce.org/>.
cmcmanis@charliehorse:~$

Power cycled the monitor, and where previously this would always cause it to not come back, it now returns. System is Xubuntu 16.04 otherwise vanilla install.

I have confirmed that this patch allows my NUC derived systems to recover the display when the monitor is switched off and then switched on again. This for a NUC5i7RYH and a Gigabyte BRIX (GB-BXi5H-4200)

Chuck McManis (chuck-mcmanis) wrote :

And the title here really needs to be changed that this isn't an nVidia bug, that probably confuses people trying to find it.

Drew Lustro (drewlustro) wrote :

OK. This has been driving me nuts for weeks. I would lose my entire X session every single day as soon as the screen blanked... quite troublesome when you're trying to make linux work as your daily drive, haha.

*Confirmed fix* w/ the patch suggested on xfce's bugzilla: https://bugzilla.xfce.org/show_bug.cgi?id=11107#c53

Download the xfce4-settings source, apply the patch, increment with a non-maintainer version number (for no future apt-get conflicts once this gets an official fix), and reinstall your patched xfce4-settings.

I had to learn how to patch a .deb file properly in the process, but that was worth it too.

-- Hardware/Software --
GPU: GTX 970 over DisplayPort 1.2
Monitor: Dell P2715 (4K@60Hz, hardware rev A03)
OS: Xubuntu Xenial (16.04 LTS)
Manually patched xfce4-settings version: 4.12.0-2ubuntu1

Useful links on patching .deb's:
https://help.ubuntu.com/community/UpdatingADeb
http://www.cyberciti.biz/faq/appy-patch-file-using-patch-command/

Displaying first 40 and last 40 comments. View all 123 comments or add a comment.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.