How to set up Sage to record from a FireWire(FW) port on a Set Top Box(STB)

How to set up Sage to record from a FireWire(FW) port on a Set Top Box(STB). (This is a WIP. I cannot type well nor use very great grammar. (See, I to...
6 downloads 0 Views 493KB Size
How to set up Sage to record from a FireWire(FW) port on a Set Top Box(STB). (This is a WIP. I cannot type well nor use very great grammar. (See, I told you!) Revisions to this for accuracy or extra info will happen. This should be 95% of what you need to get this installed. I will not cover any debugging or testing remarks. Good Luck) Assumptions: 1. You have followed Naylia’s directions to getting the drivers installed for your STB and have tested a short clip using one of the programs mentioned in his directions. If not, please see this thread . Also see this thread to change channels thru the FW port (more in step 11). 2. Your cable company does not have 5c encryption enabled preventing you from decoding the channel. 3. Your STB has an active FW port. 4. You have some sort of external IR blaster device to change channels on the STB. USB-UIRT is probably the most popular, but other blasters will work. I will use USB-UIRT as the example in this guide. Changing channels thru the FW port is now possible and is working with good success. USBUIRT will be covered as well as the new instructions for setting up your FW AV/C Panel for changing channels. 5. The hard drive you will use has been formatted to NTFS. These files get rather large and surpass Fat or Fat32’s size limits. Lord of the Rings (pick one) takes up ~18Gb! It is also helpful if it is formatted with 64k clusters…not necessary, but greatly helps with smooth recording/playback. 6. A recent copy of SageTV..like 2.2.4 or so. And NOT running in service mode. Disable service mode while we go thru these steps. Currently, service mode produces a large amount of GET_FILE_SIZE messages to be sent to your encoder. This can impede your performance. 7. You know how to add shortcuts to the Startup Menu. This guide will take you thru setting up the necessary files beyond Naylia’s instructions to get SageTV to work like a PVR. One note—I am using the same PC for Sage and for the FW to the STB. If you will be using different computers, some steps may be different. My STB is Motorola 6412, yours may be different. Software needed: Nvidia DVD drivers http://www.nvidia.com/object/dvd_decoder.html USB-UIRT drivers by Jon Rhees http://www.usbuirt.com/ SGraphRecorder by Anders Nolberger http://www.nolberger.se/Sage/GraphRecorder/ Graphedit by Microsoft Girder by Proximis http://www.promixis.com/products.php Girder GML file by DFA http://forums.sage.tv/forums/attachment.php?attachmentid=1958 For changing channel thru the FW port, please read this. Thanks to Timmmoore! Grab his zip file. And make sure you still have DFA’s FW driver (meistb.zip) posted here.

Suggested Hardware: (this varies and some have better luck with older parts) Pentium 3.0G class/AMD 3000+ XP 512MB RAM ATI 9700/NVIDIA 6600GT 10Gb of HDD space per hour USB-UIRT Step 1: Installing the Nvidia DVD software. Download the trial software from Nvidia from the link above. We’ll need the Nvidia TS Info Parser filter that is included with that package. The video and audio codecs that come with package is very excellent for certain uses as well. Make sure you grab the trial information from the download page..you’ll need it when you install the software. It should look something like this: Name: NVIDIA Trial Email Address: [email protected] Last 4 Digits of Credit Card: 2004 Activation Key: 7152-9346-DD6E-2CB0-79A3-5F08-AC23 Step 2: Installing the USB-UIRT. This is pretty straightforward. Plug the USB cable into your computer and follow the prompts to install the drivers downloaded from the link above. You can do a quick test by pointing almost any remote toward the front of the box and pressing a button. You should see the red LED blinks when it receives a signal. I am using a separate blaster than the one already present in the front of the box. I found mine at http://www.smarthome.com/8170.HTML . Just plug it into the small port on the back of the box and attach it to the front of your STB (near the IR LED of course). We’ll get to programming your remote codes later using the UIRT. Step 3: Installing SGR. SGraphRecorder (SGR) is a Universal Network Encoder (UNE) written by Anders. This is the software that will “tune” in the FW port and send channel changes to Girder. If you are planning on using a remote PC (remote from the Sage server), this is the software you will need instead of Sage Recorder. Download the files from the link above and extract them to a folder you designate. You can use any folder. Take a look at Ander’s website for more information on configuring the .ini file. I’ll touch on what needs to be altered when we get to that step. Step 4: Installing Graphedit. Graphedit is a direct show debugging program. You’ll have to Google for it. There will be many variations but try to get one from the DirectX 9.0 SDK. You’ll notice that version will color code the filters. Per DFA, “…you need to be sure you have "proppage.dll" AND that it is registered (use "Regsvr32" to register it). This file normally resides in the "System32" folder. It frequently comes with the Graphedit download but still requires manual install with "Regsvr32". Without it, you will not be able to display all property pages for devices and filters within Graphedit.” More than likely, you will find this program in the zip file. Make a directory somewhere and extract the zip file.

Step 5: Configuring Graphedit. Build a test graph. Enough installing, let’s get to work. First thing we want to do is try to test our filters that we installed previously. If you haven’t used Graphedit before, don’t worry. You’re not making any system changes (unless you change properties of certain filters like FFdshow). You can actually use Graphedit to tell you what filters are defaulted when playing back a media file. Go to FILE>RENDER MEDIA FILE…choose the media file to play and it will load all the necessary filters. You’ll notice a small PLAY symbol to actually play back the file. Use the SLIDER and the PLAY/PAUSE/STOP buttons for the media playback. If a media file plays back differently in each media player you use, this is a good test to see what the default filters are. One note, most of the filters we play with can be found under GRAPH>INSERT FILTERS>DIRECTSHOW FILTERS. I was surprised to see all the filters installed in my system! Let’s load the test graph: If you have any filters showing or used the RENDER MEDIA FILE, clear the board by going to FILE>NEW. If at any time you accidentally insert the wrong filter, get out of the Add Filters combo box and click on the filter once, then hit the delete key (on your keyboard). Same goes for linking filters, just click on the arrow and hit the delete key. Go to GRAPH>INSERT FILTERS and expand the VIDEO CAPTURE SOURCES list. Here you should see entries for any tuner cards you have and your STB. Choose your STB filter and click on “insert filter”. (See figure A)

Figure A

You should then see a small box put on the board representing the STB filter (see Figure B).

Figure B Now let’s add the rest of the filters. These filters will all be under DIRECTSHOW FILTERS: NVIDIA TS Info Parser MPEG-2 Demultiplexer NVIDIA Audio Decoder or Intervideo Audio Decoder NVIDIA Video Decoder or Intervideo Video Decoder Overlay Mixer2 Video Renderer (might be 2 of these listed, pick the one without the VMR input stub) And lastly, let’s grab something from the AUDIO RENDERERS group: Default Directsound Device Now connect the dots according to either Figure C or Figure D. Click on the stub of one filter and drag to the stub of the next filter. You’ll notice Graphedit tries to move the filters around so they are in a straight line. You can disable this by unchecking OPTIONS>AUTOARRANGE FILTERS. If Windows doesn’t agree with the compatibility of the two filters you are linking, it will either tell you right away, or it will freeze your computer for a little while, and then tell you. The Orange filter below might look different on your computer, but it’s the STB filter.

Figure C (My Old Setup)

Figure D (My New Setup) Click on the Play button and a new window should open and start playing the video/audio coming in thru your FW! Save this graph (FILE>SAVE AS GRAPH) just for backup and testing purposes. And now, time for something completely different…. Step 6: Configuring Graphedit. Build a new graph that you will use with SGR / SageTV. Again, if you have any filters showing or used the RENDER MEDIA FILE, clear the board by going to FILE>NEW. Go to GRAPH>INSERT FILTERS and expand the VIDEO CAPTURE SOURCES list. Choose your STB filter and click on “insert filter”. These filters will all be under DIRECTSHOW FILTERS: NVIDIA TS Info Parser MPEG-2 Demultiplexer Any MPEG Muxer. I’m using the Cyberlink MPEG Muxer—you may not have this one (see the forums for other suggestions). Any MPEG Dump filter. I’m using the Moonlight DumpPos—again you may not have this one. You can alternately use MPEG2Dump. After you click insert on the dump filter, it will ask you for a filename and location to save the dump. Sage uses this dump. Please name this anything you like (ie. “Dump.mpg”) and put this under your SageTV Recordings directory.

Connect the dots according to Figure E.

Figure E If everything linked correctly, hit PLAY. This time you won’t see the directshow window open, but you should notice the “Dump.mpg” file growing in size (check your hard drive). Let this run for a minute (not literally) and click the STOP button. Go and check your file to see if it plays correctly with Windows Media Player or the like. If this is successful, do another SAVE AS and put this in the same directory as SGR (remember you installed this already to a new directory?). Note the name of the file and try to NOT use any spaces. Most of us call this “TStoPS.GRF”….since you are converting the incoming Transport Stream(TS) to a Program Stream(PS). Sage is adding capability to read TS files, and these graphs may change one day to reflect. We’re done with Graphedit! Wasn’t that fun? Feel free to try different filters and report back the usefulness to the forum. We are always looking for a better filter. Sage sends the filename to SGR who in turn sets that filename in the dump filter. You will see a separate file under your recordings directory (as usual but it will be much bigger!).

Step 7: Configuring SGR. Navigate to the directory you extracted SGR to. Open the SGraphRecorder.ini file with Notepad or another editor. Anders has explanations for everything you need to know in the .ini file already, or on his webpage. I’ll reword it here so it sinks into your head. This file gets the graph we made in the previous step and also tells SGR how to talk to Girder. Under the [Graph] section, note the entry, “FileName=”. Please type in the filename of your graph that we created in the previous step, “TStoPS.GRF”. Note that we don’t have to type in the hard drive or directory (ie C:\graph\test) because we saved the graph in the SGR directory. You should start off with a default number for “TuningDelay”. Make this “TuningDelay=3500”. This is the amount of time (in milliseconds) that SGR is to wait for your STB to change channels and output the new channel thru the FW. SGR does not like to see the channel change when it isn’t ready. The new channel you are watching (more than likely) is using different PID’s. This will hose up Sage/directshow filters. They do not like unscheduled changes. SGR will terminate the current graph, and start a new one when this delay (TuningDelay=3500) has passed. Also set “UnloadGraphOnStop=” to a “1”. This goes hand in hand with preventing the unscheduled PID changes.

Now look at the [Girder] section. To have SGR send channel change commands to Girder, set “UseGirder=” to “1”. If you are using the same computer to host the Sage server and SGR, set “GirderHost” to “127.0.0.1”. If not, then type in the IP address of the computer running Girder. Leave “GirderPort=1024” alone. Unless you have some really strange problem you shouldn’t change this. If you do, jot this down because you’ll need the port # to enter into Girder. For “GirderPassword=”, put in a simple password without spaces or extra characters. You could use “GirderPassword=HTPC”…...doesn’t matter. You will plug this password into Girder as well. “GirderPrefix=Number”. This tells SGR to send channel changes with a prefix of “Number”. When Sage is ready to change channels, for instance to channel 612, Sage will send messages to SGR to change channels. SGR will send, Number6, Number1, Number2, Number. That translates into 612— enter. You can call this whatever you want, just jot it down cause we’ll use it in Girder. Are you still following along? I bet you can figure out the last two entries without me regurgitating their meaning! Make sure SGR is in the startup folder. Always make sure SGR has loaded before Sage. SGR loads very fast so having it in the startup folder with Sage is fine. If you haven’t done so yet, go ahead and start SGR. You should see the icon appear in the taskbar area. Step 8: Configure Girder. Skip this step if you do not have an IR blaster yet or want to try the FW channel change method (more later) It is assumed you know how to download and install Girder. If you already use Girder, this will be painless. DFA has provided you with a .GML file you can IMPORT into Girder. If this is the first time you’ve installed Girder, just open it. If you are already using Girder, make sure you IMPORT it (there, I said it twice now, don’t blame me for not following instructions). You can find the .GML file here: http://forums.sage.tv/forums/showthread.php?p=87168&postcount=190 You must find the UIRT plugin and download it: http://www.usbuirt.com/latestGirderPlugin.zip. Unzip this file into your …\Girder\plugins directory or ..\Girder32\plugins directory.

Load the plugins-Go to FILE>SETTINGS. Click on the Plugins tab. Note the directory shown and verify that is where you put the plugin. If not, move the plugin and restart Girder. Scroll down the list and activate the INTERNET EVENT SERVER plugin. This should come with Girder already. Make sure AUTO ENABLE INPUT DEVICE is selected. Then click on settings. Set the PORT and PASSWORD in the dialog box to match what is in SGraphRecorder.ini (see figure F).

Figure F Click OK to get back to the Settings box. Scroll down and activate the USB-UIRT DRIVER plugin (see figure G). Click OK.

Figure G

Next import the .GML file you downloaded above by going to FILE>IMPORT GROUP (see figure H).

Figure H Note that the operation of Girder is backwards for sending IR commands. Usually, you have an eventstring identified and a remote code learned. When Girder sees this code, it executes the command above it. That command can be almost anything (ie change resolution). For sending IR commands, you learn the IR code thru the settings button near the bottom right for each command. The eventstring is where you program what message to look for from SGR. Remember the setting in the .ini file, “GirderPrefix=Number”? Reference a few paragraphs back on “GirderPrefix=Number”. What if you changed the “GirderPrefix=Number” to something else, like “GirderPrefix=channel”? Let’s take the first digit “0” as example. The .GML file already has the prefix “Number” assigned to all digits. If you’ve changed the SGraphRecorder.ini to “GirderPrefix=channel”, you will need to change every digit to expect a “channel” command instead of a “number” command. Click on the eventstring below Number0. At the top right, click on the drop down box and select INTERNET EVENT SERVER. Then click the LEARN EVENT. A dialog box will pop up and will already have “Number0” assigned. Change this to “channel0”. You will need to repeat this for every digit/channel command (09). Lastly, change the Number Enter command from “Number” to “channel”. This is the ENTER command that can be sent to your STB. Program your remote codes— This can be tricky. A good distance to program your STB’s remote into the UIRT is anywhere from 1” to 4”. Let’s learn the code to send a “0”. Click on the Number0 command (not the eventstring). At the bottom right, make sure USB-UIRT driver is selected on the Plugins tab. Click on Settings.

This is where we learn the code (see figure I).

Figure I As you can see, I already have mine programmed. To program your code, hold your STB remote about 2” from the front of the UIRT. Do a quick test by pressing and holding the “0” button on the remote. You should see the red LED blink on the UIRT. If the blinking isn’t constant, reposition the remote so you are receiving a continual blinking signal. Once satisfied, use your other hand and click on the LEARN button. Hold the “0” button on the remote until you return back to Figure G. Click OK and return back to Girder. Continue for the rest of the buttons. When done, make sure you save your .GML file (FILE>SAVE AS). Hints: You can test the commands right after you learn them (the button above that says TEST), or you can test from the main screen by going to COMMANDS>TEST COMMAND F5. Note the ENABLED check box in the upper right side (Figure H). Make sure this is checked to enable each command or Group. Step 9: Configure Sage for SGR. Almost done now! Shut down Sage, both the client and disable/shutdown the service. Open your sage.properties file. Find the last line beginning with “mmc/encoders/……” Copy the below text and paste/insert it after that last line. (Plagiarized from DFA’s post) “ mmc/encoders/12345/1/0/available_channels= mmc/encoders/12345/1/0/brightness=130 mmc/encoders/12345/1/0/contrast=135 mmc/encoders/12345/1/0/device_name= mmc/encoders/12345/1/0/hue=125 mmc/encoders/12345/1/0/last_channel= mmc/encoders/12345/1/0/provider_id= mmc/encoders/12345/1/0/saturation=105 mmc/encoders/12345/1/0/sharpness=170 mmc/encoders/12345/1/0/tuning_mode= mmc/encoders/12345/1/0/tuning_plugin= mmc/encoders/12345/1/0/tuning_plugin_port=0 mmc/encoders/12345/1/0/video_crossbar_index=0

mmc/encoders/12345/1/0/video_crossbar_type=10 mmc/encoders/12345/audio_capture_device_name= mmc/encoders/12345/audio_capture_device_num=0 mmc/encoders/12345/audio_processor= mmc/encoders/12345/capture_config= mmc/encoders/12345/default_device_quality=DVD Standard Play mmc/encoders/12345/encoder_merit=0 mmc/encoders/12345/encoding_host=localhost\:6969 mmc/encoders/12345/last_cross_index=0 mmc/encoders/12345/last_cross_type=10 mmc/encoders/12345/live_audio_input= mmc/encoders/12345/never_stop_encoding=false mmc/encoders/12345/video_capture_device_name=SGR mmc/encoders/12345/video_capture_device_num=0 mmc/encoders/12345/video_encoding_params=DVD Standard Play mmc/encoders/12345/video_processor= For those installing UNE / SGR on a remote client machine, you need to put the IP address for that machine for this variable: mmc/encoders/12345/encoding_host=###.###.###.###\:6969 For installation in local machine, "localhost" or 127.0.0.1 is used. The port param must match what is in "SGraphRecorder.ini". 6969 is default. Things like "Recording Quality" can be changed from SageTV setup menu although that means nothing to the UNE anyway. I have not tried contrast, brightness and color encoding controls but they should have no effect either. The TS stream from the STB is-what-it-is and already encoded so no control over any of that. Also, while in "sage.properties" check and see that these variables are set as follows: mmc/always_tune_channel=true Save the sage.properties file. After starting Sage, go to the "Setup Wizard" and select "Add New Source". You should now find the "SGraphRecorder" network encoder and configure from there. Some leg work is needed for the EPG part. For the UNE, I have assigned an independent EPG that has identical channel lineup. I was able to find a neighboring town with the same provider that had the same lineup. I put the zipcode in for that locale and assigned the digital EPG from that provider to the UNE. This way I can enable channels that I want the UNE to handle and disable those same channels for the PVR-250. The EPG for the PVR-250 and the EPG for the UNE are inverse mirrors of each other. What is enabled in one is disabled in the other and vise-versa.”””

Step 10: (Almost) Final instructions Make sure SGR and Girder are in the startup folder (as well as Sage). Delays— Delays are something you have to set high to begin with and lower their times until failure is found. Doing things too quickly will guarantee you bad channel changes. There are two delays in SGR and one delay to set in sage.properties. The first delay in SGraphRecorder.ini (“TuningDelay=3500”) is to allow the STB to change channels and output new data across the FW port. Tuning in before the data has changed will lock you up. Most people set this delay anywhere from 2500ms to 5000ms. The second delay in SGraphRecorder.ini affects the timing of channel change commands. Having this set too fast will make you miss a couple of digits. You’ll need to play around with this value (“GirderInterNumberTimeSpacing=550”). The delay in sage.properties has to be longer than the TuningDelay in SGraphRecorder.ini. Usually set this to 2 seconds or more. Common values would be between 4500ms and 7000ms. You can find the entry to change in sage.properties below: videoframe/network_encoding_to_playback_delay=4000 Step 11: Using the FW port to change channels. First, a big thanks to timmmoore for providing this! This will be a little tricky because we can’t distribute a hacked Microsoft file. Please read this before you get started. I’ll try to sum up the procedure. By the way, this is all in Tim’s readme. 11-1: a. b. c. d. e. f. g.

h. i. j.

Install drivers for the AV/C Panel Device. The AV/C Panel had been disabled up until this time. Download the firewire.zip from the link above. Also download the meistb.zip from here. Unzip the meistb.zip somewhere (we’ll call this folder “temp”). Close the meistb.zip file. Open the firewire.zip. Extract the meistb.inf from the firewire.zip into the folder “temp” where you extracted meistb.zip overwriting the file that is currently there. You can also extract the channel.exe from the firewire.zip. We’ll use this file later. Ignore the rest of the files except the readme.txt. Close the firewire.zip. Find the mstape.sys file. If you are running SP2 it might be in the C:\WINDOWS\ServicePackFiles\i386 folder. Copy this file into the “temp” directory. Rename the mstape.sys to mstapeo.sys. Use a hex editor and change the following: Offset 130 is 04 BC 01 00 change to 0a 11 01 00 Offset 18bf is 8b f0 3b f7 0f 8c a0 01 00 00 change to 90 90 90 90 90 90 90 90 90 90 Offset 1a76 is 8b c6 change to 33 c0 Save the mstapeo.sys file. Open your devices tab in control panel/system properties/computer management. Right click on the AV/C Panel Device and choose to enable the device. It should pop up a window looking for the driver. If it doesn’t, right click and choose to update the driver. Point this to the “temp” folder. Hit “continue anyway” to get past the driver warning. If successful, you should see the AV/C Panel Device next to the AV/C Tuner Device.

k. Move the channel.exe file from the firewire.zip into a folder for permanent storage/use. I used the same folder that I put SGraphRecorder in. 11-2: Test the channel.exe and the newly installed Panel driver. Open your command prompt and navigate to the directory where you put channel.exe from the firewire.zip. Type in the command “channel –v”. This should produce a nice list of your FW drivers and all tuner cards. I’ll attach mine for example: Firewire STB channel changer V1.01, by timmmoore Device 1 Channel 1 1 "FireBus MPEG2TS Tuner Subunit Device" 'Motorola AV/C Tuner Device' "@device:pnp:\\?\avc#motorola&dct-6412&typ_5&id_0#2011ddfeff1a1100#{65e8773d-8f56-11d0-a3b9-00a0c922 3196}\global" 0 2 "Motorola AV/C Panel Device" 'Motorola AVC Panel Device' UniqueID '2011ddfeff1a1100' VendorID '111a' ModelID '64ca' VendorText 'MOTOROLA' ModelText 'DCT-6412' "@device:pnp:\\?\avc#motorola&dct-6412&typ_9&id_0#2011ddfeff1a1100#{65e8773d-8f56-11d0-a3b9-00a0c922 3196}\global" 1 3 'Hauppauge WinTV PVR PCI II Capture' "@device:pnp:\\?\pci#ven_4444&dev_0016&subsys_40090070&rev_01#4&3b1d9ab8&0&3840#{65e8773d-8f56-11d0a3b9-00a0c9223196}\hauppauge wintv pvr pci ii capture" 0 4 'Hauppauge WinTV PVR PCI II Capture' "@device:pnp:\\?\pci#ven_4444&dev_0016&subsys_40090070&rev_01#4&3b1d9ab8&0&5040#{65e8773d-8f56-11d0a3b9-00a0c9223196}\hauppauge wintv pvr pci ii capture" 0 Device Id "" Device Version "2.1.0"

Please make sure you are not watching live thru the FW or recording something before continuing. What you’re looking for is the AV/C Panel Device. Do not use the Tuner device or you’ll get the BSOD. In my case, I’m looking at using device 2 "Motorola AV/C Panel Device". Now you can directly test the channel change command by using “channel.exe 2 610” (to turn device 2 to channel 610). Check your STB to see if it worked. If you wish, you can use “channel.exe –v 2 610” to see some more info. 11-3: Edit SGraphRecorder.ini to enable external tuning executables. Anders is a smart guy and he did not have to make any changes to his UNE! Whatever you put on the ExeTunerPath= line is regurgitated and the channel number is added to the end. Very, very sneaky! The following options should be filled out if attempting to use the FW port to change channels. [ExeTuner] UseExeTuner=1 ExeTunerPath=C:\get_hd\channel.exe 2 Note: the above path is my path…please put your path in the “ExeTunerPath=” place. Also change the number “2” to your AV/C Panel Device number. Restart SGraphRecorder for the changes to take effect. There are no changes necessary for Sage. If happy with the results, you can turn off the Girder use in Ander’s UNE. See step 7 and set UseGirder=0. Enjoy! -EOF