NextPVR Forums

Full Version: Idea for QAM recording / live TV using External Recording Plugin and TVPI
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
The Fusion HDTV software can respond to imported TVPI files (see http://en.wikipedia.org/wiki/TVPI). When a recording command is imported, the Fusion software stays minimized and the recorded .mpg or .tp is placed in the recordings directory. The recording can be stopped by closing the Fusion application (which can also be automated in various ways).

It should not be very difficult to use these features to enable QAM recording in GBPVR with the Fusion cards, and I intend to do this, but there is one problem. When FusionHDTV records an analog channel, the resulting MPG file is readable by GBPVR during recording, and the length of the recording even updates in real time as the show records, just like any other GBPVR recording, which is great. But, this does not work for digital recordings, and GBPVR is unable to read the output .mpg file until the recording stops in Fusion.

The error log shows this:
12:35:32.703 INFO DirectShowPlayerBase::playVideoFile(C:\DVR-RECORDINGS\2007-02-04(Sun)PM1235-CHD112.mpg)
12:35:32.703 VERBOSE File already in use - probably still recording
12:35:32.703 VERBOSE waited: 0 (0 - 1170610532) filesize: 0
.....
12:35:43.968 VERBOSE waited: 11 (0 - 1170610543) filesize: 0
12:35:44.062 ERROR DirectShowHelperVMR9::playFile() - Waited ten seconds, and file size is still zero!!!

So it appears that the Fusion app opens digital recording files for exclusive access but not analog ones. And apparently Windows Media Player and Media Player Classic also use exclusive access because they can't read the .mpg's for Fusion's analog recordings while GBPVR can.

Anyone have any ideas around this? I'm going to try editing the fusion binary to change the parameters of all CreateFile calls to allow shared file access, but first I gotta find the right tools to even do that. If anyone already has a good disassembler/re-assembler, maybe give that a shot?
Yeah, I'm guessing youre probably correct and the fusion app is opening the file with exclusive access, no sharing allowed when recording digital.
Got it! And it only took 3 hours of debugging. I can now record a QAM digital/HD channel with FusionHDTV 3.50.01 minimized and view the file while it is recording with GBPVR.

It took a while to find the spot that actually opens the file because it isn't in FusionHDTV.exe or any of its declared imports, it's actually in ZuluPsDump.Ax which is dynamically loaded. Only 2 bytes need to be changed:
0x15B9: change 00 to 01
0x2673: change 00 to 01

I doubt I can legally post the altered binary but I can post a patch that will make the changes if anyone wants that.

Next up is to do the actual GBPVR integration. The hooks/actions should be something like:
When LiveTV is started for some channel:
1) Create a tvpi file that says to record that channel starting immediately and for some very long amount of time and launch fusionhdtv with that file as its argument.
2) Make GBPVR start playing the resulting .mpg file.
When LiveTV is stopped
1) Kill FusionHDTV by sending it the WM_CLOSE message, it exits cleanly.
2) Delete the output file.
For recording the start/stop actions are the same except for deleting the output file, and maybe instead move it somewhere else or rename it or do whatever it takes to make it show up in the Recordings list in GBPVR.

Hopefully all of this is possible and it runs stably.
If anyone is interested, I got FusionHDTV automation working. I can now record QAM channels and watch live TV (in timeshift mode) in GBPVR.

The integration is *almost* seamless, the fusionhdtv splash screen is seen briefly when it starts. When Live TV is started, it shows the "Entering Timeshift mode" for 11 seconds before the video starts. This is a long time but not likely to be improved as that is how long it takes fusionhdtv to start up and begin recording. Fusionhdtv.exe uses 2% cpu on my core2duo 2.4ghz machine while recording, as expected, the important thing is that it does not load the GUI at all so it does not wastefully decode the mpeg2 in the background.

The requirements for this are the External Recording plugin, Perl, and PsKill from Sysinternals, all of which are free of course.
I have been trying to do this ever since I bought the fusion cards. Please send me details on how and what to do exactly to get this to work.
I do this with my graphRecorder/TVPI plugin - although it doesn't work for live (it may with your modded binary)

You may want to check it out you don't need perl, etc. Although you may still need taskkill for changing channels if you do while watching live TV.

DVICO has told me they have BDA Qam drivers in the works, but not when the release date is.
I did something similar to this with the HDHomeRun before they released the BDA drivers. I ended up rewriting most External Recorder code so that it launched the hdhomerun_config.exe to tune the channel, filter the program then start the stream. It also killed the exe when the recording/viewing session was finished via Thread.Process.

Not sure if I still have my C# project source code (hard drive crash), but I can pretty much remember it all if you are interested in integrating it this way. It would eliminate the Perl and PSKill requirements.
I write code (c#) for living yet I am ashamed to say I do not understand how to get started. Are we talking about accessing guide data from somewhere (ex. xmltv or zap2it) and creating a .tvpi file that will cause dvico software to begin recording? What is the best way to map the qam channels? Do I store the data in a xml file? What tool will allow me to later view/search guide data?

As you can see I need a beginner's guide for this. I have been reading a lot of forums but still no clue I would really appreciate the help. BTW, I should mention I have two other friends on the same boat; so you will be helping all of us.
If you use my plugin all you need to do is put the translations in the table and it will register the tvpi for you just before the recording should start. As I mentioned it works for recording but not timeshifting due to the issue above, but it looks like if you mod the driver it may work for both,
I am working on a graph that stops at the Fusion HDTV WDM Capture. What I cannot figure out how to write the .tp file from this box to my hard drive. I assume I have a .tp file at this point and I want to write it as is. I do not want to encode because of system resources but just want to write the .tp file. One other thing that I don't understand is where do the input box (that has the file name) come from in all the sample graphs?
Pages: 1 2