Help to narrow down S3 Resume bug (2 Viewers)

jameson_uk

Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    There is a slight bug in MP but I can't quite replicate it and I could do with seeing if others have similar problems or if anyone can help pinpoint where the code is failing (I think it is powerscheduler on client but it is intermittent and I am struggling to replicate)

    Basically sometimes when I come home turn everything on and resume from S3 standby I am just greeted by a black screen. On my old setup this was the whole thing but on my new setup it looks like 720p on a 1080p res (the other part of the screen is the desktop background colour).

    The only thing I can do at this point is end task on MP. Once I open the client up however the machine goes straight into S3 standby. I can then resume and everything works fine. As this has happened to me on two different hardware platforms now I am fairly sure it is a bug within MP not a problem with my hardware.

    I have tried the hack for resume (but I know my new mobo sends the right codes as I have written a small piece of code to check which codes were being sent on resume) and I have tried various different settings in MP (restart on resume, turn on/off monitor on S3 but without much joy)

    My guess is that somewhere in the code two requests are being sent for the machine to sleep. Something is happening whereby the client is forgetting to give up sleep rights to the tv server or something and the client is actually sending the machine to sleep at the same point the TV server is. When I resume the correct code to go to standby has not been executed so it is stuck with the black screen. When I start MP client again this triggers the code which has been waiting and the machine does then go into standby (and then everything works)

    So has anyone else got this problem, have they fixed it and does anyone know where this bug might lie?
     

    craigparris1

    Portal Pro
    May 20, 2008
    189
    15
    Home Country
    Hi jameson_uk,

    Good luck on getting to the bottom of this one, because it certainly seems to be something that plagues a lot of MP users, with no particular resolution that seems to suit everybody. I'm not sure how much help I'll be, but I'll tell you my scenario.

    Like you, I had problems with the PC resuming from standby, and varying degrees of response from the MediaPortal client. I never actually had any problems with the machine going INTO standby - the TV-Server always took care of this just fine. Like you, I also tried a number of suggested fixes throughout the site such as the S3Hack and also various standby-related tools (like MCE Standby Tool and MP StandbyHandler) - without much success.

    You can read a thread that I created about my problems here.

    Again, like you, I also wrote my own little app so that I could try and figure out what was happening. The key for me seems to come down to the resume process, and whatever it is that's happening within Windows at the time.

    Setting MP aside for the moment, with the small .Net app that I wrote I am logging an entry in the event log each time the PC goes into standby or resumes from standby (I'm just using SystemEvents.PowerModeChanged to trap the standby/resume). I always get an event recorded for when the PC goes INTO standby, but sometimes I won't get an event logged when the PC resumes ..... note: I NEVER get an event logged when the system wakes up automatically (ie. for EPG grabbing or scheduled recording), and I occasionally (but not very often) don't get an event logged when the system is woken up manually (ie. turned on by the power switch). So, given that this is just a small app that's relying on the OS (in my case, Windows XP) triggering a power event, there's obviously something not getting notified properly within the OS.

    Having said that, though, at the times when I don't get a "resume" event logged by my little app, there are entries in the TV-Server log to indicate that it knows the PC is resuming from standby. But, there can be unusual entries in the MediaPortal client log that seem to indicate that it's not been notified correctly of the original standby or the resume.

    So, where to from here for me? Well, I guess my next task is to do some research into XP, .Net and power events and see if I can narrow down why the OS doesn't seem to be notifying correctly sometimes on resume. In the interim, I've written my own little hack into my app that relies on file creation and deletion to work out of the system has come out of a resume - then I can restart the MP client properly each time it resumes.

    Like I said at the top of this reply - good luck getting to the bottom of it. If you can narrow it down to a replicable bug, and get a developer to fix it, you'll have a lot of happy MP users!

    Cheers,
    Craig
     

    eboman

    Portal Member
    December 22, 2007
    11
    0
    Hi Jameson,

    I won't be much of a help, but i can confirm i have the same black screen problem although i do not have it 100% of the times, in my case it is always in standby (24 hours). @ 18:30pm it get a new tvguide and goes to sleep (via powerscheduler) this works perfect. Except for when i want to get it out of standy after a couple of days and watch something. Usually i end up with a black screen with no reponse to buttons (no sounds) and end up pressing the power button to shutdown the machine (i do not have a keyboard). Usually windows tries asks to shutdown mediaportal as it is not repsonding. My regular desktop is just behind it when it finally closes mediaportal and everything works, it is as if directx fails or something.

    Something else i noticed is that for example when i let it go to sleep and wake it up again it is usally fine, so maybe it is related to being in standby for a longer while..
    hope this helps

    PS i also get error messages that the tv service is unreach able but after i click ok (if i do not get a black screen) it is fine. Maybe i should try the standby handler aswell.

    PS2 even more problems here : https://forum.team-mediaportal.com/general-support-51/mp-hangs-when-getting-out-standby-50788/
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Something else i noticed is that for example when i let it go to sleep and wake it up again it is usally fine, so maybe it is related to being in standby for a longer while..
    I Agree, I just can't find the evidence....
    I am thinking that it may be where the machine wakes itself up to record and then puts itself back to sleep (possibly twice in a row). Not sure if resuming manually is reseting something or the like ? Should not be the case as the S3Hack is handling both automatic and manual resumes the same.
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    i'm hoping the 1.0.1 patch will help us some people mention the new SVN's fix their issues.

    As far as I am aware this is just the S3Hack now being part of the config app rather than a manual thing. I am hoping 1.0.1 solves everything but I am not sure it will else if the bug had been identified already there would be someone who knew how to fix it....
     

    pridehaveit

    Portal Member
    April 7, 2008
    34
    4
    Kiel
    Home Country
    Germany Germany
    I also have the same problem that MediaPortal is black and i see part of the desktop.
    If i press the down key on my mce remote mediaportal reacts again.
    I think i narrowed down the problem. For any reason OnSizeChanged is called in class d3dapp and thinks it needs to change to windowed mode. Can you add some log files to see if you have the same problem.
    I changed the OnSizeChanged method to ignore the request if mediaportal was started in fullscreen mode.
    Here the new MediaPortal.exe for Version 1.0.
    View attachment MediaPortal.zip
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    I also have the same problem that MediaPortal is black and i see part of the desktop.
    If i press the down key on my mce remote mediaportal reacts again.
    I think i narrowed down the problem. For any reason OnSizeChanged is called in class d3dapp and thinks it needs to change to windowed mode. Can you add some log files to see if you have the same problem.
    I changed the OnSizeChanged method to ignore the request if mediaportal was started in fullscreen mode.
    Interesting. That might explain it.... I have noticed that very rarely when my PC resumes it seems to be using the default monitor at 1680x1050 (odd choice of resolution). I think it then picks sorts out all the HDMI stuff and figures out that my TV is capable of 1080p and resets the res to 1920x1080.

    Thinking now that the black part of the screen is probably 1680x1050. Sometimes pressing something on the keypad does bring it back to life but sometimes not.

    The odd thing for me is more that when I end up killing mediaportal.exe and then restart it that the machine goes straight into standby. It seems as if the call to go to standby half failed and is still waiting even though the machine has actually made it into standby. (hence when it restarts it removes this lock and allows the standby call to continue)
     

    craigparris1

    Portal Pro
    May 20, 2008
    189
    15
    Home Country
    Hi guys,

    Here's a bit more info on my personal experiences with these standby/resume issues - particularly now that I've had a perfectly working system for about two weeks. Every resume from standby, MediaPortal has worked as expected - no remote control problems, no "TV service is not started" problems. It's great!

    Here's what I've done of late: as I reported earlier in this thread, I had a small .Net app which I'd written myself to try and trap all the suspends/resumes properly and do the appropriate actions .... but, the problem was, even that app wasn't always getting the power event notification from the OS. I put some extra code into the app, as a backup measure, to basically use a file on the local C: drive to try and identify if a suspend or resume had happened, but hadn't been triggered properly by the power event notification. Essentially, when a suspend happens properly, a file gets created, then when a resume happens properly the file gets deleted. I've then got a timer as well which is looking for this file - if it finds it and the date/time of the file is more than 15 minutes, it's pretty safe to assume that the last resume wasn't notified correctly to the .Net app, so it just does the resume routine via the timer.

    So far, this seems to be working fine (for about two weeks or so). Previously, I was pretty much having resume problems every second day.

    I've also implemented this fix: Windows Defender breaks localhost, which seems to have resolved the issue where TV streaming wouldn't start sometimes after resume (saying the TV-server was not available). I wasn't actually using Windows Defender - but hey, if it fixes the problem then that's all that matters!

    To be honest, jameson_uk, this probably doesn't actually help you much in your investigations, because at the end of the day I haven't actually solved the problem, I've just got a working "workaround" ...... but that suits me just fine for now!

    Cheers,
    Craig
     

    matis1

    MP Donator
  • Premium Supporter
  • January 13, 2005
    139
    1
    Austria /Europe
    Home Country
    Austria Austria
    just joking- couldn´t resist

    maybe its a feature not a bug, i mean its kind of the human touch of the project:

    when i resume in the morning out of bed-standby i sometimes get a blackscreen too, the only thing that works is a complete reset, sometimes also a new setup of the whole system. as i cant do that on my own for obvious reasons i told my wife what to do in such a case... and NO - i won´t tell you what it is exactly...

    ;o)
     

    Users who are viewing this thread

    Top Bottom