Commit graph

233 commits

Author SHA1 Message Date
Andrew Kelley c62c2e4661 macos: avoid allocation when getting time 2015-09-11 10:20:46 -07:00
Andrew Kelley b6c0c84294 macos: fix not cleaning up condition variables 2015-09-10 17:14:16 -07:00
Andrew Kelley f0356597e2 ALSA: remove stray print statement 2015-09-08 15:05:44 -07:00
Andrew Kelley 369ea0f608 os: fix some variables not static 2015-09-08 10:03:23 -07:00
Andrew Kelley 749654b922 PulseAudio: better clear buffer implementation
seek instead of pa_stream_flush
2015-09-07 16:58:46 -07:00
Andrew Kelley e2e483a4d5 no longer depend on or link against libm 2015-09-05 14:56:36 -07:00
Andrew Kelley f8cb816139 ALSA: remove duplicate assert
Thanks to Devin Anderson for pointing it out.
2015-09-04 11:11:14 -07:00
Andrew Kelley 9cc6495306 JACK: fix infinite loop when refreshing devices
closes #9
2015-09-03 20:20:59 -07:00
Andrew Kelley 918183adc6 ALSA: be ready for /dev/snd to not be available
If this occurs, the system has no ALSA support in the kernel,
and it is appropriate for the backend to fail.

closes #6
2015-09-03 15:40:36 -07:00
Andrew Kelley 85c2190675 build: fix build on linux with clang
closes #8
2015-09-03 14:05:19 -07:00
Andrew Kelley b55a225b9c CoreAudio: pass the latency test
See #2
2015-09-03 10:47:38 -07:00
Andrew Kelley f422fcddf3 WASAPI: pass the latency test
See #2
2015-09-03 10:26:55 -07:00
Andrew Kelley 1381cf21d3 ALSA: pass the latency test
See #2
2015-09-03 09:52:21 -07:00
Andrew Kelley d8a7a794d3 PulseAudio: fix microphone regression
introduced by adb3cd88ee
2015-09-03 09:35:37 -07:00
Andrew Kelley e444b8823b JACK: pass the latency test
See #2
2015-09-02 15:23:41 -07:00
Andrew Kelley adb3cd88ee PulseAudio: pass the latency test
See #2
2015-09-02 14:46:36 -07:00
Andrew Kelley e5cd076e2e dummy: pass the latency test
See #2
2015-09-02 13:31:50 -07:00
Andrew Kelley debab8e70f get latency skeleton
See #2
2015-09-02 12:22:03 -07:00
Andrew Kelley 06dc7704a3 ALSA: fix sometimes calling write_callback with 0 frame_count_max 2015-09-02 10:24:04 -07:00
Andrew Kelley 760aee2e54 JACK: better pause/resume behavior
See #3
2015-09-01 17:14:56 -07:00
Andrew Kelley 7b2a10f7e5 WASAPI: simplify and fix device thread logic
closes #5
2015-09-01 17:00:13 -07:00
Andrew Kelley c14d61fa32 WASAPI: better pause/unpause and clear buffer behavior
See #3
2015-09-01 16:31:56 -07:00
Andrew Kelley c88e79cb7b dummy: better clear buffer behavior
See #3
2015-09-01 15:39:03 -07:00
Andrew Kelley cd72f45f06 ALSA: fix clear buffer behavior 2015-09-01 15:06:33 -07:00
Andrew Kelley fe4a04d93c ALSA: better pause/unpause behavior 2015-09-01 14:43:50 -07:00
Andrew Kelley dd6b7003d9 ALSA: better handling of raw devices
* Recover from xruns
 * Better period size choice
2015-08-27 22:58:17 -07:00
Andrew Kelley 7a714298c1 add soundio_force_device_scan API 2015-08-27 21:45:22 -07:00
Andrew Kelley 2d8f8e7f31 ALSA: look for the control file rather than pcm files 2015-08-27 21:22:30 -07:00
Andrew Kelley 16437bd357 various code adjustments
* doc clarifications
 * examples compile with c99 not c11
 * fix pulseaudio on_backend_disconnected not firing only during
   flush events
 * make wait events more efficient
 * fix alsa devices race condition
 * fix backend disconnected code handling
 * add overflow test
 * fix on_events_signal not called at correct times
 * refactor pulseaudio device scanning
 * fix SoundIoErrorNoSuchDevice string value
2015-08-27 20:57:53 -07:00
Andrew Kelley 6032b83180 JACK: fix return type of rename callback 2015-08-26 19:05:07 -07:00
Andrew Kelley b8a2adb4ec PulseAudio: detect server going offline 2015-08-26 17:10:52 -07:00
Andrew Kelley 8d3a32e668 PulseAudio: fix scan devices out of memory race condition 2015-08-26 15:54:03 -07:00
Andrew Kelley a0562af122 document possible errors 2015-08-26 15:17:51 -07:00
Andrew Kelley c96405a091 rt prio warning behavior is overridable 2015-08-26 12:54:13 -07:00
Andrew Kelley 195ea59209 ALSA: fix playback on raw device 2015-08-26 12:31:09 -07:00
Andrew Kelley 1a52d9956d more docs 2015-08-26 11:23:20 -07:00
Andrew Kelley 418904abd3 WASAPI: support exclusive mode capture 2015-08-25 00:23:12 -07:00
Andrew Kelley 65416669d3 WASAPI: all COM functions called in dedicated threads 2015-08-24 23:53:32 -07:00
Andrew Kelley 2c9055d0d3 WASAPI: call COM functions in dedicated thread for outstream 2015-08-24 23:33:27 -07:00
Andrew Kelley d1f27fad83 WASAPI: use stream name for session display name 2015-08-24 19:52:43 -07:00
Andrew Kelley b3dfcb4526 WASAPI: microphone example works 2015-08-24 17:42:57 -07:00
Andrew Kelley 90fa377c99 WASAPI: sine wave example works with raw device 2015-08-21 17:11:46 -07:00
Andrew Kelley a05e0e283e WASAPI: fix device cleanup segfault 2015-08-21 13:08:11 -07:00
Andrew Kelley 3b49292897 use hidden visibility by default and explicitly export
Also don't expose os functions.
And do the dllexport/dllimport thing.
2015-08-20 14:48:19 -07:00
Andrew Kelley 843ea287b9 WASAPI: fix double unref of IMMDevice 2015-08-20 00:45:22 -07:00
Andrew Kelley c2bc2c7c21 WASAPI: sine wave example works with shared device 2015-08-19 23:41:35 -07:00
Andrew Kelley fbc7318268 remove the concept of period duration from the API
also more progress on WASAPI
2015-08-13 22:54:15 -07:00
Andrew Kelley 61b95a458c WASAPI: detecting device changes 2015-08-13 12:23:22 -07:00
Andrew Kelley e82c3e89da WASAPI: get period duration for raw devices 2015-08-13 10:18:46 -07:00
Andrew Kelley 9a06d22608 WASAPI: detect channel layout of exclusive device 2015-08-13 00:58:05 -07:00
Andrew Kelley 1f58cdc0bd WASAPI: get formats for shared and exclusive devices 2015-08-13 00:11:54 -07:00
Andrew Kelley 709fc5fa19 WASAPI: detect raw devices 2015-08-12 19:29:01 -07:00
Andrew Kelley ba65bdb131 WASAPI: shared mode devices support any sample rate 2015-08-12 18:57:34 -07:00
Andrew Kelley c420bf9e71 WASAPI: get channel layout from devices 2015-08-12 17:50:36 -07:00
Andrew Kelley 75185d17d7 WASAPI: get the list of supported formats from devices 2015-08-12 17:11:03 -07:00
Andrew Kelley f4ad630769 WASAPI: get the period duration of devices 2015-08-12 15:32:44 -07:00
Andrew Kelley 20b0515582 WASAPI: default device detection 2015-08-12 11:01:06 -07:00
Andrew Kelley 31e17477bc WASAPI: get friendly name of devices 2015-08-10 23:18:08 -07:00
Andrew Kelley 97abe08f0e WASAPI: get the number of available audio devices 2015-08-10 15:22:08 -07:00
Andrew Kelley 21bf405859 WASAPI skeleton 2015-08-08 15:22:50 -07:00
Andrew Kelley 34ba7e7564 CoreAudio: fix build 2015-08-08 14:49:03 -07:00
Andrew Kelley 7238d29666 sample rate is exposed as a list of min/max pairs 2015-08-08 14:44:31 -07:00
Andrew Kelley eb7308d992 CoreAudio: microphone example works 2015-08-08 11:45:21 -07:00
Andrew Kelley 29d55f59f7 CoreAudio: ability to open an input device 2015-08-07 15:28:22 -07:00
Andrew Kelley 48d927d8e3 CoreAudio: ability to set buffer duration 2015-08-07 13:40:25 -07:00
Andrew Kelley cdb02e2b46 CoreAudio: underflow test passes 2015-08-07 13:13:10 -07:00
Andrew Kelley c263a29b52 os: fix cond timed wait crash on large timeout 2015-08-06 21:28:02 -07:00
Andrew Kelley bdb604cc45 PulseAudio: handle error instead of panicking 2015-08-04 22:20:07 -07:00
Andrew Kelley 753673b194 CoreAudio: fix build 2015-08-04 22:15:43 -07:00
Andrew Kelley c381526205 callbacks supply min and max frame count parameters
This changes the semantics of the callbacks so that instead of
a single `requested_frame_count` or `available_frame_count`,
the callbacks get a minimum frame count and maximum frame count.

The callback must write at least the minimum or get an underflow.
The minimum will be 0 on ALSA, PulseAudio, and Dummy, and will
equal the maximum on CoreAudio and JACK.

This ensures optimal behavior regardless of buffer size.
2015-08-04 21:57:46 -07:00
Andrew Kelley 8da5ae0798 PulseAudio: opening out stream populates buffer_duration 2015-08-04 13:09:45 -07:00
Andrew Kelley a378cac92d JACK: fix not setting outstream buffer_duration 2015-08-04 12:25:15 -07:00
Andrew Kelley 29a914ceba no constructors or destructors 2015-08-04 11:03:19 -07:00
Andrew Kelley 28f73ba037 CoreAudio: listen for changes to device properties 2015-08-04 10:40:26 -07:00
Andrew Kelley d00fe4db58 CoreAudio: cleanup 2015-08-04 09:52:48 -07:00
Andrew Kelley f87961275d write and read functions no longer allow setting frame count
CoreAudio and JACK both have this limitation
2015-08-04 00:56:03 -07:00
Andrew Kelley df0ca8a772 CoreAudio: sine wave example works 2015-08-03 22:27:09 -07:00
Andrew Kelley a774a72958 CoreAudio: get the full list of available sample rates 2015-08-03 17:06:38 -07:00
Andrew Kelley c347629c8d CoreAudio: obtain device buffer duration 2015-08-03 15:14:41 -07:00
Andrew Kelley d8aa9dce4d CoreAudio: get the UID for the device id 2015-08-03 14:58:46 -07:00
Andrew Kelley b0f983bd84 CoreAudio: obtain sample rate information for devices 2015-08-03 14:29:57 -07:00
Andrew Kelley c52e76928f fix build on linux 2015-08-01 22:40:55 -07:00
Andrew Kelley f77663399f CoreAudio: obtain most device information 2015-08-01 22:10:43 -07:00
Andrew Kelley 6d185de82c CoreAudio: emit on_backend_disconnecte when service restarts 2015-08-01 13:24:58 -07:00
Andrew Kelley 7371ce5146 Fix kqueue-based cond and signal implementation 2015-08-01 13:01:49 -07:00
Andrew Kelley 4c5742eb29 CoreAudio skeleton 2015-07-31 18:52:51 -07:00
Andrew Kelley 1829fbf073 fix build on OSX 2015-07-31 18:06:11 -07:00
Andrew Kelley 860370d859 rename examples, install them, and correct #include path 2015-07-30 14:16:22 -07:00
Andrew Kelley 2a70bdb745 add a test for underflow handling and expose os API 2015-07-30 12:07:58 -07:00
Andrew Kelley 6a439dffb9 document device pairs 2015-07-30 10:46:25 -07:00
Andrew Kelley e6112b40ed rename purpose to aim 2015-07-30 10:39:10 -07:00
Andrew Kelley 4ba1fd91a1 rename device name and description to id and name 2015-07-30 10:26:36 -07:00
Andrew Kelley 12db5fd970 remove all calls to soundio_panic
Return codes are the way errors are communicated, not
crashing the entire program.
2015-07-30 00:46:13 -07:00
Andrew Kelley 5503072fc8 ALSA: recover from underflow gracefully 2015-07-29 22:39:27 -07:00
Andrew Kelley 2900616e9b flesh out buffer semantics 2015-07-29 21:50:12 -07:00
Andrew Kelley 44569708a0 Delete the concept of prebuffering 2015-07-29 20:55:28 -07:00
Andrew Kelley d3cf8f02db PulseAudio: fix using 100% CPU
soundio_wait_events wasn't blocking but now it is.
2015-07-29 13:12:04 -07:00
Andrew Kelley 0dee34a84e PulseAudio: fix microphone example 2015-07-29 13:02:17 -07:00
Andrew Kelley 0847d727b1 JACK: fix crash when refreshing devices 2015-07-29 12:27:31 -07:00
Andrew Kelley fe29bc4f45 pulseaudio: fix cork logic 2015-07-29 01:27:07 -07:00