[0.2] Fails to restart TV tuner after returning from suspend (2 Viewers)

jcee

Portal Pro
November 23, 2004
282
1
Here all channels are encrypted.

So it does work, when I exit "my TV" before hibernate and reenter afterwards.

If I have hiberanted while beeing in "my TV" and coming back, TV does not work anymore. I have to exit MP and restart MP.
 

Paranoid Delusion

Moderation Manager
  • Premium Supporter
  • June 13, 2005
    13,052
    2,978
    Cheshire
    Home Country
    United Kingdom United Kingdom
    ziphnor

    Sorry, not all that up on cam's, thought most of them connected usb, or do they plug directly into the card. nice to know as thinking of getting one.

    Again whichever way they connect it's as if the driver is not initiliasing correctly within MP.

    Regards
     

    ziphnor

    Retired Team Member
  • Premium Supporter
  • August 4, 2005
    755
    13
    Copenhagen
    Home Country
    Denmark Denmark
    Again whichever way they connect it's as if the driver is not initiliasing correctly within MP.

    How can that be, when restarting MP is sufficient to get it to work? That means MP is doing something when restarting which is sufficient to properly initialize the tuner/CI/CAM/whatever. Im thinking that some tuners need to be totally reset when resuming from hibernation or standby, and that MP only does this when it starts up, not when it resumes.

    If you card has a Common Interface, then you can put a CAM into that, and a smartcard(from your provider) into the CAM.
     

    J-B-N

    Portal Pro
    December 29, 2005
    196
    20
    Sweden
    Home Country
    Sweden Sweden
    I have been looking for the initializing code in MP sources but haven't really found anything that deals with the tuners and resume. (Most likely because I dont know my way around the code).

    What I am pondering about is if this is easily done or not, or if the best thing to do is to write a plugin that simply detects a resume-event and then totaly restarts MP.
     

    ziphnor

    Retired Team Member
  • Premium Supporter
  • August 4, 2005
    755
    13
    Copenhagen
    Home Country
    Denmark Denmark
    I have been looking for the initializing code in MP sources but haven't really found anything that deals with the tuners and resume. (Most likely because I dont know my way around the code).

    I know the feeling, im considering doing the same myself. What MP needs is some overall architecture documentation, ie an overall view of what parts do what!

    What I am pondering about is if this is easily done or not, or if the best thing to do is to write a plugin that simply detects a resume-event and then totaly restarts MP.

    The easiest thing is probably to modify the PowerScheduler plugin to restart MP as it is already handing resume events.
     

    ziphnor

    Retired Team Member
  • Premium Supporter
  • August 4, 2005
    755
    13
    Copenhagen
    Home Country
    Denmark Denmark
    I took a look in the Recorder.cs and Powerscheduler source code.

    The Recorder has a Start()/Stop() pair, when the HTPC resumes the powerscheduler calls Recorder.Start(), but start returns immediatly if its already running(which it probably is because the powerscheduler doesnt turn it off when going into standby/resume). Im guessing that calling Recorder.Stop() followed by Start() should reinit all TV tuner related stuff. According to the description of the Stop method:

    Code:
        /// Stops the scheduler. It will cleanup all resources allocated and free
        /// the capture cards

    and Start()

    Code:
        /// This method will Start the recorder. It
        ///   -Loads the capture cards from capturecards.xml (made by the setup)
        ///   -Loads the recordings (programs scheduled to record) from the tvdatabase
        ///   -Loads the TVchannels from the tvdatabase
        ///   -starts the thread which handles all the tv cards
     

    ziphnor

    Retired Team Member
  • Premium Supporter
  • August 4, 2005
    755
    13
    Copenhagen
    Home Country
    Denmark Denmark
    I tried adding Recorder.Stop() to the two startup points in the PowerScheduler, and now it works for me. However, it does take a few seconds, so if you are very quick to turn on TV after a resume, it will be turned off again immediatly because the recorder is restarting.

    Im going to add it as an option to the PowerScheduler and submit it as a patch.
     

    J-B-N

    Portal Pro
    December 29, 2005
    196
    20
    Sweden
    Home Country
    Sweden Sweden
    Aha, that sounds great Ziphnor! I hope the patch will be available soon.

    I am actually reinstalling my HTPC, just to see if that will make any difference.

    As a side note I actually dont have any signal at all for the HTPC. My wife wanted to move around the furniture, and then the antenna cable turned out to be too short, so today I have adjusted the antenna on the roof, replaced the entire old antenna and now I am hopeing for a better signal after the reinstall of the computer.

    Soo much for the saying: Dont change anything that works...
     

    ziphnor

    Retired Team Member
  • Premium Supporter
  • August 4, 2005
    755
    13
    Copenhagen
    Home Country
    Denmark Denmark
    Good luck with that :)

    Im having problems actually testing the patch, because i had to update to the latest SVN(bugger me if i could figure out how to get the 0203 sources :) and thats giving me some completely different problems. Its so annoying testing for periodic errors.

    Anyway, ive added it as an option in the powerscheduler plugin, and its off by default. I now also have the powerscheduler stop the recorder before going into hibernate/suspend because then the Stop call on startup is faster(it returns immediatly) when it was the powerscheduler which did the suspend/hibernate.

    But i still have stop on startup because people can suspend/hibernate independetly of MPs controls.

    Im going to test it a bit on/off today and then submit the patch(i cant see it breaking anything, and its off by default, making it even less 'dangerous' :)
     

    ziphnor

    Retired Team Member
  • Premium Supporter
  • August 4, 2005
    755
    13
    Copenhagen
    Home Country
    Denmark Denmark
    The patch is in the sourceforge patch queue now(has been for a while). Maybe i should make a thread on it in the dev forum?
     

    Users who are viewing this thread

    Top Bottom