Hauppauge HD-PVR & Colossus Support (2 Viewers)

Quek9

MP Donator
  • Premium Supporter
  • June 16, 2013
    51
    8
    54
    Home Country
    United States of America United States of America
    Pin values are determined by the videoSource and audioSource fields associated with each channel (TuningDetail table in the TV-Server database).

    The mapping of videoSource/audioSource onto pin numbers is performed by a device-specific basis, allowing generic source IDs in the database to be used interchangably with various cards having different crossbar configurations. Take a look at PerformTuning() in TvEngine3\TVLibrary\TVLibrary\Implementations\Analog\Graphs\HDPVR\TVCardHDPVR.cs if you want to see the details about how it works. The mapping values are stored in configuration file. Here is an excerpt from the configuration file of a Colossus (C:\ProgramData\Team MediaPortal\MediaPortal TV Server\AnalogCard\Configuration-1-Hauppauge Colossus Crossbar 0.xml):

    Code:
    <crossbar>
    	<name>Hauppauge Colossus Crossbar 0</name>
    	<videoOut>0</videoOut>
    	<audioOut>1</audioOut>
    	<videoPin type="13" index="0" related="7" />
    	<videoPin type="10" index="1" related="8" />
    	<videoPin type="1" index="2" related="8" />
    	<videoPin type="4" index="3" related="8" />
    	<videoPin type="11" index="4" related="10" />
    	<videoPin type="2" index="5" related="10" />
    	<videoPin type="5" index="6" related="10" />
    	<audioPin type="8" index="7" />
    	<audioPin type="5" index="8" />
    	<audioPin type="9" index="9" />
    	<audioPin type="6" index="10" />
    </crossbar>

    What you can see here is that a videoSource value of 10 ("YRYBY #1" in the TV Server Configuration GUI), for example, corresponds to pin 1 on the Colossus, which is the component video input #1. Similarly, an audioSource value of 9 corresponds to pin 9 on the Colossus, which is S/PDIF audio input #2. Note that the Colossus' discrete S/PDIF audio input port is uses an optical physical layer, hence the TOSLink port.

    Also, each videoPin mapping has a "related" attribute specifying the audio pin that will be used when the "Automatic" audio source is chosen (audioSource = 0 in the database). So, the "Automatic" choice isn't really automatic at all, but rather the team's best guess as to what audio pin you might want to use based on the video pin you have already specified. Thus, it's a good idea to explicitly specify the audio source.

    The enumeartions for the videoSource and audioSource values are easily inferred from the the combo boxes in the Add/Edit Analog Tuningdetail dialog. They start from 0 for the first item in the box and increase from there. That means videoSource may have any of the following values:

    Code:
    0 = Tuner
    1 = CVBS #1
    2 = CVBS #2
    3 = CVBS #3
    4 = SVHS #1
    5 = SVHS #2
    6 = SVHS #3
    7 = RGB #1
    8 = RGB #2
    9 = RGB #3
    10 = YRYBY #1
    11 = YRYBY #2
    12 = YRYBY #3
    13 = HDMI #1
    14 = HDMI #2
    15 = HDMI #3

    I edited the above list on 04/10/12; thanks to ltpr for pointing out my error.

    Similarly, for audioSource:

    Code:
    0 = Automatic
    1 = Tuner
    2 = AUX In #1
    3 = AUX In #2
    4 = AUX In #3
    5 = Line In #1
    6 = Line In #2
    7 = Line In #3
    8 = SPDIF In #1
    9 = SPDIF In #2
    10 = SPDIF In #3

    Obviously, not all values are valid for all card types.

    As for setting the videoSource/audioSource values, you can do it on a per-channel basis in the TV Server Configuration GUI. It is also possible to set up Microsoft Access to link to the TV Server database, where search and replace can be used to make the desired changes. A better, and less error-prone method would be to write a SQL UPDATE query that changes the videoSource and audioSource values for channels mapped to a particular card, avoiding potential mishaps that could occur when having multiple devices that are not connected to their sources in identical manners. In this example, let's change the videoSource to 10 (component video input #1) and the audio source to 9 (TOSLink) for every channel mapped the Colossus having a card ID of 1. In the previously mentioned Access environment, the following query will do the job:

    Code:
    UPDATE dbo_TuningDetail SET videoSource = 10, audioSource = 9
    WHERE idChannel IN (
    	SELECT dbo_Channel.idChannel
    	FROM dbo_Channel INNER JOIN dbo_ChannelMap
    	ON dbo_Channel.idChannel = dbo_ChannelMap.idChannel
    	WHERE (((dbo_ChannelMap.idCard)=1))
    );

    For quick edits, the change can be made right from the command line without even bothering with Access, using the sqlcmd (SQL Server) or mysql (MySQL) command line utilities. Consider the former, as an example. Simply remove the "dbo_" prefixes from all the table names that Access likes to add, and pack everything into a single command line:

    Code:
    sqlcmd -d MpTvDb -Q "UPDATE TuningDetail SET videoSource = 10, audioSource = 9 WHERE idChannel IN (SELECT Channel.idChannel FROM Channel INNER JOIN ChannelMap ON Channel.idChannel = ChannelMap.idChannel WHERE (((ChannelMap.idCard)=1)));"

    Note that this assumes a trusted connection. If you want use an explicitly specified username/password/server/etc., refer to the sqlcmd documentation (http://msdn.microsoft.com/en-us/library/ms162773.aspx).

    Sasha

    Sasha, thanks for your help but I am a complete novice with respect to SQL. How do I implement the information that you are giving? Do I place the code in a .txt document and change the filetype to something like .vbs and run?

    I am making the switch from DVBLink to MP and I currently have picture without any sound. I think this will solve my problem. Thanks.
     

    Quek9

    MP Donator
  • Premium Supporter
  • June 16, 2013
    51
    8
    54
    Home Country
    United States of America United States of America
    Ok, I figured out how to apply it, I am glad that everyone was soooooo helpful :(:( :). I wish someone would have told me or mentioned that the file extension for sql scripting was .sql, who knew, lol.

    On another note, it would have probably been infinitely more helpful if a lot of the content posted here was broken out into separate threads with separate thread titles. It is very difficult for a newbie to digest all of the info when drinking from a fire hydrant of information, just my $0.02
     

    Quek9

    MP Donator
  • Premium Supporter
  • June 16, 2013
    51
    8
    54
    Home Country
    United States of America United States of America
    Dang gommit, the .sql file extension did not work. How in the heck do yo apply the script that Sasha provided?
     

    mm1352000

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

    Dang gommit, the .sql file extension did not work. How in the heck do yo apply the script that Sasha provided?
    The answer depends on what kind of database you chose when you installed MP.
    Did you choose MySQL or SQL Server?

    Sasha has SQL Server.

    mm
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Okay, off the top of my head... (I'm at work, can't test)

    1. Click the start button.
    2. Type cmd into the search box and hit enter.
    3. Type cd "c:\Program Files\MySQL\MySQL Server 5.1\bin" and hit enter.
    4. Type mysql -u root -p and hit enter.
    5. Type MediaPortal and hit enter.
    6. Type use MpTvDb; and hit enter.
    7. Copy Sasha's query (with your tweaks if you have any), right click on the command window and click paste, then press enter.
    Hopefully that will work. Like I say, those instructions are written from memory so there may be a few mistakes. Feel free to ask if you get stuck. :)
     

    Quek9

    MP Donator
  • Premium Supporter
  • June 16, 2013
    51
    8
    54
    Home Country
    United States of America United States of America
    Awesome! I will give it a go later today, I'm working from home. :)
     

    Quek9

    MP Donator
  • Premium Supporter
  • June 16, 2013
    51
    8
    54
    Home Country
    United States of America United States of America
    Dang, I use the following script:

    Code:
    UPDATE dbo_TuningDetail SET videoSource = 10, audioSource = 5
    WHERE idChannel IN (
    	SELECT dbo_Channel.idChannel
    	FROM dbo_Channel INNER JOIN dbo_ChannelMap
    	ON dbo_Channel.idChannel = dbo_ChannelMap.idChannel
    	WHERE (((dbo_ChannelMap.idCard)=3))
    );
    And I got the following error:
    Code:
    ERROR 1146 (42S02): Table 'mptvdb.dbo_tuningdetail' doesn't exist
    mysql>
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    The script is wrong. Please remove the dbo_ prefixes from dbo_TuningDetail, dbo_Channel, and dbo_ChannelMap.
     

    sjevtic

    MP Donator
  • Premium Supporter
  • January 16, 2012
    114
    29
    44
    Chicago, IL
    Home Country
    United States of America United States of America
    Sasha, thanks for your help but I am a complete novice with respect to SQL. How do I implement the information that you are giving? Do I place the code in a .txt document and change the filetype to something like .vbs and run?

    I am making the switch from DVBLink to MP and I currently have picture without any sound. I think this will solve my problem. Thanks.
    I provided a SQL query that will perform a particular update on a MS SQL Server database. You can execute that via any interface you choose, such as SQL Server's own management tools, or via a client application such as Access or even a VBScript script that connects to the database via ODBC or some other means. So, it's not really a matter of choosing an extension for the file as much as it is deciding how you plan to execute it.

    I also demonstrated how to execute the query using "sqlcmd", which is a command line client utility that ships with MS SQL Server. To use it, you literally just execute the "sqlcmd" command with the arguments I provided from a cmd.exe session subject to the limitations I described.
    The script is wrong. Please remove the dbo_ prefixes from dbo_TuningDetail, dbo_Channel, and dbo_ChannelMap.
    Unfortunately, every database vendor implements things a little differently, and since you're using MySQL, you'll have to make the necessary changes to execute the query there. As @mm1352000 already pointed out, MySQL's command line utility is called "mysql" instead of "sqlcmd" and has a different interface. As you have both already observed, SQL Server also adds "dbo_" prefixes to table names, whereas MySQL does not. Unfortunately, I don't have a MySQL setup right now, so I am unable to provide specific examples for MySQL. Sorry.

    Sasha
     
    Last edited:

    Users who are viewing this thread

    Top Bottom