Commit Graph

19 Commits

Author SHA1 Message Date
Sam Lantinga
3b0c79363d Some systems include both "default:" and "hw:" for the same usb device 2016-10-07 11:18:55 -07:00
Sam Lantinga
8e1994614c fix for finding ALSA hotplug devices on Steam Link
James Zipperer

The device names show up as "default:", not "hw:"
2016-10-06 06:08:16 -07:00
Sam Lantinga
69cf170356 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
2016-10-04 06:46:46 -07:00
Ryan C. Gordon
2da1ec8354 Merge audio capture work back into the mainline. 2016-08-28 13:36:13 -04:00
Ryan C. Gordon
06dcdc7d48 Patched to compile. 2016-08-28 11:56:11 -04:00
Ryan C. Gordon
850da32f30 alsa: Implemented hotplug support, cleaned up device names. 2016-08-28 08:50:26 -07:00
Ryan C. Gordon
cfa95fe68c alsa: don't enumerate virtual devices, just physical hardware. 2016-08-15 10:09:41 -04:00
Ryan C. Gordon
761a79788c audio: changed some SDL_memset() calls to SDL_zero(), other minor corrections. 2016-08-05 01:59:06 -04:00
Ryan C. Gordon
979de761c9 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.
2016-08-05 01:44:15 -04:00
Ryan C. Gordon
9b64772775 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.
2016-08-05 01:44:41 -04:00
Ryan C. Gordon
38f4b68ca7 alsa: capture devices don't need a mixbuf allocated. 2016-08-03 01:00:30 -04:00
Ryan C. Gordon
41e8f9ede4 alsa: Implemented audio capture support! 2016-08-02 15:06:40 -04:00
Ryan C. Gordon
754efd43f4 alsa: Cleaned up the 5.1 swizzle mess a little.
Shouldn't this be something ALSA handles for us with channel maps, so we can
just delete this code?
2016-08-02 15:06:05 -04:00
Ryan C. Gordon
6d5c9c1e67 audio: Made some SDL_AudioDevice fields atomic.
This makes sure they're properly communicated to the audio threads.
2016-08-02 13:48:52 -04:00
Philipp Wiesemann
427472fe2e ALSA: Fixed adding wrong status to error message (thanks, romain145!).
Fixes Bugzilla #3364.
2016-07-19 21:02:44 +02:00
Ryan C. Gordon
a581346fae alsa: Make device enumeration robust against weird results with NULL strings. 2016-04-04 22:49:13 -04:00
Ryan C. Gordon
1e8df9cd60 alsa: Implemented basic device detection.
This is kind of nasty, because ALSA reports dozens of "devices" that aren't
really things you'd ever want, or things that should be listed this way, but
the default path still works as before, and it at least allows these devices
to be available to apps.

This does not handle hotplugging yet. You get a device list at init time
and that's it.
2016-03-05 23:25:23 -05:00
Sam Lantinga
42065e785d Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Philipp Wiesemann
0e45984fa0 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().
2015-06-21 17:33:46 +02:00