|
c8866658
|
2018-08-15T19:53:30
|
|
Catch device removal as well as device arrival on Windows
|
|
641c674f
|
2018-08-15T19:53:28
|
|
Turned off debug messages
|
|
51902010
|
2018-08-15T19:53:26
|
|
Remove the HIDAPI device if we get a read error from it
This fixes detecting PS4 controller disconnect on Mac OS X, where there isn't any device removed notification
|
|
dfbd7f65
|
2018-08-15T19:53:24
|
|
Fixed Mac OS X build
|
|
ec74c318
|
2018-08-15T19:53:22
|
|
Polling hid_enumerate() every 3 seconds causes freezes and stutters on some USB audio devices and mice.
We'll only enumerate devices when we get notification that the system devices have changed
|
|
2dc04b4c
|
2018-08-10T15:22:02
|
|
libm: one more static analysis fix.
|
|
67a48ad1
|
2018-08-10T15:04:08
|
|
haiku: Patched to compile with new joystick interfaces.
|
|
e1ac643b
|
2018-08-10T14:54:26
|
|
bsd: Patched to compile.
(I think.)
|
|
67764070
|
2018-08-10T14:42:40
|
|
bsd: Update joystick code for new interfaces.
(this is an untested push to see if buildbot likes it.)
|
|
b692c352
|
2018-08-10T14:32:30
|
|
emscripten: Patched to compile with new joystick interfaces.
|
|
941f8ecf
|
2018-08-10T14:10:47
|
|
joystick: define inline to SDL_INLINE
|
|
0b2863d4
|
2018-08-10T14:09:44
|
|
joystick: #if 0'd out some things that aren't currently used.
Fixes some compiler warnings.
|
|
a7c3d2af
|
2018-08-10T11:50:55
|
|
SDL_hidapi_ps4.c: lowercase windows header names.
|
|
4f41f07d
|
2018-08-09T16:05:48
|
|
Added missing files from previous commits
|
|
31b02243
|
2018-08-09T16:04:45
|
|
Added notes that this code was contributed by Valve
|
|
99759bac
|
2018-08-09T16:04:34
|
|
There's no controller that's supported by both XInput and HIDAPI
|
|
ab07ce11
|
2018-08-09T16:04:30
|
|
Don't update the device list for devices we know aren't supported
This should reduce HID enumeration (hitting the USB bus) if for some reason we're getting spammed with false device insert/removal events
|
|
28e0c0ee
|
2018-08-09T16:04:21
|
|
Sam Lantinga <slouken@libsdl.org> 2018-08-06 13:00 -0700
Backed out changeset 794a209b2270
http://hg.libsdl.org/SDL/rev/2e2ecdac957c
|
|
25a952e7
|
2018-08-09T16:04:18
|
|
Sam Lantinga <slouken@libsdl.org> 2018-08-06 11:58 -0700
Removed mapping for VID/PID 0x0079/0x0006, which is a generic PCB used in many different devices
http://hg.libsdl.org/SDL/rev/794a209b2270
|
|
888bf1af
|
2018-08-09T16:03:50
|
|
Worked around bug with Sony PS Now PS3 controller where DirectInput polling will continue to return success after the controller is unplugged.
The code is now reliant on SDL_PrivateJoystickAdded() and SDL_PrivateJoystickRemoved() being called correctly when devices are added or removed on Windows
|
|
f35e97ba
|
2018-08-09T16:03:29
|
|
Fixed Windows build
|
|
d2042e1e
|
2018-08-09T16:00:17
|
|
Added HIDAPI joystick drivers for more consistent support for Xbox, PS4 and Nintendo Switch Pro controller support across platforms.
Added SDL_GameControllerRumble() and SDL_JoystickRumble() for simple force feedback outside of the SDL haptics API
|
|
ba90412c
|
2018-08-08T15:39:20
|
|
libm: Don't let Visual Studio generate an implicit memset() call.
|
|
4cb84b8f
|
2018-08-08T12:36:54
|
|
backout INFINITY change...of course Visual Studio doesn't have it.
|
|
257071fc
|
2018-08-08T12:19:01
|
|
e_exp: One more compiler warning.
|
|
550437ed
|
2018-08-08T12:13:56
|
|
libm: Fixed all static analysis warnings.
|
|
c0aa626b
|
2018-08-08T10:26:22
|
|
e_exp: Fixed compiler warning on Visual Studio.
|
|
941c5b47
|
2018-08-07T18:07:11
|
|
haiku: Rename internal functions from BE_* to HAIKU_*
Fixes Bugzilla #2349.
|
|
f59b0056
|
2018-08-07T16:56:46
|
|
evdev: On sudden termination, make sure keyboard isn't lost (thanks, Tadek!)
"In release 2.0.6, when Linux evdev keyboard support has been moved to a
separate source file, a feature was added to disable normal keyboard event
processing to prevent "spilling" keystrokes to background virtual console.
This feature has one unpleasant side effect: if application fails to call
`SDL_Exit` before termination or crashes with fatal signal, console is left
in unusable state with keyboard not working and no possibility to switch
virtual console. If user has a chance, he can login remotely and restore
keyboard with `kbd_mode`, otherwise the only option is to reboot the machine.
This patch fixes that problem by intercepting fatal signals (with `sigaction`)
and process termination (with `atexit`), to restore keyboard state, if it
wasn't properly restored with `SDL_Exit`.
The function registered with `atexit` also restores original signal handlers,
to prevent leaving invalid handlers after SDL library is unloaded, if it was
loaded dynamically with `dlopen`.
No signal handlers or `atexit` function are installed if SDL boolean hint
`SDL_HINT_NO_SIGNAL_HANDLERS` is `SDL_TRUE`.
Additionally, if environment variable `SDL_INPUT_LINUX_KEEP_KBD` exists,
keyboard initialization function completely skips disabling keyboard. This
can be useful for debugging."
Fixes Bugzilla #4193.
|
|
623a6def
|
2018-08-07T16:49:18
|
|
alsa: optionally run entire pipeline non-blocking.
|
|
56f44cfa
|
2018-08-07T13:04:15
|
|
audio: Deal with device shutdown more carefully.
This would cause problems in various ways, but specifically triggers an
assert when you close a WASAPI capture device in an app running over RDP.
Related to (but not the actual bug) in Bugzilla #3924.
|
|
e714f659
|
2018-08-07T12:06:31
|
|
haptic: Fix initial detection of haptic devices on Linux system
SDL_UDEV_Scan must be called during SDL_SYS_HapticInit to ensure devices
outside of the 0-31 range are added to the list of haptic devices.
Fixes Bugzilla #3923.
|
|
a37d3e0b
|
2018-08-06T13:00:11
|
|
Backed out changeset 794a209b2270
It turns out the mapping is correct, just the name was confusing
|
|
cc682f20
|
2018-08-06T11:58:08
|
|
Removed mapping for VID/PID 0x0079/0x0006, which is a generic PCB used in many different devices
Different device with same vid/pic that is kind of a Saitek shape:
https://www.trust.com/en/product/17416-gxt-24-runa-compact-gamepad
n64 with same ID
https://bbs.archlinux.org/viewtopic.php?id=163488
PS shaped with numbers for buttons
https://pineight.com/mw/index.php?title=USB_game_controller#DragonRise_Inc._Generic_USB_Joystick
fightstick with same vid/pid
https://retropie.org.uk/forum/topic/7594/bartop-2-player-zero-delay-encoders-not-working
|
|
f45f33bd
|
2018-08-05T10:01:01
|
|
SDL_expf: return SDL_exp() instead of SDL_uclibc_exp() for consistency.
|
|
b4fe7412
|
2018-08-04T11:52:46
|
|
SDL_exp
|
|
e061a92d
|
2018-08-02T16:03:47
|
|
Some drag'and'drop improvements.
First: disable d'n'd events by default; most apps don't need these at all, and
if an app doesn't explicitly handle these, each drop on the window will cause
a memory leak if the events are enabled. This follows the guidelines we have
for SDL_TEXTINPUT events already.
Second: when events are enabled or disabled, signal the video layer, as it
might be able to inform the OS, causing UI changes or optimizations (for
example, dropping a file icon on a Cocoa app that isn't accepting drops will
cause macOS to show a rejection animation instead of the drop operation just
vanishing into the ether, X11 might show a different cursor when dragging
onto an accepting window, etc).
Third: fill in the drop event details in the test library and enable the
events in testwm.c for making sure this all works as expected.
|
|
8f0cc4a4
|
2018-07-22T19:42:08
|
|
Backed out changeset 2e42ec46061e.
This change isn't correct. See comments in Bugzilla #4183.
|
|
1089944b
|
2018-07-22T19:40:42
|
|
libm: Fixed signature mismatches for __ieee754_rem_pio2 and __kernel_rem_pio2.
Fixes Bugzilla #4201.
|
|
862aa4b4
|
2018-07-22T19:28:27
|
|
windows: Fixed some Visual Studio warnings about shadowed variables.
Fixes Bugzilla #4118.
|
|
b5a420cb
|
2018-07-13T17:53:24
|
|
dbus: Deal with undefined behavior with va_args.
Parse out a copy of the varargs ourselves to get to the reply portion, since
the original passed to D-Bus might modify or not modify the caller's copy,
depending on system ABI.
|
|
df0d3f13
|
2018-07-12T13:28:15
|
|
More controller drivers support CARTESIAN coordinates.
This fixes rumble on the Saitek Cyborg V.3 Rumble Pad
|
|
ff8c9538
|
2018-07-12T13:28:13
|
|
Allow trapping the back button so right mouse click can work on some Android systems (thanks Rachel!)
Also, added a function SDL_AndroidBackButton() so applications can respond to the back button directly
|
|
c3178e67
|
2018-07-12T16:52:45
|
|
Ensure we still clear the X locale modifiers even if not compiled with ibus or fcitx support
|
|
ff8c62f2
|
2018-07-02T03:53:57
|
|
Fixed bug 4210 - SSE2-based converter makes junk result of S32 -> Float
At the HG state abdd17144682, 64-bit assemblies are using SSE2-based resampler, produces junk sound when converting the S32 -> Float32 -> S16 chain. The `NEED_SCALAR_CONVERTER_FALLBACKS` thing works perfectly.
If I will find a reason that caused this mistake, I'll send a patch by myself.
|
|
013b146d
|
2018-06-30T20:55:51
|
|
SDL_windowstaskdialog.h (struct _TASKDIALOGCONFIG): make unions anonymous
otherwise build fails. (at least with my VS2005. and the code accesses the
arms of the unions anonymously anyway.)
|
|
949b8bd8
|
2018-06-30T20:10:40
|
|
correct the comment correction..
|
|
67f18a19
|
2018-06-30T20:04:01
|
|
comment correction
|
|
7c2028f8
|
2018-06-29T16:56:11
|
|
Attempt to fix "cast from pointer to integer of different size" warnings.
|
|
52857de2
|
2018-06-29T16:55:55
|
|
Corrected a comment.
|
|
3b173f81
|
2018-06-25T23:00:38
|
|
Patched to compile on Visual Studio (typo).
|
|
58168a8c
|
2018-06-25T16:34:16
|
|
atomic: Fight with all the assemblers that don't like REP NOP. :/
|
|
5f123e31
|
2018-06-25T15:58:35
|
|
atomic: Spin locks now try to use the x86 PAUSE instruction for short waits.
Fixes Bugzilla #4151.
|
|
5a8ecf4e
|
2018-06-25T13:14:52
|
|
yuv: Patched to make static analysis happy (warned about unused variable).
|
|
4773690d
|
2018-06-25T12:55:23
|
|
Deal with possible malloc(0) calls, as pointed out by static analysis.
|
|
915a7e03
|
2018-06-25T01:57:28
|
|
gles2: Whoops, overzealous copy/paste on my part. :)
|
|
c8ac9096
|
2018-06-24T22:42:36
|
|
wayland: Implemented xdg-wm-base support.
This is just in parity with the existing zxdg-shell-unstable-v6 code. Making
the Wayland target robust (and uh, with title bars) is going to take a lot
of work on top of this.
|
|
59574fe2
|
2018-06-24T13:57:22
|
|
x11: Normalize x11xinput2 touch x to be 1.0 at width (thanks, Zach!).
"Applications (such as SDL's testgesture) do "event.tfinger.x * window_width"
to find window coord. Currently the X11 XInput2 backend expects application
to do "event.tfinger.x * (window_width-1)" instead.
X11 XInput2 touch events are normalized so x is 1.0 at "width - 1" but other
SDL backends appear to have x be 1.0 at "width". Same issue for touch event
y with regards to height."
Fixes Bugzilla #4183.
|
|
5308a245
|
2018-06-24T12:16:58
|
|
Fixed some possible malloc(0) calls reported by static analysis.
|
|
88dfa466
|
2018-06-18T13:14:04
|
|
Use a blank cursor instead of PointerIcon.TYPE_NULL since that shows the default cursor on Samsung DeX
|
|
a5158535
|
2018-06-18T13:14:02
|
|
Added support for external mouse in Samsung DeX mode
relative mode doesn't work, but absolute coordinates are functional
|
|
74ec7cab
|
2018-06-18T13:13:56
|
|
Fixed race condition where Android touch events could get scaled by a render target's viewport
|
|
9924a8e3
|
2018-06-14T00:51:45
|
|
Fixed bug 4094 - No SDL_TEXTEDITING after pressing Alt key on Raspberry Pi Linux
This was reproducible by running an SDL app on the console from an ssh login. In this case the terminal wasn't owned by the user running the app, so we were using the default keymap, which didn't have state transitions defined for ctrl and alt, so once we entered that state keypresses would no longer transition out of that state, nor would they generate text.
As a workaround, we'll just reset to the default shift state if that happens, which means we'll get text for keys pressed while ctrl is held down, but I don't think that's a big problem.
Note that in this case we also can't mute the keyboard, so the keypresses go to the console, which probably isn't what you want...
|
|
fe682827
|
2018-06-14T06:12:12
|
|
egl: Don't change context when deleting current.
If we change the current context behind the app's back, those tracking
the current context to minimize context changes are going to get
confused.
This brings the EGL backend in line with the GLX one.
Fixes Bugzilla #4199.
|
|
08de74ec
|
2018-06-13T14:45:02
|
|
use the 'aborts' pragma of Watcom for SDL_NORETURN functions
SDL_ExitProcess(), SDL_AbortAssertion() and SDLTest_BailOut().
(Commit 303c1e0fb0cf for bug #4100 removed SDL_NORETURN from
SDL_ExitProcess() and SDL_AbortAssertion() in order to avoid
warnings from windows builds, but that's temporary I guess..)
|
|
4a4bac95
|
2018-06-12T13:22:58
|
|
Deal with fullscreen limitations under windowed Android environments (Chromebook, DeX, etc.) (Thanks Rachel!)
|
|
864b8f89
|
2018-06-12T01:04:26
|
|
Merged in community contributed controller mappings from https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt
|
|
12059782
|
2018-06-12T00:18:10
|
|
Added common controllers used with Steam Big Picture
These are entirely untested
Several USB ids refer to multiple packaged products. In those cases I tried to use the most common name, or a general name (e.g. PS3 Controller), or a completely generic name (e.g. USB gamepad) if it wasn't clear what type of controller it was.
Patches welcome!
|
|
fe196db7
|
2018-06-07T17:07:03
|
|
Track android device panel width & height as well as window surface & height.
Expand SDLActivity::SDLSurface::surfaceChanged() callback to grab the panel width and height at the same time and pass that along to the native code. Only works on API 17+. Duplicates surface dimensions whenever it fails.
Add Android_DeviceWidth/Android_DeviceHeight globals to native code.
Disambiguate Android_ScreenWidth/Android_ScreenHeight -> Android_SurfaceWidth/Android_SurfaceHeight
Use device width/height for all display mode settings.
|
|
db86e7a6
|
2018-06-07T10:54:54
|
|
Added support for the PS3 controller driver in PlayStation Now
|
|
113801b7
|
2018-06-05T12:46:13
|
|
Added SDL_IsChromebook() to determine if we're running on a Chromebook.
|
|
2dedbc72
|
2018-06-05T12:46:11
|
|
Add Android support for relative mouse mode to SDL.
|
|
9d6ac3de
|
2018-06-05T12:46:09
|
|
Fix creating a minimized window in SDL to not cause focus to be stolen (because ShowWindow( hwnd, SW_MINIMIZE ) would be called after creation, thus changing focus to the prior window based on some per-app list in windows, rather than the window being created with WS_MINIMIZED to start with).
This means we have to consider SDL_WINDOW_MINIMIZED a window creation flag, but on non-windows platforms we just remove it and let the normal FinishWindowCreation re-apply and do the minimize as I have no idea what is right on them or if anything should change.
CR: Phil
|
|
1d25135b
|
2018-06-01T19:43:53
|
|
Fixed bug 4184 - jack audio driver fails in presence of midi ports
Martin ?irokov
Launching an SDL application with SDL_AUDIODRIVER=jack, and then calling SDL_OpenAudioDevice() with whatever parameters fails with an error like this one:
SDL_OpenAudioDevice: Couldn't connect JACK ports: SDL:sdl_jack_output_0 => system:midi_playback_1
This happens because JACK_OpenDevice in src/audio/jack/SDL_jackaudio.c blindly tries to connect to all input ports without checking whether they are for audio or midi.
The fix is to check port types and ignore all non audio ports. Also I removed devports field from struct SDL_PrivateAudioData, because it's never really used and removing unused ports from it would be PITA.
|
|
ff6aebc4
|
2018-05-29T08:03:44
|
|
Added a new GUID for DS3 controller connected over bluetooth, for both Sony and Shanwan (thanks William!)
|
|
3d387098
|
2018-05-27T20:30:03
|
|
metal: contrary to documentation, we need to set the drawableSize explicitly.
Fixes Bugzilla #4149.
|
|
8325df25
|
2018-05-24T07:30:24
|
|
Fixed bug 4169 - Crash due to audio session observer race condition
Jona
The following explains why this bug was happening:
This crash was caused because the audio session was being set as active [session setActive:YES error:&err] when the audio device was actually being CLOSED. Certain cases the audio session being set to active would fail and the method would return right away. Because of the way the error was handled we never removed the SDLInterruptionListener thus leaking it. Later when an interruption was received the THIS_ object would contain a pointer to an already released device causing the crash.
The fix:
When only one device remained open and it was being closed we needed to set the audio session as NOT active and completely ignore the returned error to successfully release the SDLInterruptionListener. I think the user assumed that the open_playback_devices and open_capture_devices would equal 0 when all of them where closed but the truth is that at the end of the closing process that the open devices count is decremented.
|
|
b3173d9d
|
2018-05-23T17:15:37
|
|
Added support for the NVIDIA SHIELD handheld gaming device
|
|
361043a5
|
2018-05-23T17:15:33
|
|
Actually left trigger is motion axis 17 and right trigger is motion axis 18, which will map in that order to SDL axes.
|
|
4d9a3469
|
2018-05-23T16:00:21
|
|
Added additional supported Android controllers
|
|
c07656db
|
2018-05-23T16:00:19
|
|
Fixed default mapping for Android controller triggers (they were reversed)
|
|
101544d6
|
2018-05-21T12:05:17
|
|
audio: Needed to fix two more instances for Visual Studio.
|
|
0ad4b0b6
|
2018-05-21T12:00:21
|
|
thread: fixed compiler warnings on non-Linux systems that use pthread.
(static function rtkit_setpriority was unused, moved it in with rest of
__LINUX__ section.)
|
|
49881861
|
2018-05-21T11:54:09
|
|
audio: Patched to compile on Visual Studio.
(It gets upset at the -2147483648, thinking this should be an unsigned value
because 2147483648 is too large for an int32, so the negative sign upsets the
compiler.)
|
|
4df859c5
|
2018-05-21T11:35:42
|
|
cpuinfo: Added SDL_HasAVX512F().
This checks for the "foundation" AVX-512 instructions (that all AVX-512
compatible CPUs support).
|
|
8543ad7d
|
2018-05-21T11:34:57
|
|
cpuinfo: Added some internal SIMD-aligned allocation functions.
Fixes Bugzilla #4150 (sort of).
|
|
999af809
|
2018-05-18T13:09:30
|
|
Merged latest changes from Steam Link app
|
|
e2619f1d
|
2018-05-17T12:50:46
|
|
dynapi: don't let system loader resolve the initializer to the wrong version.
Fixes problems launching Firewatch on Linux (which statically links SDL but
also dynamically loads a system-wide copy from a plugin shared library) with
a newer SDL build.
|
|
b7e88aaa
|
2018-05-16T02:03:06
|
|
audio: Added ARM NEON versions of audio converters.
These are _much_ faster than the scalar equivalents on the Raspberry Pi that
I tested on. Often 3x to 4x as fast!
|
|
cb0e614f
|
2018-05-15T02:29:35
|
|
audio: SSE2 float-to-int converters should clamp input.
The scalar versions already do this.
|
|
a07e5815
|
2018-05-15T01:40:05
|
|
audio: Fix range on float-to-int data clamping.
I can't tell if there was a good reason for this or it was just me getting
numbers wrong due to exhaustion.
|
|
7832cb65
|
2018-05-15T01:35:53
|
|
audio: float to int converters should clamp inclusively.
If we have to test if a sample is > 1.0f anyhow, we might as well use this
to avoid the unnecessary multiplication when it's == 1.0f, too. (etc).
|
|
e2ec1eb1
|
2018-05-15T01:04:11
|
|
audio: converting int32 to/from float shouldn't use doubles.
The concern is that a massive int sample, like 0x7FFFFFFF, won't fit in a
float32, which doesn't have enough bits to hold a whole number this large,
just to divide it to get a value between 0 and 1.
Previously we would convert to double, to get more bits, do the division, and
cast back to a float, but this is expensive.
Casting to double is more accurate, but it's 2x to 3x slower. Shifting out
the least significant byte of an int32, so it'll definitely fit in a float,
and dividing by 0x7FFFFF is still accurate to about 5 decimal places, and the
difference doesn't appear to be perceptable.
|
|
4718791f
|
2018-05-14T00:03:39
|
|
cpuinfo: Make CPU flags easier to read and add to.
|
|
652d59fb
|
2018-05-10T09:02:39
|
|
make sure SDL_vsnprintf() nul terminates if it is using _vsnprintf
The change makes sure that SDL_vsnprintf() nul terminates if it is
using _vsnprintf() for the job.
I made this patch for Watcom, whose _vsnprintf() doesn't guarantee
nul termination. The preprocessor check can be extended to windows
in general too, if required.
Closes bug #3769.
|
|
fe032ff4
|
2018-05-10T08:25:23
|
|
do the direct3d tap dance for overscan hint only if SDL_VIDEO_RENDER_D3D == 1
|
|
a4d0571e
|
2018-05-07T20:10:12
|
|
Reverted change for bug 4152 - restrict the win10 mouse bug workaround to win10 v1709 only
Daniel Gibson
Sorry, but it seems like Microsoft didn't fix the issue properly.
I just updated my Win10 machine, it now is Version 1803, Build 17134.1
I tested with SDL2 2.0.7 (my workaround was released with 2.0.8) and still got
lots of events that directly undid the prior "real" events - just like before.
(See simple testcase in attachement)
By default it sets SDL_HINT_MOUSE_RELATIVE_MODE_WARP - which triggered (and on my machine still triggers) the buggy behavior. You can start it with -raw, then it'll not set that hint and the events will be as expected.
The easiest way to see the difference is looking at the window title, which shows accumulated X and Y values: If you just move your mouse to the right, in -raw mode the number just increases. In non-raw mode (using mouse warping) it stays around 0.
I also had a WinAPI-only testcase: https://gist.github.com/DanielGibson/b5b033c67b9137f0280af9fc53352c68
It just calls SetCursorPos(320,240); on each WM_MOUSEMOVE event, and it also
logs all those events to a mouseevents.log textfile.
This log indeed looks a bit different since the latest Win10 update: It seems like all those events with x=320 y=240 do arrive - but only after I stopped moving the mouse - even though the cursor seems to be moved back every frame (or so).
So moving the mouse to the right gives X coordinates like
330, 325, 333, 340, 330, ...
and then when stopping movement I get lots of events with X coordinate 320
|
|
eb14b635
|
2018-05-07T19:52:25
|
|
Fixed bug 4134 - Render targets lose scale quality after minimizing a fullscreen window
Olli-Samuli Lehmus
If one creates a window with the SDL_WINDOW_FULLSCREEN_DESKTOP flag, and creates a render target with SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"), and afterwards sets SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "nearest"), after minimizing the window, the scale quality hint is lost on the render target. Textures however do keep their interpolation modes.
|
|
606c5a58
|
2018-05-05T10:27:53
|
|
Fixed bug 4152 - Windows 10 v1803 update seems to have fixed the jumping mouse bug (see bug #3931.)
|
|
c5914295
|
2018-05-04T21:21:32
|
|
alsa: avoid hardware parameters with an excessive number of periods.
The previous code attempted to use set_buffer_size / set_period_size
discretely, favoring the parameters which generated a buffer size that was
exactly 2x the requested buffer size. This solution ultimately prioritizes
only the buffer size, which comes at a large performance cost on some machines
where this results in an excessive number of periods. In my case, for a 4096
sample buffer, this configured the device to use 37 periods with a period size
of 221 samples and a buffer size of 8192 samples. With 37 periods, the SDL
Audio thread was consuming 25% of the CPU.
This code has been refactored to use set_period_size and set_buffer_size
together. set_period_size is called first to attempt to set the period to
exactly match the requested buffer size, and set_buffer_size is called second
to further refine the parameters to attempt to use only 2 periods. The
fundamental change here is that the period size / count won't go to extreme
values if the buffer size can't be exactly matched, the buffer size should
instead just increase to the next closest multiple of the target period size
that is supported. After changing this, for a 4096 sample buffer, the device
is configured to use 3 periods with a period size of 4096 samples and a buffer
size of 12288 samples. With only 3 periods, the SDL Audio thread doesn't even
show up when profiling.
Fixes Bugzilla #4156.
|