Commit Graph

167 Commits

Author SHA1 Message Date
Andriy Symonovych 37016e612c Fix macos build (#186)
* fix compile error

* fix missing function error

* fix undefined behavior issue

* require callback to be `Send`
2017-12-06 12:13:36 +01:00
Zachary Hamm 5105427529 Fix coreaudio build (#189)
The last commit to coreaudio/mod.rs added a call to convert_error, but
that function was removed earlier. Remove the call to fix the build.
2017-12-05 08:47:08 +01:00
Eidolon e9856c07ed [coreaudio] Remove intermediate buffer (#182)
* [coreaudio] Remove intermediate buffer

Fixes #181

* [coreaudio] Create voice id after setting format
2017-11-03 10:51:02 +01:00
Eidolon 77cd690b00 [coreaudio] Simplify error conversion (#183) 2017-11-03 10:50:02 +01:00
mitchmindtree 019b27350f Implement `pause` and `play` for ALSA backend (#176)
* Implement `pause` and `play` for ALSA backend

This commit also ensures that the Voice is initially paused when
returned to remain consistent with the rest of the CPAL backends.

Related to #175.

* Remove ineffective pause from end of build_voice method

* ALSA - Change `is_paused` flag from `AtomicBool` to `bool`

* Add pause and play ALSA addition to CHANGELOG
2017-11-02 10:30:15 +01:00
tomaka 743e4e3526
Fix #177 (#179) 2017-11-01 10:15:17 +01:00
tomaka 91adc3e380 Docs and style improvements (#174)
* Improve the crate root documentation

* Add entry in CHANGELOG

* Run rustfmt on the code

* More improvements to documentation
2017-10-23 16:41:38 +02:00
tomaka c524f63000 Improve the emscripten backend (#172)
* Use the js! macro from stdweb

* Rework the Buffer::finish method

* Use references from stdweb

* Fix emscripten warnings

* Rework the run() method to use stdweb

* Adjust timings

* Add entry in CHANGELOG
2017-10-22 14:17:25 +02:00
tomaka d353c97c30 Add samples conversion functions and publish 0.5.1 (#170) 2017-10-21 09:45:02 +02:00
tomaka 87949d859b Add SupportedFormat (#168) 2017-10-20 21:18:40 +02:00
tomaka c28407b26d Fix warnings and reduce scope of libc (#166) 2017-10-19 12:44:14 +02:00
tomaka 6ae01f437c RFC: Rework the API [WIP] (#165)
* Rework the API to not use futures anymore

* Add some comments

* Update the MacOS backend

* Restore the null implementation

* Add an emscripten backend

* Remove erroneously added feature

* Fix to_f32 formula

* [WIP] Alsa backend

* Alsa backend compiling

* Working ALSA backend

* Fix tests

* Move WASAPI endpoint to endpoint module

* Fix WASAPI warnings

* Rework the WASAPI backend

* Check overflows for voice ID

* Add comments and minor fixes to WASAPI backend

* Add a changelog
2017-10-18 20:24:05 +02:00
tomaka 4b019243c2 Rename the methods of the backend as well (#164) 2017-10-12 11:54:09 +02:00
tomaka 2028d5907f Run rustfmt on the code (#162) 2017-10-11 13:24:49 +02:00
tomaka cdcef96279 Remove the `get_` prefix of methods (#151)
* Remove the `get_` prefix of methods

* Fix overlooks
2017-10-11 10:39:44 +02:00
egnehots bd88d9d6ff Document RemoteIO as ios unit fallback
iOS provides three I/O (input/output) units. The vast majority of audio-unit applications use the Remote I/O unit, which connects to input and output audio hardware and provides low-latency access to individual incoming and outgoing audio sample values. For VoIP apps, the Voice-Processing I/O unit extends the Remote I/O unit by adding acoustic echo cancelation and other features. To send audio back to your application rather than to output audio hardware, use the Generic Output unit.

See https://developer.apple.com/library/content/documentation/MusicAudio/Conceptual/AudioUnitHostingGuide_iOS/UsingSpecificAudioUnits/UsingSpecificAudioUnits.html
2017-10-10 20:43:37 +02:00
egnehots 33a8cde056 Minimal ios support 2017-10-10 18:24:53 +02:00
Johannes Lundberg e86ffce712 Fixes for *BSDs
Replace linux-only eventfd() with pipe() to enable use on *BSDs for alsa.
Add FreeBSD to supported OSes.
2017-07-13 15:59:40 +02:00
shockham 97657fae4a SampleStream also holds on to the AudioUnit so it is not dropped 2017-04-19 11:44:42 +01:00
shockham 8cfe176e52 Fix for loop in EventLoop::run being optimised out in a release build on macOS 2017-04-07 11:06:00 +01:00
Nikita Chashchinskii 0f8babe8bd Pass period instead of buffer to snd_pcm_sw_params_set_avail_min
* Also bump version from 0.4.2 to 0.4.3
2017-02-04 08:20:21 +03:00
jwestfall 7c03219451 alsa: set sw_params_set_avail_min based on get_params buffer size
snd_pcm_sw_params_set_avail_min was being hardcoded to 4096, which
seems to be problematic for lower sample rates.  This update sets
the value to the buffer size as supplied by snd_pcm_get_params(),
which is what alsa own sample code does.

This should fix https://github.com/tomaka/cpal/issues/142
2017-01-23 16:10:44 -08:00
Pierre Krieger c291ab13f1 Mark deprecated functions as deprecated 2016-11-16 08:32:02 +01:00
Pierre Krieger a26a9f5337 Fix compilation on windows 2016-11-16 08:17:11 +01:00
Ronald Kinard b44a2ab515 [osx] Implement play/pause for coreaudio 2016-10-18 01:20:40 -05:00
thiolliere 25bb025a9a arc not necessary 2016-10-02 14:24:30 +02:00
thiolliere 5c86eec4f3 line not necessary 2016-10-02 14:21:33 +02:00
thiolliere 1b0c9f2c54 syntax: space after comma 2016-10-02 14:19:58 +02:00
thiolliere f822631bc4 impl play and pause for ALSA
snd_pcm_pause could have been used but not all hardware implement it, so
I propose not to use it.

In this implementation:

there are two kind of scheduling: wait for resume signal and wait for
pcm to be available

if the stream is paused then it return notready and wait for resume

the event loop is different as it manages descriptors corresponding to
voices according to the nature of the scheduling.

there is still a FIXME: in voice.play the is signal is send even if
the event loop wasn't waiting for resume.
It doesn't seem to create any issue. But it happens when you write
voice.pause();voice.play();
2016-10-02 13:29:01 +02:00
mitchmindtree f71a95cd0e Do not lock inner twice. Fixes bug in osx futures 0.1.1 update. 2016-10-01 18:19:27 +10:00
Pierre Krieger 869af718a2 Try fix the OSX code with futures 2016-10-01 09:21:29 +02:00
thiolliere e031025abe update to futures 0.1.1: alsa wasapi 2016-10-01 00:44:22 +02:00
Boris-Chengbiao Zhou 70858ad2e5 Fix #126 2016-08-19 21:48:53 +02:00
Pierre Krieger bf051dd16f Add some documentation to the winapi implementation 2016-08-12 18:06:17 +02:00
Pierre Krieger b1add0b12b Fix most warnings 2016-08-12 17:57:06 +02:00
mitchmindtree cc26897acd Update coreaudio backend to new futures-rs oriented design.
This depends on the changes introduced in #121.

Update to coreaudio 0.6.
2016-08-12 17:49:13 +10:00
Pierre Krieger 6060582aa0 Update the null implementation 2016-08-03 13:06:23 +02:00
Pierre Krieger c2f89d8b2d Update documentation 2016-08-03 13:06:23 +02:00
Pierre Krieger 0c915cac8f Use a max buffer size in order to avoid problems 2016-08-03 10:31:02 +02:00
Pierre Krieger 7c587853ad Make it work on Linux 2016-08-03 10:17:23 +02:00
Pierre Krieger be8310da51 Draft for switching to futures 2016-08-02 18:19:03 +02:00
Jan Solanti f717817c86 coreaudio: update to coreaudio-rs 0.5.0 2016-07-06 00:13:17 +03:00
Ronald Kinard 4d2767ee42 [osx] Correct implementation of get_pending_samples 2016-06-28 18:09:54 -05:00
Ronald Kinard e9b8f46f73 [osx] Return correct Voice period. 2016-06-14 23:38:52 -05:00
Ronald Kinard b2635a52c5 [osx] Add get_period to Voice 2016-06-01 01:28:59 -05:00
Pierre Krieger 752676c818 Be more relaxed with c_void 2016-04-25 13:33:12 +02:00
Pierre Krieger c4bf6e91da Fix the android build 2016-04-22 17:31:24 +02:00
Mathijs van de Nes f3f194293a Fix underflow detection for alsa
The old method always returned _RUNNING on some machines.
This new method seems to produce the expected behaviour.

Note: -32 is probably -EPIPE, but the appropriate constant was not
available at this time.
2016-02-28 17:01:13 +01:00
Nicolas Koch 606bcf9fa6 Fix underflow bug on linux 2016-01-28 21:27:09 +01:00
psych0d0g 7c3aab71a2 Add some sane error messages 2016-01-15 21:16:34 +01:00