270 likes | 576 Views
Presentation Virtualization: Graphics Remoting (RDP) Today And Tomorrow. RDP Graphics Remoting Agenda. Introduction to RDP What is new in Windows 7? Deep dive into RDP Graphics Architecture RDP Platform How to extend RDP API Walkthroughs
E N D
Presentation Virtualization: Graphics Remoting (RDP) Today And Tomorrow
RDP Graphics RemotingAgenda • Introduction to RDP • What is new in Windows 7? • Deep dive into RDP Graphics Architecture • RDP Platform • How to extend RDP • API Walkthroughs • How to make your apps run efficiently in a remote session Related talks: • PC-05 Unlocking the GPU with Direct3D • PC-18 Introducing Direct2D and DirectWrite
Current State Of RDPVista and Windows Server 2008 era • RDP is an optimized binary protocol for remoting the Windows Experience • Currently RDP provides • A great remoting experience for GDI Apps • Rich media and animated scenarios fallback to bitmap remoting • RDP has an extensibility model built on Virtual Channels • Used internally as basis of new features • Detailed protocol docs (2000+ pages) on MSDN
RDP Platform TechnologyRemoting scenarios enabled by RDP • Terminal Server • Remote Desktop • Remote Assistance • Windows Meeting spaces • Media Center Extenders and XBox 360 • SCCM Remote control • Hyper-V Remote Control • Windows Live Mesh
RDP Protocol Structure Graphics Virtual Channels (VCs) Device VCs Mouse &Keyboard VCs Partner Virtual Channel Plug-Ins Virtual Channel Multiplexing and Framing Bulk Compression (RDP5+, RDP6.0, RDP6.1) Security Layer (SSL/Kerberos/NTLM) Transport Layer (e.g. TCP, RPC/HTTP, Windows Live Tunnel)
Why Make Changes?Trends affecting presentation remoting • Increasing graphics richness • Media, 3D UI, Video, Animations, Flash, Silverlight • Increasing fragmentation of graphics stacks • Strong demand for closing “gap” with the local experience • I.e. all local features “just work” • Diversity of client-side devices
Agenda • Introduction to RDP • What is new in Windows 7? • Deep dive into RDP Graphics Architecture • RDP Platform • How to extend RDP • API Walkthroughs • How to make your apps run efficiently in a remote session
What's New In Windows 7RDP Platform Improvements Windows 7 Aero Direct2D & Direct 3D 10.1 True Multimon Support Multimedia:Media Foundation RDP Core Performance Improvements Multimedia: DirectShow Low latency Audio Playback Bi –directional Audio
Agenda • Introduction to RDP • What is new in Windows 7? • Deep dive into RDP Graphics Architecture • RDP Platform • How to extend RDP • API Walkthroughs • How to make your apps run efficiently in a remote session
RDP Graphics Remoting Internals • Approaches to graphics remoting • Host rendering • Client rendering • RDP in Windows 7 • Does both! • Remotes efficient graphics commands to client • GDI, Direct 3D, Media, DWM (Desktop Window Manager) • Efficient techniques for host rendering • Caching, Compression • Client-side compositor combines streams
RDP Graphics Architecture In Windows 7 DX10.1 App D2D App DWM Media App GDI App DX Runtime DWMcore.DLL TSMF.DLL RDPD3D.DLL Efficient GDI Stream TS Dynamic Virtual Channels USER KERNEL Win32k.sys (USER/GDI) Efficient Command Streams RDPDD (Display Driver) Apps RDP Driver Stack RDP To RDP Client Transport: (TCPIP.Sys) OS
RDP Remoting Techniques In Windows7 RDP Client Rendering RDP Host Rendering Direct2D WPF Direct 3D: 10.1 Silverlight Efficient Media Requires: Codecs on Client Content cannot have DRM or licensing Flash All other media Direct 3D <10.1 GDI
Agenda • Introduction to RDP • What is new in Windows 7? • Deep dive into RDP Graphics Architecture • RDP Platform • How to extend RDP • API Walkthroughs • How to make your apps run efficiently in a remote session
RDP PlatformAPI family overview • Dynamic Virtual Channels APIs • Client/Server extensibility for RDP • Bi-directional streams that extend RDP • Internal features use same technology • Remote Desktop ActiveX APIs • Host/customize full RDP client in your apps • Usable from web, managed or native code • RDP Windows Desktop Sharing APIs • RDP Platform for screen sharing • Enables sharing console, multiparty connections • Basis of Remote Assistance
Dynamic Virtual Channels (1/2)Intro and usage • What’s new? • Automatically handles packet reconstruction • Removes 32-channel limitation in past product • Server usage: • Opening a channel: WTSVirtualChannelOpenEx (..,WTS_CHANNEL_OPTION_DYNAMIC) WTSVirtualChannelQuery • Data IO: ReadFile/WriteFile
Dynamic Virtual Channels (1/2)Intro and usage • What’s new? • Automatically handles packet reconstruction • Removes 32-channel limitation in past product • Server usage: • Opening a channel: WTSVirtualChannelOpenEx (..,WTS_CHANNEL_OPTION_DYNAMIC) WTSVirtualChannelQuery • Data IO: ReadFile/WriteFile
Dynamic Virtual Channels (2/2)Client-side usage 1) Implement IWTSPlugin and register CLSID: HKCU\Software\Microsoft\Terminal Server Client\Default\AddIns 2) Create listener and accept new channels pChanMgr->CreateListener(Name, pMyCallback) 3) Accept and use channel ::OnNewChannelConnection(pChannel) 4) Do IO IWTSVirtualChannel::Write(cbSize, buf) CMyChannel::OnDataReceived(cbSize, buf)
Agenda • Introduction to RDP • What is new in Windows 7? • Deep dive into RDP Graphics Architecture • RDP Platform • How to extend RDP • API Walkthroughs • How to make your apps run efficiently in a remote session
Tips For Writing Efficent Remote AppsBasics • Consider scaling down expensive graphics in remote e.g., Animations • Detect if the session is remote: • Managed: System.Windows.Forms.SystemInformation.TerminalServerSession • Win32:GetSystemMetrics(SM_REMOTESESSION) • Consider session transitions • Leverage RDP Compression GP’s • 30-40% bandwidth savings • Important to test your app remotely!
Tips For Writing Efficent Remote AppsGDI • Guidance for offscreen surfaces • Do NOT use DIBs (Device Independent bitmaps) • DO use Device-Dependent or compatible bitmaps (enables primitive remoting) • Layered Windows can be very expensive • Except if Composed Desktop (Aero is ON) • Do NOT use Screen capture - GetDC(NULL) • Can require client-roundtrip • What about color depth? • Your choice! 32bpp is just as efficient as 16bpp
Tips For Writing Efficent Remote AppsRemoting Direct 3D and Direct2D • Use Direct2D – has efficient command remoting • Direct3D Apps: Use DX10.1 and DXGI 1.1 (DirectX Graphics Infrastructure) • CreateDXGIFactory1(…); • pFactory->EnumAdapters1(i, &pAdapter) • pAdapter->GetDesc1(&Desc); • BOOL IsRemote = Desc.Flags & DXGI_ADAPTER_FLAG_REMOTE; • Use the new IsCurrent() API to handle session transitions and discover new adapters • Tip: Local optimizations are magnified remotely!
Key Takeaways • RDP Platform continues to evolve and improve • RDP Platform has a rich extensibility model today with API’s and detailed protocol documentation in MSDN • Extend the TS Platform for your needs • Call to action: Please optimize and test your apps for the TS environment • We would love your feedback on future evolution and extensibility!
References • Terminal Services (TS) Team Blog: http://blogs.msdn.com/ts • TS Application Compatibility Guidance: http://connect.microsoft.com/tsappcompat • TS Home page: http://www.microsoft.com/ts
Evals & Recordings Please fill out your evaluation for this session at: This session will be available as a recording at: www.microsoftpdc.com
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.