Commit Graph

80 Commits

Author SHA1 Message Date
Ruslan Prokopchuk
ae7fc0177b fix microphone example fill with zeros case
Usually when microphone example is run you never hit buffer underflow and "fill with zeros" branch is never executed. But when it's executed it fails with "invalid value" because of checks performed on frame_count. This platform-independent check 8094dc5249/src/soundio.c (L447) sometimes passed because unitialized local frame_count have arbitrary value, but this CoreAudio one 8094dc5249/src/coreaudio.c (L1078) is not passed, and "fill with zeros" scenario always fails on MacOS.
2017-03-27 10:39:38 +03:00
Andrew Kelley
8094dc5249 update sio_record usage text
closes #135
2016-12-23 18:14:58 -05:00
Andrew Kelley
6703021eba sio_sine: add phase wrap around
closes #110

Thanks to @iskunk for the fix.
2016-10-23 16:12:56 -04:00
Andrew Kelley
1b332a44a0 sio_sine example: check memory allocation 2016-06-29 16:11:37 -07:00
Andrew Kelley
67746c42ec sio_sine example: unref device properly
closes #82
2016-06-13 16:48:22 -07:00
Andrew Kelley
aef8d1646d sio_list_devices example: fix cli argument typo 2016-01-05 15:18:11 -07:00
Andrew Kelley
72fde44073 PulseAudio: fix incorrect outstream software_latency
Previously, when using PulseAudio, unintended integer division
caused SoundIoOutStream::software_latency to be incorrect.
2015-11-20 23:51:16 -07:00
Andrew Kelley
d168a7d192 ALSA: better device detection
* Don't suppress sysdefault.
 * If default and sysdefault are missing, use the first device as
   the default device.
 * In sio_record example, don't segfault when device not found or
   probe error.
 * Workaround for Raspberry Pi driver that incorrectly reports
   itself as Output when it is actually Input.

See #44.
2015-11-10 04:23:27 -07:00
James Dyson
4cf76cb228 Fixed error message from no input found 2015-11-05 18:23:27 +11:00
Andrew Kelley
a37b8cf847 update tests to catch pausing during write_callback 2015-10-28 15:42:52 -07:00
Andrew Kelley
b202f6746b underflow test: add --device and --raw params 2015-10-13 00:20:56 -07:00
Andrew Kelley
8bba0de3c1 add --latency and --sample-rate to sine example 2015-09-28 18:12:17 -07:00
Andrew Kelley
0047eb2776 sio_microphone: make latency a command line arg
See #22
2015-09-08 10:37:16 -07:00
Andrew Kelley
8406dcd0ad sio_record: explain about shutting down
closes #12
2015-09-05 11:30:18 -07:00
Andrew Kelley
9d3c08fa3f sio_record: no fwrite in read_callback
See #12
2015-09-04 18:01:57 -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
20fe4ac8d0 sine example: display connected backend 2015-09-01 17:16:48 -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
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
ff73c08667 add sio_record example 2015-08-27 23:32:22 -07:00
Andrew Kelley
7a714298c1 add soundio_force_device_scan API 2015-08-27 21:45:22 -07:00
Andrew Kelley
195ea59209 ALSA: fix playback on raw device 2015-08-26 12:31:09 -07:00
Andrew Kelley
8c9c4f85c2 sine example: remove panics 2015-08-25 00:08:20 -07:00
Andrew Kelley
d1f27fad83 WASAPI: use stream name for session display name 2015-08-24 19:52:43 -07:00
Andrew Kelley
1bb10e6a13 microphone example: more cli parameters 2015-08-24 18:10:09 -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
2eb8ce24cf sine example: add parameter to specify device 2015-08-20 17:38:01 -07:00
Andrew Kelley
2514e19195 build: fix sine example compiling with MSVC 2015-08-20 00:44:56 -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
7238d29666 sample rate is exposed as a list of min/max pairs 2015-08-08 14:44:31 -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
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
f77663399f CoreAudio: obtain most device information 2015-08-01 22:10:43 -07:00
Andrew Kelley
860370d859 rename examples, install them, and correct #include path 2015-07-30 14:16:22 -07:00
Andrew Kelley
4ba1fd91a1 rename device name and description to id and name 2015-07-30 10:26:36 -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
0dee34a84e PulseAudio: fix microphone example 2015-07-29 13:02:17 -07:00
Andrew Kelley
31678c7777 examples: add --jack param 2015-07-29 01:13:57 -07:00
Andrew Kelley
754343bba6 microphone example works with JACK 2015-07-28 18:47:28 -07:00
Andrew Kelley
6df84096f3 sine example works with JACK 2015-07-28 11:28:07 -07:00
Andrew Kelley
3dd9e513bc add JACK backend skeleton 2015-07-24 18:43:14 -07:00
Andrew Kelley
ab8a2c2ffe microphone example: recover from underflow 2015-07-24 13:33:41 -07:00
Andrew Kelley
3d3f9f91a2 microphone example: no more glitches 2015-07-24 13:26:46 -07:00
Andrew Kelley
efa7b7cbc0 ALSA input stream: add missing clean up 2015-07-23 21:07:51 -07:00
Andrew Kelley
34039b4858 microphone example working with ALSA 2015-07-23 20:55:36 -07:00