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.