Solution to Resolution Fallback in Windows 7 When HDMI Signal Lost
#16
Not for everyone, but I solved this problem using HDMI Detective. It's about $90, but never a resolution or audio problem over HDMI, regardless of video card/tv/receiver combo.
Reply
#17
Well thanks to metheos I've solved my problem and saved $90. Wink
Reply
#18
Glad to hear it's working! Mind posting your macros here in case it helps someone in the future?

You can right click on them in eventghost and copy, then paste it here in CODE tags.
Reply
#19
Will do.
Reply
#20
Metheos, I think you are my new hero. I've had constant issues with XBMC crashing my entire HTPC when I turn off or switch sources on my receiver. I never realized that the resolution change was the issue. I'm going to give this a whirl.
Reply
#21
Hitcher Wrote:I never realised so much can be done with EG.

As I'd rather not have XBMC close down and restart is there a way to window XBMC when the resolution changes, then fullscreen if and when it reverts back to 1980x1080?

Note: This is currently what I manually do when playing music and switching off the TV so the PC/XBMC doesn't crash.

Hitcher Wrote:I'm part way there using the XBMC action ToggleFullScreen but I can't figure out how to make it initially toggle when the resolution changes from 1920x1080 to whatever it is when the TV is switched off.

metheos Wrote:You should simply be able to add a second macro with the event trigger for whatever the resolution changes to. If you leave eventghost running when the change happens it should show up in the event list as ResolutionChanged.1024x768 or whatever the resolution is that it is falling back on.

Hitcher Wrote:Ah now I get how it works.

Added ResolutionChanged.1024x768 to toggle once and ResolutionChanged.1920x1080 to toggle back again.

Testing now.

Thanks.

metheos Wrote:Glad to hear it's working! Mind posting your macros here in case it helps someone in the future?

You can right click on them in eventghost and copy, then paste it here in CODE tags.

As promised here's my EG solution to the problem -

PHP Code:
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1534">
    <Macro Name="RestartXBMConResEvent" Expanded="True">
        <Event Name="ResolutionChanged.1920x1080" />
        <Action>
            XBMC2.ToggleFullScreen()
        </Action>
    </Macro>
</EventGhost>

<EventGhost Version="1534">
    <Macro Name="RestartXBMConResEvent" Expanded="True">
        <Event Name="ResolutionChanged.1024x768" />
        <Action>
            XBMC2.ToggleFullScreen()
        </Action>
    </Macro>
</EventGhost> 

All credit to metheos.
Reply
#22
Hitcher, I like your idea of toggling fullscreen, but I can't seem to make your macros work. As near as I can tell EventGhost can't interpret the XBMC2.ToggleFullScreen() command. Do you have something additional in your configuration that would be pertinent to that command and making this work?
Reply
#23
Do you have the XBMC2 plugin for EV?
Reply
#24
That's a plugin that comes with the standard eventghost install. Probably just need to add it to the tree.

Right Click anywhere in tree>Add Plugin>Program Control>XBMC2
Reply
#25
Hitcher Wrote:As promised here's my EG solution to the problem -

PHP Code:
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1534">
    <Macro Name="RestartXBMConResEvent" Expanded="True">
        <Event Name="ResolutionChanged.1920x1080" />
        <Action>
            XBMC2.ToggleFullScreen()
        </Action>
    </Macro>
</EventGhost>

<EventGhost Version="1534">
    <Macro Name="RestartXBMConResEvent" Expanded="True">
        <Event Name="ResolutionChanged.1024x768" />
        <Action>
            XBMC2.ToggleFullScreen()
        </Action>
    </Macro>
</EventGhost> 

All credit to metheos.

I've modified this a little and been using it. I updated the macro names and combined them into one macro bound to both events since they did the same thing.

It additionally sets the screen resolution just to be sure and brings the xbmc window to the front.

This code block contains the CheckTV python scripting and the "SetDisplay and Toggle XBMC Fullscreen" Macro in a folder named "XBMC Resolution Fix"

PHP Code:
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1534">
    <Folder Name="XBMC Resolution Fix" Expanded="True">
        <Macro Name="Check TV">
            <Event Name="Main.OnInit" />
            <Action>
                EventGhost.PythonScript(u'from threading import Thread, Event\nfrom win32api import EnumDisplayMonitors\nfrom win32api import GetSystemMetrics\nprevres = \'1\'\n\nclass MyThread(Thread):\n    def __init__(self):\n        Thread.__init__(self, name = \'CheckTV_Thread\')\n        self.event = Event()\n        self.tv = False\n        \n    def run(self):\n        global prevres\n        while True:\n            width = GetSystemMetrics(0)\n            height = GetSystemMetrics(1)\n            if prevres == \'1\':\n                prevres = str(width) + str(height)\n            if prevres != str(width) + str(height):\n                eg.TriggerEvent(str(width) + \'x\' + str(height), prefix = "ResolutionChanged")\n                prevres = str(width) + str(height)\n            self.event.wait(1)\n            self.event.clear()\n            \n\nmt = MyThread()\nmt.start()\n')
            </Action>
        </Macro>
        <Macro Name="SetDisplay and Toggle XBMC Fullscreen">
            <Event Name="ResolutionChanged.1920x1080" />
            <Event Name="ResolutionChanged.1024x768" />
            <Action>
                System.ChangeDisplaySettings(1, (1920L, 1080L), 60L, 32L, False, False)
            </Action>
            <Action>
                Window.FindWindow(None, u'XBMC', None, None, None, 1, False, 10.0, 0)
            </Action>
            <Action>
                Window.BringToFront()
            </Action>
            <Action>
                XBMC2.ToggleFullScreen()
            </Action>
        </Macro>
    </Folder>
</EventGhost> 
Reply
#26
I think I found the problem. I was using an older version of EventGhost and had the XBMC plugin added, but there was no XBMC2 plugin. I just updated and now I see an XBMC2 plugin, so I'll give it another whirl. I feel a little dumb.

EDIT: Too bad it looks like it'll be days until I can properly test. I attempted to upgrade my media store from a 2x1.5TB RAID1 to a 4x1.5TB RAID5 earlier this week and it's been a huge headache/nightmare. A drive dropped out of the array today and even though I think I've fixed the problem it looks like I'll be waiting DAYS on the rebuild.
Reply
#27
Pardon my ignorance but does anyone have a slightly more detailed walkthrough of how to get this set up?

I've never used eventghost before so I don't know how this script/macro's/etc integrate with xbmc or resolution changes.

Thanks!
Reply
#28
Sure!

From the beginning:

Download and install the latest EventGhost.
Run EventGhost and create a new configuration. (File > New)
Right click on "Configuration Tree" and choose "Add Plugin"
Scroll through the list until you find "XBMC2" in the "Program Control" folder.
Choose "XBMC2" and press "OK". Adjust the settings as needed, no change is usually needed since we're running this on the XBMC PC.
Now select and copy the following code:

Code:
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1534">
    <Folder Name="XBMC Resolution Fix" Expanded="True">
        <Macro Name="Check TV">
            <Event Name="Main.OnInit" />
            <Action>
                EventGhost.PythonScript(u'from threading import Thread, Event\nfrom win32api import EnumDisplayMonitors\nfrom win32api import GetSystemMetrics\nprevres = \'1\'\n\nclass MyThread(Thread):\n    def __init__(self):\n        Thread.__init__(self, name = \'CheckTV_Thread\')\n        self.event = Event()\n        self.tv = False\n        \n    def run(self):\n        global prevres\n        while True:\n            width = GetSystemMetrics(0)\n            height = GetSystemMetrics(1)\n            if prevres == \'1\':\n                prevres = str(width) + str(height)\n            if prevres != str(width) + str(height):\n                eg.TriggerEvent(str(width) + \'x\' + str(height), prefix = "ResolutionChanged")\n                prevres = str(width) + str(height)\n            self.event.wait(1)\n            self.event.clear()\n            \n\nmt = MyThread()\nmt.start()\n')
            </Action>
        </Macro>
        <Macro Name="SetDisplay and Toggle XBMC Fullscreen">
            <Event Name="ResolutionChanged.1920x1080" />
            <Event Name="ResolutionChanged.1024x768" />
            <Action>
                System.ChangeDisplaySettings(1, (1920L, 1080L), 60L, 32L, False, False)
            </Action>
            <Action>
                Window.FindWindow(None, u'XBMC', None, None, None, 1, False, 10.0, 0)
            </Action>
            <Action>
                Window.BringToFront()
            </Action>
            <Action>
                XBMC2.ToggleFullScreen()
            </Action>
        </Macro>
    </Folder>
</EventGhost>

Right click on "Configuration Tree" again and choose "Paste"
Now save this configuration somewhere (File > Save)
If you want this to run on startup there is an option to enable that under File > Options...

That should do it! Merry Christmas!
Reply
#29
Hi Guys, I have the same problem but my screen only falls back from 1080p to 1080i. Is it possible to make the script detect this?
Reply
#30
Anyone know if a way to have EG force XBMC to Monitor #2?

I'm having a problem where about once a day (approx 1 out of every 4 uses) XBMC will not launch on Monitor #2, even though the Settings have it as such. It opens Full Screen on Monitor #2 and I must go into Settings and change it back to Monitor #2... it must be an XBMC problem since Monitor #2 has already been on for a while and in use seconds before that with WMC.

thx!
I'm not an expert but I play one at work.
Reply

Logout Mark Read Team Forum Stats Members Help
Solution to Resolution Fallback in Windows 7 When HDMI Signal Lost0