Hyper-V Discrete Device Assignment (DDA) with a TV Tuner (Hauppauge HVR-4400)

System Requirements:

  • Windows Server 2016
  • Hauppauge HVR-4400 PCIe Tuner

The Problem:

I am a DVBLink user. DVBLink does not play nicely with Windows Service and consequently it wants to run on a client OS. This means that I have lots of server hardware running server Operating Systems and one device with 4 TV Tuners in it running Windows 10.

With the release of Windows Server 2016 came the promise of VMWare like PCIe Pass-through, allowing physical devices on the PCI bus to be attached to VMs. The plan is to attach the PCIe TV Tuner and attempt to get DVBLink working in a VM so that the physical unit can be decommissioned (saving the power bill).

More Info

As part of the process, I was considering building a new server at the start of 2017 to perform a consolidation against. The Windows 10 DVBLink machine would be one consolidated devices onto more powerful modern hardware. I would also need new TV Tuners as only 2 of the 4 in the DVBLink TV Server is PCIe, the rest are PCI. Again, there are opportunities to consolidate that into fewer PCIe devices too.

The driver for the new server was Hyper-V PCIe Pass-through, or “Discrete Device Assignment” (DDA) as Microsoft are calling it. It is however quite difficult to find out whether BIOS firmware supports the proper implementations of I/O-MMU VT-d to permit it, making the purchase a risk. Equally, there is no guarantee that DDA will work with a TV Tuner.

Consequently, I decided to borrow a dual CPU Dell PowerEdge R630 to perform the experiment as there were several reports on-line that the R6xx and R7xx have the proper VT-d and SR-IOV feature set for this type of activity. Well done Dell (why don’t you advertise this?!).

After updating firmware, adding the TV Tuner and installing Windows Hyper-V Server 2016 on the machine, the first step was to – as an experiment – attempt to install the TV Tuner drivers on Windows Server 2016 (which errored). After that it was time to run the DDA Survey Script from Microsoft.

Download: DDA Survey Script (GitHub)

 

This was promising. The script found two devices that it stated were capable of being used with DDA

PERC H730 Mini
Express Endpoint -- more secure.
And its interrupts are message-based, assignment can work.
PCIROOT(0)#PCI(0100)#PCI(0000)

and

Hauppauge WinTV HVR-4400 (Model 121xxx, Hybrid DVB-T/S2, IR)
Express Endpoint -- more secure.
And it has no interrupts at all -- assignment can work.
PCIROOT(0)#PCI(0200)#PCI(0000)

The next step was to dismount the device from the Hypervisor and make it available to Hyper-V

# Find the HVR-4400
$pnpdevs = Get-PnpDevice -PresentOnly | Where-Object {$_.Class -eq "Media"} | Where-Object {$_.Service -eq "HCW85BDA"}# ... or if you know the hardware ID
$pnpdevs = Get-PnpDevice -PresentOnly | Where-Object {$_.InstanceId -eq "PCI\VEN_14F1&DEV_888
0&SUBSYS_C1080070&REV_04\4&39CDA168&0&0010"}foreach ($pnpdev in $pnpdevs) {
Disable-PnpDevice -InstanceId $pnpdev.InstanceId -Confirm:$false
Write-Host 'Device ' $pnpdev.InstanceId ' Disabled. NOTE: If this hangs, reboot and try again'
$instanceId = $pnpdev.InstanceId
$locationpath = ($pnpdev | get-pnpdeviceproperty DEVPKEY_Device_LocationPaths).data[0]
Write-Host 'Dismounting Device At: ' $locationpath ' (' $instanceId ')'
Dismount-VmHostAssignableDevice -locationpath $locationpath
Write-Host $locationpath
}

Initially, it hung PowerShell (and the system) so I had to hard reset the server. In this instance it was in fact necessary to reboot after issuing

Disable-PnpDevice

After trying again and rebooting the Dismount-VmHostAssignableDevice failed with

dismount-vmhostassignabledevice : The operation failed.
The manufacturer of this device has not supplied any directives for securing this device while exposing it to a
virtual machine. The device should only be exposed to trusted virtual machines.
This device is not supported when passed through to a virtual machine.
The operation failed.
The manufacturer of this device has not supplied any directives for securing this device while exposing it to a
virtual machine. The device should only be exposed to trusted virtual machines.
This device is not supported and has not been tested when passed through to a virtual machine. It may or may not
function. The system as a whole may become unstable. The device should only be exposed to trusted virtual machines.
At line:1 char:1

It would not proceed past this point. The trick was to change the line to

Dismount-VmHostAssignableDevice -locationpath $locationpath -Force

The next step was to ensure that the VM’s Automatic Stop Action was set to anything other than “Save”

Set-VM -Name “10-TEST” -AutomaticStopAction Shutdown

… and at this point it was simply a case of creating a VM and assigning the device

Add-VMAssignableDevice -LocationPath “$locationpath” -VMName “10-Test”

At which point the device immediately popped up in Device Manager under Windows 10 in the Generation 2 VM

DDA PCIe Passthrough in Device Manager

…. before the VM blue screened a few seconds later.

Blue Screen of Death

I tried to use several versions of the HVR-4400 driver that I could find and it made no difference. The VM would crash whenever it attempted to talk to the card. The Hypervisor itself did not seem to be impacted by the Blue Screen event and itself did not crash.

I also tried fully removing the device from the Hypervisor using DEVCON and clearing out the driver using pnputil. Superficially, this action made it worse as the VM wouldn’t boot at all now if it had a driver on-file for the TV Tuner. Before it would at least boot.

So this project was a failure and I will not be investing in new server hardware just yet. I’ll wait to see if Microsoft improve the feature set as allegedly this type of insanity (and yes, it is insane) is possible in VMWare. I do not want to change away from Hyper-V at the current time though, so I will have to stick with a client machine as a service.

This does not mean of course that this cannot work in Hyper-V. The HVR-4400 is a card from 2011/2012. So it is not exactly new hardware. PCIe TV Tuners designed to modern electrical standards and for use on PCIe 3.0 bus architectures may provide better interoperability out of the box. I just don’t have any other cards to test with and am in a bit of a chicken and egg situation over wanting to invest in new cards and servers unless I know they will work nicely together.

If you are interested in this too and would like me to have a go testing your hardware, please get in touch via HPC:Factor.

Performing WUSU 3.0 database maintenance (database re-indexing) via WsusDBMaintenance under Windows Server 2008

System Requirements:

  • Windows Software Update Services 3.0
  • Windows Server 2008, 2008 R2

The Problem:

Microsoft recommend that you perform monthly maintenance on your WSUS database to keep it in good order. The following pages represent the instruction for undertaking this activity

This document simply seeks to clarify the process when using Windows Internal Database (instead of SQL Server) under Windows Server 2008/R2.

The Fix

The following summarises the steps involved in the process.

  1. Install the SQL Server Native Client for your processor on the WSUS server
  2. Install the SQLCmd utility for your processor on the WSUS server
  3. Copy & Paste the T-SQL code from Re-index the WSUS 3.0 Database into a notepad file and save it on c:\ as WsusDBMaintenance.sql (or download here)

If you wish to automate or schedule the task:

  1. Create a .cmd file on your desktop
  2. Enter the following into it
"c:\Program Files\Microsoft SQL Server\90\Tools\Binn\sqlcmd.exe" -I -i"c:\WsusDbMaintenance.sql" -S "np:\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query"
  1. Note that the version of the SQL Server SQLCmd that you install will need to be reflected in the version number (90 above). 90 = SQL Server 2005, 100 = SQL Server 2008 and so on.
  2. Right click the .cmd file and select “Run as Administrator” to launch it through an elevated command prompt
  3. If you setup a scheduled task for this, remember to set the always run with full permissions option.

If you just want to run it once:

  1. Open an elevated command prompt
  2. Enter the command:
"c:\Program Files\Microsoft SQL Server\90\Tools\Binn\sqlcmd.exe" -I -i"c:\WsusDbMaintenance.sql" -S "np:\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query"
  1. Note that the version of the SQL Server SQLCmd that you install will need to be reflected in the version number (90 above). 90 = SQL Server 2005, 100 = SQL Server 2008 and so on.

Cannot install the integrated audio AC97′ hardware from a Asus P4S333 or P4S533 under Windows Vista

System Requirements:

  • Windows Vista SP1
  • Windows Server 2008

The Problem:

So, you get fed-up of trying to get PCI sound cards working under Vista and opted for the integrated sound CPU clogging solution?! I don’t blame you.

The P4S333 may be old kit, but it’s a solid motherboard, very much Vista capable with the right upper end P4 and enough RAM, particularly if you flashed the P4S333 with the P4S533’s BIOS to make use of the 533 MHz FSB. The difficulty we have is however in that the C-Media CMI8738 AC97′ chip that the board uses cannot be matched to any of Windows Updates hardware ID’s and Asus, naturally, do not offer a Vista driver.

More Information:

Thankfully, C-Media do provide generic drivers, and there is a January 2009 driver release for the CMI8738 as of writing. The driver does work once you get it out of the RAR file, however:

  1. The driver does not have the necessary hardware ID to install automatically against the customised chip on the P4S333 / P4S533
  2. The driver is not digitally signed

Despite that, I’ve not seen any problems with it, and despite the CPU connotations, it got rid of irritating buzzing that the Creative Labs Sound Blaster Live! 5.1 was causing with the useless Vista driver set.

The Fix

Very simply, you need to manually install the driver.

  1. Download the latest CMI8738 driver from C-Media (http://www.cmedia.com.tw/). As of writing the driver version was 8.17.33 and it worked a treat
  2. Deflate the RAR into the file system
  3. Open the Control Panel
  4. Open the Device Manager
  5. Find the uninstalled multimedia device in the Other Devices section, right click, Update Driver Software
  6. Click Browse my computer for driver software
  7. Click let me pick from a list of device drivers on my computer
  8. Hit the have disk button
  9. Browse to the path that you inflated the RAR file to, for example if you inflated the RAR file to c:\temp\ you want to browse to the following location:
    c:\temp\PCI-8738-090109-8.17.33(Vista3264-RC-01)\SoftwareDriver\driverNote that if the driver version you are using is newer, then the version in the file name will clearly be different. Ultimately however you are looking to point to the SoftwareDriver\driver folder (there are several INF’s and some CAT files in here)
  10. In the manufacturer list from the available select:
    C-Media
  11. From the Model list select:
    C-Media PCI Audio Device
  12. Click Next
  13. Windows will notify you that the driver has not been digitally signed. You’re going to have to tough this one out I’m afraid and install it.
  14. At that point the audio should just start working.

How to install Windows Media Player 11 with Media Sharing on Windows Server 2003 / R2

System Requirements:

  • Windows Server 2003 SP2
  • Windows Server 2003 R2 SP2

The Problem:

Windows Server 2003 ships with Windows Media Player version 10.0, and this version is maintained and services through Service Packs for Windows Server 2003.

The version of Media Player that ships with 2003 does not include Media Sharing support for distributing central Media Library databases to network clients. Unfortunately, with Microsoft’s decision to not to release Windows Media Player 11 for Server 2003 and not to include media library sharing in their 2008 platform, a minority of users (myself included) who use Server 2003 as a home server platform are forced to find other ways of centrally distributing media or to use an XP license, hardware (VM) and additional electricity to service WMP11 clients.

Prerequisites:

This article specifically discusses and assumes the following:

  • Windows Server 2003 / 2003 R2 SP2
  • Windows Media Player 11 – 11.0.5721.5145 (wmp11-windowsxp-x86-enu.exe published 1/15/2007)

Please Note: If the Windows Media Player 11 build is updated in the Microsoft Download Centre then the Service Pack 2 component of this article may no longer apply.

More Information:

Microsoft have made a conscious decision not to include Windows Media Player 11 in 2003, presumably as an added incentive to upgrade to Server 2008. However even Server 2008 fails to integrate the Media Library sharing components of WMP11 as Microsoft view the feature as not being of intrinsic use in corporate situations.

While Microsoft aren’t wrong here, and they (now) offer the Windows Home Server platform with this support, it isn’t something that I personally wish to look towards using having built a Server solution at home rom NT 4.0 onwards. As I have a domain environment at home and having a server infrastructure I have no desire to add a Windows XP system “server” into the mix just to support media sharing or to purchase Home Server.

As usual I have to wonder what goes through the heads of Microsoft development from time to time. For the sake of the 792 KB of entirely optional DLL files that are required to implement this – DLL’s that are being serviced anyway in the XP/XP64 (which is 2003 Server) and in Vista. You would have thought that adding it as an optional module wouldn’t be an unreasonable thought, however I digress.

The XP/Server 2003 code base is identical and as such the binary versions of WMP11 for Windows XP will run on Server 2003, unofficially.

This article outlines how to install Windows Media Player 11 and the system services necessary for Media Sharing using my nearly fully automated installation process.

Installing Windows Media Player 11 with SSDP & UPnP

This guide outlines how to install WMP11 on Server 2003. The process of getting Windows Media Player 11 onto Server 2003 is fairly simple, and I did start to investigate how to get the services working myself. While searching on Google for a fix for an error message I stumbled upon someone else’s fix for the services. So, not wanting to reinvent the wheel I abandoned my research and have used their process in my automation tool for installing the services for media sharing.

Credit for the process discovery for the system services goes to steven2004 of neowin.net.

If you need the User Mode Driver Framework for mobile device connectivity (e.g. Android), download version 1.0.2 (with thanks to kevin551 from Neowin for the variable tip) if you do not, use version 1.0.1. If you want to replace the default version of UMDF with the newer 1.9 release, see this page.

Please Note:

  1. This is not supported by Microsoft Corporation, Microsoft will not (and should not) be expected to support this
  2. After installing this on a server, Windows/Microsoft Update will no longer track updates for Windows Media Components, you will be responsible for doing this yourself
  3. Do not roll this out in a production environment, it’s one thing to do it on a box at home, quite another to do it in an enterprise environment; so for the sake of arguments, just don’t.

Download: Automatic Installer 1.0.1 (354 KB)
Download: Automatic Installer 1.0.2 (354 KB)

 

  1. Download my automatic installer
  2. Extract the installer files into a directory on your computer
  3. Download wmp11-windowsxp-x86-enu.exe into the SAME directory that you extracted my automated installer
  4. Run INSTALL.cmd
  5. The installer will stop with the following message on the screen:
  6. Open c:\wmp11\1\update\
  7. Right click update.exe
  8. Click properties
  9. Open the Compatibility Tab
  10. Check the box next to “Run this program in compatibility mode for:” and select Windows XP from the drop menu
  11. Click OK
  12. Repeat from step 7 for the version of update.exe found in C:\wmp11\2\update\
  13. Return to the INSTALL.cmd window and press any key to continue with the installation process
  14. Select the UPnP service when prompted by the wizard and click next. If prompted for a file path select c:\wmp11
  15. Finish the Wizard
  16. Restart your Server
  17. You will now be able to start and configure the SSDP and UPnP Services

Note: This process does not patch the WMP11 installation. You will no longer received Windows Media Player updates from Windows/Microsoft Update and will need to apply these patches manually.

If you do not have Windows Media Player 11 on your start menu at this point then you either:

  1. Failed to copy the wmp11-windowsxp-x86-enu.exe to the correct location
  2. You failed to set the update.exe files to Windows XP compatibility mode

Note: It has been suggested in some areas that you can edit the update.inf to change the require Operating System version information. If you do this, the CheckSum verification will fail at the beginning of the installation and WMP11 will not be installed. All Windows XP QFE files are digitally signed and therefore will fail to install if the hash check fails.

Updates

11/02/2013 – Added information on installing UMDF and version 1.0.2 of the install script.