33 Commits

Author SHA1 Message Date
Chris Robinson
fe6e532c87 Use a separate backend callback to start playback of the device
This allows us to properly update the ALCdevice and its resources with the new
parameters before starting playback, instead of expecting the mixer to block
and wait after it has begun.

This also lets us avoid holding the device lock while resetting and starting
the device, which helps prevent lock inversion on some backends (ie, one thread
locking A then B, and another thread locking B then A), ultimately allowing
certain backends to asynchronously update the ALCdevice without risk of lockup.
Capture still has issues here, however.
2012-03-05 07:11:09 -08:00
Chris Robinson
e5d365a3d9 Avoid an unnecessary doCapture check 2012-03-01 20:47:49 -08:00
Chris Robinson
06debb153d Fix a memory leak 2012-03-01 09:56:25 -08:00
Chris Robinson
55556f0e6c Avoid enumerating when opening the default ALSA device 2012-03-01 04:58:28 -08:00
Chris Robinson
85daab0d5e Don't define lib handles when dynamic loading is disabled 2012-03-01 03:46:45 -08:00
Chris Robinson
e88f954cbf Allow reading audio from ALSA directly if the requested length is supported 2012-02-29 10:01:45 -08:00
Chris Robinson
4b88168edb Use a switch to handle the ALSA PCM state 2012-02-27 04:31:03 -08:00
Chris Robinson
f29fbdf088 Print enumerated ALSA devices 2012-02-26 23:02:29 -08:00
Chris Robinson
6ba0fd25a2 Remove an unneeded wrapper 2012-02-22 18:08:15 -08:00
Chris Robinson
4f0d862cbe Set the default ALSA device name when probing 2012-02-20 20:59:55 -08:00
Chris Robinson
e2ccc6f98e Always use "OpenAL Soft" for the short device enumeration list 2012-02-20 20:45:22 -08:00
Chris Robinson
771ef3e8d5 Rename p -> hp for ALSA's hw params 2012-02-20 12:46:09 -08:00
Chris Robinson
4a65747a4b Add a COUNTOF macro to get the number of entries in a static array 2012-02-19 12:07:40 -08:00
Chris Robinson
592fb2b913 Make sure an ALSA capture device was found before accessing the map 2012-02-18 12:39:17 -08:00
Chris Robinson
f68f3f5f86 Simplify ALSA parameter error checking 2012-02-18 12:34:58 -08:00
Chris Robinson
5f23860880 Rename a couple variables and fix their types 2012-02-18 11:07:54 -08:00
Chris Robinson
faf59a7cba Fix some comments 2012-02-18 11:03:42 -08:00
Chris Robinson
1140b3ae83 Support signed and unsigned 32-bit int output 2012-02-14 11:44:57 -08:00
Chris Robinson
5e1d1a52ba Check for each ALSA prefix config option only as needed 2012-02-13 10:33:53 -08:00
Chris Robinson
b375b130ba Add config options for card- and device-specific prefixes in ALSA device names 2012-02-11 09:36:40 -08:00
Chris Robinson
3fb6351212 Format the ALSA device name when enumerating them 2012-02-11 06:55:24 -08:00
Chris Robinson
b4b492c417 Improve checks for supported output formats from ALSA 2012-02-09 22:26:16 -08:00
Chris Robinson
deb84cfdac Improve a couple error messages with the full ALSA device control name 2012-02-07 07:04:33 -08:00
Chris Robinson
ae7b61b040 Avoid printing messages about device parameter changes in the backends 2012-01-17 16:38:58 -08:00
Chris Robinson
6a97f6a327 Reset the ALSA device if the number of available samples grows too large 2011-11-28 10:24:24 -08:00
Chris Robinson
dfd02817fa Make ALSA XRUN when the number of available samples exceeds the buffer size 2011-11-28 09:12:30 -08:00
Chris Robinson
edb386eb1e Add a ConfigValueStr function, to return the string through a parameter 2011-09-19 11:29:18 -07:00
Chris Robinson
cc3dd648ac Check the number of available samples before calling the capture method 2011-09-18 20:27:34 -07:00
Chris Robinson
97024151e4 Return an error from the CaptureSamples method instead of setting it 2011-09-14 02:01:35 -07:00
Chris Robinson
62dfea43c6 Limit the minimum ALSA capture size to 100ms, and the maximum period size to 50ms 2011-09-13 23:51:22 -07:00
Chris Robinson
7e2155d937 Return an ALC error enum from the OpenCapture backend method 2011-08-24 14:44:15 -07:00
Chris Robinson
c696d4dbb2 Return an ALC error enum from the OpenPlayback backend method 2011-08-24 14:24:48 -07:00
Chris Robinson
9989f33fc2 Move backend sources to a separate sub-directory 2011-08-20 00:41:47 -07:00