61 Commits

Author SHA1 Message Date
Chris Robinson
03274a5b95 Ensure at least the specified ringbuffer size is writable
Previously, all but one of the specified size could be written (so for a size
of n, only n-1 was guaranteed writable). All users pretty much compensated for
this, but it makes more sense to fix it at the source.
2018-03-02 13:01:11 -08:00
Chris Robinson
6f62fed65c Add an option to limit the write size of the ringbuffer 2018-03-01 21:23:13 -08:00
Chris Robinson
9b878c64f9 Make the Connected state atomic
Also don't send the Disconnected event more than once.
2018-02-04 00:01:12 -08:00
Chris Robinson
b99e64a0e3 Provide more descriptive messages to disconnection events 2018-02-03 13:54:42 -08:00
Chris Robinson
e7217760f3 Don't bother with an explicit stop backend method 2018-01-29 01:00:53 -08:00
Chris Robinson
a042dbf305 Call the backend close method in the destructor 2018-01-28 23:32:28 -08:00
Chris Robinson
3832b25f30 Move the ringbuffer declarations to a separate header
And rename alcRing.c to ringbuffer.c for consistency.
2018-01-11 09:16:28 -08:00
Chris Robinson
8aa9e35f8c Move the config function declarations to their own header
And rename alcConfig.c to alconfig.c for consistency.
2018-01-11 07:56:54 -08:00
Chris Robinson
82a990e08e Downgrade some ERRs to TRACEs
These don't exist outside OSSv4, e.g. with OSS/Free, padsp, or aoss, so no need
to be concerned.
2017-07-23 16:43:39 -07:00
Chris Robinson
5ab4e584ee Make sure OSS device files exist before adding them 2017-07-23 16:38:54 -07:00
Chris Robinson
f94fa5d5cf Use separate atomic macros for pointers 2017-04-14 17:47:55 -07:00
Chris Robinson
901804d724 Store the ambisonic order separate from the channel enum 2017-04-12 18:26:07 -07:00
Chris Robinson
26144ca9df Rename al_string_* functions to alstr_* 2017-04-04 06:58:53 -07:00
Chris Robinson
2e1f1449bc Don't remove a period from the OSS buffer
Since we're now waiting for space to be available before mixing, the mixing
buffer isn't adding another period.
2017-02-22 15:44:47 -08:00
Chris Robinson
d8c42918f4 Use select() to wait for audio with OSS and Solaris 2017-02-18 15:58:15 -08:00
Chris Robinson
43ab6075f9 Use proper atomics in the OSS backend 2017-01-10 03:17:23 -08:00
Chris Robinson
e270a9784b Add missing macros for OSS3/Free compatibility 2016-12-21 10:54:19 -08:00
Chris Robinson
70378925b0 Warn when a given device name isn't found for OSS 2016-12-01 18:34:29 -08:00
Chris Robinson
66569295e5 Minor cleanup for ALCossListPopulate 2016-12-01 18:26:18 -08:00
Chris Robinson
338e0d72b4 Ensure OSS devices are enumerated when a name is requested. 2016-12-01 18:11:52 -08:00
Chris Robinson
6d4380a48c Change the backend getLatency method to return the clock time too
This will also allow backends to better synchronize the tracked clock time with
the device output latency, without necessarily needing to lock if the backend
API can allow for it.
2016-05-28 00:43:14 -07:00
Chris Robinson
d6163fe570 Convert remaining ringbuffers to the lockless variant 2016-03-29 23:48:36 -07:00
Chris Robinson
9c05a16c9a Fix for systems that don't have strnlen 2016-01-21 02:09:32 -08:00
Chris Robinson
bbd2876afb Improve the OSS enumeration code 2016-01-21 01:05:29 -08:00
Keegan Drake H.P
5a73aa2502 Added a check for an empty path 2015-12-17 20:05:21 -06:00
Keegan Drake H.P
df2ee7ba87 Add device enumeration support for OSSv4 2015-12-17 19:20:08 -06:00
Chris Robinson
01e43e5d4d Add includes to work around broken GNU headers and POSIX-2001 2015-12-11 09:24:40 -08:00
Chris Robinson
e5fa4ee25d Allow for device-specific config values 2015-08-28 14:10:39 -07:00
Chris Robinson
9f49ac0fda Add a macro to simplify allocating and constructing an object 2015-05-18 16:39:44 -07:00
Chris Robinson
28a9f0826c Use a macro for the record thread name 2014-12-21 10:38:40 -08:00
Chris Robinson
2be33d8a77 Only pass nano seconds to al_nssleep 2014-09-08 04:37:52 -07:00
François Cami
3c13e1e333 Update COPYING to the latest https://www.gnu.org/licenses/old-licenses/lgpl-2.0.txt to fix the FSF' address Fix the FSF' address in the source 2014-08-18 11:34:29 -07:00
Chris Robinson
36df67f546 Rename SetThreadName to althrd_setname 2014-04-17 20:41:32 -07:00
Chris Robinson
b020dd13fd Avoid using a Sleep() wrapper 2014-04-16 06:59:44 -07:00
Chris Robinson
d124aee4d7 Remove the old thread wrappers for the new ones 2014-04-16 06:11:40 -07:00
Chris Robinson
7b93e10f7a Use an al_string for the device name 2014-03-28 22:11:34 -07:00
Chris Robinson
d8bfd12d31 Use a void* for the backend Delete method param 2014-03-22 00:28:55 -07:00
Chris Robinson
3d921e0e6f Make backend factory methods static as needed 2013-11-02 16:35:05 -07:00
Chris Robinson
a1a3f51be2 Convert the OSS backend to the new interface 2013-11-02 15:42:45 -07:00
Chris Robinson
f24cb44781 Move the device mutex to the backend 2013-10-28 12:05:33 -07:00
Chris Robinson
8ceb800def Rework threading functions 2013-10-27 08:14:13 -07:00
Chris Robinson
f93bfab824 Set a name for the mixer and recording threads 2013-10-27 07:00:44 -07:00
Chris Robinson
1fb9311d82 Lock the device before calling aluHandleDisconnect
PulseAudio causes an assert if being relocked inside a callback on the worker
thread, where aluHandleDisconnect is called. We can assume it's already locked
there, so just make sure the device is locked before being calling it.
2012-12-02 11:30:23 -08:00
Chris Robinson
0f3a575a09 Don't include alu.h in alMain.h 2012-09-14 02:14:29 -07:00
Chris Robinson
37924887e8 Use a default method to provide a dummy latency 2012-08-19 12:31:59 -07:00
Chris Robinson
0865db564f Move the device lock into the backend function table
For backend-specific implementations: this should hold the audio mixer loop for
playback devices, and provide recursive mutex behavior.
2012-08-18 15:58:04 -07:00
Chris Robinson
ac4fc4026c Add a device method to retrieve the active latency
This is effectively the time until the next update will be heard by the user,
or the closest approximation thereof, in nanoseconds.
2012-08-17 13:38:52 -07:00
Chris Robinson
259e4f5b38 Rename AllDevice -> AllDevices 2012-05-09 16:28:16 -07:00
Chris Robinson
648464a2da Check the right playback device file with OSS 2012-04-22 05:06:44 -07:00
Chris Robinson
5418519637 Remove some more hungarian notation 2012-04-19 23:00:58 -07:00