Граф коммитов

1652 Коммитов

Автор SHA1 Сообщение Дата
Paul Adenot de7cf5ccce Log input and output frames 2021-07-13 13:51:30 +02:00
Ryan Hileman cf7636f17c don't run resampler unless we have enough frames
(fixes #647)
2021-07-06 17:32:01 +12:00
Alexandre Ratchov 275de804d1 sndio: default max_channels to 8 for OUTPUT and 2 for INPUT
cf https://bugzilla.mozilla.org/show_bug.cgi?id=1633769
2021-07-05 08:44:33 +02:00
Matthew Gregan 5ebe69cb3a wasapi: Adjust output stream volume internally rather than using IAudioStreamVolume. 2021-05-25 08:15:25 +12:00
Tomas Maly 701b73c5c8 memory_order_relaxed has changed in c++20 2021-05-06 11:00:45 +12:00
Hans Petter Selasky fa0645fed9 oss: Use the minimum space of both direction in full-duplex path
There is a bug in the OSS cubeb code which use the previous number of
frames as input for the next data-exchange, when full-duplex is
activated. This causes noticable jitter, because the wrong number of
audio frames is exchanged.

The solution is to check both input and output audio DSP buffers and
select the minimum number of audio frames which can be transferred when
full duplex is activated.
2021-04-29 16:07:28 +12:00
Matthew Gregan b729f5750b Point build badge to build action. 2021-03-10 19:24:33 +13:00
Matthew Gregan 03a6f108b0 Remove obsolete CI configs. 2021-03-10 19:14:54 +13:00
Matthew Gregan 48749d62b0 Add build action. 2021-03-10 00:41:02 +13:00
Matthew Gregan 8942382280 Remove cubeb_stream_reset_default_device API. 2021-02-17 22:05:37 +13:00
Matthew Gregan 9beb8ed0c9 wasapi: Don't clear `device_enumerator` in {un,}register_notification_client.
This is a follow up to 5d5fa34e13.
2021-02-17 10:22:19 +13:00
Nicola Orlando 8d53747d4a Fixed option to not automatically connect ports on jack. 2021-01-22 13:44:54 +13:00
Paul Adenot 4a83932cae Remove a static keyword to remove a warning. 2021-01-19 16:05:14 +01:00
Paul Adenot ed90311f10 Fix two warnings in cubeb_wasapi.cpp. 2021-01-19 16:05:14 +01:00
Ka Ho Ng da818aad24 oss: Fix CPU spinning 100% for playback-only stream 2021-01-19 13:28:14 +01:00
Albert Liu 860bf2b315 WASAPI: Fix potentially uninitialized pointer warning 2020-12-09 14:35:48 +13:00
Paul Adenot 85f1cf48df Fix clock reporting on the AAudio backend
On some device (namely, a Samsung Galaxy A30 running Android 10, see
https://bugzilla.mozilla.org/show_bug.cgi?id=1679932), the state is
"STARTED" for quite some time, so we don't go into the `if` statement.
It's best to fallback.

We then need to ensure the monotonicity of this clock (since now we use
two distinct ways of reporting the time, it can end up being
non-monotonic for some calls), using the same technique we use on other
backends.
2020-12-07 08:11:33 +00:00
Albert Liu 70fadbfb4e WASAPI: Adjust PCM format tag based on configured bits per sample 2020-12-07 16:37:42 +13:00
Ka Ho Ng 5c2cf26778 Rework the buffering logic
Reduce the code complexity of non-blocking IO all together. Besides, we
should let recording direction driving the playback direction if we are
working with duplex stream.

- Fix misuse of SNDCTL_DSP_GETOSPACE ioctl on record.fd as well

- Add more comments regarding buffer initialization

- Address comments about which direction driving another direction
2020-12-01 14:05:01 +00:00
Paul Adenot df5fe422b7 Check various lengths before comparing the group id with the handsfree tag 2020-11-16 09:19:25 +00:00
Paul Adenot b887693072 Fix typo in bluetooth handsfree tag 2020-11-16 09:19:25 +00:00
Paul Adenot 4e851e9960 Null check input and output stream param before dereferencing 2020-11-03 16:36:58 +01:00
Paul Adenot 48e349ef99 Format src/cubeb_aaudio.cpp with clang-format 2020-11-02 16:08:27 +00:00
Paul Adenot c81283271f Add an initial clang-format file 2020-11-02 16:08:27 +00:00
Paul Adenot a851a3ea8d Cleanup comments, add misc. logs. 2020-11-02 15:37:29 +00:00
Paul Adenot a0469241db Port over the input and output policies for voice content from OpenSL to AAudio, unmodified. 2020-11-02 15:37:29 +00:00
Paul Adenot 97ef18c8e8 Implement cubeb_get_preferred_sample_rate for the new AAudio backend. 2020-11-02 15:37:29 +00:00
Paul Adenot 9d421b9935 Implement cubeb_get_min_latency for the new AAudio backend. 2020-11-02 15:37:29 +00:00
Paul Adenot 77956e5267 Implement cubeb_stream_get_input_latency for the new AAudio backend. 2020-11-02 15:37:29 +00:00
Paul Adenot 777d9082a0 Implement cubeb_stream_get_latency for the new AAudio backend. 2020-11-02 15:37:29 +00:00
Paul Adenot 81fbf06c9e Remove context and stream name related code, this is not used on Android. 2020-11-02 15:37:29 +00:00
Paul Adenot 3be35e9e61 Repair opensl output latency, integer division issue. 2020-11-02 15:37:29 +00:00
Paul Adenot e36697bb76 Use C++ style unused argument instead of C-style. 2020-11-02 15:37:29 +00:00
Paul Adenot de1a1f8439 Use sizeof instead of numeric litterals. 2020-11-02 15:37:29 +00:00
Paul Adenot 3fe4d25c04 Make the low-latency/powersave policy choice dynamic, based on latency.
This adds a new file that shares the value between the two non-obsolete
android backend.
2020-11-02 15:37:29 +00:00
Paul Adenot e479f4268d Use a constant instead of a define. 2020-11-02 15:37:29 +00:00
Paul Adenot 2b73ea65a3 Capitalize enums, as it's done elsewhere. 2020-11-02 15:37:29 +00:00
Paul Adenot f61dd1ebea Tell GTest that RTTI is not available for clang (for other compilers it's automatically detected) 2020-10-30 16:38:43 +00:00
Paul Adenot 5a76f201ec Don't use exception in the new cubeb_aaudio.cpp, and don't build with exception or RTTI 2020-10-30 16:38:43 +00:00
nyorain 05e27634df Fix rebase for new latency method 2020-10-28 16:55:14 +00:00
nyorain bb6e83cadb aaudio: Make sure to completely cleanup streams 2020-10-28 16:55:14 +00:00
nyorain 0209aec788 Add minor documentation and logs 2020-10-28 16:55:14 +00:00
nyorain 9183f2e654 Move aaudio backend to C++ & enable low latency 2020-10-28 16:55:14 +00:00
nyorain 9905226379 AAudio: Address first review comments 2020-10-28 16:55:14 +00:00
nyorain 4480be2939 AAudio: destroy pthread_condattr 2020-10-28 16:55:14 +00:00
nyorain 3a5831fac3 AAudio: Fix codestyle 2020-10-28 16:55:14 +00:00
nyorain 706c533829 AAudio: Fix cv clock for android < 21 2020-10-28 16:55:14 +00:00
nyorain 687fa39311 AAudio: Use condition variable instead of sleeping
This removes the constant checking for state changes with
5ms of sleep in between for the state thread.
We need a new thread to wakeup the state thread reliably
without blocking in the audio thread. For a more detailed
and theoretical explanation of the problem and solution (specifically
written for this commit), see:
https://nyorain.github.io/lock-free-wakeup.html

Now, will only do this time-based sleeping when actively waiting
for a state change. We can't implement that with a blocking call to
AAudioStream_waitForStateChange since that can't be woken up
and we furthermore might have to wait for multiple streams at once.
This also fixes some issues and race conditions with stream destruction
and adds some more documentation.
2020-10-28 16:55:14 +00:00
nyorain efae368bcf AAudio: Implement stream_set_volume 2020-10-28 16:55:14 +00:00
nyorain 3c316f4ed2 AAudio: don't send stopped state after draining 2020-10-28 16:55:14 +00:00