Trying to debug TvServer configuration (1 Viewer)

Kimmeridgien

Portal Member
November 16, 2007
20
1
Stockholm
Home Country
Sweden Sweden
Hi,

I'm trying to set up the development environment for TvServer configuration so that I can debug analog TV tuning, but I am having trouble getting it all to work. I have followed the instructions that are linked from
http://wiki.team-mediaportal.com/MediaPortal1_Development
, for example
http://wiki.team-mediaportal.com/1_.../Building_MediaPortal_from_source/1_Git_Setup

So far I have built the /mediaportal/MediaPortal.sln and /TvEngine3/TVLibrary/TvLibrary.sln but MediaPortal debugging ends with the first splash window (normal/expert configuration) and the TvLibrary debugging doesn't start at all.

Could someone please help me get this up and running?

Cheers

Niclas
 

mm1352000

Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Hello Niclas

    I'm trying to set up the development environment for TvServer configuration so that I can debug analog TV tuning, but I am having trouble getting it all to work.
    If you're trying to debug analog TV tuning then you have to debug the TV service. There's no point in debugging TV Server Configuration or MediaPortal.

    I have followed the instructions that are linked from
    http://wiki.team-mediaportal.com/MediaPortal1_Development
    , for example
    http://wiki.team-mediaportal.com/1_.../Building_MediaPortal_from_source/1_Git_Setup

    So far I have built the /mediaportal/MediaPortal.sln and /TvEngine3/TVLibrary/TvLibrary.sln
    Okay, that's a good start. :)

    but MediaPortal debugging ends with the first splash window (normal/expert configuration)
    Of course! If you try to run MP without first running MP Config (to create a config file) then MediaPortal.exe will stop and Configuration.exe will start (showing the normal/expert choice). If you want to debug MediaPortal.exe then you must first save a configuration file. Then MediaPortal will be able to start/open.
    Anyhow, as I said above, debugging MediaPortal (and MediaPortal Configuration) is pointless for debugging analog tuning.

    ...and the TvLibrary debugging doesn't start at all.
    The only ways to debug the TV service are:
    1. Use the /DEBUG switch to run the TV service as a console EXE. Don't forget to stop the normal TV service first.
    2. In VS: debug -> attach to process.
     

    Kimmeridgien

    Portal Member
    November 16, 2007
    20
    1
    Stockholm
    Home Country
    Sweden Sweden
    Thanks!

    How do I start SetupTv.exe in such a way as to connect to this console EXE version of the TV service? It currently says that "The Tv service is not running. Start it now?". Using /DebugOptions makes no difference.
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    How do I start SetupTv.exe in such a way as to connect to this console EXE version of the TV service?
    It may not be possible without building a custom version of SetupTv.exe excluding this condition:
    https://github.com/MediaPortal/MediaPortal-1/blob/master/TvEngine3/TVLibrary/SetupTv/Startup.cs#L279

    Have you tried just clicking "yes"?

    Normally if you want to debug TV Server Configuration (SetupTv.exe) and the TV service at the same time you'd do it by building a debug version of the TV service DLLs etc. and attaching a debugger to the TV service process.
     

    Kimmeridgien

    Portal Member
    November 16, 2007
    20
    1
    Stockholm
    Home Country
    Sweden Sweden
    Clicking "yes" makes it start the service, both when running SetupTv from the debug folder and from the 1.12 install. If I stop the new process, SetupTv just complains that the TV service is not started.

    I will try to comment out the section you refer to later today.

    I have run MSBUILD_Rebuild_All_MediaPortal_Debug.bat without errors. Doesn't it build everything for debugging?


    Maybe another approach would be better:

    I'm trying to get the Hauppauge HVR-2200 dual DVBT/analog card to complete analog tuning. After finding a random number of channels it BSODs with "Page fault in non-paged area" in ntoskrnl.exe. After reboot, MP2 manages to use the channels registered before the BSOD but the sound (and possibly image) stutter. When closing MP2 it BSODs. Please note that I am sticking to MP1 at this point - MP2 was just to see if there were any changes that might affect this problem.

    I have tested this HVR-2200 card with WinTV7 so I know that it isn't broken. I am also successfully running another MP1.12 machine with a Compro Videomate Vista E900F that is a very similar card. The machine I am using now has only had the HVR-2200, so it can't be a driver conflict.

    The HVR-2200 successfully completes FM radio tuning and playing. It also completes analog TV tuning if the cable is not attached (so no channel is found).

    Is there a better way to debug this problem than what I have tried so far?
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    I'm trying to get the Hauppauge HVR-2200 dual DVBT/analog card to complete analog tuning. After finding a random number of channels it BSODs with "Page fault in non-paged area" in ntoskrnl.exe.
    I wish you'd said that earlier! ;)

    BSOD'ing during the analog TV scan is a known compatibility issue with HVR-22** tuners. It seems to be an issue with newer versions of the tuner driver. Please see this thread for more information and an older driver that we know works properly:
    https://forum.team-mediaportal.com/threads/hvr-2250-scanning-channels-causes-crash.102858/

    It would be great if you could report this problem to Hauppauge. The more reports they receive, the more chance there is that the problem will be fixed.

    After reboot, MP2 manages to use the channels registered before the BSOD but the sound (and possibly image) stutter. When closing MP2 it BSODs. Please note that I am sticking to MP1 at this point - MP2 was just to see if there were any changes that might affect this problem.
    The TV Server used by MP2 is identical to the one used by MP1 for all aspects of analog TV tuning, so a difference in behaviour is not expected.
    You can choose to use MP2 if you want, but please keep in mind that I can't help you with MP2.

    I have tested this HVR-2200 card with WinTV7 so I know that it isn't broken.
    Yes, there's nothing wrong with the hardware. The reason for the difference in behaviour/results is probably that WinTV7 and TV Server code is different with respect to scanning. Since WinTV7 is closed source we can't see how to workaround the problem in our code.

    I am also successfully running another MP1.12 machine with a Compro Videomate Vista E900F that is a very similar card. The machine I am using now has only had the HVR-2200, so it can't be a driver conflict.
    Yes, from LinuxTV info it looks like the E900F is also an SAA7164-based design with NXP TDA18271 tuners and NXP TDA10048HN demodulators. The two cards may be based on an NXP reference design with reference driver. However I'm sure AVerMedia and Hauppauge have differences within their drivers.

    The HVR-2200 successfully completes FM radio tuning and playing. It also completes analog TV tuning if the cable is not attached (so no channel is found).
    Interesting. My suspicion is that the problem may be related to the encoder's handling of noisy/low/zero signal, but I could be completely wrong. Please make sure to mention this information if/when you report the problem to Hauppauge.

    Is there a better way to debug this problem than what I have tried so far?
    With the greatest respect, I think it may be very time consuming (if not practically impossible) for you to solve this problem with debugging. You cannot catch, prevent or ignore a BSOD generated from within the driver. The best you may be able to do is identify which code or conditions are triggering the BSOD. I suspect it will be something within this function:
    https://github.com/MediaPortal/Medi...plementations/Analog/Components/Tuner.cs#L460

    ...or perhaps something related to the DirectShow graph handling (eg. graph must always be stopped or started when tuning is performed).

    Hauppauge will be able to debug their driver properly and/or analyse memory dumps to find and fix the source of the BSOD within the driver. IMHO that is the better way to handle the problem.

    Regards,
    mm
     

    Kimmeridgien

    Portal Member
    November 16, 2007
    20
    1
    Stockholm
    Home Country
    Sweden Sweden
    Thanks again for the extensive information.

    I have an on-going correspondence with one person from the Hauppauge US tech support and one from the German one. We are making some progress, but they only support WinTV7/8 and MediaCenter so I am not sure how far I can convince them to go. I have just sent them the information in your latest posting together with the following request:

    "I can now report that 7.9.1.29186 from the old driver CD also BSODs.
    If you would send me all revisions from (and including) 7.9.1.28162 to 7.9.1.29186 I could systematically test all of them and report back the revision in which the BSOD first appears."

    I will keep you posted. (I will not install drivers with unknown origin.)

    Cheers

    Niclas
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    I will not install drivers with unknown origin.
    The driver came from me, and I got it from an old WinTV CD. ;)

    Anyhow, I am willing to assist Hauppauge to resolve the problem. Please feel free to pass on any technical questions to me.

    Regards,
    mm
     

    Kimmeridgien

    Portal Member
    November 16, 2007
    20
    1
    Stockholm
    Home Country
    Sweden Sweden
    I am really grateful for all your help so far but better safe than sorry. ;)

    I could pass on your contact details to the Hauppauge tech support when I receive a reply to my latest e-mail to them. Could you send a private message to me or include me in the group of people who are allowed to see your profile? I would need name, e-mail address, and a short description of your role within the MP development group so I could promote you properly. :D

    Cheers

    Niclas
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Hello again Niclas

    I've sent you a private message with the information you requested. :)
     

    Users who are viewing this thread

    Top Bottom