2011-08-10, 22:15
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.
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.
<?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>
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.
<?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>
<?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>