Don't reuse "card" handlers. In device redetection scenarios this doesn't work so well in practice. Better to dispose the handler and start fresh with a new handler.
Tweaks to UPnP device detection:
1. Start UPnP device detection after BDA/WDM device detection. I was seeing a strange issue in a VM environment where inserting the Prime clear QAM proxy filters seems to have been blocking reception of HTTP/SSDP packets. This caused device detection to be delayed until the Prime NOTIFY packet cycle rolled around.
2. Apply the device detection delay when the system triggers OnSystemDeviceConnectedOrDisconnected(). I was seeing strange circumstances where TV Server seemed to be blocking the system from properly detecting devices. Hopefully the possibility to delay detection here should fix this.
Remove the MS NP from the graph after using it for detecting tuner type. Otherwise you end up with released COM objects left in the graph - bad!