Monday, January 02, 2012

HTPC: Displaying the Windows Media Center actively recording program on an LCD Display

A project that I took on over this past Christmas break was to get my HTPC to display on an LCD display mounted in the PC’s case informaton about the TV program actively being recorded by the Windows Media Center DVR, so that I could see what was being recorded even when the attached TV was off.

The basic hardware/software setup for this project was:

  • LCD Display: An nMediaPC PRO-LCD-B display, which is a blue LCD display that can display 2 rows of 20 characters, and fits into a standard PC case 5 1/4” drive bay. 
  • A PC running Windows 7 64-bit, configured to act as a DVR using Windows Media Center.

This project turned out to be significantly more complex that I originally planned on it being, although after nearly a full day of tinkering, I did finally get it to work!  The remainder of this post is a set of instructions for what I did to get the LCD display working to display the active Windows Media Center recording (leaving out many of the missteps and dead ends I encountered along the way, although I do include a couple of the major ones as an appendix at the end of this post). 

WorksOnMyMachineI’m providing this information for my own future reference and in the hopes that it may be helpful to you, the reader; however, please note that this is in no way an “official” set of instructions.  It worked for me, but may not work for you.  Your mileage may vary.  I am awarding this post the official Jeff Atwood / Jon Galloway “It works on my machine!” seal of approval. 

These instructions assume that you already have Windows Media Center actively running as a DVR on your PC, and that you have a reasonable level of technical expertise, and patience – there are a lot of steps here, and quite a few “moving parts” to get working together!

Enough disclaimers; on with the show!

1. Purchase the nMedia PRO-LCD-B LCD Display

Purchase the nMediaPC PRO-LCD-B.  As I write this post, it’s available from newegg.com for US $38 shipped.

Other nmMdiaPC PRO-LCD models may work with these instructions as well, but I only tried them with the PRO-LCD-B.

2. Install the PRO-LCD-B hardware

Power off your PC, and install the PRO-LCD-B in an empty 5 1/4” drive bay. 

The install was fairly easy; the PRO-LCD-B has two connections: One to a standard disk drive power cable from the PC’s internal power supply, and one to a 4-pin USB connection on the motherboard.  My HTPC’s motherboard (a Gigabyte AMD GA-MA785GM-US2H) had several such 4-pin USB leads available on the motherboard, even with all of my case’s front and rear USB ports already hooked up.

(When I powered my PC back on, I *think* I saw some stock/default text on the LCD display, but I’m not 100% sure about this – and I’m not about to voluntarily revert my HTPC to that state at this point just to double-check.) :-)

3. Install the PRO-LCD-B driver software

Download and install the PRO-LCD-B driver software from the nMediaPC website:

http://www.nmediapc.com/LCD/download.htm

I also have a mirrored copy (current as of January 2012) in the event that the file ever becomes unavailable from the nMediaPC site:

http://jonschneider.com/jsblog/CDM20600.zip (1.8 MB)

(Although at this point my next step at this point was to install nMediaPC’s “M-Play Home Center (MHC)” software to drive the LCD display, this turned out to be a dead end, and I recommend you skip it if your goal is to get your LCD display to show the actively-recording Windows Media Center program.  See the “Dead Ends” appendix at the end of this post for more on this.)

4. Install LCDSmartie

LCDSmartie is a free open-source program for Windows that can drive the display of text on LCD display devices, including the PRO-LCD-B.

I downloaded and installed the 5.4.2.92 beta release (dated June 8, 2011).  LCDSmartie downloads are available from here:

http://lcdsmartie.sourceforge.net/smartied.htm

I mirrored the 5.4.2.92 beta release here:

http://jonschneider.com/jsblog/lcd_smartie_v5.4.2.92 Beta.zip (2 MB)

Uncompress the “lcd_smartie_v5.4.2.92 Beta” folder and its contents from that .zip archive.  I put this folder onto the root directory of my C: drive.

5. Install the lisvfd.dll display driver for LCDSmartie

None of the out-of-the-box drivers that come with the LCDSmartie 5.4.2.92 release work with the PRO-LCD-B.  However, there is another driver available on the LCDSmartie site that did work for me: the “L.I.S VFD” display driver.

It’s available on the LCDSmartie SourceForce site from here:

http://downloads.sourceforge.net/lcdsmartie/lisvfd.zip?download

If that link doesn’t work anymore, try looking for it on the LCDSmartie site download page under “Plugins”, or else download my mirrored copy:

http://jonschneider.com/jsblog/lisvfd.zip

After downloading that, place the lisvfd.dll file from the .zip archive into the “displays” folder under your LCDSmartie installation folder.

6. Configure the lisvfd.dll display driver in LCDSmartie

Run LCDSmartie (via the LCDSmartie.exe file in the extracted “lcd_smartie_v5.4.2.92 Beta” folder that you created in step 4 above).

When LCDSmartie comes up, it should show a small window showing the content that it is sending to the LCD display (although nothing will actually appear on the PRO-LCD-B until the steps in this section are completed).  Click the “Setup” button in the lower-left corner of the window to bring up the Setup window.

In the LCDSmartie setup window, in the “LCD Size” dropdown in the Display Size section in the top-right corner, select the “2x20” value (the display size of the PRO-LCD-B).

Next, still in the Display Size section, click the Plugin tab.  In the Display Plugin dropdown, select lisvfd.dll.  (This option will only appear if you copied the lisvfd.dll file into the LCDSmartie “displays” subfolder in the previous step.)

For the next step, you need to know what COM port your PRO-LCD-B is running on.  To determine this:

  • Bring up the Windows 7 “Devices and Printers” screen by opening the Windows Start menu, typing “devices” into the text field, and selecting the “Devices and Printers” option that appears.
  • On the “Devices and Printers” screen, in the “Unspecified” section, look for a device named “FT232R USB UART”.  Right-click on it and select Properties from the context menu.
  • On the Properties window, select the Hardware tab.
  • In the “Device Functions” table that appears, look for an entry like “USB Serial Port (COM4)”, where the “4” might be any number.  Make a note of that number.
  • Close the FT232R properties window and the “Devices and Printers” window.

Then, return to LCDSmartie.  (It doesn’t appear in the Alt+Tab list on my machine, so you may need to select it from the Windows taskbar).  In the LCDSmartie Setup dialog, in the Display Settings section, in the Plugin tab, in the Startup Parameters field, enter “COM4,38400” where “COM4” is the actual COM port value from the Devices and Printers section above.

  • If for whatever reason you couldn’t find the FT232R device in “Devices and Printers”, then an alternative here might just be to try entering different values for the COM port number in this field to see if you can get something to display on the PRO-LCD-B screen.

Once this is done, click OK on the LCDSmartie setup dialog.  You should now see some text from LCDSmartie (a scrolling LCDSmartie logo, and possibly some other information) appear on the PRO-LCD-B screen on your PC!

7. Install the “LCDSmartie dll to display Windows Media Center status”

Once LCDSmartie is successfully configured to display information on the PRO-LCD-B screen, the next step is to get it to display what’s currently recording in Windows Media Center.  A plug-in called “LCDSmartie dll to display Windows Media Center status” by Dave Perrow can be used to do this.

Download the “LCDSmartie dll to display Windows Media Center status” from its website, here:

http://mcedll.codeplex.com/

Or grab my mirrored version (current as of January 2012):

http://jonschneider.com/jsblog/MCE_DLL.zip

Extract the MCE_dll.dll, MCE_dll.cfg, and MCE_dll.ini files to the “plugins” folder under your LCDSmartie installation.

8. Install Windows Media Center TCP/IP Controller

The MCE_dll plugin relies on another piece of open-source for Windows called Windows Media Center TCP/IP Controller (or “TcpIpController”) to function.  TcpIpController publishes a “feed” of what Windows Media Center is currently doing (including what program it’s recording) to a particular TCP port on your PC, where it can be read by MCE_dll.

I installed the “Win7 64 and 32 bit Alpha - button command fix” release of TcpIpController.  (Note: This is not the default release of TcpIpController – I’m not sure whether or not the default release works with MCE_dll.)

Download the “Win7 64 and 32 bit Alpha - button command fix” release of TcpIpController from its codeplex.com website here:

http://vmccontroller.codeplex.com/releases/view/23251

Or get this version from my website:

https://jonschneider.com/jsblog/Setup%20x64.msi

Run the downloaded .msi file, and continue through the prompts to complete the installation wizard.

When the installation finishes, reboot – without a reboot, TcpIpController will not work properly.

9. Configure TV channel names

The MCE_dll plugin will display the name of the channel being recorded, along with the channel number and the name of the program being recorded.  It gets the channel number and program name from Windows Media Center (via the TcpIpStatus plugin), but we need to manually supply the channel names.

To do this, in a text editor, open the MCE_dll.ini file that you previously placed in the “plugins” folder under the LCDSmartie folder, and replace all of the values with the channel numbers and names for your local channels.

(You can skip this step if you happen to live in the same region of Scotland as the MCE_dll author.) :-)

10. Configure LCDSmartie to use the Windows Media Center status (MCE_dll) plugin

Now that we have the MCE_dll plugin and its TcpIpController dependency in place, we need to configure LCDSmartie to use them.

Bring up the LCDSmartie Setup dialog.  In the “Screens settings” section, make sure Screen 1 is selected (set the value of the Screen field to 1), and then replace the values in the two large fields in this section (which represent what LCDSmartie will display on the PRO-LCD-B screen):

Line 1: 

$dll(MCE_dll.dll,1,,)

Line 2:

$dll(MCE_dll.dll,2,,)

An explanation of what these values mean, along with some other values you can play with, can be found on the MCD_dll plugin site.

Finally, click OK.  If your Windows Media Center is actively recording something, you should now see the channel number, channel name, and show name on the PRO-LCD-B display!

The finished product on my HTPC (with the PRO-LCD-B installed just below the DVD drive):

PRO-LCD-B

(The actual LCD display image is far cleaner/sharper than it appears in the photo; my iPod camera refused to take a nice image of it.)

11. Configure LCDSmartie to run at Windows startup

In the LCDSmartie setup dialog, in the Startup/Shutdown tab, click the “Autostart hidden” radio button, then click OK.

Appendix: Dead ends

A couple of the things that I tried that didn’t work:

  • A piece of open-source software for Windows called LCDWriter by “andy vt” says that it will also get an LCD display to display what Windows Media Center is currently recording, among several other functions.  However, I couldn’t get the 64-bit version to successfully display anything to my PRO-LCD-B; and the 32-bit version (which can work with LCDSmartie display plugins via a wrapper dll) gave me a runtime error on my PC every time I tried to run it, so I eventually gave up on getting it to work on my PC.
  • The default PRO-LCD-B display software from nMedia has a lot of cool functions, and it was very easy to install and get initially working, but I was unable to successfully get it to display the recording program in Windows Media Center.  It also seemed to be slightly buggy in other ways (at least for me); for example, after exiting Windows Media Center, the PRO-LCD-B would continue to display “Channel Listing”, for example, instead of reverting back to the default date/time display.

Appendix: Thanks!

Thanks to the authors of LCDSmartie, the lisvfd.dll display driver, the “Windows Media Center status” plugin for LCDSmartie, and the Windows Media Center TCP/IP Controller.  Without all of those open source projects having been developed and made freely available, I wouldn’t have been able to complete this project – or at least, it would have taken me significantly longer to code up a solution myself!

Wednesday, August 31, 2011

Blank screen after Windows logo: Apparent broken video card

I got a call from my wife while I was at work yesterday: There was a problem with our primary home PC, which runs Windows 7.  As the machine was booting, after the BIOS data appeared followed by the graphical Windows 7 “loading” logo on the primary monitor, the primary monitor went into sleep mode (as though it had been unplugged from the PC).  By moving the mouse around, the mouse cursor was visible on the secondary monitor, but clicking it (including right-click) didn't do anything.

Getting home, I saw the problem for myself.  I concluded that the Windows logon screen was being displayed on the primary monitor -- I just couldn't see it because the primary monitor was off.  I was able to log onto the machine blind (by arrowing over to my user profile, hitting Enter to activate it, keying in my password, and hitting enter again to log in).  Once in to Windows, I was able to make my secondary monitor become the primary monitor, via right-click on the desktop, selecting Screen Resolution from the Right-click menu, “rescuing” the Screen Resolution window from the sleeping primary monitor onto the secondary monitor to make it visible, then checking the “Make this my main display” checkbox on the secondary monitor.

I spent pretty much the entire evening troubleshooting the problem.  Here the long list of troubleshooting steps I tried:

Verify both ends of the monitor cable were firmly seated: It was seated properly.

Cold reboot: No change in behavior.

Install the latest video driver (for the video card, an NVidia Geforce 6800 GT): No change in behavior.

Install the latest monitor driver (for the primary monitor, a ViewSonic VX2035wm connected via DVI): No change in behavior.

Uninstall the monitor drivers (and let Windows reinstall them after rebooting): No change in behavior.

Uninstall Microsoft Security Essentials (which I had just recently installed) (on the theory that MSE could somehow be seeing the ViewSonic monitor driver as malware): No change in behavior.  (I reinstalled MSE again afterwards.)

Restore the system to a restore point from a few days prior (when I know the monitor had been working fine): No change in behavior.

Reboot into Windows Safe Mode: This actually did get the logon screen, and then the Windows desktop, to display properly on the primary monitor.  I was even able to increase the screen resolution from the safe mode default (1024x768, I think) back to the native resolution of 1680x1050.  I was not able to use dual-monitor display, though; the Screen Resolution dialog only detected the primary monitor while in Safe Mode.  Rebooting again (back into normal mode) brought me back to square one.

Uninstall the video driver (then reboot): After rebooting, the behavior was similar to safe mode; the primary monitor worked, but not the secondary.  Upon reinstalling the NVidia video driver and rebooting once more, it was again back to square one.

Reseat the video card (with the PC powered off, then boot back up): No change in behavior.

Unplug the secondary monitor (leaving only the primary monitor plugged in) (then reboot): This didn’t help.  I still got, after rebooting, the BIOS information visible, the graphical Windows 7 logo visible, then blank screen / sleeping monitor.

Swap the ports that the two monitors’ DVI cables were plugged into, then reboot: This actually caused me not to get anything display on either monitor.  I changed it back afterward.

Check BIOS settings: I didn’t notice anything unusual, or any settings that I could change that might be likely to fix the problem.  I ended up leaving everything alone.

Finally, after all that, I hit upon a good solution: I replaced the video card.  Specifically, (after powering both machines down and unplugging them, of course), I pulled the GeForce 6800 GT from my primary machine and set it aside; then, I pulled the GeForce GT 430 from my HTPC (leaving that PC with just the motherboard’s onboard audio/video), and installed that card in my primary PC; then I booted the primary PC back up.  After doing that, and letting Windows install the NVidia display driver, both monitors came up with no problem.

So even though I had been pretty convinced initially that I was looking at a software problem, probably a driver problem of some kind (given that the primary monitor worked fine at boot time, and even displayed the graphical windows logo, and also worked fine in Safe Mode), the problem apparently was that my GeForce 6800 GT decided to (partially) fail on me.  It was actually my lovely wife that made the astute observation that the fact that I had been fairly recently running that card at a scorching hot 100+ degrees C probably hadn’t helped matters!

Note that I don’t recommend that anyone else who encounters this issue (and comes across this blog post via a search) run out and spend $$$ to replace your video card as your first option.  In researching this issue online during the course of the troubleshooting, I did run across some reports from others of this same problem (screen goes blank after displaying the Windows logo during boot) who were able to solve their issue by doing one of the other steps that I tried, such as uninstalling and reinstalling video drivers.

For the time being, I’m in good shape with my workaround.  The lower-end but newer GeForce GT 430 is actually almost as good a video card as the original 6800 GT; and the HTPC can play TV and movies fine with the onboard video.  I guess this gives me something to put on my birthday list for my birthday coming up later this year!

Friday, August 26, 2011

Firefox: The case of the corrupted cursor

At work, I recently had the chance to upgrade to a new development laptop PC, a Thinkpad T520 running Windows 7.  The machine is excellent, with one weird exception: In Firefox (and only in Firefox), when keying in text into a text entry field in a web page or into the browser address bar, the caret (i.e. the text entry cursor) would sometimes appear to be “distorted” or “corrupted” – that is, some “garbage” pixels would appear around the caret whenever I moved it (either by typing in a character, or by using the arrow keys). 

Problem Details

The problem is hard to explain, so here’s a screen capture of a particularly severe example that occurred when I was entering text into a textarea.  The caret in this cropped screen shot is between the “2” and “5” in “8/25/2011”; note all the other weird stray black and white marks in the text.  (I added the red oval to the screen capture to show the area in which the “corruption” was appearing.

firefox caret garbage - crop

After waiting a little less than a second without moving the caret, the problem would go away – the “corruption” would disappear from the display.  However, the problem would come right back upon moving the caret again.

The caret itself would also sometimes not appear until the “corruption” went away, which made text editing surprisingly difficult – a frustrating problem.

Investigation

The problem would only occur in Firefox, not in other browsers such as Internet Explorer 9, or in any other applications I tried (such as Eclipse, Word, and Notepad).

Experimenting, I found that the problem would not occur when Firefox was started in Safe Mode (via Firefox menu | Help menu | Restart with Add-ons Disabled).  However, I tried running Firefox in normal mode with all extensions and add-ons manually disabled, and that didn’t help.  I tried setting up a new Firefox user profile, and that didn’t help either.

I also noticed that beyond the issues with the caret, the actual rendering/shape of letter character glyphs being typed into Firefox was affected.  The  characters themselves appeared “wrong” when Firefox was running in normal mode, but they appeared normally with Firefox in safe mode.  Here are two cropped screen shots I took of a bunch of “f” characters being entered in to the address bar, the first in normal mode, the latter in safe mode:

firefox address bar standard

firefox address bar safe mode

Here’s a zoomed-in view (again, normal mode first, then safe mode):

ffff_normal_zoom

ffff_safemode_zoom

Note that in the former image (Firefox normal mode), the “f” glyphs do not appear the same as one another and have some faint red/yellow/blue/green aliasing (blurring), whereas in the latter screen capture (Firefox safe mode) each “f” glyph is identical and has no aliasing (look at the unzoomed image).

At this point I was suspicious of some kind of issue with my video card.  The normal first course of action with a suspected video card behavior issue would be to update video card drivers.  When I checked, though, I found that I was already running the latest drivers for my video card (an NVidia NVS 4200M).

Google was initially no help; all the searches that I tried for terms like “firefox cursor corruption” or “firefox caret appearance” resulted in pages talking about the Firefox caret navigation feature (F7 key), which was not the issue here.

Solution

I hit upon the solution when I changed angles of attack and Googled for “firefox safe mode”.  The first result was a Firefox help article describing safe mode, which linked to a Mozillazine knowledge base article with more details on Firefox safe mode. That article in turn had a list of about a dozen bug repots related to safe mode, one of which was Bug 591139 - Disable hardware acceleration in safe mode. Aha – that sounded like a video-related issue!  Reading through that ticket, I learned that starting in Firefox 4, a feature called “hardware acceleration” (with which I was previously unfamiliar) is disabled when Firefox is in safe mode.

Hitting up Google once more, this time for “firefox disable hardware acceleration,” I was led to a setting in the Firefox options menu: Firefox menu | Options | Advanced | General tab | Use hardware acceleration when available

I unchecked that setting, restarted Firefox, and that did it – the problems with the caret corruption/garbage and the malformed character glyphs no longer occurred!

So apparently Firefox has an on-by-default feature where it uses hardware acceleration, presumably from the local PC’s video card, further presumably to improve its performance and/or ease load on the primary CPU.  However, having disabled this setting, I haven’t noticed any appreciable difference in performance.

I don’t know who is to blame for this issue – bad video driver, bad video hardware, Firefox itself, some combination of those, or something else entirely – but for the time being, I’m just satisfied that the issue is resolved for me!

I hope this saves some frustration and/or troubleshooting time for anyone else experiencing this odd issue!

Wednesday, August 03, 2011

Key Jammin’, Circa 1950!

While helping my Mom clean out her basement in preparation for a move recently, I came across the apparent answer to the mystery of why some older fixed-width fonts confusingly feature “1” (numeral one) and “l” (lowercase letter L) glyphs that are identical:

royalTypewriter

(Hint: Look to the left of the “2” key!  Anything missing there?)

Monday, July 18, 2011

PathFind.exe 2.0.1 released

I just posted a point release of PathFind, my Windows command-line utility which finds files located on the PATH (similar to the Unix/Linux which utility).

This is a general maintenance release which fixes a minor bug where a spurious error message would be displayed when the PATH environment variable included an extra trailing “;” character.  The utility’s output is also improved when multiple matching files and/or folders are found, including a display of total matches found.

Download it from my utilities page, or directly from here: PathFind.exe 2.0.1 (6k)