|
d2723875
|
2020-10-14T23:01:06
|
|
os2: integrate the port into main tree.
|
|
554037a6
|
2020-09-26T09:30:08
|
|
audio: fix popping sounds caused by signed/unsigned conversion
When converting audio from signed to unsigned values of vice-versa
the silence value chosen by SDL was the value of the device, not
of the stream that the data was being put into. After conversion
this would lead to a very high or low value, making the speaker
jump to a extreme positon, leading to an audible noise whenever
creating, destroying or playing scilence on a device that reqired
such conversion.
|
|
4bb95e84
|
2020-02-11T16:14:02
|
|
Implemented OpenSL-ES audio recording on Android
|
|
f30ef6ed
|
2020-01-21T17:40:16
|
|
audio: Fixed a '//' style comment.
|
|
dbe5c14b
|
2020-01-21T15:49:37
|
|
audio: Calculate a legitimate SDL_AudioSpec::silence in SDL_LoadWAV_RW().
|
|
a8780c6a
|
2020-01-16T20:49:25
|
|
Updated copyright date for 2020
|
|
aef1ed4a
|
2019-09-25T15:40:27
|
|
audio: Set (something close to) the correct silence value for U16 audio.
Partially fixes Bugzilla #4805.
|
|
7a47c292
|
2019-07-31T01:22:02
|
|
Fix bug 4746 - introduce SDL_zeroa macro.
|
|
723d0143
|
2019-06-04T17:32:15
|
|
Fixed bug 4171 - SDL_GetQueuedAudioSize is broken with WASAPI
Cameron Gutman
I was trying to use SDL_GetQueuedAudioSize() to ensure my audio latency didn't get too high while streaming data in from the network. If I get more than N frames of audio queued, I know that the network is giving me more data than I can play and I need to drop some to keep latency low.
This doesn't work well on WASAPI out of the box, due to the addition of GetPendingBytes() to the amount of queued data. As a terrible hack, I loop 100 times calling SDL_Delay(10) and SDL_GetQueuedAudioSize() before I ever call SDL_QueueAudio() to get a "baseline" amount that I then subtract from SDL_GetQueuedAudioSize() later. However, because this value isn't actually a constant, this hack can cause SDL_GetQueuedAudioSize() - baselineSize to be < 0. This means I have no accurate way of determining how much data is actually queued in SDL's audio buffer queue.
The SDL_GetQueuedAudioSize() documentation says: "This is the number of bytes that have been queued for playback with SDL_QueueAudio(), but have not yet been sent to the hardware." Yet, SDL_GetQueuedAudioSize() returns > 0 value when SDL_QueueAudio() has never been called.
Based on that documentation, I believe the current behavior contradicts the documented behavior of this function and should be changed in line with Boris's patch.
I understand that exposing the IAudioClient::GetCurrentPadding() value is useful, but a solution there needs to take into account what of that data is silence inserted by SDL and what is actual data queued by the user with SDL_QueueAudio(). Until that happens, I think the best approach is to remove the GetPendingBytes() call until SDL is able to keep track of queued data to make sense of it. This would make SDL_GetQueuedAudioSize() possible to use accurately with WASAPI.
|
|
f3e76ea1
|
2019-05-23T13:47:30
|
|
Use the OpenSL ES audio driver by default on Android, as it has the lowest latency.
|
|
6a3356ab
|
2019-03-25T12:24:38
|
|
Backed out changeset cec31de4e126
This was meant to migrate CoreAudio onto the same SDL_RunAudio() path that
most other audio drivers are on, but it introduced a bug because it doesn't
deal with dropped audio buffers...and fixing that properly just introduces
latency.
I might revisit this later, perhaps by reworking SDL_RunAudio to allow for
this sort of API better, or redesigning the whole subsystem or something, I
don't know. I'm not super-thrilled that this has to exist outside of the usual
codepaths, though.
Fixes Bugzilla #4481.
|
|
7dc92a76
|
2019-01-12T12:18:44
|
|
Initial Android OpenSL ES implementation, contributed by ANTA
|
|
d23c2f07
|
2019-01-10T18:05:56
|
|
Fixed bug 3930 - Android, set thread priorities and names
SDLActivity thread priority is unchanged, by default -10 (THREAD_PRIORITY_VIDEO).
SDLAudio thread priority was -4 (SDL_SetThreadPriority was ignored) and is now -16 (THREAD_PRIORITY_AUDIO).
SDLThread thread priority was 0 (THREAD_PRIORITY_DEFAULT) and is -4 (THREAD_PRIORITY_DISPLAY).
|
|
5e13087b
|
2019-01-04T22:01:14
|
|
Updated copyright for 2019
|
|
04cbf132
|
2018-10-10T15:20:56
|
|
audio: All device names reported by SDL must be unique.
This means that if you have two devices named "Soundblaster Pro" in your
machine, one will be reported as "Soundblaster Pro" and the other as
"Soundblaster Pro (2)".
This makes it so you can't into a position where one of your devices can't
be opened because another is sitting on the same name.
|
|
0378529e
|
2018-10-10T14:55:24
|
|
audio: clean_out_device_list() already sets this flag to false for us.
|
|
f5a21ebf
|
2018-10-09T20:12:43
|
|
Added support for surround sound and float audio on Android
|
|
b2518761
|
2018-10-01T09:47:10
|
|
commit c6b28f46b8116552ec2b38d1d3c8535df28ba7a1
Author: Anthony Pesch <inolen@gmail.com>
Date: Fri May 4 20:21:21 2018 -0400
Added SDL_AUDIO_ALLOW_SAMPLES_CHANGE flag enabling users of SDL_OpenAudioDevice to get
the sample size of the actual hardware buffer vs having a stream created to handle the
delta
|
|
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.
|
|
f521b22e
|
2018-04-23T22:07:56
|
|
Added SDL_THREAD_PRIORITY_TIME_CRITICAL
|
|
dc8b55e5
|
2018-04-16T02:11:09
|
|
coreaudio: Use the standard SDL audio thread instead of spinning a new one.
Fixes corner cases, like the audio callback not firing if the device is
disconnected, etc.
|
|
40b27fd5
|
2018-02-12T17:00:00
|
|
revert the recent typecast assignment changes (see bug #4079)
also change the void* typedefs for the two vulkan function
pointers added in vulkan_internal.h into generic function
pointer typedefs.
|
|
90e72bf4
|
2018-01-30T18:08:34
|
|
Fixed ISO C99 compatibility
SDL now builds with gcc 7.2 with the following command line options:
-Wall -pedantic-errors -Wno-deprecated-declarations -Wno-overlength-strings --std=c99
|
|
e3cc5b2c
|
2018-01-03T10:03:25
|
|
Updated copyright for 2018
|
|
351d6d47
|
2017-12-06T12:24:32
|
|
audio: Port WASAPI to WinRT, remove XAudio2 backend.
XAudio2 doesn't have capture support, so WASAPI was to replace it; the holdout
was WinRT, which still needed it as its primary audio target until the WASAPI
code code be made to work.
The support matrix now looks like:
WinXP: directsound by default, winmm as a fallback for buggy drivers.
Vista+: WASAPI (directsound and winmm as fallbacks for debugging).
WinRT: WASAPI
|
|
1a3b95a1
|
2017-09-21T02:51:14
|
|
audio: Replaced the resampler. Again.
This time it's using real math from a real whitepaper instead of my previous
amateur, fast-but-low-quality attempt. The new resampler does "bandlimited
interpolation," as described here: https://ccrma.stanford.edu/~jos/resample/
The output appears to sound cleaner, especially at high frequencies, and of
course works with non-power-of-two rate conversions.
There are some obvious optimizations to be done to this still, and there is
other fallout: this doesn't resample a buffer in-place, the 2-channels-Sint16
fast path is gone because this resampler does a _lot_ of floating point math.
There is a nasty hack to make it work with SDL_AudioCVT.
It's possible these issues are solvable, but they aren't solved as of yet.
Still, I hope this effort is slouching in the right direction.
|
|
d619d885
|
2017-08-28T21:42:39
|
|
Fixed bug 3662 - Error message when using the audio conversion setup without an initialized audio subsystem is a bit vague
Simon Hug
This issue actually raises the question if this API change (requirement of initialized audio subsystem) is breaking backwards compatibility. I don't see the documentation saying it is needed in 2.0.5.
|
|
8e7998e1
|
2017-08-27T19:10:30
|
|
Fixed bug 3710 - SDL_OpenAudio(desired, obtained) doesn't update desired's size when obtained is NULL
David Ludwig
I've created a new set of patches. I am happy to create more, if it would help.
One version only copies 'size'.
A second version copies both 'size' and 'silence'. When looking over the documentation for SDL_OpenAudio in SDL_audio.h, it mentioned that both 'size' and 'silence' were things that SDL_OpenAudio would calculate.
Regarding *both* patches, I did notice that SDL 1.2 appears to have always modified desired's size and silence fields. The SDL wiki, at https://wiki.libsdl.org/SDL_OpenAudio#Remarks , does note:
|
|
96305832
|
2017-08-11T10:21:19
|
|
Fixed bug 3702 - Clear error messages of SDL_LoadObject for optional libraries
Simon Hug
Some code in SDL loads libraries with SDL_LoadObject to get more information or use newer APIs. SDL_LoadObject may fail, set an error message and SDL will continue with some fallback code. Since SDL will overwrite the error or exit the function with a return value that indicates success, the error form SDL_LoadObject for the optional stuff might as well be cleared right away.
|
|
d9039f23
|
2017-06-08T13:27:58
|
|
jack: Initial shot at a JACK audio target.
http://jackaudio.org/
Fixes Bugzilla #2163.
(with several more commits following to improve this code.)
|
|
a7fc2822
|
2017-05-24T19:56:59
|
|
audio: rename bsd target to netbsd.
Apparently this is no longer a generic BSD audio target, and hasn't been for
years, so rename it for NetBSD.
|
|
4073a669
|
2017-05-18T15:33:17
|
|
audio: One more callbackspec fix (thanks, Simon!).
|
|
226541cb
|
2017-04-26T01:43:40
|
|
audio: another wrong struct that causes NULL pointer crash (thanks, Simon!).
Fixes Bugzilla #3632.
|
|
7382cebb
|
2017-04-20T21:25:29
|
|
audio: Fix audio queue functions to use new spec structure.
Using the old spec structure causes the audio queueing functions to fail
due to bad callback pointers being checked.
|
|
d20d426c
|
2017-04-18T22:17:40
|
|
Fix crash in SDL audio thread, by Juha Kuikka
Wrong audio spec structure was populated with the internal callback, causing the audio thread to call a NULL pointer.
|
|
c85c57a0
|
2017-03-29T14:23:39
|
|
wasapi: Handle lost audio device endpoints.
This gracefully recovers when a device format is changed, and will switch
to the new default device if the current one is unplugged, etc.
This does not handle when a new default device is added; it only notices
if the current default goes away. That will be fixed by implementing the
stubbed-out MMNotificationClient_OnDefaultDeviceChanged() function.
|
|
c4d54504
|
2017-03-14T07:16:56
|
|
differentiate between capture / playback audio thread names
|
|
a4249b48
|
2017-02-26T00:56:13
|
|
Patched to compile on C89 compilers.
|
|
3b9e4d0a
|
2017-02-26T00:39:22
|
|
audio: Try to keep callbacks firing at normal pace when device is lost.
|
|
a366c35f
|
2017-02-26T00:12:33
|
|
audio: run the audio callback even if device was lost.
We will throw away the data anyhow, but some apps depend on the callback
firing to make progress; testmultiaudio.c, if nothing else, is an example
of this.
Capture also will now fire the callback in these conditions, offering nothing
but silence.
Apps can check SDL_GetAudioDeviceStatus() or listen for the
SDL_AUDIODEVICEREMOVED event if they want to gracefully deal with
an opened audio device that has been unexpectedly lost.
|
|
5728cb20
|
2017-02-26T00:10:02
|
|
audio: Make sure the disk and dummy targets are the last ones we try to init.
|
|
6046fd4c
|
2017-02-14T03:03:27
|
|
wasapi: Initial WASAPI support, for Windows Vista and later.
This should remain binary compatible with Windows XP, as we dynamically
load anything we need and fall back to DirectSound/WinMM/XAudio2 if not
available.
|
|
175f1e8f
|
2017-02-13T16:55:00
|
|
audio: Added a ThreadDeinit() method to match ThreadInit.
Not used by any targets at the moment, but will be shortly!
|
|
886736a2
|
2017-02-11T16:38:16
|
|
Fixed bug 3584 - Small stack size for audio callback thread
Walter van Niftrik
We have found that since SDL 2.0.5 the audio callback thread is created with a very small stack size. In our application this is leading to stack overflows.
We believe there is a bug at http://hg.libsdl.org/SDL/file/391fd532f79e/src/audio/SDL_audio.c#l1132, where the is_internal_thread flag appears to be inverted.
|
|
ede5c734
|
2017-01-24T19:38:01
|
|
Generalized the audio resampling hint for other resampling methods in the future
|
|
c7f9dcb6
|
2017-01-24T15:52:22
|
|
audio: Offer a hint for libsamplerate quality/speed tradeoff.
This defaults to the internal SDL resampler, since that's the likely default
without a system-wide install of libsamplerate, but those that need more can
tweak this.
|
|
57182930
|
2017-01-16T00:58:28
|
|
audio: Implemented SIMD support for audio data type converters.
This currently adds an SSE2 implementation (but it's #ifdef'd out for now,
until it's hooked up to the configure script and such).
|
|
a41103b1
|
2017-01-09T05:59:30
|
|
audio: Patched to compile if linking directly to libsamplerate.
|
|
35166609
|
2017-01-08T14:28:44
|
|
audio: Patched to compile with libsamplerate support (again).
|
|
19e937fc
|
2017-01-08T14:18:03
|
|
audio: libsamplerate loading now happens once at init time.
|
|
37f404fb
|
2017-01-06T00:47:42
|
|
Fixed confusion between Ryan's new audio stream and the audio buffer we were calling stream in the callback
|
|
748f4605
|
2017-01-06T03:38:14
|
|
audio: Add an assert to make sure non-streaming audio uses good buffer sizes.
|
|
b3e8db80
|
2017-01-06T01:07:34
|
|
audio: rename fake_stream to work_buffer.
It's more than an alternative for when the OS can't provide a DMA buffer, now.
|
|
992124d4
|
2017-01-06T01:02:58
|
|
audio: Fixed SDL_AudioStreamGet() function parameters.
There was a draft of this where it did audio conversion into the final buffer,
if there was enough room available past what you asked for, but that interface
got removed, so the parameters didn't make sense (and we were using the
wrong one in any case, too!).
|
|
f07a1a5a
|
2017-01-05T21:31:02
|
|
emscriptenaudio: Reworked to use SDL_AudioStream.
|
|
3761b5f6
|
2017-01-05T20:11:19
|
|
Fixed a few compiler warnings.
|
|
30178a9b
|
2017-01-05T19:29:38
|
|
audio: Added SDL_AudioStream. Non-power-of-two resampling now works!
|
|
45b774e3
|
2017-01-01T18:33:28
|
|
Updated copyright for 2017
|
|
b2f6c4c1
|
2016-12-19T11:15:53
|
|
Fixed bus error when converting 16-bit to float for non-integral-multiple sample rates
|
|
c0231875
|
2016-12-06T12:23:17
|
|
audio: Fixed compiler warnings.
|
|
a0e003ee
|
2016-12-06T02:23:54
|
|
Refactored the audio queueing code to a generic SDL_DataQueue interface.
This is not a public API (at the moment), but we will be needing this for
other internal things soon.
|
|
57d01d7d
|
2016-11-13T22:57:41
|
|
Patch from Sylvain to fix clang warnings
|
|
7d2108ce
|
2016-10-07T19:39:43
|
|
audio: Backed out the audio-thread detaching changes.
It added a ton of complexity. A simpler solution might arise at some
point though.
|
|
f6a280ab
|
2016-10-07T15:13:46
|
|
audio: Don't trust audio drivers to drain pending audio.
This tends to be a frequent spot where drivers hang, and the waits were
often unreliable in any case.
Instead, our audio thread now alerts the driver that we're done streaming audio
(which currently XAudio2 uses to alert the system not to warn about the
impending underflow) and then SDL_Delay()'s for a duration that's reasonable
to drain the DMA buffers before closing the device.
|
|
551cdc8d
|
2016-10-07T14:42:24
|
|
audio: better way to calculate buffer drain wait times.
|
|
76f48acf
|
2016-10-07T14:35:25
|
|
audio: threading and device hang improvements.
This tries to make SDL robust against device drivers that have hung up,
apps don't freeze in catastrophic (but not necessarily uncommon) conditions.
Now we detach the audio thread and let it clean up and don't care if it
never actually runs to completion.
|
|
9257b72d
|
2016-10-05T00:12:16
|
|
Backed out a very unsafe change that was trying to prevent audio hang at quit.
Ryan and I have ideas on a better way to handle this.
|
|
bac61096
|
2016-10-04T06:48:07
|
|
ensure SDL_AUDIODEVICEREMOVED gets sent when hotplug removes a device
James Zipperer
The problem I was seeing was that the the ALSA hotplug thread would call SDL_RemoveAudioDevice, but my application code was not seeing an SDL_AUDIODEVICEREMOVED event to go along with it. To fix it, I added some code into SDL_RemoveAudioDevice to call SDL_OpenedAudioDeviceDisconnected on the corresponding open audio device. There didn't appear to be a way to cross reference the handle that SDL_RemoveAudioDevice gets and the SDL_AudioDevice pointer that SDL_OpenedAudioDeviceDisconnected needs, so I ended up adding a void *handle field to struct SDL_AudioDevice so that I could do the cross reference.
Is there some other way beside adding a void *handle field to the struct to get the proper information for SDL_OpenedAudioDeviceDisconnected?
|
|
69cf1703
|
2016-10-04T06:46:46
|
|
fix deadlock on close device
James Zipperer
snd_pcm_drain doesn't always drain when you unplug a usb device. Use snd_pcm_drop instead
|
|
2558c9c8
|
2016-10-04T06:45:28
|
|
fix audio deadlock
James Zipperer
Close the audio device before waiting for the audio thread to complete, which fixes a situation where the audio thread never completes
Add an additional check in the audio thread to see if the device is enabled and bail out if the device is no longer enabled
|
|
e435659c
|
2016-08-11T22:26:58
|
|
audio: Cleaned up "extern AudioBootStrap" list.
|
|
6f4bcd24
|
2016-08-11T22:22:09
|
|
audio: Renamed some internal driver symbols in various targets.
|
|
b879595a
|
2016-08-10T14:14:14
|
|
audio: Patched to compile on C89 compilers.
|
|
a05bde21
|
2016-08-09T00:44:59
|
|
audio: Only allocate fake_stream if we're using the standard audio threads.
|
|
be8d7a46
|
2016-08-09T00:44:05
|
|
audio: simplifed check for internal callback.
Easier to check when it's NULL instead of a list of known internal functions.
|
|
978df1ad
|
2016-08-06T03:39:15
|
|
disk audio: Implemented "capture" support, cleaned up some things.
|
|
73153901
|
2016-08-06T02:47:27
|
|
audio: Implemented buffer queueing for capture devices (SDL_DequeueAudio()).
|
|
e7347a40
|
2016-08-06T02:27:55
|
|
audio: SDL_ClearQueuedAudio() should free everything but two packets.
Otherwise, if you had a massive, one-time queue buildup, the memory from that
remains allocated until you close the device. Also, if you are just using a
reasonable amount of space, this would previously cause you to reallocate it
over and over instead of keeping a little bit of memory around.
|
|
9b2a59ef
|
2016-08-05T02:04:48
|
|
audio: Changed OnlyHasDefaultInputDevice to OnlyHasDefaultCaptureDevice.
|
|
9b647727
|
2016-08-05T01:44:41
|
|
audio: Clean up some CloseDevice() interface details.
- It's now always called if device->hidden isn't NULL, even if OpenDevice()
failed halfway through. This lets implementation code not have to clean up
itself on every possible failure point; just return an error and SDL will
handle it for you.
- Implementations can assume this->hidden != NULL and not check for it.
- implementations don't have to set this->hidden = NULL when done, because
the caller is always about to free(this).
- Don't reset other fields that are in a block of memory about to be free()'d.
- Implementations all now free things like internal mix buffers last, after
closing devices and such, to guarantee they definitely aren't in use anymore
at the point of deallocation.
|
|
979de761
|
2016-08-05T01:44:15
|
|
audio: Removed internal SDL_audiomem.h and macros.
I think this was important for SDL 1.2 because some targets needed
special device memory for DMA buffers or locked memory buffers for use in
hardware interrupts or something, but since it just defines to SDL_malloc
and SDL_free now, I took it out for clarity's sake.
|
|
6bd1ec6b
|
2016-08-02T15:04:33
|
|
audio: a little more robustness in the capture device's thread.
|
|
0d0f7080
|
2016-08-02T13:50:21
|
|
audio: implemented higher level infrastructure for running capture devices.
|
|
6d5c9c1e
|
2016-08-02T13:48:52
|
|
audio: Made some SDL_AudioDevice fields atomic.
This makes sure they're properly communicated to the audio threads.
|
|
67f2538c
|
2016-08-01T13:32:27
|
|
audio: changed some internal ints to be SDL_bools.
|
|
c754662d
|
2016-08-01T11:45:45
|
|
audio: Make SDL_AudioDevice::shutdown an atomic value.
Just to make sure this get communicated to the audio thread properly.
|
|
ee099750
|
2016-08-01T00:18:56
|
|
audio: Initial bits to enable audio capture support.
|
|
c61675dc
|
2016-04-12T16:45:10
|
|
threads: Move SDL's own thread creation to a new internal API.
This allows us to set an explicit stack size (overriding the system default
and the global hint an app might have set), and remove all the macro salsa
for dealing with _beginthreadex and such, as internal threads always set those
to NULL anyhow.
I've taken some guesses on reasonable (and tiny!) stack sizes for our
internal threads, but some of these might turn out to be too small in
practice and need an increase. Most of them are simple functions, though.
|
|
42065e78
|
2016-01-02T10:10:34
|
|
Updated copyright to 2016
|
|
0e45984f
|
2015-06-21T17:33:46
|
|
Fixed crash if initialization of EGL failed but was tried again later.
The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly
uninitialized data structure if loading the library first failed. A later try to
use EGL then skipped initialization and assumed it was previously successful
because the data structure now already existed. This led to at least one crash
in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was
dereferenced to make a call to eglBindAPI().
|
|
2c4a6ea0
|
2015-05-26T06:27:46
|
|
Updated the copyright year to 2015
|
|
b72938c8
|
2015-04-20T12:22:44
|
|
Windows: Always set the system timer resolution to 1ms by default.
An existing hint lets apps that don't need the timer resolution changed avoid
this, to save battery, etc, but this fixes several problems in timing, audio
callbacks not firing fast enough, etc.
Fixes Bugzilla #2944.
|
|
fe6c797c
|
2015-04-10T23:30:31
|
|
Fixed an iOS view orientation issue when SDL_GL_CreateContext or SDL_CreateRenderer is called.
|
|
528e48b9
|
2015-03-23T20:24:04
|
|
Android: Removed not needed include statement.
|
|
182a7768
|
2015-03-20T11:11:44
|
|
Audio hotplug fixes for winmm and XAudio2 backends.
|
|
b24ff446
|
2015-03-19T23:44:47
|
|
Make static analysis happy.
|
|
277e07e7
|
2015-03-19T23:39:53
|
|
Fixed a compiler warning on Visual Studio.
|
|
537b68b9
|
2015-03-19T22:11:20
|
|
Zero out the audio hotplug event structure, so the "padded" fields are sane.
Just in case we ever need those bits in the future.
|
|
11cffe1d
|
2015-03-19T15:43:00
|
|
SDL_RemoveAudioDevice() should specify capture vs output.
This lets us reuse values between the two categories without conflicting, etc.
|
|
1e78ef21
|
2015-03-19T13:34:17
|
|
Removed the broken audio streaming code, other small cleanups.
|