But it works on my PC!

The random thoughts of Richard Fennell on technology and software development

More experiences upgrading my Media Center to receive Freeview HD

In my post experiences upgrading my Media Center to receive Freeview HD I said I thought the reason my Windows 7 Media Center was hanging at the "TV signal configuration” step was down to using mixed tuner cards. Well my second PCTV nanoStick T2.arrived yesterday so I was able to try the same process with a pair of identical USB T2 tuners.

Guess what? I got the same problem!

However, being USB devices it mean I could test the tuners on my laptop, a Lenovo W520 (Core i7, 16Gb, Windows 7). So I plugged them both in, they found drivers from the web automatically, I ran Media Center, select setup the TV signal and……. it worked! A few worrying pauses here and there, but it got there in about an hour.

So why did it work on a laptop and not on my Media Center PC?

I considered performance, but it seemed unlikely,the Media Center is aCore2 Duo based system about 3 years old and has had no performance problems to date. So the only difference was that the laptop had never seen a TV Tuner before, the Media Center had.

Unused drivers

So I wondered if the old Hauppauge drivers were causing the problem. Remember in Windows if you removed an adaptor card then the drivers are not removed automatically. If  the driver was automatically added (as opposed to you running a setup.exe) then there is no obvious way to removed the drivers. The way to do it as detailed in this Microsoft Answers post. When you load device manager this way you see the Hauppauge devices and you can uninstall their drivers.

And it makes no difference to the problem.

Media Center Guide Data and Tuner setup

Using task manager I could see that when Media Center TV setup appeared to hang the mcupdate.exe program was running and using a lot of CPU. I had seen this on the Lenovo, but it has passed within 30 seconds or so, on my 3 years old Intel based Media Center PC I would expect it to be a bit slower, but I left it overnight and it did not move on. So it is not just performance.

The mcupdate.exe is the tools that updates the TV guide data for Media Center. It is run on a regular basis and also during the setup. So it seems the issue as far as I can see that

  1. There is corrupt guide data so that it cannot update the channel guide
  2. There is data about a non-existent tuner that locks the process
  3. There is just too much data to update in the time allows (but you would expect leaving it overnight would fix this)
  4. There is an internet problems getting the guide (which I doubt, too much of a coincidence it happens only when I upgrade a tuner)

Simply put I think when the TV setup gets to the point it needs to access this data, it gets into a race condition with the mcupdate.exe process which is trying to update the guide.

The Hack7MC blog post seems to suggest the problem is that the guide data and tuner setup needs to be cleared down and provides a process. post suggest the problem can be addressed by cleared down the data; it provides a process to do this. However I though I would try to avoid this as I did not want really to loose the series recording settings I had if I could avoid it.

So I loaded Media Center and select update guide from the Task menu. This started the mcupdate process and  caused a 50% CPU load, and showed no sign of stopping. Again pointing to a probably one of the issues listed above. So I unloaded Media Center, but mcupdate.exe was still running as was the tool tray notification application. Again I left this a while to no effect. So I used task manager to kill mcupdate and the ectray.exe application.

I had at this point intend to run the process from the Hack7MC post, so stopped all Media Center services, but thought i would give the setup one more try. When I ran the setup TV dsignal I got a message along the lines of ‘guide data corrupt will reload’ and then the setup proceeded exactly as it should have done in the first place. I ended up will all my channels  both HD and non-HD accessible from both tuner, and all my series recording settings intact.

So a success, I am still not clear which step fixed the issue, but I am sure it was down to needing to clear down the guide data and tuner setting fully.

Bitlocker keeps asking for my recovery key after a change in my disk’s MBR

My development laptop is bitlocker’ed, and yours should be too. It provides a great and non-invasive way (assuming you have a TPM chip) to protect you and your clients data on a machine that is far to easy to steal or loose. However, whilst fiddling with Windows 8 I did trip myself up.

I have my PC setup for a boot to Windows 7 from a bitlocker’ed drive C with a non bitlocker’d drive D used to boot to Windows 2008 for demos (and hence no production data). To try out Windows 8 I added a new boot device, a boot from VHD partition. This edited the PC’s master boot record (MBR) and bitlocker did not like it. It thought the PC had a root kit or something similar to prompted me to enter a my bitlocker recovery key (which is 48 characters long) when I tried to boot to Windows 7. However, once this is done my bitlocker’ed Windows 7 partition worked find, but on each reboot I had to type the key in, bit of  pain. Removing the new VHD boot entry did not help, the MBR has still be edited, so bitlocker complained

The solution was actually easy, but took me a while to find as it does not seem to be clear in any documentation or via a search.

When the WIndows7 partition is booted open the control panel, select the bitlocker option and then suspend bitlocker, then restart it

image

This has the effect of telling the bitlocker system that you are accepting the current hardware/MBR setting are correct. After this the PC boots as expected

If I were being more sensible I would suspend bitlocker prior to any fiddling about with Windows 8 – but the bits from Build was just too tempting……….

VHD boot and c00002e2 Errors

For some reason that is beyond me now I did not setup my Lab Manager test system to be a VHD boot. So before installing the 2010 RC version I decided to P2V this system (on the same hardware) to make backups easier whilst testing. All seemed to go well

  1. I used IMAGEX to create a WIM of the disk
  2. Created an empty VHD
  3. Used IMAGEX to apply the WIM to the VHD
  4. Formatted the PC with a default Windows 7 install
  5. Added a VHD boot Windows Server 2008R2 to the PC, tested this all booted OK
  6. Replaced the test VHD with my own and rebooted

…. and it just went into a reboot cycle. Pressing F8 and stopping the reboot on error I saw I had a “c00002e2 Directory Services could not start” error. I managed to get into the PC by pressing F8 and using the AD recovery mode (safe mode did not work). After much fiddling around I eventually noticed that my boot drive was drive D: not C: as I would have expected. My VHD and parent drive had reversed letter assignments. So when the AD services tried to start they look on the parent Windows 7 partition (C:) for their data and hence failed.

I think the root cause was the way I had attached the empty VHD to used IMAGEX. I had not done it using WINPE, but just created in my Windows 7 instance and attached the VHD as drive D: before copying on the WIM

So my revised method was

  1. I used IMAGEX to create a WIM of the disk (actually used the one I already had as there was nothing wrong with it, which was a good job as I had formatted the disk)
  2. Formatted the PC with a default Windows 7 install
  3. Added a VHD boot Windows Server 2008R2 to the PC, tested this all booted OK
  4. Copied my WIM file to the same directory as my newly created W2k8R2.VHD
  5. Copied IMAGEX to this directory
  6. Booted of a Win7 DVD
  7. Pressed Shift F10 to get a prompt at the first opportunity
    1. Ran DISKPART
    2. Select Disk 1
    3. Select Part 1
    4. Detail Part – this was the 100Mb system partition Windows 7 creates and was assigned as drive C: (note when you boots Windows 7 the drive letters get reassigned just to confuse you, as to look at this you would expect your Windows 7 boot drive to be D:)
    5. Assign Letter = Q – this set the system partition to be drive Q, but any unused letter would do
    6. Select vdisk file:d:\vhd\w2k8r2.vhd
    7. attach vdisk – this loaded the VHD and assigned it the letter C: as this was now not in use
    8. list disk
    9. Select disk 2
    10. Select Part 1
    11. detail Part – checked the drive letter was correct
    12. I then exited DISKPART and from the same command prompt ran IMAGEX to put the WIM on this new drive C:
  8. Rebooted and it worked

So the technical tip is make sure your drive letter assignments are what you think they are, it may not be as obvious as you expect.

Windows 7 Boot from VHD

I have been having a play with the boot from VHD functions in Windows 7, it seems like a really useful feature when you need the raw power of your PC, but would like the ease of management of Virtual PCs (i.e. can copy them around and archive them), There are many posts on the steps that are required to add a boot from VHD partition  to an existing standard install (remember the VHD must be for a Windows 7 or Windows 2008 R2 operating system), I followed notes on knom’s developer corner. Just a couple of things that got me:

  • The notes say to press Shift F10 to open the console and enter the DISKPART commands to create and mount the new VHD. This is fine, but I then closed the window to continue, this is wrong. In step 6 the notes do say to Alt Tab back to the installer and this is vital. If you close the command window, as I did, the new VDISK is dismounted so you cannot install to it.
  • After the install I could dual boot, I had a ‘real’ Windows 7 install and my ‘boot from VHD’ install. The boot manager showed both in the menu, but they both had the same name ‘Windows 7’, only trial and error showed me which was which. Also my new VHD boot was the default. All a bit confusing and not what I was after. As I find the command line to BCDEDIT not the friendliest for editing the boot setting I tried to use EasyBCD to edit one of the name to ‘Windows 7 VHD’ and alter the default to my original installation. This caused me to end up with two boot options that both pointed to the ‘real’ installation. My guess is that EasyBCD does not understand VHD boot on Windows 7. I therefore had to use the manual command as listed on TechEd. Once this was done all was OK

The next step is to try a VHD boot from an external USB or eSATA disk.

Update on Media Center on Windows 7

Since the upgrade of my Media Center PC to Windows 7 I have had a few problems with fast forward on recorded TV and DVDs (which I had not seen on Vista). It was as if the fast forward button on my remote got jammed on and I could not go back to standard playback easily, it took a few seconds for the message to get through, then you ended up back where you started.

I decided it was probably a CPUprocessing speed issue, so upgrade my 3 year old AMD/ASUS single core motherboard to a current entry level dual core system, a MSI motherboard and Intel E5300 Dual Core (the brand choice was just down to what was cheap and in stock at my local supplier). This fixed the issue completely, but did require a reinstall of Windows 7, as the Intel Dual Core needed a different HAL to the AMD single core. However the reinstall was not a major issue as I run a dedicated PC as a Media Center and it is practically a default installation,

Red button works in the BBC Interactive

Cool, I just noticed that on Windows 7 Media Center with a Hauppauge Nova 500 T Tuner card the red button works; so at last I can get Digital Teletext and interactive channels on the BBC without having to know their actual channel numbers (and as I remember they were actually ignored by previous versions of Media Center without a registry hack anyway).

This makes using MCE just like a standard Digital TV – should help general acceptance. This has certainly improved since the older versions.

Upgrading my Media Center to Windows 7

Over the past couple of days I have upgraded my Vista based Media Center to Windows 7. After my previous experiences upgrading from XP herehere  and here I decided to do a new install onto a new 1Tb disk as opposed to an in place upgrade. This all went OK, there was nothing major to note, Windows 7 shipped with a driver for everything in my 3 year old AMD/ASUS based PC bar the sound card built into my motherboard, but that was easily downloaded. It is worth commenting that my Hauppauge Nova 500 T digital TV turner was found OK, but I had to get it to scan for channels three times before it got a signal. Why it worked the third time I don’t know as I did not change anything.

The problems I had were when I wanted to copy on media (photos, music and TV recordings) from my old hard disks. The first problem was when I connected them (using external USB cases, one was SATA the other PATA) to a Windows 7 laptop they were not seen. The physical disks were detected but the partitions were not present. When I tried them on a Vista box at work the partitions were seen but marked as foreign when I looked in the administrator disk management tool. Once I selected the ‘import foreign disks’ option they both appeared OK as drives on the Vista box (at this point I copied the files to a network location as a backup, that took a while!). I then tried the disks again on another Windows 7 box and another Vista box, in both cases it now said the drives were dynamic and corrupt. However back on the working Vista box they were both still OK. I was now confused. However, as I now had a backup of the data, on the second Vista box I tried to convert this corrupt dynamic disk to a basic disk, this ‘worked’ but the ‘corrupt’ partition disappeared. When I tried to quick format that failed too, but a full format worked, but seemed slow (a couple of hours for 300Gb). Now once this disk was formatted it could be read and used on all the Vista and Windows 7 boxes. I copied the data back from my network share backup and used the fixed external UBS drive to move the files back onto my new Media Center at home.

Sorry I don’t have a better solution to the disk issues than a format. I have no idea what was gong on there, but I now have a fully working Windows 7 Media Center with all my old media on it. Probably not a quick as an in place upgrade, but I know it is a nice clean install. First impression of the RTM version of Windows 7 Media Center is that it is fast and  the interface clean. We shall see how it is to live with it.

Licensing exception with Ivonna the Typemock add-in (and any other add-ins I suspect)

Like a good developer I have been trying to run Visual Studio with least privilege; with Windows 7 this seems to work well. My main account is not an administrator, but Windows prompts me for elevated rights when needed. I have been developing happily with Visual Studio and Typemock without any need for extra rights.

However, when I have been doing some testing using Ivonna, the Typemock add-in, I hit a problem. When I tried to create an Ivonna.Framework.TestSession() I got a Licensing.LicenseException: This copy has expired. Which it hadn’t as I have a fully licensed product.

I had got so use to not needing elevated privilege I did not consider it to be the problem; so I contacted Sm-Art and Typemock support. The answer was simply to run Visual Studio with administrator privileges (right click on the short cut). Once this is done the licensing exception goes away as Typemock has enough rights to look in the right bit of the registry to access the add-in license. I have suggested that if possible this requirement needs to be addressed.

The other alternative is to grant your non administrator account more rights in the registry. On a 64bit development box it seems you need to a Read-Write access to HKEY_LOCAL_MACHINE\SOFTWARE\TypeMock and HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\TypeMock