Steveice10
d0ffc6d302
audiounit: Resample to match output device hardware sample rate in uncommon cases.
...
In some cases, weird sample rates can cause AudioUnit output
units to misbehave. Instead, use resampling for non-native rates
to make sure this does not happen.
2024-01-31 10:51:22 +01:00
Andreas Pehrson
dd8a91f982
Add an API for muting the input side of a stream
2024-01-15 15:25:40 +01:00
Andreas Pehrson
5a2df9b0aa
Add APIs for input processing
2024-01-15 15:25:40 +01:00
Nikolay Borodin
ffec8ede4c
Checking buffer, buffer_in, buffer_out pointers for non NULL values
2024-01-08 11:31:04 +01:00
Andreas Pehrson
ed2efe22cb
auto_array: protect from various calls when length_ is 0
...
cubeb-coreaudio-rs has hit a case when running its tests on MacOS 12
where it fails the `assert(destination && source);` in `PodCopy` because
it tried to push 0 samples to an auto_array of length 0, as the internal
auto_array buffer had not been allocated yet.
2023-12-12 10:56:31 +01:00
Paul Adenot
54217bca3f
Relax a single test_sanity.cpp assertion when using OpenSL
2023-11-21 11:08:34 +01:00
Paul Adenot
33531e337a
Allow not being able to get the minimum latency in test_callback_ret.cpp and test_logging.cpp, as it's not essential for the test
2023-11-21 11:08:34 +01:00
Paul Adenot
699c44180e
Add static keyword to fix build of tests in unified builds
2023-11-21 11:08:34 +01:00
Paul Adenot
5707d0e447
Fix latency reporting on OpenSL
2023-11-21 11:08:34 +01:00
Paul Adenot
30efcd1cdf
Remove test_deadlock.cpp file, hasn't been compiled since March 2018
...
Removed in 789eaa.
2023-11-10 17:00:19 +01:00
Paul Adenot
2f01da4a8a
Include gtest.h in test/common.h
2023-11-10 15:52:55 +01:00
Paul Adenot
63f69b9986
Include the header directly to use AudioBuffer on macOS in cubeb_ring_array.h
2023-11-10 15:48:07 +01:00
Paul Adenot
001b904409
Non-functional change: Directly include string.h in test/common.h
2023-11-10 15:37:57 +01:00
Paul Adenot
47f9a4733b
Consistently use double in the mixer
...
This fixes a warning: INT32_MAX cannot be represented as a float.
2023-11-10 15:32:03 +01:00
Paul Adenot
28eed05dd5
Non functional change: Fix missing documentation in cubeb.h
2023-11-10 15:32:00 +01:00
Paul Adenot
625213fd9f
Non-functional change: Check tests when checking format
2023-11-10 15:31:57 +01:00
Paul Adenot
687b1e3446
Non-functional change: clang-format tests
2023-11-10 15:31:52 +01:00
Paul Adenot
8b4721e51e
Non functional change: fix unified compilation issue -- make callbacks static
2023-11-10 15:31:45 +01:00
Paul Adenot
6f0f147148
clang-format
2023-11-10 11:31:35 +01:00
Paul Adenot
b32ab34399
Reset logging thread ID when starting a new stream to allow debugging comfortably
2023-11-10 11:31:35 +01:00
Paul Adenot
2dedf7b191
AAudio: set the callback size to the latency passed in, increase internal buffer size to be 3 times the burst size
2023-11-10 11:31:35 +01:00
Paul Adenot
eb1293382e
Add and modify a few logging statements
2023-11-10 11:31:35 +01:00
Paul Adenot
b040f89681
AAudio: when finding that an input device has been disconnected, reinitialize the duplex stream
2023-11-10 11:31:35 +01:00
Paul Adenot
4b4d18a70f
AAudio: remove unused header
2023-11-10 11:31:35 +01:00
Paul Adenot
ce3645e65c
Reset thread id when a new stream is created, in OpenSL backend
...
This is not 100% correct, but prevents crashing on an assert in the very
common case of opening multiple streams back to back with logging
enabled.
2023-11-10 11:31:35 +01:00
Paul Adenot
72ded59b4d
Fix output buffer conversion: handle differing channel count between input and output
2023-11-10 11:31:35 +01:00
aeiouaeiouaeiouaeiouaeiouaeiou
a0e8b8e49a
CI: update actions/checkout to v4
2023-11-10 23:12:31 +13:00
Paul Adenot
d07ea5aa66
Fix mistake break audio input on OpenSL ES
2023-11-08 14:42:49 +01:00
Andreas Pehrson
785a3ca155
In test_duplex loop back all input frames
...
The break removed here makes sense for input-only, where breaking has no
side effects. In a loopback duplex case like here it makes the callback
exit early, before having written all frames. This can be caused by
clipping on the input side (as observed on MacOS) and creates a
distortion that sounds terrible.
2023-11-07 12:04:32 +13:00
Paul Adenot
5f0d17373b
AAudio: ensure input buffer is large enough when reading input data
2023-10-26 11:43:35 +02:00
Paul Adenot
75d5e6a040
Return an error if failing to open a recorder and it's not a sample-rate not supported issue
2023-10-24 11:11:47 +02:00
Paul Adenot
f1bfefbbd4
Actually use the return value in initialize_with_format callback call.
2023-09-26 15:23:21 +13:00
Paul Adenot
f9c118ddc0
Use uint64_t for the samplerate in opensl_stream_get_position to avoid overflow
2023-09-15 16:14:22 +02:00
Paul Adenot
3f86a06fce
Generate compile_commands.json while building
2023-08-25 20:09:58 +02:00
Paul Adenot
46f10c2eea
Handle input side
2023-08-25 20:09:58 +02:00
Paul Adenot
ed468c2a47
Refactor conversion and format setting logic
2023-08-25 20:09:58 +02:00
Paul Adenot
cd4effa91a
OpenSLES and related file: clang-format
2023-08-25 20:09:58 +02:00
Paul Adenot
510266b364
OpenSLES: clang-format
2023-08-25 20:09:58 +02:00
Paul Adenot
4dfcbd32fd
OpenSLES: Fix most clang-tidy warnings
2023-08-25 20:09:58 +02:00
Paul Adenot
714ac6e8db
OpenSLES: when floats IO aren't supported, perform a conversion
2023-08-25 20:09:58 +02:00
Paul Adenot
13872fb5f1
OpenSLES: use cubeb logging facilities
2023-08-25 20:09:58 +02:00
Paul Adenot
33ade008b5
OpenSLES: compile as C++
2023-08-25 20:09:58 +02:00
Paul Adenot
ac8474a592
AAudio: Don't unlock a mutex owned by a lock_guard
2023-08-03 14:13:06 +02:00
Paul Adenot
b9af56cee7
Don't attempt to use an unavailable cubeb_stream in aaudio_stream_init.
2023-07-31 11:50:04 +02:00
Paul Adenot
41344b3abb
Update googletest to current master
...
This is what is recommended by upstream.
2023-07-26 14:02:22 +02:00
Paul Adenot
af4769f18a
Run clang-format
2023-07-26 14:02:22 +02:00
Paul Adenot
cfd7bf22d6
Compile in C++17, like Gecko
2023-07-26 14:02:22 +02:00
Paul Adenot
31d6a2b0f2
AAudio: Fix log level when stopping a stream
2023-07-26 14:02:22 +02:00
Paul Adenot
eef055ab21
AAudio: When a device is disconnected, reinitialize the stream with the same parameters
2023-07-26 14:02:22 +02:00
Paul Adenot
29d266e628
AAudio: Split init/destroy/start functions into an internal and external interface
...
This will allow calling those functions properly from an internal thread, and
simplify lock management. This will happen in a subsequent patch.
The initial parameter passed to cubeb_stream_init are now stored on the
cubeb_stream struct to be able to reinitialized properly (again in a subsequent
patch).
Since all those calls need have a lock held, the lock is passed as argument to
ensure thread safety. This ensures the caller of the internal functions has
taken the lock, and at the same time allows not unlocking/relocking the mutex if
a series of call is performed (that will be the case in a subsequent patch,
during reinitialization).
The boolean that marks that a stream is in use is modified in the external
interface, called by the user. A stream is marked as being in use when the user
initialize it, and is marked as not being in use when the user destroys it.
2023-07-26 14:02:22 +02:00