Software runs behind next-generation displays
As usual in the technology world, hardware continues to advance at an incredible pace and software engineers play catch up to write code that can tap its full potential. The evolution of high resolution displays is a perfect example of this fact. Remember when HD TVs came out, but there were no HD channels available? How about that neighbor of yours that loved to show off his new 4K flat screen by playing the same demo video over and over due to the lack of 4K content? Something similar is happening with a new generation of computer displays and the software that is available, both at the operating system and, more importantly, the application level.
As the product manager for HDX Graphics here at Citrix, I have experienced firsthand the tremendous impact the proliferation of high resolution displays is having in the enterprise. At the center of this is something called pixel density or pixels per inch (PPI), but more commonly referred to as dots per inch (DPI) in the context of this blog. If this is the first time you are hearing about DPI, I would suggest you do a quick search on-online on the subject or browse to the two links above to familiarize yourself with the underlying concepts. In this blog post, I will cover DPI scaling on Windows in particular and how it relates to the user experience in a Citrix environment.
DPI Scaling: The good, the bad, and the ugly
Now that you know more about DPI, what are some of the benefits of DPI scaling? Why is this even needed? The simplest answer is that without DPI scaling, your high-resolution display would be borderline unusable in the size available on the typical laptops, desktop computers, or even today’s tablets. Think 4K UHD and Retina displays, or even your new Microsoft Surface Pro tablet, to name but a few examples.
DPI scaling is what makes it possible to benefit from higher resolutions while maintaining the proper size and sharpness of the graphics on screen. Without the ability to scale up, you would essentially see extremely tiny text and graphics unless you were on a very large display. I don’t know about you, but I don’t know too many workers using a 50+ inch display in their office, let alone wanting to sit a mere 20 or 40 inches away from one.
DPI scaling is the solution to the problem with tiny graphics and we can now enjoy our desktops and applications in ultra-high definition with our new 4K displays. Well… not so fast. There are several other things to consider for all of this to work.
The first thing to understand is that the software is in charge of managing the scaling factor. This means the operating system must provide this capability and have the right display drivers installed, etc. More importantly, it means that applications now need to be DPI-aware, in order to adapt the graphical user interface and other visual components to the appropriate size while maintaining the same level of image quality. Going back to the analogy at the beginning of this blog, you basically need a UHD player and UHD movies to see your 4K TV shine.
Note that I have not even mentioned graphics remoting or even Citrix, for that matter, since I started discussing DPI scaling. That is because with DPI scaling and the challenges with OS and application support, the biggest problems to solve need to be taken care of before we further complicate things with graphics remoting. Many Win32 business applications and Windows OS components were developed before these high-resolution displays came into existence, so it is no surprise to see the lack of native support for DPI scaling. Windows 7, still widely used in the enterprise today, has limited support for dealing with DPI scaling. Even Windows 10 has been slow to adapt to the complexities of high-DPI scaling as documented by Microsoft here, here, and here.
Current state of affairs when it comes to the Windows ecosystem and high-DPI scaling
In Windows 10, you can set the desired DPI scale in the display settings via the “Change the size of text, apps, and other items” slider bar. The scale is expressed in percentages and can be set differently for each display, as shown in the screenshot below. It is important to note that Windows 10 will choose a default DPI scale automatically based on the detected screen size, which generally aligns with what is recommended. Needless to say, this doesn’t mean it is what the user will want in every case.
In the best-case scenario, you are using the latest version of Windows 10 with modern applications that are DPI-aware and include native support to scale graphical elements accordingly. Applications built upon the Windows Universal Platform (UWP) handle display scaling very well, for example.
In the not-so-ideal scenario, you are using legacy applications that are not DPI-aware and letting Windows manage the scaling of the application graphics. In essence, this works by stretching the image based on the DPI scale configured in the OS. For example, a DPI scale of 200% would result in the stretching of the application’s graphical elements, in all dimensions, to be twice the size or use twice the number of pixels of what the application is actually (or think it is) drawing on screen. The biggest disadvantage with this scaling method is that it inherently results in image fuzziness and may cause text to appear blurry.
In the worst-case scenario, you are using a legacy Windows OS with non-DPI-aware applications where all graphics and text appear miniscule (this assumes, of course, that you can even get the OS and display adapter to support the native resolution of the display in use).
How does Citrix fit into all this and what are we doing about it?
At Citrix, we have been following this high-resolution display movement very closely and our HDX team has been developing solutions to help our customers make the best use of their new hardware. We are looking to match the same level of support, in a Citrix remote session, that a given Windows OS or application may have for high resolution and DPI scaling on a local endpoint. We are also taking it one step further and introducing new features to enhance the user experience and support certain scenarios that would not be possible with native OS and application support.
The first thing we needed — and what was the foundation for the rest of the work — was to modify the Citrix Receiver for Windows client to be DPI-aware, an enhancement introduced in version 4.10. With Receiver now able to accurately detect resolution and DPI scale for all displays attached to the endpoint, we can now support different DPI scales (mixed-DPI) in multi-monitor scenarios, a feature of Windows 10 and something that was not possible before. This also enables two different approaches to support DPI scaling of the Citrix ICA session:
#1 Client-side scaling
This feature is currently available with Receiver for Windows 4.10.1. With this scaling method, Receiver is looking at the set resolution and DPI scale for a given display and calculating the effective resolution at a DPI scale of 100%, which in turn is used to request the resolution for the ICA session. For example, a display configured with a resolution of 4096×2160 (4K) and a DPI scale of 150% would result in the ICA session to be set at 2730×1440.
Now that we have what is actually a lower-resolution session, we end up with a window that takes a fraction of the local display. This is when the “client-side” scaling comes into play and Receiver simply stretches the window to either, fit the entire screen in the case of a full screen desktop session or be proportionate to other windows in the case of a XenApp seamless application.
There are several advantages to this approach. For one, this is strictly a Receiver function with no dependencies on the VDA, which means backwards compatibility with supported versions of XenDesktop & XenApp and Windows OSs. It also has the least impact on server scalability, as sessions with a lower (effective) resolution require less CPU, memory, and bandwidth than the alternative (native high-resolution). We also used existing Windows OS functions which accelerated our development process.
The main disadvantage to this approach is that you may experience a loss of image quality (or fuzziness), mainly when using high DPI scales with smaller lower-resolution displays and in some cases when using legacy graphics mode (or XenApp 6.5).
As of Receiver for Windows v4.10.1 DPI-awareness is disabled by default but may be enabled via policy or in the advance preferences in the user interface. For those cases where client-side scaling isn’t desired, Receiver also includes an option for ignoring DPI scale and sending full (native) resolution.
For configuration instructions, known issues, and other considerations, please refer to CTX230017.
#2 DPI matching
This feature has been available in tech preview form since the release of XenApp 7.13 and Receiver for Windows 4.7, and it offers limited support for Windows Server 2016 VDAs only. With this scaling method, we leverage the DPI-aware capabilities of Receiver to detect resolution and DPI scale set for a given display and request an ICA session to match these parameters exactly (1:1) on the VDA. So, a 4K display on the endpoint with a DPI scale of 150% would result in the ICA session to be just that on the VDA.
The main advantage to this approach is that there is no scaling performed by Receiver and what you get is a true representation of what you would see on the endpoint if you were running the same desktop or applications locally. In other words, we don’t get in the way of what the Windows OS or the application is doing from a DPI scaling perspective.
The main disadvantage to this approach is that it has the biggest impact to server scalability as the increase in CPU, memory, and bandwidth utilization may be substantial when connecting sessions at such high resolutions. Unless you sized your server hardware to accommodate user sessions at 4K resolutions, I would highly recommend a scalability assessment before going this route.
The other challenge with this approach, and the reason it hasn’t been fully productize yet, is that there are dependencies on Microsoft for Windows 10 support. As of this writing, there are no APIs available to set DPI scale dynamically and in-session on Windows 10. We are working closely with Microsoft and GPU vendors to develop a solution that works for everyone but this could take some time. In the meantime, we are evaluating our options to productize what we have currently as tech preview and offer support for XenApp on Windows Server 2016.
Conclusion (at least for now)
DPI scaling is not a trivial subject and there are many things to consider including hardware, OS capabilities, and application support before you even get into the aspects of graphics remoting. I can only hope you were able to stay with me throughout this blog and it helped you make some sense of this DPI madness.
It is important to understand that even with improved support from Microsoft and Citrix, it is ultimately up to the application to support DPI scaling while maintaining intended levels of image quality. An application that appears fuzzy when DPI scale is higher than 100% will always look that way regardless of the DPI scaling methods in use. So, you may want to reach out to your ISV of choice and ask about their plans to support high DPI if you intend to use their applications with high-resolution displays.
Product Management, Workspace Services – HDX
Citrix TechBytes – Created by Citrix Experts, made for Citrix Technologists! Learn from passionate Citrix Experts and gain technical insights into the latest Citrix Technologies.
Want specific TechBytes? Let us know! firstname.lastname@example.org