xrdp icon indicating copy to clipboard operation
xrdp copied to clipboard

Win 11 mstsc.exe doesn't send RemoteFX capability

Open metalefty opened this issue 2 years ago • 17 comments

Win 11

[2022-10-28T22:04:33.958+0900] [DEBUG] Client requested compression enabled.
[2022-10-28T22:04:33.960+0900] [DEBUG] Client supplied domain:
[2022-10-28T22:04:33.961+0900] [DEBUG] Client supplied username: meta
[2022-10-28T22:04:33.963+0900] [DEBUG] Client supplied password: <omitted from log>
[2022-10-28T22:04:33.964+0900] [DEBUG] Client supplied program:
[2022-10-28T22:04:33.966+0900] [DEBUG] Client supplied directory:
[2022-10-28T22:04:34.771+0900] [INFO ] xrdp_caps_process_pointer: client supports new(color) cursor
[2022-10-28T22:04:34.782+0900] [INFO ] xrdp_process_offscreen_bmpcache: support level 1 cache size 10485760 MB cache entries 100
[2022-10-28T22:04:34.798+0900] [INFO ] xrdp_caps_process_codecs: nscodec, codec id 1, properties len 3
[2022-10-28T22:04:34.814+0900] [WARN ] xrdp_caps_process_codecs: unknown codec id 5
[2022-10-28T22:04:34.832+0900] [DEBUG] xrdp_00005c68_wm_login_state_event_00000001

image

Win 10

[2022-10-28T22:02:07.907+0900] [DEBUG] Client requested auto logon.
[2022-10-28T22:02:07.908+0900] [DEBUG] Client requested compression enabled.
[2022-10-28T22:02:07.910+0900] [DEBUG] Client supplied domain:
[2022-10-28T22:02:07.911+0900] [DEBUG] Client supplied username: meta
[2022-10-28T22:02:07.913+0900] [DEBUG] Client supplied password: <omitted from log>
[2022-10-28T22:02:07.915+0900] [DEBUG] Client supplied program:
[2022-10-28T22:02:07.916+0900] [DEBUG] Client supplied directory:
[2022-10-28T22:02:08.309+0900] [INFO ] xrdp_caps_process_pointer: client supports new(color) cursor
[2022-10-28T22:02:08.320+0900] [INFO ] xrdp_process_offscreen_bmpcache: support level 1 cache size 10485760 MB cache entries 100
[2022-10-28T22:02:08.336+0900] [INFO ] xrdp_caps_process_codecs: nscodec, codec id 1, properties len 3
[2022-10-28T22:02:08.352+0900] [WARN ] xrdp_caps_process_codecs: unknown codec id 5
[2022-10-28T22:02:08.368+0900] [INFO ] xrdp_caps_process_codecs: RemoteFX, codec id 3, properties len 49
[2022-10-28T22:02:08.386+0900] [DEBUG] xrdp_00004df2_wm_login_state_event_00000001

image

metalefty avatar Oct 28 '22 13:10 metalefty

This seems to be quite an issue for me. When connecting to the remote desktop from my Win 11 laptop, dragging windows etc is super slow. Also the solution of setting the connection speed to Lan as suggested in #2136 doesn't help. However when I try the same with my Win 10 desktop, changing the setting to Lan results in a performance boost while having it set to WLAN gives similar results on both systems. It seems to me like the issue described by @metalefty could cause the symptoms I see.

TuNeXiZz avatar Nov 15 '22 12:11 TuNeXiZz

@TuNeXiZz Yes, the issue seems to be caused due to this.

@jsorg71 Jay, can we add Image RemotFX? I'm not very familiar with RemoteFX but as far as I read MS documentation, Image RemoteFX has little differences from (Video) RemoteFX. It will take a while until we implement GFX. I think some mitigation is needed.

metalefty avatar Nov 16 '22 01:11 metalefty

@metalefty I can look into this. I'm guessing that most of what we already have makes this possible...

Nexarian avatar Nov 28 '22 01:11 Nexarian

After #2400, codec GUID is recorded on the log. The Win11 client sends only 2 codecs:

[2023-07-17T14:25:46.742+0900] [INFO ] xrdp_caps_process_codecs: NSCodec(CA8D1BB9-000F-154F-589F-AE2D1A87E2D6), codec id [1], properties len [3]
[2023-07-17T14:25:46.743+0900] [WARN ] xrdp_caps_process_codecs: unknown(2744CCD4-9D8A-4E74-803C-0ECBEEA19C54), codec id [5], properties len [49]

2744CCD4-9D8A-4E74-803C-0ECBEEA19C54 is for Image RemoteFX. So we need to implement Image RemoteFX capability to reinstate performance with Win11 client.

metalefty avatar Jul 17 '23 06:07 metalefty

+1

Indeed, a Win10 client sends 3 codecs and the performance is good:

[INFO ] xrdp_caps_process_codecs: NSCodec(CA8D1BB9-000F-154F-589F-AE2D1A87E2D6), codec id [1], properties len [3]
[WARN ] xrdp_caps_process_codecs: unknown(2744CCD4-9D8A-4E74-803C-0ECBEEA19C54), codec id [5], properties len [49]
[INFO ] xrdp_caps_process_codecs: RemoteFX(76772F12-BD72-4463-AFB3-B73C9C6F7886), codec id [3], properties len [49]

But with Win11, only 2 are sent:

[INFO ] xrdp_caps_process_codecs: NSCodec(CA8D1BB9-000F-154F-589F-AE2D1A87E2D6), codec id [1], properties len [3]
[WARN ] xrdp_caps_process_codecs: unknown(2744CCD4-9D8A-4E74-803C-0ECBEEA19C54), codec id [5], properties len [49]

And no RFX is used which affects the performance

samikha avatar Aug 09 '23 08:08 samikha

Try going to the settings described here: https://github.com/stascorp/rdpwrap/issues/810

AVC444v2 wasn't working on my Windows 11 install until I went there as well. This is keyed for AVC444, but there are RemoteFX settings too.

Nexarian avatar Aug 10 '23 02:08 Nexarian

Started initial implementation: https://github.com/neutrinolabs/xrdp/pull/2789

metalefty avatar Sep 08 '23 01:09 metalefty

As far as I read the specification [MS-RDPRFX] the difference between Image RemoteFX vs Video RemoteFX is:

  • The encoder must send theencode header message sequence before every encode data message sequence.
  • The encode header message sequence is then followed by an arbitrary number of encode data message sequences.

@jsorg71 What do you think?

So it is much easier to implement than GFX and easier to backport to v0.9.

metalefty avatar Sep 19 '23 09:09 metalefty

While working on this, I found an issue that seems to be a FreeRDP bug. https://github.com/FreeRDP/FreeRDP/pull/9425

metalefty avatar Sep 23 '23 17:09 metalefty

Just for record my development progress.

Windows 11 mstsc.exe Shell version: 10.0.22621 Control version: 10.0.621

Connecting to xrdp with Image RemoteFX codec.

[2023-09-30T14:18:04.437+0000] [INFO ] xrdp_caps_process_codecs: NSCodec(CA8D1BB9-000F-154F-589F-AE2D1A87E2D6), codec id [1], properties len [3]
[2023-09-30T14:18:04.440+0000] [INFO ] xrdp_caps_process_codecs: Image RemoteFX(2744CCD4-9D8A-4E74-803C-0ECBEEA19C54), codec id [5], properties len [49]

Here is the dump of properties of Image RemoteFX. Values indicated ^^ shows operating image remotefx mode.

0000   31 00 00 00 01 00 00 00 25 00 00 00 c0 cb 08 00   1.......%.......
0010   00 00 01 00 c1 cb 1d 00 00 00 01 c0 cf 02 00 08   ................
0020   00 00 01 40 00 02 01 01 01 00 01 40 00 02 01 01   ...@.......@....
0030   04             ^^                      ^^

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdprfx/286655bf-bf34-40d4-b5cb-157dd86df346

metalefty avatar Sep 30 '23 15:09 metalefty

Thank you for working on this! This is important to my work because I spend much of it in RDP and the lag is awful. I downgraded to Windows 10 because of this problem. Thanks a lot Microsoft…

FrederickGeek8 avatar Oct 17 '23 17:10 FrederickGeek8

@metalefty Thanks a lot for working on this too!

@FrederickGeek8 In the meantime on Windows 11, I'm using a wfreerdp.exe FreeRDP client downloaded from here: https://ci.freerdp.com/job/freerdp-nightly-windows/

(linked to from https://github.com/FreeRDP/FreeRDP/wiki/PreBuilds)

The performance is not as good as Win10 client, but it's much better than the lag when using the Win11 client. Make sure you call wfreerdp.exe with /rfx

samikha avatar Oct 18 '23 06:10 samikha

WIP pull requests:

  • https://github.com/neutrinolabs/xrdp/pull/2789
  • https://github.com/neutrinolabs/librfxcodec/pull/58

It's really WIP and not working yet.

metalefty avatar Oct 26 '23 08:10 metalefty

For the record:

xfreerdp /v:'[fe80::5a9c:fcff:fe0c:ff9a%ue0]' /u:almalinux /nsc /rfx /rfx-mode:image /log-level:DEBUG

[02:26:05:347] [72693:54f18e00] [DEBUG][com.freerdp.gdi] - frameId 1 frameAction 0
[02:26:05:360] [72693:54f18e00] [DEBUG][com.freerdp.gdi] - destLeft 0 destTop 0 destRight 1024 destBottom 768 bpp 32 flags 0 codecID 4 width 1024 height 768 length 98787
[02:26:05:360] [72693:54f18e00] [ERROR][com.freerdp.gdi] - Unsupported codecID 4
[02:26:05:361] [72693:54f18e00] [DEBUG][com.freerdp.core.update] - SurfaceFrameMarker: action: End (1) id: 1
[02:26:05:361] [72693:54f18e00] [DEBUG][com.freerdp.gdi] - frameId 1 frameAction 1

metalefty avatar Nov 16 '23 17:11 metalefty

I'm using this client: https://apps.microsoft.com/detail/9WZDNCRFJ3PS?hl=en-US&gl=US

It seems to perform better than Windows 11 mstsc.exe and wfreerdp

Note: MS does not develop that app anymore, but it's a good alternative while waiting for Image RemoteFX support

remcoros avatar Dec 13 '23 14:12 remcoros

Thank you guys for the information about other clients!

We're working on implementing another efficient codec compatible with Win11. Use other clients such as FreeRDP for the time being as a workaround.

metalefty avatar Dec 14 '23 08:12 metalefty

GFX support with multi-monitor support (including monitor hot plug/unplug) has been added (#2256 #2338 #2595 #2879 #2891 #2911 #2929 #2933 #2942). v0.10.0 will be released soon.

metalefty avatar Feb 21 '24 00:02 metalefty