Showing posts with label Coding. Show all posts
Showing posts with label Coding. Show all posts

Wednesday, May 24, 2017

Hammerspoon

So after upgrading to macOS Sierra one of my most critical utilities Karabiner stopped working.  I used it to map a bunch of shortcut keys on the mac to be the same as windows.  I switch between the two OS's all the time and it drives my muscle memory crazy having to use two different sets of keyboard shortcuts.  Unfortunately, Karabiner isn't supported under sierra.  Karabiner elements doesn't have the features I need like many to many key mappings (mod key combos to different mod key combos).  There is a fork that wwwjfy did that solves the one to many mapping but doesn't solve the man to many mappings.  In the end I completely ditched karabiner elements and uninstalled it.

In comes Hammerspoon and with a little scripting I think I have it all tweaked the way I like it.  My goal was to duplicate this mapping but use Hammerspoon instead:


First thing is to swap the option and command keys (the usual keyboard settings) if you are using an external keyboard.  I do this for all external keyboards but leave the apple internal keyboard as default:

Once you install hammerspoon and enable accessibility,  choose open config.  You should get a blank init.lua file.  Just paste the following.  Leave off the visual studio section if you don't use visual studio for mac.  Then, reload the config.  


-- home/end
hs.hotkey.bind({''}, 'home', nil, function() hs.eventtap.keyStroke({'command'}, 'left')end)
hs.hotkey.bind({"ctrl"}, "home", nil, function() hs.eventtap.keyStroke({"cmd"}, "up")end)
hs.hotkey.bind({""}, "end", nil, function() hs.eventtap.keyStroke({"cmd"}, "right") end)
hs.hotkey.bind({"ctrl"}, "end", nil, function() hs.eventtap.keyStroke({"cmd"}, "down") end)

-- home/end + shift
hs.hotkey.bind('shift','home', nil, function() hs.eventtap.keyStroke({'shift','cmd'},'left')end)
hs.hotkey.bind('shift','end', nil, function() hs.eventtap.keyStroke({'shift','cmd'},'right')end)
hs.hotkey.bind({'shift','ctrl'},'home', nil, function() hs.eventtap.keyStroke({'shift','cmd'},'up')end)
hs.hotkey.bind({'shift','ctrl'},'end', nil, function() hs.eventtap.keyStroke({'shift','cmd'},'down')end)

-- cut/paste
hs.hotkey.bind('ctrl','c',nil,function() hs.eventtap.keyStroke('cmd','c')end)
hs.hotkey.bind('ctrl','v',nil,function() hs.eventtap.keyStroke('cmd','v')end)
hs.hotkey.bind('ctrl','a',nil,function() hs.eventtap.keyStroke('cmd','a')end)
hs.hotkey.bind('ctrl','z',nil,function() hs.eventtap.keyStroke('cmd','z')end)
hs.hotkey.bind('ctrl','x',nil,function() hs.eventtap.keyStroke('cmd','x')end)

--file ops
hs.hotkey.bind('ctrl','s',nil,function() hs.eventtap.keyStroke('cmd','s')end)
hs.hotkey.bind('ctrl','o',nil,function() hs.eventtap.keyStroke('cmd','o')end)
hs.hotkey.bind('ctrl','n',nil,function() hs.eventtap.keyStroke('cmd','n')end)

-- search 
hs.hotkey.bind('ctrl','f',nil,function() hs.eventtap.keyStroke('cmd','f')end)
hs.hotkey.bind('ctrl','g',nil,function() hs.eventtap.keyStroke('cmd','g')end)
hs.hotkey.bind('ctrl','r',nil,function() hs.eventtap.keyStroke('cmd','r')end)
hs.hotkey.bind('','F3',nil,function() hs.eventtap.keyStroke('cmd','g')end)
hs.hotkey.bind('ctrl','F3',nil,function() hs.eventtap.keyStroke({'shift','cmd'},'g')end)

--visual studio
hs.hotkey.bind('ctrl','h',nil,function() hs.eventtap.keyStroke({'alt','cmd'},'f')end)
hs.hotkey.bind('ctrl','.',nil,function() hs.eventtap.keyStroke('alt','return')end)

UPDATE: 11/30/2017
I no longer use hammerspoon.  I highly recommend Better Touch Tool instead.  It's well worth the few dollars.



Saturday, April 03, 2010

rcIR



rcIR (v1.0 - 4/3/2010)
source code included

Here is a little command line utility I wrote to help reboot the Hauppauge HD PVR on a regular schedule (say 4am every morning) using IR blasting. You need a few additional items for this to work:
- $5.62 Universal IR Remote Controlled AC Outlet for Appliances (110V)
- $50-55 usbuirt
- Any IR remote control with a button you don't use in the immediate area.

The basic idea is you hook up the HD PVR (or really any device you want to reboot) to the IR plug. The IR plug learns the remote button press. Then, you use rcIR to learn the same signal which saves it as some long hex looking string. After that you want to place the usbuirt near the IR plug. Use windows task scheduler to schedule when to run rcIR. It will blast whatever IR code you pass to it, wait a number of seconds you specify, and blast the IR signal a second time. This will trigger the IR plug to turn off (basically cut power at the outlet to the hd pvr) and then turn it back on basically doing a power cycle for you. It works and seems pretty reliable as long as you have the IR plug and the usbuirt positioned correctly. USBUIRT is pretty powerful and can usually even bounce off a wall and still trigger the IR plug.

Example:
- rcIR (no parameters): short help and description.
- rcIR learn
- hold the remote control about 1 inch from the usbuirt and hold down a button. Make sure you get 100% signal quality otherwise try it again. It should display some long IR code like this:
Learned IR Code = F42R0395815480AA163F1615163F1615151516151615154015161515161516151540154015151615161516151515163F163F163F16151615151615151615161515151615163F163F16|075881555516
It's also written to the log. Copy that into the clipboard.
- rcIR reboot "F42R0395815480AA163F1615163F1615151516151615154015161515161516151540154015151615161516151515163F163F163F16151615151615151615161515151615163F163F16|075881555516" 10
Make sure you use quotes around the IR code. This means blast the above ir code, wait 10 seconds, then blast the ir code again. This simulates a "toggle" to reboot a device. If you have a device that has separate on/off ir codes just pass 0 for waitsec and it will only send the IR signal once. Then you could basically just run rcIR twice back to back each with a different IR code.

Saturday, November 22, 2008

rcFeedMe - A Fully Automated Podcatcher



rcFeedMe.zip (v1.44 - 11/8/2011) (source is included)

rcFeedMe is now Open Source (Apache License, Version 2.0) and the latest source is located here :
https://bitbucket.org/arogan/rcfeedme/overview

- So I've been using Juice for a while as my podcatcher. It works ok most of the time but there were a few things that annoyed me: Sometimes downloads would just hang, no way to group feeds into different download directories, and sometimes something about a feed would change and all of the files would download. That last one might not be Juice's fault but still there are ways to solve this problem in the podcatcher.
- So I went looking to see if there was a better free alternative. Also, I'm one of those people who refuses to install itunes. I tried a few from this site:
http://www.podcatchermatrix.org/ but most of them had more issues than Juice with interfaces that seemed to make the whole process of configuring your feeds a chore.
- So I did what any programmer would do. I wrote my own. rcFeedMe is a podcatcher - basically it reads rss feeds and downloads them unattended all automatically on a schedule. It is NOT a rss reader. I use google reader for that. Once you set it up you shouldn't have to touch it anymore except when you want to add/remove feeds.
- Tip: If you find a show that only has an itunes feed and not a regular rss xml one read this article. I found it quite helpful.

Design goals/features:
- Quick and easy interface. It might not be that pretty but I wanted something that I could quickly enter settings for all aspects of the program.
- OPML import/export.
- Complete automation. Once setup, it just runs in the tray and checks the feeds for new downloads at an interval you set. No annoying popups or notifications. I just want it to silently do its thing. Downloads have to be as robust as possible and retry automatically if the download stalls.
- Maintain a history of every file downloaded so you will never get flooded with downloads when a feed changes or download something you've previously downloaded.
- Flexible system to determine where feed downloads are saved.
- Multi threaded with the ability to set the number of threads to use.
- Some basic abilities to sync to a mp3 player. I want to keep this program pretty focused on just downloading.
- Clean install. You just unzip the files and run so it's completely self contained and portable. All persisted data is stored in clear xml files.
- Source included

Developer Notes:
- Written in Visual Studio 2008 - c# targeting .net 3.5 framework. It took about a week to write the core functionality. It took another week to flesh out a few features and bug fixes.
- Utilizes Windows Communication Foundation (WCF) SyndicationFeed. I coded around their publish date parsing bug. Try it with ask a ninja and you'll see. SyndicationFeed isn't a very robust class and there were several feeds I had to massage the xml before it would load into a SyndicationFeed.
- I started with a pretty clean OO design but it broke down toward the end with me taking all sorts of shortcuts especially with presentation elements getting mixed in (mostly to help performance). This also means the memory footprint grew a bit too though cpu utilization is low.
- All persisted data is in clear xml files.
- Thread management is a bit of a mess. I'm sure there is a much better/cleaner way to do things.
- Overall life cycle of a file: First you subscribe to a feed (class Feed), I refresh that feed and get a list of all files (MediaFeed which is a keyed collection of Media; attribute on Feed). At this point in time I figure out what the filename will be and verify that a good link exists pointing to the file that will be downloaded. Next, the queue (class Queue which is a collection of Media) is built taking into account check keep counts and history. I then process the queue downloading all the files trying to spread download across different sites (this algorithm can be improved, it's very simplified right now). Once the entire queue is finished (or the user stops the downloads) I cleanup the queue. All successfully downloaded files are moved to History (collection of Media), all the ones stopped or errored are moved to errors (temporary collection of Media, never persisted to disk). Then I trim files based on keep count. It's a very safe and conservative trim. I walk the save paths resolved from Feeds (collection of Feed), I then search history by filename, if I find a match in history then it's considered for deletion based on save flag and keep count. Keyed collections were used instead of dictionaries because I needed serialization.
- I don't check free space anywhere so ummm yeah manage your disk space. The idea is keep count should keep space usage pretty constant.
- CleanupConfig.xml. This file is used to help cleanup the raw xml that causes issues with SyndicationFeed class. This has two sections in it. One is for search and replace, the other removes text between the start and end strings inclusive. In the future, as more problematic feeds are reported and fixed, hopefully I can just release an updated CleanupConfig.xml file instead of doing a new build. There is no gui for this file so if you want to manually edit it just use notepad.
- Other code used:
http://www.asp101.com/articles/christopher/filesystem/default.asp
http://www.brunofigueiredo.com/post/c-OPML-Parser.aspx (make sure you apply the fixes mentioned in the comments)
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=176890&SiteID=1 - DataGridView progress bar
http://www.codeproject.com/KB/grid/DataGridViewColumnOrder.aspx - Save DataGridView column widths and position. Modified to persist settings in appSettings instead of user.config to keep rcFeedMe portable.
http://www.codeproject.com/KB/grid/CheckBoxHeaderCell.aspx?fid=452379 - Checkbox in DataGridView column header
http://developer.novell.com/wiki/index.php/TagLib_Sharp - ID3 Tag Library
http://www.veryicon.com/pack/aqua-smiles/ (icons)
- Thanks to coolmoedee345 for helping with the testing who listens and watches more podcasts than I think is humanly possible which of course made him the ideal tester.


Requirements:
- Windows XP, Vista, or Windows 7 (I've tested in both 32bit and 64bit)
- .net framework 3.5

Quick Start:
- Import an opml file or enter the url for the feeds you are interested in.
- Update the path on the settings tab to where you want to save your downloads.
- Click Start.

Usage:
- All the labels on the settings tab and many headers on the grids have tooltip text. That should help clarify some things.
- Command line parameters:
"1" or "auto" - (without quotes) to start in automatic mode. This means the app will minimize and the scheduler will start. This is useful as a shortcut in your startup group.
"2" or "lite" - The same as 1 except it puts it into "lite mode" which uses less memory but doesn't let you interact much at all with the program. Memory usage will still be pretty high when it's actually processing the download queue, but I try to free up as much resources as possible when rcFeedMe is idle and waiting for the next scheduled run.
"3" or "once" - Run Once: It's just like 1 except after finishing the run it will automatically exit. Useful if you would rather schedule rcFeedMe with windows scheduler and not have it running in the tray all the time.
"4" or "hidden" - This is exactly like run once but you never see a window. The only thing you will see is the system tray icon while it is running. This should be a lot less annoying than run once. Note: The gui is completely disabled in this mode so double clicking on the system tray icon does nothing.
- Right click on the grids for additional functionality. You can multi select rows in most grids by clicking the white space to the left of the row. Hold down ctrl to select multiple rows, shift for ranges of rows, and click the square in the top left corner to select all rows.
- Grids can be sorted by clicking on the header of the column.
- It should use proxy information that is setup for IE automatically though I haven't tested this.
- While a file is in the process of being downloaded it will have an extension of .rcFeedMeTemp. This extension is removed once the file has successfully completed downloading.

Main Menu:
File | Import opml: Import an opml file. Feeds with a url that already exists in the grid will be skipped.
File | Export opml: Export feeds to an opml file.
About: Shows the current version and a link to this post.
Debug | Save Settings: Not usually needed since Refresh All feeds saves all settings. Settings are also automatically saved when you close the application.
Debug | Load Settings: Not usually needed since Refresh All feeds saves all settings. Settings are automatically loaded on application start up.
Debug | Dump Raw XML Feeds: If you have a feed giving you problems (no files showing up/ERROR status when refreshing) you might want a raw dump of the rss feed. This will save the file in the same directory as the rcFeedMe.exe. It also dumps a fixed version if it's a problematic feed that I had to massage a bit to get working.
Debug | Sync Count: Count how many files that need to be synced and display it on the Sync button as Sync (n) where n = number of files that still need to be synced.

Toolbar:
Start: Start the scheduler.
Stop: Stop the scheduler.
Save then Reload Settings: Click this if you changed something and want to save it immediately but don't want to refresh all the feeds.
Refresh All Feeds: Saves all Settings, re-loads all settings, and refreshes all feeds. This is the button you want to click after you've added/removed feeds.
Process All Feeds: Does a Refresh All feeds, builds the queue, and processes the queue. This is the same thing that the scheduler runs.
Sync: Syncs files to a path of your choice (usually to a mp3 player or something). Paths are defined just like Save Paths but instead use the Sync Path fields (in feeds, groups, and settings). Sync is really a one way copy from where the file was downloaded to the Sync Path. Once a file has been copied, it is flagged as Synced in History so it won't sync again even if you delete the file on the mp3 player. You can always uncheck Synced in the history if you want to sync the file again. One small difference is sync paths are created if they do not exist (this includes even base directories). After the downloads are finished it will count how many files that need to be synced and display it on the Sync button as Sync (n) where n = number of files that still need to be synced. This lets me know in the morning if I have new podcasts waiting for me to be synced to my mp3 player. You can also get a count immediately with the Sync Count menu item under Debug.
Search History: Type in the textbox any substring you want to search in your history on Feed Name, Title, and File Name.

Status bar:
- First area is just general information on the last action.
- The next grey label area is the current overall status of rcFeedMe.
Idle - not much is happening.
Feed - Feeds are in the process of being refreshed.
Queue - Queue is being processed. Files are being downloaded.
Sync - Files are being copied to your mp3 player.
You will see the word [Lite] next to the status if you are running in low memory usage Lite mode.
Depending on the status, certain functions might not be available.
- Progress Bar shows status of either the feeds refreshing or the download queue. Download progress is only updated every percentage change.
- The tray icon will show teeth while rcFeedMe is being fed (downloading). Actually, it's anytime it is not idle.

Feeds Tab:

At the top is a grid displaying all your rss feeds and a variety of parameters to customize how files are downloaded. At the bottom displays all the files associated with the feed you clicked on in the top grid. Note: You must click "Refresh All Feeds" before you will see anything in the lower grid.
- How the save path of a file is determined: If a path is specified at the feed level, then that exact path will be used. Next, if a group is specified, then the group path will be used as the base path, a sub directory with the feed name will be created in this base path, and then the file will be saved in that sub directory. Finally, if a feed has no save path defined, group is set to (None), then the Save Path on the Settings Tab will be used as the base path. The same sub directory logic is used as in the group scenario. Note: Sync Path follows the same logic.
- Please make sure all base directories are created first or the program will throw an error.

Feeds Grid (top):
- Name: The name of the feed. Please be careful when editing this field. It's best not to touch it once you've begun downloading files for the feed since I use feed name + file name as the key to determine if something has already been downloaded (history).
- Url: The address that points to the feed. If you enter this first and leave Name blank then it will try and fetch the name of the feed for you. It's not quite as robust as refreshing the feed so if this fails, try typing the feed name manually and then refreshing the feed. There is a chance it still might work.
- Group: Any groups defined on the group tab will be in this drop down. Assign this feed to a group or leave it set to (None).
- Keep Count: This number determines two things. 1) It determines the maximum number of possible files that can be downloaded for the feed. So if it is set to 5 then at most 5 of the most recent files will be downloaded for this feed. 2) It also determines the maximum number of shows to keep on your hard drive. So if you download the latest 5 files, then a new one shows up in the rss feed, then the new show will be downloaded and the oldest existing file will be deleted. This is the primary method of managing disk space. By specifying keep counts your disk space used shouldn't change much. Set it to 0 to disable the feed. Enter -1 if you want to download and keep everything. I've seen other podcatchers use number of days or something like that which I find inconvenient since different feeds publish new shows at different or irregular intervals.
- Include Extension: Pipe(|) delimited list of file extensions(include period(.)) to match against for downloads. Sometimes undesirable file types get included into the feed (say a .aspx or something) or the feed is a consolidated feed with the same show in different file formats (say wmv, mov, avi, etc). This lets you filter down the files to download by a list of extensions. Example: if you only want wmv files to download from the feed then enter ".wmv" (with the period but no quotes, search is case insensitive). If you wanted wmv and mov files then enter ".wmv|.mov".
- Include Text: pipe(|) delimited list of substrings that are compared to the filenames for download. This is similar to extension but is a substring search of the entire filename. If it finds a matches then the file will be downloaded. This is useful if a feed contains many different versions of the same show in the same file format but at different quality levels/bit rates. Example: a feed has Show01High.wmv,Show01Med.wmv,Show01Low.wmv. If you wanted just the high quality ones you would enter "High" (without the quotes, search is case insensitive).
- Save Path: Enter the complete path where the podcasts for this feed will be saved. This path overrides all other paths (groups and global settings). If you use this feature please make sure you specify a unique path here that is NOT shared with any other feed. Having more than one feed save to the same path will cause unpredictable results.
- Prepend Date? Prepend the Publish Date to filename. Useful to make the filenames unique or help with sorting. Date format used is YYYYMMDD so it sorts propery. If both Prepend Date and Prepend Title are checked, then Date comes first.
- Prepend Title?: Prepend title to filename. Useful to make the filenames unique if only a generic filename is used in the feed. Take a look at the GameTrailers feeds. All the filenames are just download.mp4. Checking this will take the title of the show and prepend it to the filename. So download.mp4 will become "show title - download.mp4".
- Sync Path: Just like save Path but defines where files are copied to when you click the Sync button.
- Sync?: Check if you want files from this feed to sync to your mp3 player.
- Apply Cache Fix?: Appends a fake query string to the end of the url when making the request for the feed. This guarantees a cached copy will not be used but also causes some sites to throw an error. Most sites don't need this. If you do check this, then do a refresh and make sure the feed still works. To be honest I'm not sure if this "fix" really helps anything. I notice on a few feeds (like hdtv podcast) where there is a bit of a lag before the latest show appears in the feed. What is odd is if you view the feed in a browser (and therefore the xslt is applied) you see the latest version of the rss feed. If you instead grab the raw xml (I use webClient but trying httpwebrequest doesn't make a difference) it's the previous version and takes a while before it's updated. If I use WebBrowser class then yeah I get the latest data but it's after the xslt is applied so it's html and no longer rss xml. It's pretty odd. It only happens on a few feeds, and it's not a big deal since the raw rss xml eventually does get updated. If any programmers out there can explain to me what is happening, why, and maybe how to fix it that would be great.
- Username: Enter a user name if the site requires login credentials.
- Password: Enter a password if the site requires login credentials. Once you save, this field will show only the encrypted version (I also save it encrypted in the feeds.xml file). Type over it to change it or just erase it if you no longer need a password.
- Priority: Used to help sort mp3's during playlist creation. See the playlist section below for more information. Leave it blank to exclude the podcast from the playlist.
- Decode?: Apply url decode to filename
- Prepend Short Date? Just like Prepend Date but a shorter format: M/D
- Post DL Exe: This command will be executed after every single media that is downloaded from this feed. You can also specify a .cmd batch file if you wish. This process is launched asynchronously when a download is completed successfully (user aborts and failures do not count). Do NOT use double quotes even if the path contains a space.
- Post DL Args: Include any arguments needed to run the above exe. Please use double quotes around anything that might contain spaces (even tokens).
- Pre Sync Exe: Like the post except this executes right before the copy is done during a sync. This is executed synchronously.
- Pre Sync Args: arguments for pre sync exe.
- Suppress Sync: This suppresses the actual copy command that Sync usually does but it still does all the other things that sync normally does like updating the sync flag in history. This is very useful if the pre sync exe will actually be doing the copying for you.

available substitution tokens:
%filename% - just the file name of what was downloaded
%fullname% - complete path and filename
%savepath% - where the file is located
%groupname% - group name (if one exists)
%syncpath% - sync path
%feedname% - feed name
%date% - publish date in the same format as prepend date (yyyymmdd)

example: I want my mp3's split into 20 min chunks when I sync to my usb thumb drive.
First, you need a command line utility that will split mp3's. I like mp3split.
Next, I would setup my feed as follows:
feed name: This is Only a Test
Sync path: d:\portableDrive
post dl exe: blank
post dl args: blank
pre sync exe: C:\Apps\mp3splt_2.4_i386\mp3splt.exe
pre sync args: -t 20.0 -d "%syncpath%\%feedname%" "%fullname%"
Suppress Sync: checked

After token substitution it would generate the following:
Pre Sync exe = C:\Apps\mp3splt_2.4_i386\mp3splt.exe
Pre Sync args = -t 20.0 -d "d:\portableDrive\This is Only a Test" "c:\podcasts\This is Only a Test\thisisonlyatest-90-20111103.mp3"

Notice how you can combine tokens but just be careful where you place your double quotes.
What this would do instead of just copying the mp3 to the sync path it would instead execute the above which would chop up the mp3 into 20min chunks and output them to the destination directory d:\portableDrive\This is Only a Test.

- Right Click menu lets you abort refreshing feeds.

Files Grid (bottom)
- Add to Queue: Manually add the file to the download queue. The file will be automatically flagged as "Keep". See History Tab for more information.
- In Queue?: Read only - checked if the file is already in the queue.
- Title: Show title. This is the text used in the filename if Prepend Title? was checked above.
- Summary: Show summary
- Publish Date: Date the show was published. This is the date used in determining the latest shows to download. By default the grid is sorted descending on this field.
- File Name: Filename that will be used when downloading and saving the file.
- Link: The url pointing to the actual file that will be downloaded.

Download Queue Tab:

- I attempt to spread the downloads across different feeds to help maximize speed and thread efficiency.
- Feed Name: Name of the feed.
- Title: Show Title
- Link: The url pointing to the actual file that will be downloaded.
- File Name: Complete path and filename of what is being downloaded and saved.
- Publish Date: Date the show was published.
- Status:
Queued - In the download queue but has not started downloading yet.
Downloading - Download is in progress.
Downloaded - File was downloaded successfully.
Error - File was not downloaded properly. Some sort of error occurred. Partially downloaded files in error status are automatically deleted.
Stopped - User right clicked on the Queue grid and selected "Stop All Downloads". Any downloads in progress will be stopped immediately and have this status. The partially downloaded file will be deleted.
Bytes - Number of bytes currently downloaded/Total Bytes.
Progress - % downloaded
Attempt - How many times rcFeedMe tried to download this file. Once attempts hits the download retry maximum (set in the Settings tab) then the file will be set to Error status.

Download Queue Context Sensitive Menu (right click):
- Build Queue: Not used often unless you want manual control over some of the steps that "Process All Feeds" does. Click this after doing a Refresh All Feeds. It will build the queue but not actually start downloading yet.
- Process Queue: Begins downloading the files in the queue.
- Stop all Downloads: Immediately stop all downloads and halts the processing of the queue.
- Remove Selected Rows: Remove the files from the download queue.
- Move Selected Rows to History. This is more for debug but it might come in handy. After build queue you can move rows from the queue to History. This will trick the program into thinking these files were already downloaded. Useful in some situations where you want to pre-populate the history. Maybe there is a specific show you just don't want to download.

Download History Tab:

- After the queue is completely finished processing, all successfully downloaded files are moved here. The history will continue to grow over time. It might be a good idea to trim it down once in a while by sorting by date and then selecting multiple rows of the oldest data and deleting it.
- I won't go through all the columns since I've already describe most of them by now. Three columns are editable on this grid: Title, File Name, and Keep?.
- I allow editing of Title and File Name since these combined is the primary key I use to determine if a show has already been downloaded. This is just in case somebody wants to tweak something in the history.
- Keep?: Checking this prevents rcFeedMe from deleting the file. This goes along with Keep Count back on the feed tab. Any files you added manually from the files grid on the feeds tab will have this already checked. It makes sense because you added the file manually (and not by the scheduling engine) so the scheduler shouldn't delete it. Kept shows are excluded from the keep count calculation.
- Right click | purge history: This will clear the entire history file (a backup is created though just in case). Useful if you want to reset and re-download
everything.
- Synced?: If checked it means the file has already been synced to your mp3 player so it won't get synced again in the future. I you wish to sync the file again for some reason just uncheck this box.
- Make sure you save any changes made before leaving this tab since this tab gets refreshed whenever you click on it.

Recent Errors Tab:

- After the queue is completely finished processing, all the files that failed to download are moved here. This only shows files that error out on the most recent run. The data in this tab is not persisted anywhere so if you close rcFeedMe and then restart it, it will be blank. If you want to see a running history of all the errors from this tab, please see Errors Log Tab.

Group Defaults Tab:

- Save Path: Specify the download path for the group. The groups you define here appear in the drop down on the Feeds tab.
- Sync Path: Default path to sync to for the group.
- Playlist Path: If a path is specified then a playlist will be created at the end of the batch run for all podcasts in this group with a priority specified.
- Playlist Cutoff Days: Go back this many days to figure out how many podcasts to include. This is based on the podcast publish date.

Settings Tab:

These are your global preferences.
- Frequency: This is how often the scheduler should refresh all feeds and download any new files. Default is 360 minutes (every 6 hrs).
- Default Save Path: If a feed doesn't have a path specified and group is set to none, then this path will be used as the base path. See Feeds Tab for a more detailed explanation of how the download path is determined for a file.
- Default Sync Path: If a feed doesn't have a path specified and group is set to none, then this path will be used as the base Sync path.
- Keep Count: Default value used to populate the Keep Count field on the feeds tab when importing an opml file. Default is 5. See Feeds Tab for more information.
- Threads used to Scan: Number of threads to use when refreshing the rss feeds. Default is 6. Maximum allowed is 16.
- Threads used to download: Number of threads to use when downloading files. I would recommend 2. Any higher and some sites limit the number of simultaneous downloads and could produce false failed downloads. I try to minimize this by spreading out simultaneous downloads across different feeds. Maximum allowed is 6.
- Scan Stall: Number of seconds that elapse of inactivity while a feed is being refreshed. If the feed refresh stalls for this many seconds, it will be considered an error.
- Download Stall: Number of seconds that elapse of inactivity while a file is being downloaded. If the download stalls for this many seconds, it will be considered an error.
- Scan Timeout: If the total time for a feed refresh takes longer than this many seconds, it is considered an error.
- Download Timeout: If the total time for a file download takes longer than this many seconds, it is considered an error.
- Scan Retry: When an error occurs during a feed refresh, retry this many times before giving up.
- Download Retry: When an error occurs during a file download, retry this many times before giving up.
- Time Zones (Advanced): Used to help parse Publish Date. Sometimes it helps to strip out the time zone.
- Date Formats (Advanced): Used to help parse Publish Date. Specify the .net Custom Date and Time Format string. see: http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx

Log Tab:

- A very detailed log of everything that happens in the program. The log self trims so it won't grow in size forever. The log is refreshed every time you go to this tab or you can right click and refresh immediately. The log will grow until it hits 1.5MB. After that the oldest entries will be deleted and the log will be automatically trimmed down to 1MB. This cycle just keeps repeating. Log size check and trimming occurs when you process your queue.

Error Log Tab:

- Since the Recent Errors Tab isn't saved anywhere I decided to create a separate error log. The information is also buried in the complete log but this log only contains information that was in the recent errors tab. This log also self trims.

Playlist Creation
- This is a new feature I added basically to use with subsonic, isub, and my iphone and it's a new way for me to listen to podcasts on my commute without ever having to use itunes/sync again.
- This is all optional. You start by specifying a full path and filename in Group Defaults tab. So say I want a .m3u playlist generated for my audio podcasts. I would enter something like:
c:\subsonicPlaylists\AudioPodcasts.m3u.
For this to work properly with subsonic/iSub I setup in subsonic|settings|general|Playlist Folder to:
C:\subsonicPlaylists
- Next, you put in a playlist cutoffdays value in group defaults. This tells how far back to include podcasts. So if I use 14 that means only podcasts with a publish date within the last two weeks would be included in the playlist.
- Finally, on the feeds tab you need to give a priority number for each podcast in that group you want included in the playlist. Leave priority blank if you want that podcasts excluded from the playlist.
example:
The Instance - 5
GWJ - 10
Maximum PC - 15
TWIT - 20
I like to number by 5's so it's easier if I need to re-prioritize later.
- At the end of a process all feeds (which happens in any schedule run or run once) I generate the playlist as follows:
For any groups with a playlist path and cut off days defined, find all podcasts with a priority. I start with the lowest priority first. I get the most recent podcast (within cutoff days) and add that to the playlist first. Then I get the next lowest priority and the most recent podcast for that feed, and so on. Once I've walked all the feeds with priorities defined, I start over again at the top and pick up any remaining podcasts that fall within the cutoff days and throw them at the bottom of the playlist.
- NOTE: I retag the mp3 files when I do this with a short date: M/D-title. I have to do it b/c this is how I want to see it in iSub and it allows me the quickest way to scan for new podcasts from the feeds I care about the most. The original tag is written to the ID3 comment field with a prefix of [ORI].
- NOTE: Only file extensions with .mp3 are supported.
- Then in iSub I go to playlists|server and pick AudioPodcasts. With the bookmarking system in iSub this works out really well and lets me listen to podcasts on my commute but music while at the office.
- So what you end up with all of this is a constantly refreshing (however you schedule rcFeedMe to run) server playlist that I can hit with iSub, quickly glance over and see any new podcasts with the ones I care about most bubbling to the top of the list (instead of a strict latest date sort), all streaming without ever having to sync to my iPhone. I've been listening to podcasts this way for the last few weeks and it's been working great. Of course this helps if you have an unlimited data plan which I do.

Upgrading from a previous version
- Usually you only need to copy over the following files:
rcFeedMe.exe
rcCommmon.dll
gfoidl.DataGridView.dll
taglib-sharp.dll
cleanupconfig.xml (if you have added your own entries in this file you'll have to manually merge them)

Hopefully you find this program useful. Leave any questions or suggestions in the comments, and I'll try to respond.

UPDATE: If you have issues with a specific feed give http://feedvalidator.org/ a try. It's quite helpful in pointing out where the problem might be.

Version History:

- I've been making some updates to this release. It is now on version 1.44f. If you aren't running the latest version please re-download.
- Fixed a bug where you couldn't erase a playlist path from the groups tab.
- Known issue: adding a new feed by entering a url and them immediately checking any checkbox will throw an error. The work around is simply to either leave the row first or save your settings before checking any of the checkboxes.
- There is a new setting: Log duplicate errors. By default these are not logged since they are mostly harmless and just clutter up the log. This happens when a feed happens to list the exact same file twice.
- Maximum log size has been increased from 1.5 MB to 10 MB.
- Added 5 new columns to feeds: Post DL Exe, Post DL Args, Pre Sync Exe, Pre Sync Args, Suppress Sync. Please see the above section Feeds Tab for more details. This adds the ability to hook in your own post download process or pre sync process.
- Added new command line option 4 (or "hidden"). This is just like run once but you will never see a window (only the system tray icon).
- Made a preliminary fix to an obscure error when syncing (or getting sync count): "An item with the same key has already been added."
- Properly set status to idle before calling create play list to prevent the busy error during a batch run.
- NOTE: The source has been updated to visual studio 2010 (though it still targets the .net 3.5 framework).

v1.43 (8/22/2010)
- Added Url Decode option on filename
- Added ability to generate playlists. See above for more Information.
- Note: I now change last modified date to equal publish date after the file has been downloaded.

v1.42 (4/4/2010)
- Added a fix for EA podcast in the cleanupconfig.xml
- Added preliminary support for userid/password for sites that require it. I wasn't really able to really test it because I don't have any podcasts that require a login. See the Feeds Tab section above for more information.

v1.41 (11/5/09)
- This is mainly user interface tweaks. All checkbox columns now have a checkbox in the column header so you can easily toggle the checkboxes for all rows.
- All grid column positions and widths are now saved. Even the split location on the first tab is saved. All these settings are saved in rcFeedMe.exe.Config. So if you want to reset just delete the appSettings section.

v1.40 (11/2/09)
- added httpWebRequest useUnsafeHeaderParsing="true" to rcFeedMe.exe.config. This fixed an issue with a specific feed. You can read more about the issue here.
- cleanupconfig.xml is now a lot more flexible. You can now add fixes that only apply to a particular feed url instead of globally to all feeds. This allows me to add specific feed fixes without the risk of breaking some other feed. Just add the optional attribute feedUrl to either ReplaceStruct or RemoveStruct. If you leave feedUrl attribute off then it still applies globally.
- Added Restore to the right click menu on the tray icon. It does the same thing as double clicking the tray icon.

v1.39 (4/21/09)
- updated CleanupConfig.xml to handle another problem feed. Fixed a rare issue where if a filename differed only in case it would hang the feed refresh process.

v1.38 (2/22/09)
- Fixed a bug where I was never using DL stall time from the config (I was accidentally using scan stall). Also, rcFeedMe no longer shows up in the alt-tab list when minimized to the tray.

v1.37 (2/16/09)
- Fixed a problem with idle thumbs feed. Added better error logging when there is an xml parsing error. I now try and extract the xml fragment that was causing the problems and save that into the log.

v1.36 (1/27/09)
- Some feeds are missing the type attribute on the enclosure tag. I've added some code that should work around this issue.

v1.35 (1/11/09)
- added new Error Log tab. Anything that ever shows up in the Recent Errors tab is archived in this log. Sure the same information is also captured in the compete Log but this is easier to read if you just want to look at your failed downloads. This log also self trims.

v1.34 (1/7/09)
- added a size check. When media is finished downloading, I check received bytes against total bytes expected. If it received less then it is considered an error.
- latest CleanupConfig.xml is rolled into this release

v1.33 (12/12/08)
- fixed a tiny bug where I forgot to reset the tray icon tool tip text and form title after doing a sync.

v1.32 (12/11/08)
- Files that are too long are now trimmed down. This can happen if you prepend the Title and it happens to be a very long title. I've set maximum file name length to be 240. It will be less than this since I subtract out the full path. Any filenames that needed trimming will show up in the log.
- Fixed a bug when deleting rows out of the Groups tab.

v1.31 (12/10/08)
- Improved error messages in the log if a download fails.
- Sync Count now also displays in the window title and the tooltip text for the tray icon.

v1.30 (12/03/08)
- added a new feature: Sync Count. After the downloads are finished it will count how many files that need to be synced and display it on the Sync button as Sync (n) where n = number of files that still need to be synced. This lets me know in the morning if I have new podcasts waiting for me to be synced to my mp3 player. You can also get a count immediately with the Sync Count menu item under Debug.

v1.29 (12/03/08)
- fixed a bug introduced in the new feature in v1.27 and made worse in v1.28: Crash bug when editing existing feeds.

v1.28 (12/02/08)
- fixed a bug where if you had no group assigned to the feed, clicking add to queue button would cause the app to blow up.
- fixed a crash bug where feed name was null when it is trying to fetch the name.
- added a new xml file: CleanupConfig.xml. This file is used to help cleanup the raw xml that causes issues with SyndicationFeed class. This has two sections in it. One is for search and replace, the other removes text between the start and end strings inclusive. In the future, as more problematic feeds are reported and fixed, hopefully I can just release an updated CleanupConfig.xml file instead of doing a new build. There is no gui for this file so if you want to manually edit it just use notepad.

v1.27 (12/01/08)
- When subscribing to new feeds, if you enter the url first and leave the Name blank, then it will try and fetch the name of the feed for you.

v1.26 (11/24/08)
- fixed some problem feeds that use dc:date instead of pubDate tag in the rss xml.

v1.25 (11/21/2008)
- Initial public release

Sunday, June 22, 2008

Hauppauge HD PVR (model 1212)





Product Page
Support Page
SHSPVR Forums
AVS Forum

- Captures 720p/1080i over component (and eventually 5.1 DD bitstream over optical) in h.264 in realtime in hardware with almost 0% cpu utilization . This takes advantage of the analog loop hole (not ICT at least not until 2012 if ever) and lets you record from almost any HD source like cable set top boxes or satellite. This is a big boon for homebrew PVR/HTPC users. Finally, you can capture any content including all the premium content you paid for on your terms and archive and do what you want with it.
- External USB 2.0 device.
- Comes with an IR blaster which I didn't test since I already change channels on my cable STB using firewire:
http://home.comcast.net/~timmmoore/firewire/readme.htm
- A farily resonable (compared to alternatives) $250 price direct from hauppauge
- Has a set of component, analog audio, and optical out for pass through. Pass through only works when the device is turned on (with no delay).
- hooked it up, installed drivers from the DL on the hauppauge support page. Looking at the file dates 1.0b seems to be the latest drivers (even newer than the ones posted in the shspvr forums).
- Current drivers only supports pcm on optical. Bitstream (5.1) is coming in a future driver update. I stuck with analog audio for now. Btw, the analog ports are reversed. Connect Red - White and White - Red.
- I Installed it along side a pvr-250 in the same pc and had no conflicts. Both are working fine together. I have read some posts where there might be IR conflict issues between the hd pvr and the pvr-150 but I use eventghost + usbuirt for all my IR needs which IMO is a more robust solution anyways.
- I don't cover transcoding much because I have htpc's and popcorn hour to cover all my playback needs on the native .TS files it produces. It does have a utility to convert this odd mpeg2 transport stream container with mpeg4 h.264 encoded video + aac audio inside of it to mp4 format but I haven't messed with that much. I hear this odd file format has been making editing a bit difficult for some.
- Captured 720p content from xbox 360 (GTA IV), and some wmv 1080p content (though I was outputting 720p from the 360 over component). AV quality is excellent even at default bitrates. I really didn't see much difference when increasing the bitrate or trying variable vs constant. Very little to no artifacts during fast action scenes. Overall picture is just a tad softer. I'm very pleased with the quality
- recording sizes for 1 min of 720p video:
default CBR (8avg, 12 peak): 61MB
HQ CBR (highest quality settings 13.5avg, 20.2peak): 103MB
HQ VBR Avg: 42MB
HQ VBR Peak: 49MB

- Files (and I tried all formats) played back fine on ffdshow, vlc for the most part (got an error once in a while during a seek), and popcorn hour.
- Arcsoft software is pretty much junk. It constantly shows a preview window (delayed about half a second compared to the live feed) that sucks up like 40% cpu on my opteron 170 oc to 2.7ghz. I tried gbpvr (free) which has sort of a command line recorder (schedule.exe) that lets you quickly schedule a manual recording. It's a pretty heavy install if all you want is a command line recorder so I wrote my own (more on that later).
- Heat issues. Seems like every new AV gadget I get these days has heat issues. Recording would freeze usually in 1-6min. The hot spot seems to be on the bottom. Sitting the unit on its side lets me record maybe only 15min before freezing. Several people have reported this issue. There are NO VISIBLE VENTS on this PLASTIC case which just seems incredibly stupid.
- I called support and got a human in about 3 min (and they were NOT in India!). I got an RMA# without any fuss. Service was incredibly fast. Total time from me shipping the defective unit back and getting a replacement was just 5 days.
- The RMA unit had a different serial number but same revision: C1.
- I've done multiple recordings up to 2 hrs at 720p and 1080i without issue now.
-1080i tests: encoded 1 min of 1080i content. I think it was 9 avg, 13.5 peak, vbr at around 81MB.
- 1080i does NOT play back in VLC at all. ffdshow tryouts (latest nightly build) plays it back with a lot of ugly artifacts on the opteron but faired better on my q6600. Using the powerdvd h264 codec instead plays it back perfectly (powerdvd 7 or 8). Popcorn hour - plays it back perfectly!
- Playback summary (under vista 32bit w/ 8600gts, q6600 oc 2.9ghz). I used Haali splitter:
720p - vlc, ffdshow tryouts, coreavc pro 1.7, powerdvd h264, popcorn hour all work fine
1080i - stick to coreavc pro 1.7, powerdvd h264, arcsoft, or popcorn hour.
UPDATE:
Did some more playback testing on low end computers:
- athlon 64 3000 + ati X800XL agp (cat 8.6)
It just can't handle 1080i content. I tried all sorts of codecs (arcsoft, cyberlink, ffdshow, coreavc) and none will play it back smoothly. 720p seems to work ok with coreavc but cpu is always at or around 100%
- dell Precision Workstation 450 pentium IV 3.0 ghz dual xenon hyperthreaded + ati hd 2400 pro agp (cat 8.3)
1080i is a struggle to get working. It played ok in powerdvd8 with dxva acceleration. You have to actually play it within powerdvd8. Using just the cyberlink codec wasn't good enough and still caused high cpu usage. Even though cpu utilization was pretty low it still wasn't completely smooth. It is watchable though. 720p plays perfectly smooth with coreavc.
- I did some short 15 sec samples of GTA IV off of xbox 360 in both 720p and 1080i. I used default CBR settings.
hdpvrsamples.zip

UPDATE:
I've added some more samples. I finally moved the hd pvr into production and did some captures from my SA 3250HD. Here are some clips from food, espn, and discovery hd theater (comcast).
default encoder settings:
hdpvr-def.zip
maximum variable average:
hdpvr-maxvbravg.zip

HD PVR Fan Mod:


- Thanks goes out to stroths over at the sagetv forums for the basic idea.
- I finished my fan mod. Nothing is permanent. Everything done is reversible. I ended up going to michaels arts and crafts store to the sewing section and bought this plastic mesh for 39 cents. It works great since you can easily cut it with plain old scissors. It comes in different colors. I chose black.

- fan used:
Enermax Marathon 120mm Fan - Magnetic Bearing
They are very quiet. No need to under volt.
- Removing the 4 rubber feet exposes some double sided sticky tape. It's really thin and hard to remove without ripping. There aren't any warranty void stickers but still, if they look closely they can tell you've opened the case. Right under the tape are the screws.

- After that the whole top comes off. At this point I pushed out the clear plastic frame along with the silver top. Just go around the edge with a small thin flat headed screw driver to loosen up the series of tabs that hold it in place. Eventually a few will give and you can pop out a side.

- Next, I separated the silver top from the clear plastic frame. This required some careful work using a jewelry screwdriver. Insert it right where the silver top meets the clear frame and slowly pry them apart working around the edge. I started at a corner and worked down one side.

- After that I just used a lot of velcro dots. I attached the fan to the under side of the plastic frame blowing down into the case. There aren't really any vents for the air to escape so it just kind of comes out around the ports.

- Cut the mesh to fit the top of the plastic frame. Cut a small corner piece out to run the fan wire through. Velcro the mesh to the top of the clear frame.


- The fan clears all the components on the board but not by much. My only fear is if the adhesive (though it's pretty darn strong) on the velcro pads fail it could bring the fan crashing down on the main board. I might end up running this thing on its side anyways you know just in case :-)

- Power the fan using a usb to sata cable power supply usually used for hard drives but with a 4 pin molex it works great for the fan.

- the hottest chip seems to the ambarella chip:

- as you can see I didn't get the voltage/fan fix in my RMA unit mentioned here:
http://forums.sage.tv/forums/showthread.php?p=288154&postcount=154

used laser infrared thermometer gun
before mod (top wasn't exactly completely sealed since I had already done the mod at this time. I just loosely put the silver top back on and unplugged the fan so I think these pre-mod temps are going to be a bit low.)
125f after 5 min 1080i recording

150f after 30 min
125f underside
93f top side

after fan mod (15 min capture time)
120f highest
102f underside

Filter Graphs:
capture:
hauppauge hd pvr crossbar -> hauppauge hd pvr capture device (proppage: color settings) -> Hauppauge hd pvr encoder (proppage:encoder settings) -> file dump (filename)

playback:
.ts file (video)-> cyberlink h.264/avc decoder (pdvd7.x) -> video renderer
(audio)-> ffdshow audio decoder -> default direct sound device

preview:
hauppauge hd pvr crossbar -> hauppauge hd pvr capture device (proppage: color settings) -> Hauppauge hd pvr encoder (proppage:encoder settings) ->
arcsoft mpeg demux (couldn't get it to work with any other demultiplexer)
create two pins: video (mpeg-2 video) and audio (mpeg-2 audio)
pid mapping: video 0x1011, audio 0x1100 both elementary stream
(video) -> arcsoft video decoder -> video renderer
(audio) -> arcsoft audio decoder -> default directsound device

rcTVCap
- rcTVCap.zip (1.03 - 1/13/09)
- Written in c#. Built using Visual Studio 2008. Makes use of the DirectShowNet library.
- Requirements:
.Net 3.5 framework
latest hd pvr drivers (1.0b as of this writing)
a compatible file dump filter like the arcsoft one (more on this below) is required.
capture filter graph built on your own machine (instructions below)
- Thanks goes out to the_tom over at avsforum for sending me a copy of his RoboCapLE program that greatly helped me in writing this.
- Command line utility to capture using any filter graph (hopefully) though currently only tested with HD PVR. It shows 0% cpu utilization on my q6600.
- Usage: rcTVCap filterGraph dumpName secondsToRecord filename [ProfileName]
filterGraph: Capture graph previously built with Graphedit.
dumpName: name of the file dump filter used in the above graph. Make sure case matches. This is needed so I can set the filename on the graph.
secondsToRecord: number of seconds to record
filename: Name of the video file to capture to (fully qualified path).
ProfileName: This is optional! Specify a profile name defined in FilterProfiles.xml to set filter properties like quality settings.
Remember to use quotes around any arguments you pass in that has spaces.
Example: rcTVCap hdpvr-reccbr.grf "File Dump" 3600 "c:\videos\my recording.ts"
Example using HQ Profile: rcTVCap hdpvr-reccbr.grf "File Dump" 3600 "c:\videos\my recording.ts" HQ
- A self trimming log is generated in the same directory as the executable: rcTVCap.log
- Complete source code is included.
- I've only tested this under vista 32bit. I hope it works under xp. I wrote this in about 2 hrs, and it's my first time working with filters so let me know if you find any issues. I've done several 2hr recordings without issue though.
- It doesn't seem like it works under 64bit. Read the comments for more info.
- It seemed I was able to playback the file while it was still recording. I only did limited testing but it seems to work.
- Note: You most very likely have to build your OWN graph on the SPECIFIC machine you plan to run rcTVCap on. The included graphs in the zip file probably will NOT work. See below on how to build your own graph. This probably has to do with USB port assigning being different depending on the machine (thanks ash from the comments).

UPDATE: New in v1.02
- You'll notice a new FilterProfiles.xml. You can edit this with notepad. This is how you can set quality settings on the fly through the command line. The basic idea is you create a profile with a unique name, then identify the property and the value you want to set it to. Nothing is hard coded so hopefully as more guids are discovered you should be able to set them just by modifying the xml file.

<profile><name>SomeUniqueName<⁄ name>
This is the name that is passed in on the command line so make it something unique.
All Comments are optional.
<filtername> - Name of the filter you want to modify
<guid> - Guid of the property set
<id> - Property ID (so far all of them are use 0)
<value> - Value you want to set for the property (right now it's either the bitrate or 0 = constant, 1 = variable average, 2 = variable peak for bitrate mode).

Just look at the included FilterProfiles.xml (make sure it's in the same directory as rcTVCap.exe), and you should be able to figure it out.

A big thanks goes out to the_tom for the code to set property values and vladd for the C# translation.
http://www.avsforum.com/avs-vb/showthread.php?p=14483946#post14483946

- Multiple HD PVR's on the same PC. My friend actually got this to work with rcTVCap. I can't test it myself since I currently only have one HD PVR. The basic idea is to build two different graphs. When you insert the filters, each one will be listed twice (one for each physical hd pvr connected to your pc) in the available filters list. By specifying different filter graph files (grf) on the command line, you can control which hd pvr is used in the recording.
- rebkell over in the avsforums built a nifty GUI front end to rcTVCap that looks pretty slick:
http://rebkell.net/KLToolBox/
Just make sure you put his files into the same directory as rcTVCap.

Version History:
v1.00 (6/22/08)
- Initial release

v1.02 (9/30/08) (v1.01 was an internal release only)
- Added ability to set filter property values like bitrate and other quality settings.
- Fixed a minor issue where sometimes rcTVCap.log wasn't being created in the same directory as rcTVCap.exe
- Tested with the latest Dolby Digital 5.1 beta drivers.
- Removed instance check so you can run multiple instances at the same time. This is useful if you have more than on HD PVR hooked up to the same PC.

v1.03 (1/13/09)
- No new functionality. Rebuilt so it should work under 32bit and 64bit windows. A big thanks to Nissen for figuring this out.

rcGraphBuilder:

rcGraphBuilder.zip (v1.02)
- I just wrote this experimental tool to help quickly build the capture graph without the need to install graphedit. Just run the exe (on the machine that has the hd pvr) and click the build button. If you need to play with the property pages that is there too. I haven't tested it a lot so let me know if this works.
- Device Number lets you build graphs for each hd pvr when you have multiple hd pvr's hooked up to the same machine.
- 99% credit goes to vladd:
http://www.avsforum.com/avs-vb/showthread.php?p=14820309#post14820309
which I pretty much stole 99% of the code from.
- requires .net 3.5 framework.
- UPDATE: v1.02 was rebuilt so it should work under 32bit and 64bit os.

Building an HD PVR capture filter graph using graphedit:

- First you need to obtain the tool.
Vista: http://www.avsforum.com/avs-vb/showpost.php?p=11420971&postcount=11
xp: http://www.shspvr.com/graph_build/demultiplexter.html
run regsvr32 proppage.dll as administrator if you are under vista.
- Make sure you have arcsoft Total Media Extreme installed.
- OPTIONAL: If you don't want to install all of arcsoft software (because I hate having a bunch of software installed with a bunch of filters you don't need) you actually just need one filter from the install (C:\Program Files\Common Files\ArcSoft\Mpeg Engine\filedump.ax). So if you can get a copy of that file (say you copy it from another PC that does have arcsoft installed, or you could just install arcsoft, copy filedump.ax somewhere else, then uninstall arcsoft) just regsvr32 filedump.ax.
- UPDATE: Even more convenient you can download dump.ax here. Thanks SHS! (UPDATE2: The file in that zip file is called dump.ax. I'm not entirely sure that will work with my tools. To be safe I still recommend you grab filedump.ax off your install cd. If you do use it notice it is called "Dump" and not "File Dump" so adjust instructions accordingly. Also, my guess is dump.ax won't work with rcGraphBuilder but I haven't tested this.)
- You are building a new graph from scratch: start graphedit, ctrl-f to insert filters. Insert the following filters:
WDM Streaming Crossbar Devices: hauppauge hd pvr crossbar
WDM Streaming Capture Devices: hauppauge hd pvr capture device
WDM Streaming Encoder Devices: Hauppauge hd pvr encoder
DirectShow Filters: File Dump (type any dummy file or just hit cancel. It doesn't matter since rcTVCap will change this to whatever is passed in the command line). UPDATE: some people are having issues when hitting cancel which makes no since to me. It's been suggested entering a filename of "File Dump" helps. It's worth a try.
- Connect the pins according to the screenshot.
- Modify any quality settings on the encoder filter property page.
- UPDATE: Change the GOP Mode on the encoder filter development tab to Simple GOP 4/32/128. If you pick any of the "No IDR" options then I had seek issues when playing back with coreavc. This setting gets cleared if you power cycle the hd pvr so make sure you change it again if you happen to power off/on the hd pvr.
- UPDATE 2: It seems the seek issues only happen with Haali Media Splitter + coreavc (even tried 1.8) + No IDR setting. You change any of the three and the seek issue goes away. For example: I tried media player classic Home Cinema using the internal splitter with external decoder (coreavc), and I had no seek issues even with the "No IDR" setting.

- Save it.
- Press "Play" and test it first to see if it is capturing in graphedit (make sure you put a name for the File Dump filter if you want to do this test). If it doesn't work here, it won't work in rcTVCap. If you are having issues, make sure you are using the original USB cable that came with the hd pvr. Reboot your pc and power cycle the hdpvr and try again.
- Still confused and need a bit more step by step help? Then I suggest you start reading from about here.

Overall, I'm pretty impressed with this product even with it's issues (heat/voltage issues, flipped audio ports, no 5.1 drivers yet, etc). It definitely feels like a rushed product but still the results are pretty darn impressive. I'll be putting this device into production this week, and then I'll be able to test 24/7 long term reliability. With the fan mod I'm pretty confident it will hold up. I'll probably pick up a second one once they go through a hardware revision or two.
Recommended for the technically savvy.

UPDATE: 10/1/08
- released rcTVCap 1.02 (see above in the rcTVCap section for details).
- Tested the new Dolby Digital 5.1 beta drivers and they seem to work quite well. This is on vista 32bit. I've read that some people are having issues on vista 64bit.
http://www.shspvr.com/smf/index.php?topic=11718.0
ftp://ftp.shspvr.com/download/wintv-hdpvr/hdpvr1.0.3.53beta.zip
http://www.hauppauge.com/site/support/support_hdpvr.html (click the beta tab)
http://hauppauge.lightpath.net/software/hd_pvr/hdpvr1.0.3.53beta.zip
- you can see the new AC3 settings here:

- I disconnected the analog audio cables and connected the optical cable to the optical input on the HD PVR.
- I did have to make one change to my capture graph. To get it to capture from the optical input instead of analog I had to make a change on the Crossbar property:

On the Crossbar tab, output drop down, choose audio decoder out. Then on the input drop down choose SPDIF. What was interesting was I only had to do this once. This setting stuck even after power cycling the HD PVR and rebooting the PC.
- I've also noticed that either Simple GOP is the default now or the setting is sticking because it also survives between power cycles and reboots. Yeah!
- Here is a short 15 sec clip of food network with dd 5.1 (CBR with default bitrates):
hdpvrfooddd51.zip

I still need to do some long term testing with these new 5.1 beta drivers but so far so good. HD PVR just keeps getting better and better. I might just have to order another one.

UPDATE: 10/17/08
- Latest 5.1 drivers are out (non-beta)(thanks comment poster!). I installed them this morning. Did a reboot, then I unplugged and plugged back in the power on the hd pvr. I ran a few short tests and it seems like it is working ok. On the previous 5.1 beta drivers I was having some slight stability issues. I could go 5-7 days 24/7 and then it would become non-responsive until I power cycle the device. I hope these new non-beta drivers bring stability back up to pre 5.1 driver levels. If not I might have to RMA this unit again (I had one of the very first rev C1 that locked up in seconds, the RMA one was also a C1 and has been pretty good).

UPDATE: 11/21/08
- So after the 5.1 drivers the hd pvr was never stable more than an average of 3 days before it would lock up and I would have to power cycle it. This went on for about 2 weeks until I decided to RMA it again. I just got the replacement unit, and it is a rev E1.
- It came with a version 2.0 disc. I noticed new v1053 drivers were recently released. I compared the two and the ones on Hauppauge's support page were newer so I just used those. I did have to rebuild my capture graph though. I did a few quick tests with rcTVCap, and it seems to be working fine.

- The first thing I noticed are the 4 sets of vents they added to the bottom! Yeah! They finally added vents!
- I still had the fan from my last mod so I just slapped it on the bottom using the same velcro dots and added a fan grill. I have the fan blowing away from the bottom hoping to pull air more quickly out of the vents:


- I still run it on its side. Eh, old habits are hard to break. Those bling lights sure are bright:

- I just stuck it back in production so it should start recording again tomorrow. Hopefully this one is 24/7 stable.

UPDATE: 11/26/08
Added rcGraphBuilder. See above right after rcTVCap.

UPDATE: 12/09/08
- I have a new theory about some long term stability issues I've been having. It seems with 5.1 you want to use the usb cable that came with the hd pvr. Using either an extension (I was using a good one from monoprice), going through a hub, or just using another longer cable seemed to cause issues for me. I've now moved the hd pvr closer to my pc and using the original usb cable. It seems to be working much better now. So the moral of the story is use the included usb cable and plug it directly into a usb port coming off of the motherboard. Do not use extensions, other usb cables, usb hubs, or plugging into any ports on the front of the pc case.

UPDATE: 1/11/09
- As requested here are some close up shots of some of the chips (this was from my original rev c1):


- Also, here are some additional sample clips that were requested. These are 30 seconds each using default recording settings, 720p:
food-30sec.ts
dhdt-30sec.ts
These were recorded using rctvcap and the latest 1.0.5.4 beta drivers.
- Another theory on long term stability: I don't think it is enough to power cycle just the hd pvr. You need to reboot the machine too. I think there might be some leak or something at the driver level that gets worse over time and isn't fixed until you reboot the pc. It takes about 3 weeks of recording about 4 hrs a day 24/7 before I run into stability issues. I hope these new beta drivers are more stable. This started with the 5.1 drivers. Before that, the hd pvr was stable for much longer periods of time.

UPDATE: 2/14/09
- Long term stability problems still continue. I'm averaging about 2 weeks before a required power cycle. My latest experiment is I'm dropping back to analog audio aac 2 channel stereo. Since all this started with the 5.1 drivers I'm just using settings as if it were pre-5.1 drivers to see if I can return to those days of months of recording without power cycling. Also, Rico66 on avsforum speculates that it might have to do with some conflict with some remote control receiver usb devices. Anyways, testing continues and I hope a find a solution that gets me back to 3+ months of stability.

UPDATE: 2/26/09
- Looks like rebkell and Rico66 on the avsforum have been busy testing another theory on long term stability. Rebkell recommends you cover the front portion of the hd pvr that looks like an IR Receiver. It's worth a try. Try using 4 strips of electrical tape to make sure the IR Receiver window is completely covered.

UPDATE: 3/27/09
- Universal IR Remote Controlled AC Outlet for Appliances (110V). I picked up a few of those thanks to the anonymous comment. I wrote a little program that runs every night at 4:15am (ms scheduler kicks it off). If the hd pvr isn't recording, it sends an IR signal that the ir plug has learned (blasting via usbuirt). This turns off the hd pvr, waits 10 seconds, and sends the IR signal again to turn it back on. So basically my hd pvr will power cycle itself every day now. Also, thanks to Rebkell which noticed that in rctvcap I make a call to IMediaControl.StopWhenReady() which is an async call. I now sleep the main thread for 5 sec before I continue tearing down the graph. I'll test this version a while before releasing it.
- Filefront is closing down so I moved all my files to dropbox. I could use some more free space. I can get some more free space through referrals. It's a pretty neat service and completely free. If you feel like giving it a try please use my referral link. I would greatly apprecate it: https://www.getdropbox.com/referrals/NTQzNDQwMjk

UPDATE: 4/3/2010
- I finally got around to writing rcIR which lets you power cycle the hd pvr on a regular schedule if you have one of the above mentioned IR plugs and a usbuirt.