RDP Session with Full Working Media Center by Random

Aug 4, 2011 at 2:56 PM

Hi

today I observed an Interesting behavior. I have an open RDP Session from Win 7 SP1 to Win7 SP1 with a full working Media Center incl. Animations and Video/Live TV.

I made a Video of it and try to keep the System to this State as long as possible. So if its interesting for one of the Softsled Developers , you more than welcome to check out the system.

Please contact me over this thread.

DanB
#

Coordinator
Aug 4, 2011 at 2:59 PM

I'm very interested by this! We stopped the original implementation due to legal issues regarding DRM.

Any chance you could put up the video on youtube or something? :)

Aug 4, 2011 at 3:49 PM
Edited Aug 4, 2011 at 3:53 PM

i have send the video link to yman235. actually the video is also showing my dev machine and maybe some stuff that is not ready for the public. (NDA)

so let’s see what  yman235 thinks about the video and if he want to access the system. ;-)

Coordinator
Aug 4, 2011 at 4:58 PM

I would be interested in hearing what you have to say about it, yman235.  I assume this is using the RemoteFX functionality.  Here is a link to some talk about it... http://www.avsforum.com/avs-vb/showthread.php?t=1318195

Aug 4, 2011 at 5:08 PM

Native RemoteFX functionality requires Windows Server 2008 R2 SP1 as host . In this Case its only W7 SP1 (RDP ) to the MC Host in Windows 7 Embedded Standard SP1 both on real HW.
In this network are no servers other than only 1x WHS V1.

I didn’t hear from yman325 yet, I hope he is messaging soon, I still have the connection open.

Coordinator
Aug 4, 2011 at 5:42 PM

I had a look at the video - very interesting.

I'm trying to work out how this is even possible. RemoteFX as Dan mentions is only possible from Server 08 R2 (plus high end graphics card). Even then it only works from the console session.

I remember reading that Microsoft was going to bring DirectX RDP redirection. However it was only ever targeted for DirectX 10 (MC is 9 I think) and the functionality/support was canned in the end. However it looks like MC is rendering through some sort of DirectX redirection. On non-embedded Windows Media Center decides which rendering path to use on start up. It'll either use GDI (for normal RDP), Xenon (when rendering to the Xbox 360) or DirectX9 when connected to the console. I'm intrigued to work out how this is happening. Surely if this was default out-of-the-box behaviour other users of MC Embedded would have discovered this?

Aug 4, 2011 at 5:49 PM

yes, the out-of-the-box behavior is the same as on Retail W7. i use this RDP connection every day the same way.
i also didn’t change anything on the system the last days. i guess it was a timing issue. waking up from S3 and RDP into it.

I may have to leave the house for an hour. I don’t know if I can keep the system till tomorrow.

Are there any steps I can do for you, or should we work out a time, where you can log in with Teamviewer ?

Coordinator
Aug 4, 2011 at 5:53 PM

 

Interesting that it's the (default) same as retail. You are probably right that it's some sort of strange timing issue. If we can pinpoint it I can write a hooker application to trick Media Center :)

 

Any time which is suitable for you and I can try Teamviewer

Aug 4, 2011 at 5:57 PM

yes, lets get a hooker app ;-)
ok, I will leave now, I ping you when i am back. (60 - 90 min)

Aug 4, 2011 at 7:53 PM

ok, i am ready, just give me a sign, and i send you immediately the credentials for teamviewer.

Coordinator
Aug 4, 2011 at 8:02 PM

Ok, I've installed teamviewer.

Coordinator
Aug 5, 2011 at 8:57 AM
Edited Aug 5, 2011 at 9:01 AM

Ok, so I had a look at Dan's machine. It appears that due to a timing issue (system 3 standby) Media Center thought it was rendering to the console and hence was rendering with directx9 and allowed video. Video was 98% - dropped a couple of frames. We disconnected and reconnected the RDP session only to find out Media Center was back to its old self (GDI rendering/no video). I tried the undocumented ehshell.exe /dx9 flag to force DirectX9 rendering within the RDP session. Crazily it worked! The animations are 97% fluid. Turns out that this flag also works on Windows 7 Retail. I don't know why I never tried this flag on retail windows (I guessed I thought it didn't work). It seems there's no DirectX remoting - it's just sending the full bitmaps over the wire but it's fast enough to look decently native. There was however no video when we reconnected as MC complained about trying to watch video inside an RDP session. We tried video in Dan's Windows Media Player and it was fine. I think RDP Video Redirection was happening there (video is rendered on the client). I imagine this was happening (by accident) within Windows Media Center for the first time - Media Center was rendering to directx and was using the Windows Media Player stack to render video which was redirecting the video onto the client. I imagine this must have been happening as RDP is not quick enough for 25FPS video?

Edit:

It should be possible to create a shim/hooker application to trick Media Center that it's not running in RDP mode.

Edit2:

I think the /dx9 mode only works when MC is windowed i.e. not full screen. Probably due to the fact than when MC is full-screen it takes exclusive control of the graphics context.

Aug 5, 2011 at 4:14 PM

I try it today several times with different timings, but it was not possible for me to get the system in this state again. Animations are working when using the /dx9 switch and MC is in window mode. this is also good news for me as MCML developer.

for the record / the setup was :

- W7 Emb Standard with SP1 / No Updates
- mst.exe Tool used as alternative Shell instead explorer.exe , starting ehshell.exe with an 5 second delay after waking up from S3.
- the mst tool from slicksolutions is using the following way to start media center:
http://msdn.microsoft.com/en-us/library/bb188947.aspx
- this might also responsible for the behavior we observed yesterday.

Coordinator
Aug 6, 2011 at 5:44 PM

I've been able to programmatically trick Media Center into thinking it's not running in a Remote Desktop session. So, video is now playing - though not really watchable. I'm going to see if I can get RDP Video Redirection working. Also, audio is working on it.

Coordinator
Aug 6, 2011 at 7:53 PM
Edited Aug 6, 2011 at 7:55 PM

Ok, so I made an image of Windows 7 Ultimate so I could play around with RDP Video Redirection. Unfortunately the video redirection isn't working inside Media Center. There is definitely something weird happening as the viewport gets redraw issues. I think the video is being sent over redirected RDP but we're not sending the clipping information i.e. where the RDP Client should superimpose the video over the bitmap. Playing the same video in WMP works fine (clipping information sent). Interestingly it doesn't seem that WMP Video Redirection even works for WTV files - just hangs for me. 

So, currently we are able to get decently-native DirectX now inside a Remote Desktop Session. Also, we are now able to play video via Media Center inside RDP - albeit shoddy jittery video. Potential idea is that we could get a reference to the Media Center Direct Show Running Graph, stop a playing graph and insert our own network/HTTP based rendering filter and restart the graph. Media Center would then render any video over the network. A custom client could then superimpose the video over the RDP. This method would not bring any legal issues re DRM, but it would be a bit of a hack - clipping the video around the Media Center UI. Would be a bit ugly - but would likely work.  

Any ideas on this?

Coordinator
Aug 12, 2011 at 2:03 PM

Dan, I've responded through the codeplex contact to you. You've been missing my emails as I'm getting bounced for some reason. 

Sep 30, 2011 at 1:22 AM

Has anyone considered using or experimented with the Media Center Extender driver that comes with Windows 7? Is there any way to emulate the extender by altering the existing extender?

I was hoping that MC would recognize the extender and the extender would show the setup code. It doesn't, but maybe there's a way to initiate it?

Thoughts?

Peter

Sep 30, 2011 at 1:40 AM
Edited Sep 30, 2011 at 1:41 AM

OK, so I continued to mess around with the built in extender driver.

In case you don't know where to find it:
Load up Device Manager
On the root node, right-click and select "add legacy hardware," select manual installation.
One of the options will be Media Center Extender.

After I installed it, I inspected the properties of the device (found under "System Devices")
It revealed a URL and port. In my case:

http://192.168.0.195:3391/XD/DeviceDescription.xml

In this XML file, I found a node called UDN. I used the last fragment as the setup key. I entered only the digits (there were 8, so I figured I'd give it a try). The MC extender process accepted the setup key, and proceeded to install. However, eventually, it said that it could not find the extender. I'm posting this in case this information helps.

Edit: I went back into the device manager to look for the Media Center Extender, and it's gone... it was there before I ran the setup on MC! 

Peter

Developer
Oct 11, 2011 at 3:58 PM

Of note:

The default shell for an extender is: C:\Windows\eHome\McrMgr.exe

However, when attempting to RDP to a box utilzing this as the shell, it simply logs you back out. I'm wondering if there is already the 'extender/mce' wrapper and we just need to get the Registry HIVE configured correctly for that user? Or maybe there is an add'l exchange that goes on beyond the initial rdp session that establishes the remote endpoint as an extender as opposed to a desktop.

Also, maybe there is some magic we can do with mstsc.exe in order to accomodate this. I'm guessing the extender is nothing more than a CE box with a special load of the RDP client utilizing these 'technologies' we are trying to make work anyhow. Especially since we know you can playback video with media player through RDP utilizing video redirection. Maybe that's the difference? McrMgr.exe makes some different calls to setup Media Center for playback through an RDP Redirect Graph, and turns on and off some of these switches everyone is using to customize their MCE boxes. I just can't imagine MS spent that much more time writing add'l protocols/etc for extenders when RDP already does what they want it to do.

Anyhow, when I get a second, I'll try diving into this executable to see what lies beneath.

 

Developer
Nov 14, 2011 at 1:02 PM

Ok. I'm on the right track. I've begun the process of sifting through and labeling the decompile of mcrmgr.exe and it's looking promising. I think there is a possibility we may be able to just ignore the check to determine if the user is an RDP user as opposed to an extender. This would allow the following to happen:

  1. mcrmgr.exe is placed as the default shell for a user, or just launched by an RDP user.
  2. mcrmgr.exe launches ehExtHost.exe and wmplayer.exe.
  3. wmplayer.exe allows playback of video by using the "RDP DShow Redirection Filter".
  4. ehExtHost.exe displays the WMC overlays on top of RDP. 

More info soon.

Dec 9, 2011 at 1:52 PM

I'm not sure if this has been suggested by anyone else but http://www.team-mediaportal.com/ I have just installed their software on my HTPC and it looks amazing. It's free and it allows streaming to an unlimited number of other PCs. It is definitely worth checking out. I know most of you are pretty deep in this project, but Microblow screws us so hard and regularly by not giving us basic functionality like using another PC as an extender that I thought I would give another software a shot. Give it a try, if nothing else it will give you a solution until the right work around is found or it could remove the need for one. This software is already miles ahead of MC and open source to boot so if you want something it doesn't have you can add it and post about it on their forum.

Mar 21, 2012 at 3:07 AM

@ayersey - mediaportal doesn't support digital cable (e.g. ceton infinitv).

@xk2600 - any updates to your work with mcrmgr.exe?

May 22, 2012 at 6:09 PM
yman235 wrote:

I've been able to programmatically trick Media Center into thinking it's not running in a Remote Desktop session. So, video is now playing - though not really watchable. I'm going to see if I can get RDP Video Redirection working. Also, audio is working on it.


Hi, I'm just wonderinghow are you able to trick Media Center into thinking it's not running in RDP session.  Can you please shed me some light?  I know this is old topic but I'm just curious.

Coordinator
Jun 2, 2012 at 10:04 PM

Hi

 

Sorry for the late reply. MC pinvokes GetSystemMetrics (If I remember correctly), specifying some parameter which states whether the current session is a TS/RDP session. I used EasyHooks to hook this call. I could probably find the src if I looked hard enough. Why are you interested, out of interest? :)

Jun 13, 2012 at 6:47 PM

I don't know if you've heard of the software called Betwin by ThinSoft.  It's pretty nice software that uses RDP.  It basically allows a single computer to be be used by multiple users simultaneously.  It uses the additional physical video card exclusively to a session connected to it. So you basically benefiting the use of 3D acceleration on the video card.  Just basically like the new RemoteFX feature on Windows 2008 R2.  I'd like to be able to use the MCE with this program.

Thanks