[NEW] Looking Glass Beta 2 Release Candidate 1

After over 200 commits over 10 Months and 6 Days, it’s finally time to announce that Looking Glass has nearly reached it’s Beta 2 release.

This marks the first of the B2 release candidates and the change list is enormous so if I miss some things I apologize.

Support

Firstly before we continue please be aware that the amount of time and work that has gone into this update is enormous and would not be possible without those that are sponsoring the work via platforms like Patreon and Kofi.

That said, this project is financially and time expensive to produce and I would very much appreciate any help you can render to continue this work should it be useful to you. Below are the options available should you wish to do so.

  • GitHub (preferred as GitHub have no fees and are currently matching every dollar donated with the same out of their own pocket).
  • Ko-Fi
  • Patreon
  • Paypal
  • BTC - 14ZFcYjsKPiVreHqcaekvHGL846u3ZuT13

With that ugly stuff out of the way, here are the detals

Documentation

There is a public wiki at https://looking-glass.hostfission.com/wiki/
Most if not all information there is current and applies here still. If anything is missing or wrong feel free to sign up and edit the content :slight_smile:

Where to get it

Note: Once again Microsoft is being stupid and are incorrectly flagging the host as a Virus (Trojan:Win32/Fuery.C!cl, and Trojan:Win32/Wacatac.C!ml), this is not true. I have submitted a request yet again to have this fixed.

Complete source archive and pre-compiled Windows x64 host available at:
https://looking-glass.hostfission.com/downloads

Shared Memory Changes

TL;DR: The looking glass host can now stream to up to 32 clients.

Initially, LG was designed to use the shared memory in a very primitive way that was just to get things working, but as this project has grown many people wanted to use LG with OBS simultaneously. This required a complete redesign of the shared memory communication to use a fast and intelligent system to mediate the sharing of this data between multiple clients without impacting performance or increasing memory usage.

Thus Looking Glass Memory Protocol (LGMP) was born. This project is not Looking Glass specific and can be used stand-alone outside of Looking Glass to create any data broadcast system over shared memory. It is platform agnostic and as such compiles and has been tested on both Windows and Linux platforms.

PureSpice

TL;DR: The spice client is far improved, uses less memory, has lower latency and generally works far better then it ever did.

Existing spice-protocol libraries are very heavyweight requiring GTK and supporting every feature of spice, including the one we care least about, graphics support. As such I wrote a spice client implementation into Looking Glass that is implemented in pure C. As this project has become more known people have wanted to use this code to create a stand-alone spice input utility however it was too integrated into Looking Glass’s codebase. It has now been separated out into a standalone library (PureSpice) and now lives in it’s own code repository.

Several bug fixes and improvements have also gone in, most notably race condition fixes that would corrupt the data stream and more efficient use of the datagrams by packing them together where possible allowing us to fully leverage the threadsafe read and write syscalls making the library mostly lockless.

Native OBS Looking Glass Plugin

TL;DR: Works well but no cursor support yet.

This plugin lives in the obs directory of the project, building it is the same pattern as the client. I am sure someone will document it on the wiki if I don’t get to it first.

EGL Improvements

TL;DR: More frames, lower latency, less stuttering, etc. The fpsLimit is no longer as much a limit but a target value to operate at and will be exceeded if the guest updates at a higher rate then the limit.

LG has been plagued with micro stutters for as long as it has been around, the cause of which has been mainly due to my lack of OpenGL/EGL experience and/or understanding. Over the last year though I have had a lot of time to learn and experiment and have come up with a design that resolves (for me at least) all micro stuttering issues caused due to frame rate sync between host and guest.

Several race conditions also were not helping things where sometimes a frame was presented before it had been completely uploaded to the GPU, showing an old frame. A new state machine was built to properly track the streamed textures and their ready states to fix this.

As part of this thread concurrency is properly supported now allowing the frame update thread to update textures concurrently.

The final fix to micro stuttering was to change the render loop to be loosely coupled to the fps limiter. Now when a new frame arrives it can trigger the render loop to run even if the fps limiter has not yet timed out. This not only resolves the primary cause of micros suttering, but also means we no longer need to have the FPS limit default to 2x the refresh rate.

Capturing the secure desktop (UAC/Lock Screen/Task Manger), etc.

If the looking glass host is run using PsExec as the SYSTEM account it is now able to capture the secure desktop. As PsExec is a microsoft tool you will need to procure this from them should you desire this feature.

For example: PsExec64.exe -s -i -d C:\\path\\to\\looking\\glass\\looking-glass-host.exe

A scheduled task can be created to run this at startup.

Bug Fixes

Way too many to list… tons of Quality of Life fixes, etc.

18 Likes

I created a github account, and when I click your link it says:

“Your GitHub Sponsors contribution will not be matched at this time. Learn more about how the matching fund works.”

Any idea what’s going on? The “about” link doesn’t appear to have anything relevent for what’s blocking matching.

Liking the Native OBS Looking Glass Plugin.

So Looking Glass Memory Protocol is codec agnostic? Would be interested to see how visually lossless compression of 4:1 (like that used in DisplayPort DSC) can work over the protocol.

I am not sure sorry, it might be limited by country.

I am not sure what you mean by codec agnostic. It’s just a sane way to allow multiple processes to obtain the captured memory at once without incurring extra memory usage or copies.

The shared memory can be any format, right? RGB buffers? Compressed stream formats? It isn’t tied to specific codecs and formats, right? I’m really hoping this protocol can adapt to compressed formats to help with memory copy, or make it a NewTek NDI replacement over shared memory using a compressed image stream.

Just given this version a try, I noticed a warning saying the guest is providing updates faster than than the client can display, but the client has the faster gpu, a RTX 2060 where as the windows guest as a GTX 970.

The guest is running at 2560x1080 at 100hz, I set the min fps to 100 for looking glass as I noticed the mouse would lag due to dropping back to 60 fps on the desktop.

This will happen if a frame drop happens. Note it states your hardware not your GPU specifically. This is a warning to just let you know a drop happened and more may occur in the future. It could be benign, or it could be a sign that your PCIe bus is saturated and you cant push the frames into the GPU fast enough, or your CPU memcpy performance isn’t great, or your CPU is overloaded, etc…

Ah good to know, I enabled vsync in the game I was testing and it actually improve the UPS quite a bit, its pretty much around 95 to 100 UPS where it was 70 - 85 before. I did have an fps cap enabled before switching vsync on.

Fantastic, thanks for the hard work!

Amongst all the new features and improvements, I was wondering if the actual release includes support for:

  • 4K resolution?
  • 144Hz refresh rate?
  • 144Hz refresh rate in 4K?

Also, I’m about to change my gaming monitor: is 2560x1440 native resolution a viable option using Integer Scaling in Looking Glass (lots of retrogaming) or is it best to choose a 4K monitor as it is an integer multiple of 1080p?

Using an NVIDIA GeForce RTX 2080 for the Windows Guest VM.
Using an AMD Radeon RX 5700 XT on the Linux host.

Want a higher resolution than 1080p for Steam Play and use Looking Glass in the best possible conditions when games are incompatible.

Thanks

It has always supported these things, it’s up to your hardware if you can do it or not.

Entirely up to your use case… no idea.