Mass Updating Channels Config for External Settops

Discussion in 'Tips and Tricks' started by kaliatech, October 16, 2005.

  1. kaliatech

    kaliatech Portal Member

    Joined:
    September 28, 2005
    Messages:
    26
    Likes Received:
    0
    Ratings:
    +0 / 0
    Problem: I'm a DirecTV subscriber with an old settop box. I am not using a serial controller for channels yet, and so I am using USBUIRT (an external IR transmitter). As such, I need to configure all of my MP TVGuide channels to use the external setup top box. Using the current MP configuration GUI, you must do this for each channel. However, even the basic DirecTV subscription has a few hundred channels. Also, unless you setup each channel manually (versus importing them from your XMLTVGuide.xml file), the channel sorting order will be off for various reasons that I'll blame on the Europeans for now. ;)

    Caveat: This tip/trick is not well tested, and I'm not an MP expert, but it has saved me a lot of time and seems to work. It is somewhat dependent on your own configuration and at a minimum you need to first determine the id value for your own settup tv capture/input card. My card's id in MP was 250000 for the S-Video input from my Hauppage PVR150MCE. Probably the easiest way for you to determine this id for yourself, is to use the MP configuration.exe to setup one external channel manually, and then use the SQLite Database Browser utility to examine that data for the capture card id. If you don't understand any of the SQL below, you probably shouldn't try doing this. At a minimum, shutdown MP and make a backup copy of the TVDatabaseV21.db3 file first.

    Solution: The MP distribution comes with a database utility for viewing/manipulating its internal databases. (MP uses the SQLite3 database.) The utility is named "SQLite Database Browser" and is in the /docs directory. (If not there, it is easily found and downloaded from the Internet.)

    The database to be modified: TVDatabaseV21.db3

    Prequisites: Everything should be setup and working in MP for you except for the actual channel changing. (You should at least setup a few channels manually for your external display to make sure things are working as expected.) You should have also imported your channels from a valid XMLTVGuide.xml file. This prequisite is very important, and you should make sure that your MP TVGuide display shows the correct information (even if it doesn't change channels correctly and is in the wrong order) before continuing. MP's tvguide import process can take a while to complete and runs in the background (I think?).

    Don't forget to change "250000" in the examples below to whatever is appropriate for your setup!

    Example Steps:
    1) Using the SQL editor in the utility, first run this SQL statement, substituting your capture card ID as appropriate. This statement takes the XMLTVGuide supplied channel number and makes it the external settop channel number.



    Code (Text):
    1. UPDATE channel SET [ExternalChannel]=[iChannelNr] WHERE [ExternalChannel] Like 'Unknown' AND [iChannelNr]<250000;
    2.  
    2) This statement tells MP that all of your channel numbers are actually sourced from your TV capture card's input.

    Code (Text):
    1.  UPDATE channel SET iChannelNr=250000 WHERE iChannelNr<250000
    3) This corrects the channel sort order according to the external channel numbers. (This makes sense to the American/Australian TV users.)

    Code (Text):
    1. UPDATE channel SET [iSort]=[ExternalChannel]
    4) This simply updates the configuration flag used by MP to indicate that a given channel is from an external settop and that transmit commands should be issued appropriately.

    Code (Text):
    1. UPDATE channel SET [bExternal]=1
    That should be it. Doing the database manipulation saved me a few hours of tedious setup I think. (If I'm missing something obvious and this wasn't really necessary, PLEASE let me know. ;)) Otherwise, hope it helps someone.
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. mzemina
    • Premium Supporter

    mzemina Retired Team Member

    Joined:
    February 23, 2005
    Messages:
    2,065
    Likes Received:
    13
    Occupation:
    Project Manager
    Location:
    Tulsa, OK
    Ratings:
    +13 / 0
    Home Country:
    United States of America United States of America
    Can't a (maybe the TV plugin screen) plugin have a button that would actually generate and submit this SQL code?

    Mike
     
  4. kaliatech

    kaliatech Portal Member

    Joined:
    September 28, 2005
    Messages:
    26
    Likes Received:
    0
    Ratings:
    +0 / 0
    It could... but making it work generically would introduce some complexities. I think at a minimum, the "plugin" would have to allow selection of the input card/channel from a drop-down box.

    I think this type functionality should probably be kept in the scope of utilities (or a fringe plug-in maybe). The "ideal" answer is probably to rework the UI of the TV channels setup. ...but I really don't understand all the issues given that MP functions in many different scenarios for different people. (e.g. Hard for me to understand not having LCN support, and hard for others to understand why some of us want it.)
     
  5. mzemina
    • Premium Supporter

    mzemina Retired Team Member

    Joined:
    February 23, 2005
    Messages:
    2,065
    Likes Received:
    13
    Occupation:
    Project Manager
    Location:
    Tulsa, OK
    Ratings:
    +13 / 0
    Home Country:
    United States of America United States of America
    I agree!

    Have you thought about talking with the developers regarding this? I'm not sure which would may have more insight and they maybe heads down trying to get 0.2.0 ready for a real beta release. But I can see that getting this problem solved would really help out quite a number of people. It could be an checkbox option to allow this LCN sorting or leave it as is.

    Mike
     
  6. gerner

    gerner Portal Member

    Joined:
    June 22, 2004
    Messages:
    8
    Likes Received:
    0
    Ratings:
    +0 / 0
    Cheers mate, saved me a real chore :D
     
  7. gdirwin

    gdirwin Portal Member

    Joined:
    March 31, 2005
    Messages:
    42
    Likes Received:
    0
    Ratings:
    +0 / 0
    What SQL commands could be used if I want to add 100's of dummy channels?

    This is to fix the LCN (logical channel numbering) problem. I have 999 channels available in my satellite (starting at 200), so if I want to press 200 on my remote and get channel 200, I have to add 199 dummy/disabled channels.

    If SQL channels are added in this way, does it somehow mess up the tv database indexing with MP?
     
  8. kaliatech

    kaliatech Portal Member

    Joined:
    September 28, 2005
    Messages:
    26
    Likes Received:
    0
    Ratings:
    +0 / 0
    The SQL would be something like this (I didn't test it):

    Code (Text):
    1.  
    2. INSERT INTO channels (idChannel, strChannel, iChannelNr, frequency, iSort, {etc columns})
    3. VALUES (90000, '0dum', 0, 25000, 1, {etc values})
    4.  
    5. INSERT INTO channels (idChannel, strChannel, iChannelNr, frequency, iSort, {etc columns})
    6. VALUES (90001, '1dum', 1, 25000, 2, {etc values})
    7.  
    You can get the entire list of column names using the SQLLite browser. I don't know what all the implications are with this workaround or if you should set the Visible field to 0, etc. You might also have to first edit all the existing iSort values so that they start at 100. (UPDATE channels SET iSort=iSort+100). I'm not really sure any more... I kind-of remember a channel sorting capability in the MP UI.
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!