No channels: "System.NullReferenceException: Object reference not set to an instance of an object" (1 Viewer)

David F

Portal Member
June 7, 2012
6
2
Home Country
United Kingdom United Kingdom
New installation of TV-Server (without MP, for now, as I just want to stream live TV across my LAN). TV-Server configuration detects my card - a KWorld DVB-T UB499-2T, i.e. a twin-tuner DVB-T USB stick - as a pair of "DVB-T IT9135 BDA Filter" cards. But when I scan for channels, I get no channels found. The tv.log file (attached) appears to show some stations being found, but the error.log file shows (this is the complete file contents):

2012-06-12 13:08:31.602291 [DVB-T scan thread(6)]: Exception :confused:ystem.NullReferenceException: Object reference not set to an instance of an object.
at SetupTv.Sections.CardDvbT.DoScan()

and there are of course no TV Channels in the TV-Server configuration application. Does anyone know of problems with this card? Is there anything else in the log file that indicates the root cause? Any tips on what I might try to make this work?
 

mm1352000

Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Hi and welcome David

    It will not be a tuner-specific problem. Can you tell me exactly how you're scanning - which region you've selected and/or the parameters that you're using in the "advanced scanning" section.

    mm
     

    David F

    Portal Member
    June 7, 2012
    6
    2
    Home Country
    United Kingdom United Kingdom
    Thanks for picking up this thread. My scan settings are:
    Country: UK
    Region: Oxford (also tried 'All Regions')
    Switches: Create "Digital terrestrial" group only (also tried without this)
    If I tick the 'Use advanced tuning options' switch, the displayed settings are
    Frequency: 730000kHz
    Bandwidth: 8MHz
    Scan type: predefined provider

    I'm using exactly the same settings on both tuners.
     

    mm1352000

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

    I'm not able to reproduce.
    Do you see a line like this in the scan box:
    "New TV/Radio:w/x Updated TV/Radio:y/z"

    mm
     

    David F

    Portal Member
    June 7, 2012
    6
    2
    Home Country
    United Kingdom United Kingdom
    I see this:

    1tp- freq:730000/167 bandwidth:8
    Total radio channels updated:0, new:0
    Total tv channels updated:0, new:0
    Scan done...

    It's only by checking the log that I found the exception at SetupTv.Sections.CardDvbT.DoScan()
     

    David F

    Portal Member
    June 7, 2012
    6
    2
    Home Country
    United Kingdom United Kingdom
    Did my response above answer your question? Please let me know if there's any other information I might provide.
     

    mm1352000

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

    I apologise - missed your response completely.
    Your response leaves me confused about what might be going on. I've assembled a debug version of TV Server configuration to allow me to see exactly where the problem is. Please could you try it like this:

    1. Take a backup of the SetupTv.exe in your TV Server install folder (default: C:\Program Files (x86)\Team MediaPortal\MediaPortal TV Server).
    2. Download and extract the attached debug SetupTv.exe into your TV Server install folder.
    3. Try to scan, and post the tv.log again.

    Expect scanning to fail, but know that this attempt should hopefully allow me to identify the problem and fix it.

    Best regards and apologies again for the delay,
    mm
     

    Attachments

    • SetupTv[1.2.3_dvbt_scan_debug].zip
      534.8 KB

    David F

    Portal Member
    June 7, 2012
    6
    2
    Home Country
    United Kingdom United Kingdom
    Hi,

    Many thanks for this. After making my post above, I spent quite some time analysing and retesting the installation, including multiple uninstall and re-installs, and eventually found my problem and a solution. I didn't explain initially that instead of a standard SQLEXPRESS or MySQL database, my installation is using a pre-installed SQL Server 2008 R2 database server which I also use for some other database applications on the same machine. When SetupTv.exe runs for the first time and creates and upgrades the MpTvDb database, it was throwing an error which I was ignoring, which turns out to be crucial. The DoScan() thread was then failing to insert data into the Channel table because of a 'not null' column which should not have existed.

    The fix I made is in TvEngine3\TVLibrary\SetupTv\57_upgrade_sqlserver_database.sql; Lines 21 and 24 should refer to table 'Channel', not 'channel'. I suppose that if my server collation was case-insensitive this might not matter, but by changing this alone, my installation works fine with case-sensitive collation.

    I tested this by downloading, patching and rebuilding the Release 1.2.3 source code. I don't have GIT installed. I hope the above is sufficient for you to roll this fix into the code, but let me know if I should help with a bug report or similar.

    David
     

    mm1352000

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

    Cheers for the details - that is definitely sufficient for us to roll in a fix. So that was definitely the only error-causing SQL?

    mm
     

    David F

    Portal Member
    June 7, 2012
    6
    2
    Home Country
    United Kingdom United Kingdom
    Yes, that fix alone was sufficient for my TV-Server to install, configure, and now work fine, and I can now stream TV across my LAN (although only currently to VLC, not yet to a MP client...I'm working on some firewall issues there). I don't have MP itself on the same PC, so I don't know if that might have similar SQL issues.
     

    Users who are viewing this thread

    Top Bottom