Frogging-Family / wine-tkg-git

The wine-tkg build systems, to create custom Wine and Proton builds
863 stars 156 forks source link

Sporadic missing keystrokes #498

Open insunaa opened 3 years ago

insunaa commented 3 years ago

Using wine-tkg 3c54897511bdeb25c1a8ac85e926614e2e3d1091 I noticed that on occasion some keypresses are just not registered by the application I'm using. In my particular use case that's in the game world of warcraft. I can't reliably reproduce it, it seem to happen after a combination of mouse inputs and keyboard inputs.

I notice this because sometimes I hit movement/direction keys and the character just does not start moving in this direction. I don't know in which version this went wrong, I only know it's definitely earlier than 6.16, earlier than 6.10 too I believe. The last Version that I know works is wine-tkg 6.0a

shaumux commented 3 years ago

Have you checked the proton logs and the kernel logs for any clues? Posting them here would be helpful in debugging if there any issues with proton

insunaa commented 3 years ago

@shaumux Thre are no proton logs because it's just wine-tkg not proton-tkg I'll try checking the kernel logs, but I'm not sure I'll see much there, but worth a try! :)

Edit: Apparently when I start the game with Lutris with wine-tkg 6.16 I can't select DirectX12 as graphics API in the game. I can select it with wine-tkg 6.0a

image

Edit: Weird thing is that it worked yesterday... I've used dxvk-tools to install the latest versions of dxvk&vkd3d-proton as runtimes for lutris. And with 6.0a it works and the vkd3d-proton library is picked up, but with 6.16 it is not

(I tried playing around in the customization.cfg and so far nothing has been successful)

Been monitoring journalctl and nothing suspicious came up so far

Edit: Removed the unnecessary bits about shader flickering. Opened a separate issue in the dxvk repo

as for the dx12 thing: wine-tkg Version 6.16

9/3 18:40:05.508  LogOpen
9/3 18:40:05.508  World of Warcraft Retail x86_64 2.5.2.40011
9/3 18:40:05.508  Windows 10 (10.0.17763) (wine emulation) x86_64
9/3 18:40:05.508  AMD Ryzen 9 5950X 16-Core Processor             | Sockets:1 Cores:16 Threads:32
9/3 18:40:05.508  31.3 GB System Memory
9/3 18:40:05.508  On AC Power - Battery Not Present
9/3 18:40:05.508  Force API D3D12
9/3 18:40:05.559  !: D3D12CreateDevice Failed
9/3 18:40:05.559  DX12 was forced but no DX12 capable device was found. Falling back to DX11...
9/3 18:40:05.663  !: D3D12CreateDevice Failed
9/3 18:40:05.663  Adapter 0: "NVIDIA GeForce RTX 3080" family:Unknown type:Unknown vendor:0x10de device:0x2206 driver(0xffffffffffffffff) location:0 dx11:true dx12:false
9/3 18:40:05.663    Monitor 0 "Generic Non-PnP Monitor" Size(2560x1440) Pos(0, 0)
9/3 18:40:05.663    Monitor 1 "Generic Non-PnP Monitor" Size(1920x1080) Pos(2560, 360)
9/3 18:40:05.693  No suitable device found. Attempting to use default device:
9/3 18:40:06.239  NotifyOnDeviceCreate
9/3 18:40:06.267  Dx11 Device Create Successful
9/3 18:40:06.267  <IsGPUDriverOutOfDate> No
9/3 18:40:06.272  Detected Graphics Defaults: 2 (CPU = 7, GPU = 2, MEM = 7) WindowSize: 2560x1440 WorldRenderSize: 1920x1080 (0.8)
9/3 18:40:06.321  Render Settings Changed. New Render Size: 2560x1440
9/3 18:40:18.573  Dx11 Device Destroy
9/3 18:40:18.574  NotifyOnDeviceDestroy
9/3 18:40:18.589  GxShutdown

vkd3d log:

04e0:info:vkd3d_get_vk_version: vkd3d-proton - applicationVersion: 2.4.0.
04e0:info:vkd3d_instance_init: vkd3d-proton - build: fa1d82e141b317d0.
04e0:err:vkd3d_create_vk_device: Failed to create Vulkan device, vr -3.
04e0:fixme:hresult_from_vk_result: Unhandled VkResult -3.

wine-tkg Version 6.0a

9/3 18:47:01.461  LogOpen
9/3 18:47:01.461  World of Warcraft Retail x86_64 2.5.2.40011
9/3 18:47:01.461  Windows 10 (10.0.17763) (wine emulation) x86_64
9/3 18:47:01.461  AMD Ryzen 9 5950X 16-Core Processor             | Sockets:1 Cores:16 Threads:32
9/3 18:47:01.461  31.3 GB System Memory
9/3 18:47:01.461  On AC Power - Battery Not Present
9/3 18:47:01.708  Adapter 0: "NVIDIA GeForce RTX 3080" family:Unknown type:Unknown vendor:0x10de device:0x2206 driver(0xffffffffffffffff) location:0 dx11:true dx12:true
9/3 18:47:01.708    Monitor 0 "Generic Non-PnP Monitor" Size(2560x1440) Pos(0, 0)
9/3 18:47:01.708    Monitor 1 "Generic Non-PnP Monitor" Size(1920x1080) Pos(2560, 360)
9/3 18:47:01.739  No suitable device found. Attempting to use default device:
9/3 18:47:01.739  D3d12 Device Create
9/3 18:47:01.739  DXGI_FEATURE_PRESENT_ALLOW_TEARING:true
9/3 18:47:01.844  DXGI_FORMAT_B8G8R8A8_UNORM UAV support: false
9/3 18:47:01.846  Ray Tracing Support: None
9/3 18:47:01.846  Variable Rate Shading Supported: true
9/3 18:47:02.382  NotifyOnDeviceCreate
9/3 18:47:02.403  D3d12 Device Create Successful
9/3 18:47:02.403  <IsGPUDriverOutOfDate> No
9/3 18:47:02.407  Detected Graphics Defaults: 2 (CPU = 7, GPU = 2, MEM = 7) WindowSize: 2560x1440 WorldRenderSize: 1920x1080 (0.8)
9/3 18:47:02.467  Render Settings Changed. New Render Size: 2560x1440
9/3 18:47:11.836  D3d12 Device Destroy
9/3 18:47:11.837  NotifyOnDeviceDestroy
9/3 18:47:11.893  GxShutdown

vkd3d log

05bc:info:vkd3d_get_vk_version: vkd3d-proton - applicationVersion: 2.4.0.
05bc:info:vkd3d_instance_init: vkd3d-proton - build: fa1d82e141b317d0.
05bc:warn:vkd3d_memory_info_find_global_mask: Blocking memory type 10 for use (PCI-pinned memory).
05bc:info:vkd3d_bindless_state_get_bindless_flags: Device does not support VK_VALVE_mutable_descriptor_type.
05bc:fixme:d3d12_device_caps_init_feature_options1: TotalLaneCount = 6528, may be inaccurate.
05bc:warn:d3d12_device_QueryInterface: {74eaee3f-2f4b-476d-82ba-2b85cb49e310} not implemented, returning E_NOINTERFACE.
05bc:warn:d3d12_device_QueryInterface: {5c014b53-68a1-4b9b-8bd1-dd6046b9358b} not implemented, returning E_NOINTERFACE.
05bc:warn:d3d12_device_QueryInterface: {9218e6bb-f944-4f7e-a75c-b1b2c7b701f3} not implemented, returning E_NOINTERFACE.
05bc:warn:d3d12_device_CheckFeatureSupport: Assuming device does not support tile based rendering.
05bc:info:vkd3d_get_vk_version: vkd3d-proton - applicationVersion: 2.4.0.
05bc:info:vkd3d_instance_init: vkd3d-proton - build: fa1d82e141b317d0.
05bc:warn:vkd3d_memory_info_find_global_mask: Blocking memory type 10 for use (PCI-pinned memory).
05bc:info:vkd3d_bindless_state_get_bindless_flags: Device does not support VK_VALVE_mutable_descriptor_type.
05bc:fixme:d3d12_device_caps_init_feature_options1: TotalLaneCount = 6528, may be inaccurate.
05bc:warn:d3d12_device_QueryInterface: {74eaee3f-2f4b-476d-82ba-2b85cb49e310} not implemented, returning E_NOINTERFACE.
05bc:fixme:d3d12_swapchain_init: Ignoring swap effect 0x4.
05bc:fixme:d3d12_swapchain_init: Ignoring swapchain flags 0x800.
05bc:fixme:rs_desc_from_d3d12: Ignoring MultisampleEnable 0x1.
insunaa commented 3 years ago

OK, at least for the DX12 issue I have a hint, and that is with wine-tkg 6.0a I can achieve the same non-functioning state by adding the environment variable VKD3D_CONFIG=dxr this breaks the dx12 compatibility in the exact same way.

Is dxr somehow an environment variable that wine-tkg 6.16 automatically passes to vkd3d?

Tk-Glitch commented 3 years ago

No, dxr isn't enabled by default in wine-tkg (nor is vkd3d). I have no problem running wow and other d3d12 games on 6.16 myself (with vkd3d-proton and without lutris). Make sure you're building wine with _use_vkd3dlib="false" set in your config, and ideally no vkd3d package installed.

Tk-Glitch commented 3 years ago

Also see https://github.com/HansKristian-Work/vkd3d-proton/issues/764 / https://github.com/HansKristian-Work/vkd3d-proton/issues/500 etc.

insunaa commented 3 years ago

That was indeed the issue for the dx12 thing, thank you and sorry for taking your time. Any idea what I could use to log the missing keystroke events? xev detects all keystrokes correctly.

I don't have exclusive mouse capturing enabled, in 6.0a this doesn't cause a problem, but could it be that between then and 6.16 something changed that would require exclusive mouse capturing? (I have a dual-monitor setup)

Tk-Glitch commented 3 years ago

thank you and sorry for taking your time

You're welcome. The more I'm aware of issues and solutions, the faster I can point them out when needed, so definitely not a time loss imho ;)

There has been quite a few changes to input handling in 8+ months :stuck_out_tongue: High polling rate devices can lead to such results when tickrate isn't high enough on the kernel side. Reducing the device polling rate or rebuilding your kernel with a higher tickrate might help.

This might be of interest to you: https://forums.lutris.net/t/wow-mouse-btn-on-hold-disturbs-keyboard-inputs/8172

insunaa commented 3 years ago

That is an issue I had before too and that particular issue was also fixed with the provided commands.

I'm currently using 5.13.13-195-tkg-pds with a 100hz tickrate, if I may ask what tickrate would you recommend?

Edit: whoa... I figured with a higher tickrate my power consumption would go up, but it actually went down :O I should've done this sooner. I'll add a new reply and close the issue if this fixed it. Thank you for all your help and your amazing work with the TkG tools and patchset!

Tk-Glitch commented 3 years ago

100 Hz is extremely low for interactive usage like gaming. I'd recommend trying 500+, 1000 Hz offering the lowest input latency which is likely to help here.

insunaa commented 3 years ago

OK, 1000hz kernel does not solve the issue, but it feels like it occurs less often. No empirical data on that, tho :(

Tk-Glitch commented 3 years ago

What kind of mouse/keyboard combo are you using?

insunaa commented 3 years ago

I'm using a gmmk as a keyboard and a razer naga (the one with the side keypad) as a mouse. There have been issues with this specific combo with Gnome's mutter compositor, but there's a discarded pull-request that I cherry-picked into my mutter compilation that fixes that (switching between keyboards causes a system hang for ~20ms)

Both are USB 2.0, the gmmk uses n-key rollover

One other thing I noticed: I have some flickering shaders which at first I thought were caused by dxvk, because they occurred when I was forced from d3d12 to d3d11 due to the nvidia driver issue. But after some more investigating and now being able to use d3d12 on 6.16 as well, the shader flickering is also present in vkd3d-proton on wine-tkg 6.16. It's present in 6.16 dxvk, 6.16 vkd3d and 6.0a dxvk. It does not seem to be present in 6.0a vkd3d and it isn't present either in WoWs "Legacy DX11" render path when using dxvk.

I've been trying my darndest to get this shader issue to show up in 6.0a vkd3d-proton but so far I've been unsuccessful.

Not sure what would be causing it tbh. might be a hardware issue, but that seems like a weird way for that to show up

Shader issue might be caused by nvidia driver and seems to only be present for people running this specific game on an RTX 3080 oO No relation to Wine. Sorry for the confusion

Still the dropped inputs thing is what is most concerning to me, because it seems to happen at very inconvenient times...

insunaa commented 3 years ago

Is there anything useful I could do to help you or anybody identify the issue? Any tools I could use, any specific logs I could check? journald and dmesg haven't produced anything meaningful so far... I'm getting a Mode SixtyFive keyboard in ~November, if you suspect it to be a keyboard issue I can test it then. I don't have a second mouse, but I could try reproducing the issue without a mouse plugged in? Tho so far I've been pretty sure that mouse inputs (such as move mouse-right-click-drag for viewport moving) were involved in making this issue occur.

I think the KBD67 Lite keyboard I built for someone has a 100hz polling rate, I'll test it with that for a while, then.

Tk-Glitch commented 3 years ago

I guess the next step will be to open a ticket on winehq. Maybe @rbernon knowns what's going on.

rbernon commented 3 years ago

Not really, but anything is possible and for instance that quickly pressed key cancel each other. It's hard to tell like that.