Commit Graph

13351 Commits (47bcb078f547554735daf2d919127f6cdd0cd656)

Author SHA1 Message Date
Brick 47bcb078f5 Fixed some incorrect SDL_AUDIO_F32 uses 2023-09-04 07:46:18 -07:00
Brick 2833f2e7b5 Fixed OOB access in audio_convertAccuracy test 2023-09-04 07:46:18 -07:00
SDL Wiki Bot 8387fae698 Sync SDL3 wiki -> header 2023-09-03 15:11:13 +00:00
Frank Praznik 8321813452 docs: Add note about Wayland application icons
Wayland doesn't support programmatically setting the app icon, so note this restriction and specify that a desktop entry file that points to the desired icon image is required.
2023-09-03 11:10:29 -04:00
Sam Lantinga 825d344756 Make sure that the same timestamp is used for all PS5 events from the same packet 2023-09-01 17:49:39 -07:00
Brick 9c1430324c Removed SDL_dataqueue 2023-09-01 14:38:45 -04:00
Brick 28b28bd8f4 Added audio_formatChange test 2023-09-01 14:38:45 -04:00
Brick a59152688a Try and avoid overflow when handling very large audio streams 2023-09-01 14:38:45 -04:00
Brick 5394a805f4 Improved testaudiostreamdynamicresample
Tweaked color palette
2023-09-01 14:38:45 -04:00
Brick e55844274d Added SDL_(Get|Set)AudioStreamSpeed 2023-09-01 14:38:45 -04:00
Brick 43c3c5736d Track the formats of data in an SDL_AudioStream 2023-09-01 14:38:45 -04:00
Brick 337fed3df6 Tweaked ResampleFrame_SSE
Use _mm_unpack(lo|hi)_ps instead of _mm_shuffle_ps
2023-09-01 14:38:45 -04:00
Ryan C. Gordon fd7cd91dc9
audio: Mix multiple streams in float32 to prevent clipping.
This only does this work if actually mixing; if the physical device only
has a single stream bound to it, it'll just write the data to the hardware
without the extra drama.

Fixes #8123.
2023-08-31 23:46:33 -04:00
Ryan C. Gordon 9097573e37
audio: Choose a mixing strategy on each iteration.
Currently it's SILENCE (just zero out the mix buffer), COPYONE (one stream
writes directly into the hardware's buffer), or MIX (everything gets mixed
together before sending to the hardware).

Devices that aren't doing anything result in SILENCE. Devices playing
one thing result in COPYONE.

This lets the two most common states take what are likely significantly
faster approaches.

There will likely be some other strategies later (like when we offer a
postmix callback, etc).
2023-08-31 14:47:06 -04:00
Sam Lantinga bbe2e012a2 Don't provide the SDL3 header path
The recommended way to include SDL.h is #include <SDL3/SDL.h>, and having both paths available was confusing for people trying to port to SDL3.

Thanks for the feedback!
https://github.com/exult/exult/issues/379#issuecomment-1701066992
2023-08-31 11:41:37 -07:00
Sam Lantinga c17a35f096 Fixed typo 2023-08-31 09:32:39 -07:00
Sam Lantinga 4f72255eb1 Fixed README.md link 2023-08-31 09:31:56 -07:00
Sam Lantinga e0ab597549 Simplified SDL_main.h migration notes
Thanks for the feedback!
https://github.com/exult/exult/issues/379#issuecomment-1701066992
2023-08-31 09:29:59 -07:00
Sam Lantinga d44bde61e5 Added SDL migration information to the top level README.md
Thanks for the feedback!
https://github.com/exult/exult/issues/379#issuecomment-1701066992
2023-08-31 09:28:54 -07:00
Jeremy Demeule 6ff31e10cf
metal: Add hint to select low power device instead of the default one (#8182)
On some system like MacBook Pro Intel with AMD card, asking for the default device will always return the AMD GPU.
This is not an issue for 99% of the case when the renderer context is here to provide the maximum performance level like for game.
However, for video application using GPU for 1 quad and 1 texture, using the discrete GPU for that lead to an important power consumption (4 to 8W), heat increase, and fan noise.
With this patch, I successfully amend ffplay to only use the integrated GPU (i.e. the Intel one), instead of the discrete GPU (i.e. the AMD one).
2023-08-31 01:23:45 -07:00
Sam Lantinga 8a8aed477d Make sure that we process touch events that position the mouse
Fixes https://github.com/libsdl-org/SDL/issues/8176
2023-08-30 21:31:19 -07:00
SDL Wiki Bot f84c87f204 Sync SDL3 wiki -> header 2023-08-31 03:26:13 +00:00
Sam Lantinga a7eea9997d macOS: Don't raise the parent top-level window when raising a child window, only raise the child window to the top of the parent 2023-08-30 20:29:57 -07:00
Sam Lantinga a5e7214795 Add SDL_WINDOW_NOT_FOCUSABLE flag to set that the window should not be able to gain key focus
- Also adds SDL_SetWindowFocusable() to set/clear flag on existing windows
2023-08-30 20:29:51 -07:00
Ryan C. Gordon b385dc3b68
n3dsaudio: Patched to compile. 2023-08-30 19:53:54 -04:00
Ryan C. Gordon 4e0c7c91fc
audio: PlayDevice() should return an error code.
Higher level code treats errors as fatal and disconnects the device.
2023-08-30 19:17:19 -04:00
Anonymous Maarten a94d724f17 wayland: add SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL 2023-08-30 23:03:03 +02:00
Anonymous Maarten da5d93d3da wayland: don't define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_* macro's
They mess with #ifdef conditional in headers.
2023-08-30 13:43:50 -07:00
Anonymous Maarten f002f7d12e ci: build emscripten with Debug buid type 2023-08-29 23:18:37 +02:00
Ryan C. Gordon 3699b12ed0
audio: Fixed some "is_*" variables to be cleaner and/or more specific.
Requested at https://github.com/libsdl-org/SDL/pull/8165#discussion_r1306700881_
2023-08-29 10:46:14 -04:00
Ryan C. Gordon 2471d8cc2a
audio: Fixed logic error in SDL_OpenAudioDeviceStream. 2023-08-27 19:30:47 -04:00
Anonymous Maarten 1b03a2430a testsurround: fix order of arguments of callback 2023-08-28 00:12:59 +02:00
Sam Lantinga 82db2b58f9 Renamed audio stream callback and moved the userdata parameter first
In general SDL API callbacks are called with the userdata paramter first, to mimic C++ method call convention
2023-08-27 14:43:21 -07:00
SDL Wiki Bot 5bdad5210f Sync SDL3 wiki -> header 2023-08-27 20:55:12 +00:00
Ryan C. Gordon 58c859f64d audio: Rename SDL_GetAudioStreamBinding to SDL_GetAudioStreamDevice. 2023-08-27 16:54:30 -04:00
Ryan C. Gordon efd2023a72 audio: Fixed documentation. 2023-08-27 16:54:30 -04:00
Ryan C. Gordon 1e775e0eef audio: Replace SDL_CreateAndBindAudioStream with SDL_OpenAudioDeviceStream.
This is meant to offer a simplified API for people that are either migrating
directly from SDL2 with minimal effort or just want to make noise without
any of the fancy new API features.

Users of this API can just deal with a single SDL_AudioStream as their only
object/handle into the audio subsystem.

They are still allowed to open multiple devices (or open the same device
multiple times), but cannot change stream bindings on logical devices opened
through this function.

Destroying the single audio stream will also close the logical device behind
the scenes.
2023-08-27 16:54:30 -04:00
Sam Lantinga bd088c2f99 Revert "Clarify whether an audio function expects a physical or logical device ID"
This reverts commit 506a133d84.

Physical and logical audio devices are intended to be interchangeable at the API level.
2023-08-27 13:42:20 -07:00
Brick 82e481b520 Added --randmem test parameter 2023-08-27 13:08:15 -07:00
Brick ea68bb8027 Add some additional checks to audio_convertAudio 2023-08-27 13:08:15 -07:00
Brick f8286df167 Fixed ResampleFrame_SSE doing unnecessary work 2023-08-27 13:08:15 -07:00
Brick b1d63be538 Fixed audio_resampleLoss test 2023-08-27 13:08:15 -07:00
Sam Huang c191d6c306 Better Win32 transparent window support 2023-08-27 13:06:42 -07:00
Ozkan Sezer 923d612ca1 hidapi: sync macOS code with mainstream.
this merges mainstream commit 4009466d59c41f (mainstream PR/611)
2023-08-27 22:33:32 +03:00
Ozkan Sezer 363f4fa9c1 avoid type redefinition errors after commit ee806597b9.
(Reference issue: https://github.com/libsdl-org/SDL/issues/8142)
2023-08-27 22:22:10 +03:00
Sam Lantinga 615824a806 Updated documentation now that SDL_GetAudioDevices() has been split into separate functions for output and capture devices 2023-08-26 17:30:57 -07:00
Sam Lantinga 506a133d84 Clarify whether an audio function expects a physical or logical device ID 2023-08-26 17:03:01 -07:00
Ozkan Sezer 3b1d1e4e31 hidapi: sync the hidraw changes with mainstream
Apply mainstream commit 8a4de63b (mainstream PR/601) to our hidapi.
The patch is a direct apply of the mentioned commit, with one sdl-
specific part guarded by HIDAPI_IGNORE_DEVICE adapted accordingly.
2023-08-26 08:09:10 -07:00
Ozkan Sezer f617918e0a cmake: check linkage to libusb too, instead of libusb.h presence only.
avoids false positives when using a cross-toolchain file
2023-08-26 17:03:42 +02:00
Brick 041dbd6b5f Fixed GetResamplerAvailableOutputFrames
Non-euclidean division is a pain
2023-08-26 09:04:47 -04:00