dosbox-staging / dosbox-staging

DOSBox Staging is a modern continuation of DOSBox with advanced features and current development practices.
https://www.dosbox-staging.org/
Other
1.3k stars 155 forks source link

Left mouse click sometimes not registered in Doom on macOS #1128

Closed Burrito78 closed 3 years ago

Burrito78 commented 3 years ago

Describe the bug Left mouse click in Doom is sometimes not registered (Fire weapon). Happens windowed and full screen.

To Reproduce Install Doom Shareware or Ultimate Doom. Configure for Keyboard + Mouse. Use left mouse button to fire your pistol.

Expected behaviour Every mouse click should fire the pistol.

Environment (please complete the following information): macOS Catalina Mac mini

Version of dosbox-staging: 0.77.0-2-gc7f51b07

Configuration parameters: Fresh installed Doom Shareware 1.9 from Doomworld Fresh dosbox-staging.conf

Additional context I tried my Logitech G305 with installed Logitech Gaming Software. Also disconnected the BT dongle and closed the Logitech software and connected a standard Logitech M100 wired mouse.

Burrito78 commented 3 years ago

Rebootet the system and the problem is gone.

Have to find out if its an incompatibility with another software running in the background or has something to do with cpu utilization.

kcgen commented 3 years ago

Thanks for the report, @Burrito78. If others hit this, we'll have a tally if this winds up being an infrequent system bug.

kcgen commented 3 years ago

Maybe related: https://apple.stackexchange.com/questions/36683/os-stops-receiving-left-primary-mouse-click

kcgen commented 3 years ago

@Burrito78 - given this issue didn't resolve when restarting DOSBox or swapping devices, but only resolved when the OS was restarted, I think this isolates the problem outside of SDL and DOSBox.

Think we can close it? (but will still be available on search hits)

Burrito78 commented 3 years ago

Couldn't reproduce this at all on my Macbook Pro with many open background tasks (mostly same tasks as the original system) and high cpu stress (Prime95 in "Torture" mode).

Will test tomorrow on the Mac mini some more and close the issue if i can't reproduce again.

dreamer commented 3 years ago

@Burrito78 is the issue reproducible in 0.76.0?

Burrito78 commented 3 years ago

I can reproduce the problem again on my 2012 mac Mini running latest Catalina (10.15.7).

Obviously its not only Doom. I've switched to Duke3d because the problem happens way more frequently in this game and firing the weapon is also way faster.

The issue is not with my system because i can't reproduce in 0.76.0-3!

While at it, checked out Win 64 and its clean!

Burrito78 commented 3 years ago

Console output after starting Dosbox with a fresh config and then starting Duke3D shareware:

Last login: Wed Jul  7 11:24:02 on ttys000
/Applications/dosbox-staging.app/Contents/MacOS/dosbox ; exit;
alex@Alexanders-Mini ~ % /Applications/dosbox-staging.app/Contents/MacOS/dosbox ; exit;
dosbox-staging version 0.77.0-2-gc7f51b07
---
CONFIG: Loading primary file /Users/alex/Library/Preferences/DOSBox/dosbox-staging.conf
MAIN: Sized window to 1120x840 with stretched pixels
OPENGL: Pixel buffer object extension: available
SDL: Mouse will move seamlessly without being captured.
MEMORY: Base address: 0x7fdfd0000000
MEMORY: Using 4096 DOS memory pages (16 MiB)
RENDER: Using GLSL shader 'default'
MIXER: Negotiated 2-channel 44100-Hz audio in 1024-frame blocks
MIDI: Opened device: coreaudio
MIXER: FM channel operating at 44100 Hz without resampling
MIXER: SB channel operating at 22050 Hz and upsampling to the output rate
MIXER: SPKR channel operating at 18939 Hz and upsampling to the output rate
MIXER: DISNEY channel operating at 10000 Hz and upsampling to the output rate
MAPPER: Found no joysticks
MAPPER: Can't find key binding for key_rctrl event
MAPPER: Loaded default key bindings
MAIN: Draw resolution: 640x400, pixel aspect ratio: 1.20
MOUNT: Path '/Users/alex/DOSBox' found, while looking for '~/dosbox'
DOSBox has switched to max cycles, because of the setting: cycles=auto.
If the game runs too fast, try a fixed cycles amount in DOSBox's options.
SB16: DSP was reset
SB16: DSP was reset
SB16: DSP was reset
SB16: DSP was reset
SB16: DSP was reset
SB16: Speaker-output has been toggled on
MAIN: Draw resolution: 320x200, double-width, double-height, pixel aspect ratio: 1.20
Burrito78 commented 3 years ago

Well, i found it.

It is my machine AND it is Dosbox.

To put a long story short: The Magnet app is OK with 0.76.0 but seems to really hate 0.77.0. Its almost as if Dosbox and Magnet are somehow fighting each other and therefore slowing input handling way down... https://magnet.crowdcafe.com

If i quit Magnet, both Staging versions work fine. With Magnet open, only 0.76.0 is working correctly.

Magnet is a desktop window management tool that can snap windows to your screen edges and arrange them for you.

Burrito78 commented 3 years ago

https://apple.stackexchange.com/questions/283941/macbook-pro-2016-left-click-lag-in-games https://www.nvidia.com/en-us/geforce/forums/gfn-tech-support/46/403869/left-mouse-button-lag-even-with-geforcenowstreamer/?topicPage=30

But why only with 0.77.0?

kklobe commented 3 years ago

https://apple.stackexchange.com/questions/283941/macbook-pro-2016-left-click-lag-in-games https://www.nvidia.com/en-us/geforce/forums/gfn-tech-support/46/403869/left-mouse-button-lag-even-with-geforcenowstreamer/?topicPage=30

But why only with 0.77.0?

While we figure that out, does it work to have Magnet ignore Staging, instead of having to quit it entirely?

Burrito78 commented 3 years ago

I can't open the Magnet option menu in the menu bar when dosbox staging has focus so i can't set it to ignore.

That menu doesn't open with 0.76.0 either, already tried that.

kcgen commented 3 years ago

@Burrito78 , can you try the branch: kc/event-stats-1 ?

macOS build is underway here: https://github.com/dosbox-staging/dosbox-staging/actions/runs/1008631870

It will log every round of event processing where at least one event was handled.

Here's a snipped from me playing Quake:

SDL: Host polling took  0.05 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.11 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.12 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.06 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.04 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.10 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.05 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.06 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.05 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.12 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.05 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.06 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.05 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.12 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.11 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.05 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.05 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.09 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.10 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.06 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.09 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.11 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.05 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.06 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.11 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.14 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.04 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.06 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.04 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.11 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.06 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.06 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.09 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.10 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.13 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.09 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.12 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.13 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.05 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.12 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.06 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.10 ms to process 4 events (1 window, 2 motion, 1 click, 0 mapper, 1 other)
SDL: Host polling took  0.11 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.02 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.11 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.03 ms to process 2 events (1 window, 0 motion, 1 click, 0 mapper, 1 other)
SDL: Host polling took  0.12 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.06 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)

The duration of polling isn't so import - beacuse these are actual events that were processed, regardless how laggy they might be (and to be fair - anything until 16ms is less than a single frame, so your input will take effect within the frame time).

What we want to see is if something different is happening when the left-click is lost.

kcgen commented 3 years ago

I added logging to make sure the mouse press and release events were being handled, and indeed nothing was being dropped or missed - so at least we know the clicks are coming through loud-and-clear between the mouse -> driver -> DOS -> SDL -> DOSBox:

Mouse_AddEvent(MOUSE_LEFT_PRESSED)
SDL: Host polling took  0.28 ms to process 2 events (1 window, 0 motion, 1 click, 0 mapper, 1 other)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
SDL: Host polling took  0.08 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.27 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
SDL: Host polling took  0.15 ms to process 2 events (1 window, 0 motion, 1 click, 0 mapper, 1 other)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
SDL: Host polling took  0.18 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
SDL: Host polling took  0.19 ms to process 2 events (1 window, 0 motion, 1 click, 0 mapper, 1 other)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
SDL: Host polling took  0.15 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
SDL: Host polling took  0.19 ms to process 2 events (1 window, 0 motion, 1 click, 0 mapper, 1 other)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
SDL: Host polling took  0.48 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.24 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  3.59 ms to process 0 events (0 window, 0 motion, 0 click, 0 mapper, 0 other)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
SDL: Host polling took  0.17 ms to process 2 events (1 window, 0 motion, 1 click, 0 mapper, 1 other)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
SDL: Host polling took  0.09 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
SDL: Host polling took  0.81 ms to process 2 events (1 window, 0 motion, 1 click, 0 mapper, 1 other)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
SDL: Host polling took  0.09 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
SDL: Host polling took  0.28 ms to process 2 events (1 window, 0 motion, 1 click, 0 mapper, 1 other)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
SDL: Host polling took  0.10 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
kcgen commented 3 years ago

Reproduce this playing Quake running the latest builds, 0.76 and SVN too.

It's more apparent at low fixed cycles < 20000, however even at higher cycles - I can perform an extremely quick tap that registers the events through DOSBox, however doesn't produce in-game fire.

Burrito78 commented 3 years ago

@Burrito78 , can you try the branch: kc/event-stats-1 ?

macOS build is underway here: https://github.com/dosbox-staging/dosbox-staging/actions/runs/1008631870

It will log every round of event processing where at least one event was handled.

The duration of polling isn't so import - beacuse these are actual events that were processed, regardless how laggy they might be (and to be fair - anything until 16ms is less than a single frame, so your input will take effect within the frame time).

What we want to see is if something different is happening when the left-click is lost.

Tested your build with Duke3D in fullscreen (320x200) on the Macbook (can reproduce there also now). At least three left mouse clicks got lost in a few seconds of playing.

Last login: Wed Jul  7 21:34:32 on ttys000

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
/Applications/dosbox-staging\ 0.78\ alpha.app/Contents/MacOS/dosbox ; exit;
Alexanders-MacBook-Pro:~ Alex$ /Applications/dosbox-staging\ 0.78\ alpha.app/Contents/MacOS/dosbox ; exit;
dosbox-staging version 0.78.0-alpha-8-g2c5ff8db
---
CONFIG: Loading primary file /Users/Alex/Library/Preferences/DOSBox/dosbox-staging.conf
MAIN: Sized window to 840x630 with stretched pixels
OPENGL: Pixel buffer object extension: available
SDL: Mouse will move seamlessly without being captured.
MEMORY: Base address: 0x7fb401400000
MEMORY: Using 4096 DOS memory pages (16 MiB)
RENDER: Using GLSL shader 'default'
MIXER: Negotiated 2-channel 44100-Hz audio in 1024-frame blocks
MIDI: Opened device: coreaudio
MIXER: FM channel operating at 44100 Hz without resampling
MIXER: SB channel operating at 22050 Hz and upsampling to the output rate
MIXER: SPKR channel operating at 18939 Hz and upsampling to the output rate
MIXER: DISNEY channel operating at 10000 Hz and upsampling to the output rate
MAPPER: Found no joysticks
MAPPER: Can't find key binding for key_rctrl event
MAPPER: Loaded default key bindings
MOUNT: Path '~/DOSBox' found
MAIN: Draw resolution: 640x400, pixel aspect ratio: 1.20
SDL: Host polling took 438.55 ms to process 8 events (5 window, 1 motion, 0 click, 2 mapper, 3 other)
SDL: Host polling took 24.63 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.33 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.31 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.48 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.27 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.37 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.69 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.38 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.65 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.32 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.48 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.66 ms to process 3 events (0 window, 0 motion, 0 click, 3 mapper, 0 other)
SDL: Host polling took  0.32 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.56 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.28 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.59 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.29 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.56 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.31 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.53 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.44 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.45 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.30 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.53 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.34 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.79 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.33 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.92 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.48 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.38 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.32 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.45 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.30 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.51 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.28 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.71 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.33 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.78 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.28 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.43 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
DOSBox has switched to max cycles, because of the setting: cycles=auto.
If the game runs too fast, try a fixed cycles amount in DOSBox's options.
SDL: Host polling took  0.39 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SB16: DSP was reset
SB16: DSP was reset
SB16: DSP was reset
SB16: DSP was reset
SB16: DSP was reset
SB16: Speaker-output has been toggled on
MAIN: Draw resolution: 320x200, double-width, double-height, pixel aspect ratio: 1.20
SDL: Host polling took  1.82 ms to process 1 events (1 window, 0 motion, 0 click, 0 mapper, 1 other)
SDL: Host polling took  3.36 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.33 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.46 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.30 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.89 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.38 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.54 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.41 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.53 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.29 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.54 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: captured the mouse
SDL: Host polling took 677.35 ms to process 8 events (5 window, 0 motion, 0 click, 3 mapper, 2 other)
SDL: Host polling took  0.60 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.31 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.49 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.37 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.54 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.40 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.62 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.34 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.62 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.33 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.54 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.35 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.59 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.64 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.38 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.53 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.32 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.33 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took 13.61 ms to process 0 events (0 window, 0 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.07 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.84 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  1.03 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.49 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.86 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.45 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.86 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.45 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  1.07 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.52 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.87 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.48 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.92 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.51 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.93 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.47 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.94 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.42 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.98 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.58 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.97 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.50 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  1.82 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.75 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.90 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.49 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.88 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.44 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.95 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.44 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.49 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.63 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  1.18 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.41 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.47 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.58 ms to process 1 events (0 window, 0 motion, 1 click, 0 mapper, 0 other)
SDL: Host polling took  0.71 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.46 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took 11.64 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.43 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.46 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.38 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.67 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.57 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.39 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.38 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.54 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SB16: Speaker-output has been toggled off
SB16: DSP was reset
MAIN: Draw resolution: 640x400, pixel aspect ratio: 1.20
SDL: Host polling took  0.45 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.52 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.29 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.72 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.39 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.62 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.33 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.68 ms to process 2 events (0 window, 0 motion, 0 click, 2 mapper, 0 other)
SDL: Host polling took  0.33 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: Host polling took  0.44 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
SDL: released the mouse
SDL: Host polling took 827.52 ms to process 10 events (6 window, 1 motion, 0 click, 3 mapper, 3 other)
SDL: Host polling took  5.82 ms to process 2 events (0 window, 2 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.89 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.73 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.00 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  2.11 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.25 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  4.92 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.47 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  4.76 ms to process 2 events (0 window, 2 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  2.23 ms to process 2 events (0 window, 2 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.05 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  2.70 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.51 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.14 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.95 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.98 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  2.36 ms to process 2 events (0 window, 2 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  3.52 ms to process 2 events (0 window, 2 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.92 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.24 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.58 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.82 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.65 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.96 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  2.30 ms to process 2 events (0 window, 2 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.92 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.56 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.19 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.83 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.07 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.90 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.08 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.73 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.99 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.48 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.93 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.61 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.55 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.99 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  2.13 ms to process 2 events (0 window, 2 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.94 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.51 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.27 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.61 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.00 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.61 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  3.45 ms to process 2 events (0 window, 2 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.99 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.14 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.78 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  2.53 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.66 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  3.04 ms to process 2 events (0 window, 2 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  2.47 ms to process 2 events (1 window, 1 motion, 0 click, 0 mapper, 1 other)
SDL: Host polling took  4.06 ms to process 0 events (0 window, 0 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  3.38 ms to process 0 events (0 window, 0 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  3.59 ms to process 0 events (0 window, 0 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  3.53 ms to process 0 events (0 window, 0 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  3.11 ms to process 0 events (0 window, 0 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  3.40 ms to process 0 events (0 window, 0 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  2.50 ms to process 2 events (1 window, 1 motion, 0 click, 0 mapper, 1 other)
SDL: Host polling took  1.96 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.91 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.99 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  2.58 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.86 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.60 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.94 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.85 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  3.12 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.60 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.77 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.98 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.14 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  2.07 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.46 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  2.65 ms to process 2 events (0 window, 2 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  2.59 ms to process 2 events (0 window, 2 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.51 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  0.91 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  2.20 ms to process 1 events (0 window, 1 motion, 0 click, 0 mapper, 0 other)
SDL: Host polling took  1.11 ms to process 2 events (1 window, 1 motion, 0 click, 0 mapper, 1 other)
SDL: Host polling took  0.45 ms to process 1 events (0 window, 0 motion, 0 click, 1 mapper, 0 other)
kcgen commented 3 years ago

Thanks @Burrito78,

On my Linux systems, I can get dropped mouse clicks on the latest build, Staging 0.76, and DOSBox SVN (they all behave the same for me) if I click with a very short timframe.

I've updated the branch to exclusively report left click events:

Mouse_AddEvent(MOUSE_LEFT_PRESSED)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)

When I run Quake at cycles = 20000 and do extremely short-lived quick taps on the mouse, the clicks will register in the log (a pair of events above), but the game won't register them (ie: no gun fire).

Curious if you see this same behaviour. New macOS build is here: https://github.com/dosbox-staging/dosbox-staging/actions/runs/1009326305

Burrito78 commented 3 years ago

Thanks @Burrito78,

On my Linux systems, I can get dropped mouse clicks on the latest build, Staging 0.76, and DOSBox SVN (they all behave the same for me) if I click with a very short timframe.

I've updated the branch to exclusively report left click events:

Mouse_AddEvent(MOUSE_LEFT_PRESSED)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)

When I run Quake at cycles = 20000 and do extremely short-lived quick taps on the mouse, the clicks will register in the log (a pair of events above), but the game won't register them (ie: no gun fire).

Curious if you see this same behaviour. New macOS build is here: https://github.com/dosbox-staging/dosbox-staging/actions/runs/1009326305

Hi @kcgen,

thanks for helping. With your build and Quake_SW 1.06 fixed cycles 20000 (damn slow, btw) i too see missed left clicks (weapon didn't fire). For me, they are just clicks as i can't click "fast" or "slow" on the Macbook Trackpad. This is all without running the Magnet app!

MAIN: Draw resolution: 320x200, double-width, double-height, pixel aspect ratio: 1.20
SB16: DSP was reset
SB16: Speaker-output has been toggled on
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
Mouse_AddEvent(MOUSE_LEFT_PRESSED)
Mouse_AddEvent(MOUSE_LEFT_RELEASED)
SB16: Speaker-output has been toggled off
SB16: DSP was reset
kklobe commented 3 years ago

also able to repro this on M1 MacBook with a local build.

kcgen commented 3 years ago

also able to repro this on M1 MacBook with a local build.

This is great news @kklobe.

Can you give 0.76 a try too? We didn't have M1 back then, but hopefully you can get a build out of it (test with core = normal):

git checkout remotes/origin/release/0.76.x
./scripts/build.sh -c clang -t release --disable-fluidsynth

Binary is src/dosbox directory. Also repros w/ SVN on Linux.

But I don't know if this specific issue (Quake @ 20k not shooting on extremely quick left-clicks) is what @Burrito78 is experiencing with Magnet..

@kklobe, another interesting bit: keyboard events always register in Quake @ 20k. When I follow the code up, unfortunately the paths into DOS are very different.. the mouse activates an IRQ, which is somewhat throttled and has a PIC delay (I've tried removing those throttles and trying vastly different delays.. all without any change).

kcgen commented 3 years ago

@Burrito78 , when you run that last latest testing build you mentioned above (https://github.com/dosbox-staging/dosbox-staging/actions/runs/1009326305) with Magnet - does it still exhibit the same issue? In that build, I removed a poll-limiter, so it now 'over-polls' similar to 0.76.. but for me, this change didn't help (as I'm seeing the issue w/ 0.76 too)

kklobe commented 3 years ago

Can you give 0.76 a try too? We didn't have M1 back then, but hopefully you can get a build out of it (test with core = normal):

Same behavior with core=normal and cycles=20000.

@kklobe, another interesting bit: keyboard events always register in Quake @ 20k. When I follow the code up, unfortunately the paths into DOS are very different.. the mouse activates an IRQ, which is somewhat throttled and has a PIC delay (I've tried removing those throttles and trying vastly different delays.. all without any change).

I tried the same things! Hopefully we can zero in on the root cause.

Burrito78 commented 3 years ago

@kcgen Running Duke3D with the latest build (your link) with Magnet, the problem is gone. Fired 200 shots to be sure. :) Directly checked against 0.77 and problem happens after 3 clicks...i think you found something!

kcgen commented 3 years ago

Fired 200 shots to be sure :)

He's dead Jim. :laughing:

Running Duke3D with the latest build (your link) with Magnet, the problem is gone.

Great! Even though it's gone, we're back to polling thousands of time a second, which isn't recommended by SDL maintainers. Let's try to find a sweet spot.

@Burrito78 , can you try another build again with Magnet?

The new build: https://github.com/dosbox-staging/dosbox-staging/actions/runs/1012161093, steps up polling to twice within one frame period. This is still twice as fast as before. If that doesn't work, we'll try 3x ... but hopefully we won't have to go there!

Do you have a build environment? If so, you can control the polls-per-frame: Edit src/gui/sdlmain.cpp, search for polls_per_frame, and adjust the number :-)

Burrito78 commented 3 years ago

@kcgen This new build is much better but there are still some clicks lost when running magnet. I'd say that from 100 clicks, 1-2 clicks are lost.

Maybe you could increase the limit still a little bit and we try again?

If i'd try to do my own builds that would result in more problems then its worth, imho. :)

kcgen commented 3 years ago

This new build is much better but there are still some clicks lost when running magnet.

Sounds like we're close!

Maybe you could increase the limit still a little bit and we try again?

Here's a couple builds:

If i'd try to do my own builds that would result in more problems then its worth, imho. :)

No worries!

Burrito78 commented 3 years ago

@kcgen The three cycles build is fine! Thanks everyone for helping to nail this one down!

kcgen commented 3 years ago

@Burrito78 , thanks for the confirmation!

Would you be able to try one more binary?

https://github.com/dosbox-staging/dosbox-staging/actions/runs/1015878804

This changes the approach slightly:

This approach takes both the DOS world and SDL's recommendation (of processing events once per video frame) into consideration - by using the quicker of the two.

This binary still has the DEBUG logging of latency overages and left-click events (just to confirm that the click event is being handled by DOSBox and emulated on the DOS side).

Burrito78 commented 3 years ago

@kcgen With the latest build i'm at around 1-2 missed clicks out of 200. Definitely not the perfect score i got with the "three cycles" build. Does it make sense to you that the newest build performs slightly worse on my end?

kcgen commented 3 years ago

Ahh ok - sounds like we still need to do multiple rounds - I will re-add that! Thank you for the quick feedback.

kcgen commented 3 years ago

@Burrito78 - updated build is here: https://github.com/dosbox-staging/dosbox-staging/actions/runs/1016591209 (Thank you for all of these checks!)

Burrito78 commented 3 years ago

@kcgen Latest build is good, no missed clicks anymore. I start to really hate shooting in video games recently... :)

kcgen commented 3 years ago

Thanks @Burrito78 -- time to get this PR'd and backported to 0.77.1 (if anyone else is using Magnet)!

kcgen commented 3 years ago

I've tested the build on Windows and Linux hardware, and clicks are behaving as they were previously too.

Burrito78 commented 3 years ago

@kcgen Got some news. I suspected because of Google results that all macOS window management tools are problematic with some apps and can cause missed mouse clicks in games and some other software.

But i just tested Better Touch Tool (one of the most popular macOS tools out there) against staging 0.77 and it doesn't cause any problems. Instead it even allows proper window management of the Dosbox window (unlike Magnet which is broken also on the window handling side with Dosbox).

So maybe, after all this troubleshooting, its a Magnet issue afterall. Good you reported this already to them, @kcgen . Let's see how and if they reply.