Неустойчивое движение мыши в 3D-играх через RDP с RemoteFX

11415
AviD

Кажется, что драйвер мыши по умолчанию при соединении с RDP плохо работает с некоторыми приложениями, такими как 3D-игры.

Моя настройка:

  • Windows 2012 R2 с Hyper-V и мощной видеокартой
  • ВМ с настроенной Windows 8.1 Enterprise, RemoteFX и vGPU
  • Соединение с RDP по быстрой ссылке.

Производительность 3D видео отличная, благодаря RemoteFX / vGPU. Это определенно позволяет играм быть очень играбельными по RDP (если бы не мышь).

Проблема в том, что в игре мышь реагирует довольно безумно, но совершенно нормально за пределами 3D-среды. (Например, в игровых меню мышь просто отлично).

Насколько можно судить по экспериментам и многим поискам в Интернете (у многих других была такая же проблема, но решения не найдено) - кажется, что драйвер мыши передает свое относительное местоположение вместо движения.
Эта «теория» хорошо коррелирует с некоторыми объяснениями того, как указатель мыши прыгает внутрь и из окна RDP (например, перемещает его из окна слева, обратно справа), и он ведет себя отлично, то есть мышь на основе местоположения и не на основе движений), а также с игровым поведением - например, если я перемещаю мышь влево, изображение безумно переходит влево; если я затем переместлю его немного вправо, но все еще не полностью назад к центру (то есть мышь все еще находится слева от центра, но перемещается вправо), он продолжит прыгать влево. (Т.е. кажется, что он все еще сообщает, что находится «слева от центра», а не «двигается вправо»).

Я надеюсь найти ЛЮБОЕ решение для этого. Идеи кого-нибудь?

8
гектометр Будет ли эксперимент с более ориентированной на игры платформой удаленного доступа возможным вариантом? nvidia streaming и Steam Streaming хорошо работают для меня (более гигабит). Также относительная позиция напоминает мне планшет в стиле мышки. Journeyman Geek 9 лет назад 0
Сумасшедший, что годы спустя, это все еще не установлено. :( Shiki 6 лет назад 0

3 ответа на вопрос

6
AviD

Wow, after a ton of research and failed attempts, I actually solved this!
Well, mostly solved it - it is functional, but not without drawbacks.

Thanks to @JourneymanGeek's answer, and in particular the post he linked to, I was able to follow the lead, and eventually discovered that amongst the many interfaces implemented by the Remote Desktop Client ActiveX, one of them supports a RelativeMouseMode property! That sounds like exactly what I need, it will force the RDP to support relative mouse movements!

However, I did note on this MSDN Forums post that "RelativeMouseMode is not supported in RDP RDSH/RDVH scenarios and should not be used", but I figured to heck with it, it's not a real production environment, and I was fine using a feature that is not supported. It was also poorly documented, but it seemed that I had what I needed - this question on StackOverflow also gave me hope that it was doable.

So, I set to work implementing a simple WinForms app to host the ActiveX control, with the "...Unsafe" interface properties set.


Except that as it turns out, by "unsupported", this time Microsoft meant "it does not work".
Well, if it did, this would be an SO question, sorry to lead you on (but I think its good to have it documented somewhere...)


However, not all was for naught, during all that digging into the RDP protocol, I looked at the RemoteFX USB Redirection - and that looked like a dead-end, since basic input devices (such as mouse, keyboard, printer) are explicitly blocked from the USB Redirection mechanism:

By default, devices in the aforementioned categories are accessible in the remote session by using high-level device redirection methods. These methods of redirection enable optimal performance and backward compatibility of the device in the majority of user scenarios. Consequently, these devices are not offered via RemoteFX USB redirection.

Well, the final answer, as it turns out, is that there is an override mechanism to this block.


Step 1: Enable RemoteFX USB Redirection
There is a nice elaboration here: http://windowsitpro.com/virtualization/q-how-do-i-enable-remotefx-usb-redirection . Basically, on the client machine, you use either Local Policy or Group Policy to set RemoteFX USB Device Redirection to Enable, and allow users (or just admins) the rights. Then gpupdate /force and reboot.

Step 2: Enable the redirection override for the mouse.
As this MS KB article explains, you can set a registry key to enable a specific device (or class of device) for USB Redirection.

Again on the client, under

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\Client\UsbSelectDeviceByInterfaces

you can add a string value with the device identifier.
For example, under this key I added the following string value:

"GUID_DEVINTERFACE_MOUSE"=""

Depending on your mouse, you might need a different identifier, so YMMV. But start with that.

Step 3: Set the RDP client to redirect the mouse.
As the article from step 1 stated:

Once it's enabled, access the Local Resources tab, click More under Local devices and resources, and you'll see a new Other supports RemoteFX USB devices setting. You can use this setting to map through many types of USB hardware that you couldn't with vanilla RDP USB redirection, as shown below.

Under that you should see an entry for your mouse; it might be a bit ambiguous such as:

Other devices redirection

Select your mouse (or other appropriate entry).

That's it! You now have a hardware mouse attached "directly" to your VM, which allows the 3D games to pull out the relative mouse movements directly from the mouse driver (-ish..)


However, as stated, there are some drawbacks.

  1. The mouse is redirected to the RemoteFX'd VM - in other words, the client machine no longer has a mouse, at least while the Remote Desktop session is open.
    A possible solution would be to attach a 2nd mouse, and redirect only one of them. (I have yet to try this, but it should work just fine).

  2. For some reason, when redirected the mouse does not directly show a cursor in the remote session. While it still works, it does make it a bit confusing to aim what your mouse is pointing at.
    A simple solution is to turn on Mouse Trails, with the length turned down all the way. Mouse trails
    This will have the mouse location show up, but it is a bit sluggish.

  3. Overall, while this solution does work well, the mouse is still a bit slow and sluggish.
    You can turn up the mouse speed, play with pointer precision (sometimes turning it OFF will actually help with this), and even twiddle with the mouse acceleration registry settings under HKEY_CURRENT_USER\Control Panel\Mouse (Mouse Speed, MouseThreshold1, and MouseThreshold2 respectively).
    This will help mitigate the problem, but not really make it go away.

So overall, this can make even 3D games very playable - for casual gaming, unfortunately not great for twitch gaming. (Though if you need that you can just boot metal straight into that VHD, and have both options....)

Хорошо сделано ... надеюсь, кто-то может использовать эту информацию для работы в других местах. Twisty Impersonator 9 лет назад 0
2
Journeyman Geek

Apparently remotefx does tablet style 'absolute' input modes only, which is the source of your issue. I can't find any documentation on changing it.

You may need to consider an alternate remote access mode - steam works well for me (using an nvidia GPU on the 'host' and a dinky little bay trail box on the other end). Nvidia has an option for their cards, but I've not really tried that.

In short, there's no obvious way to fix this with remotefx, unless the game could be set to use the input mode remotefx is using.

1
XBOX Controller

Remote Desktop transmits absolute mouse movements, as a way to reduce the number of mouse movement packets that need to be sent from client to server. This arrangement works well for most windows applications (email, web browsing etc). Many 2D games are also fine with this. However, FPS games generally need relative mouse movements in order to control mouselook, which Remote Desktop unfortunately does not transmit. The loss of relative mouse movement data is what causes the game to rotate the viewport unexpectedly. Microsoft would need to modify Remote Desktop in order to make this gaming scenario work. However, using the XBOX controller for PC with USB redirection might be an alterative for you.

Спасибо, я вроде знал это, и в основном повторял ответ @ Journeyman ... но контроллер - хорошее решение (хотя и не поможет мне ...) AviD 9 лет назад 0

Похожие вопросы