pvrusb2 driver utilities

$Id: utils.html 1274 2006-07-03 05:07:20Z isely $

Mike Isely <isely at pobox dot com>


This page briefly describes the usage of the utilities included with the pvrusb2 driver distribution.

You can find the main driver page on the web at http://www.isely.net/pvrusb2/pvrusb2.html.


Overview

The utilities can be found in the utils subdirectory. They include the following:


Sniffing and decompiling USB traffic

There is a free USB sniffer that can be run under Windows for capturing all traffic between a USB device and its driver. The home page for it is here. Using this tool we can learn about how the Windows driver operates the device. If you want to explore, download that tool and follow the related instructions.

To help with understanding the log data from the sniffer, there are two tools provided with this driver:

The first tool is usbreplayprep.pl, which will preprocess the USB sniffer data into a more compact form. This tool was originally written by Björn but I have since modified it to provide more data. The version provided here saves both directions of traffic; the previous one only saved data going in the driver-to-device direction.
The second tool is decode_log, which is compiled from the similarly named C++ source file. This program interprets the output from usbreplayprep.pl and produces a concise listing of all the commands and data moving to / from the device and the driver. (This tool can also capture and save the encoder firmware if seen as part of the log.)

The decompiler is a 2-weekend hack that I wrote in C++ and must be built first. Run make in the utils directory to build this tool. Note that this program has no other dependencies beyond needing C++ so it should be a straight-forward build.

To capture and decompile a session with the device when run with the Windows driver, do the following:

  1. Boot windows, start the sniffer and enable it, and plug in the device.
  2. Run your TV app for a little while. NOTE: The sniffer log data can get ENORMOUS so you may not want to run it for long. Also the capture process does slow things down so the video playback in the TV app might get choppy, but that's OK.
  3. Copy the log data to your Linux system or reboot to Linux
  4. Run usbreplayprep.pl < data.log >data.txt where data.log is the name of the log output from the sniffer.
  5. Run decode_log < data.txt > data.src and the decompiled output will be in data.src.

The decompiler also has an option for saving off the encoder firmware captured, which is useful when one has to figure out the firmware extraction details for a newer Hauppauge driver snapshot. There's lots more about that feature described in firmware.html.