aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
AgeCommit message (Collapse)Author
2024-04-30Invalidate timing info buffers when destorying AAudio stream.John Lin
aaudio_stream_get_position() returns incorrect result because aaudio_stream_init() recycled destroyed stream where the timing_info buffers contain stale data.
2024-04-16Add internal utility to log audio streams to disk from real-time audio callbacksPaul Adenot
2024-03-06Only build duplex_collection_change_no_unregister when death tests are ↵Mike Hommey
supported (#780)
2023-11-21Relax a single test_sanity.cpp assertion when using OpenSLPaul Adenot
2023-11-21Allow not being able to get the minimum latency in test_callback_ret.cpp and ↵Paul Adenot
test_logging.cpp, as it's not essential for the test
2023-11-10Remove test_deadlock.cpp file, hasn't been compiled since March 2018Paul Adenot
Removed in 789eaa.
2023-11-10Include gtest.h in test/common.hPaul Adenot
2023-11-10Non-functional change: Directly include string.h in test/common.hPaul Adenot
2023-11-10Non-functional change: clang-format testsPaul Adenot
2023-11-10Non functional change: fix unified compilation issue -- make callbacks staticPaul Adenot
2023-11-07In test_duplex loop back all input framesAndreas Pehrson
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-04-26Skip a couple more tests when a backend can't use audio inputPaul Adenot
2023-04-26Only run test_overload.cpp when using the WASAPI backendPaul Adenot
2023-04-26Don't run test_loopback and test_duplex on backends that can't open audio inputPaul Adenot
2023-04-26Prevent running test that make use of audio input streams on backends that ↵Paul Adenot
don't implement it
2023-04-20Sync back BMO#1825328Paul Adenot
https://bugzilla.mozilla.org/show_bug.cgi?id=1825328 landed in Firefox without going through upstream. It's necessary to build in an environment where gtests are all compiled in the same executable. Original patch by serge-sans-paille <[email protected]>.
2022-12-14Add a triple_buffer class that allows publishing data in a wait-free manner ↵Paul Adenot
from a real-time thread to another thread. It's largely inspired from the crate cubeb-coreaudio-rs uses, but ported to C++.
2022-12-12Add a test to stress test the asynchronous logging systemPaul Adenot
2022-12-05Account for the fact that some OSes have longer callback duration and async ↵Paul Adenot
logging is batched
2022-12-02Inline values for stream params in test_logging.cpp, undef defines in test ↵Paul Adenot
to avoid breaking unified builds when building tests in Firefox.
2022-12-02Allow dynamic enabling and disabling of the log, add tests for the logging ↵Paul Adenot
system. Also clear out the memory used by the async logger when it's shut down. This relies on the fact that enabling and disabling logging is performed on the same thread, but I think this is a reasonnable thing to do. We could assert it though.
2022-03-30Add test case for data_callback returning error.Matthew Gregan
2022-03-08Add a parameter to cubeb_resampler_create to enable reclockingPaul Adenot
2022-02-28Assert device collection callbacks were unregistered before cubeb_destroy is ↵Matthew Gregan
called.
2021-07-28Increase delay to really test the pulse backend.Paul Adenot
Turns out it was testing the preroll, and with the preroll gone from the pulse-rust backend in https://github.com/mozilla/cubeb-pulse-rs/pull/69, this fails on (at least) docker-on-AWS hosts.
2021-07-25Add a multiple input devices test (#651)Chun-Min Chang
Add a multiple input devices test Add a test to check if we can open multiple input devices at the same time. This is a simple check for BMO 1238038.
2021-02-17Remove cubeb_stream_reset_default_device API.Matthew Gregan
2020-10-07Add method to change stream nameBrendan Early
2020-09-21Address review commentsPaul Adenot
2020-09-21Add a test case for WASAPI reconfigure eventPaul Adenot
2020-06-30resampler: avoid overflow on uint arithmeticsAlex Chronopoulos
2020-04-26tests: Fix crash when device enumeration is not supportedCameron Cawley
2020-03-31Remove test for registering device changed callback twiceChun-Min Chang
audiounit-rust backend will return an error instead of hitting an assertion when registering a callback by calling `cubeb_stream_register_device_changed_callback` without unregistering the registered callback. It's not possible to run a death test in gtest for the Rust API[1] [1] https://users.rust-lang.org/t/how-to-write-a-death-test-in-gtest-for-rust-apis/23575
2020-01-22fix a few warnings (#571)Alex Chronopoulos
2020-01-22resampler: avoid integer signed comparison mismatch (#570)Alex Chronopoulos
2020-01-21resampler: handle explicitly the case that input frames are less than output ↵Alex Chronopoulos
frames (#565) * resampler: handle explicitly the case that input frames are less than output frames * Review comments * resampler: stop expecting input number of frames equal to output * resampler: report correctly the input frames used * resampler: add unit tests for passthrough_resampler::fill
2020-01-21test_ring_buffer: Use `yield` instead of `sleep_for(10us)`. (#569)Matthew Gregan
See issue #567 for details.
2019-09-06test: unbreak on non-GTEST_HAS_DEATH_TEST platformsJan Beich
test/test_device_changed_callback.cpp:79:3: error: use of undeclared identifier 'ASSERT_DEATH' ASSERT_DEATH( ^
2019-08-22Remove panning API from cubebPaul Adenot
This is best done by the host application, and had very little implementation anyways.
2019-06-11Fix tests warnings (#512)Chun-Min Chang
* Using unsigned long-long modifier in fprintf * Remove unnecessary lambda captures * Align naming conventions among the functions * Replace llu by PRIu64 * Define __STDC_FORMAT_MACROS * Using default capture
2019-03-30Make sure data_callback and state_callback are not null (#496)Chun-Min Chang
* Make sure data_callback and state_callback are not null * Check callbacks are valid in cubeb.c * Initialize stream with non-null callbacks
2019-01-06Make sure no active device changed callback when registering a new oneChun-Min Chang
2019-01-06Add tests for cubeb_stream_register_device_changed_callbackChun-Min Chang
2018-12-17trivial test to check if cubeb_stream_get_latency is callable (for Rust ↵Chun-Min Chang
implementation)
2018-12-17Remove misleading commentsChun-Min Chang
2018-10-18 tests: check correctly the audio buffer values range (BMO 1484541). (#461)Alex Chronopoulos
* tests: check correctly the audio buffer values range (BMO 1484541). * tests: create a comfortable way to enable logs in tests * duplex test: check audio range correctly and change the input channel to stereo to avoid AD mixer (BMO 1484541). * test_duplex: Revert back input channel to mono
2018-07-19audiounit: Reduce duplicate code in audiounit_stream_get_current_device (#453)Chun-Min Chang
* Add a test for cubeb_stream_get_current_device() and cubeb_stream_device_destroy() * Reduce duplicates in audiounit_stream_get_current_device() The audiounit_stream_get_current_device() will set the default device's name for input and output by the following steps: 1. Get default device's data, whose type is uint32 2. Convert the uint32 data into a string 3. Set the string into cubeb_device's name Hence we can split it into functions to do the above steps: i. audiounit_get_default_device_data(...) Do the step 1 ii. allocate_and_convert_uint32_into_string(...) Do the step 2 and 3. It will allocate memory for a string and put the converted string right there. (If we don't allocate and then set the values into the memory at the same time, we need to find a way to check the memory's boundary.) They are called by a function named audiounit_get_default_device_name(...), with cubeb_device_type parameter to set the device name of input or output. And audiounit_get_default_device_name(...) will be used in audiounit_stream_get_current_device(). * Replace allocate_and_convert_uint32_into_string(...) by convert_uint32_into_string(...) 1. Rename allocate_and_convert_uint32_into_string(...) to convert_uint32_into_string(...) 2. Return a unique_ptr<char[]> from convert_uint32_into_string(...) pointing to an allocated memory * Hard-coding the convertion from uint32 into string This change is to make sure the conversion only ever needs to handle 4 bytes. * Add more information to log when calling audiounit_stream_get_current_device(...) We add a log with error message when we cannot get datasource data from the devices. However, we don't return an error code in this case since it's quite common when we try getting that data from USB devices. We will convert the datasource data into a string. If there is no data, the string is empty. Instead of logging when we cannot get the datasource data, it's better to log that the converted name is empty. It'll give more meaning (Users are more likely confused about what the empty datasource means.). * Rename audiounit_get_default_device_data() to audiounit_get_default_device_datasource() We should use an explicit name for this function since the same device will return different datasources. For example, the default input device on macbook pro will return "imic" if it uses the default internal microphone or "emic" when it uses an external microphone plugged in audio jack. TODO: it's better to rename audiounit_stream_get_current_device to audiounit_stream_get_current_device_source. The reason is same as above.
2018-03-27Initialize cubeb_stream_params.prefs field in more tests to avoid random ↵Matthew Gregan
failures.
2018-03-21wasapi: Remove COM initialization and require caller to complete.Matthew Gregan
This addresses the thread local COM initialization lifetime problem discussed in issue #416 by moving the responsibility for COM initialization from within cubeb to the caller.
2018-03-19Multi-channels support for windows/mac/linux (#426)Jean-Yves Avenard
* Add QUAD and QUAD_LFE layouts. * Remove dual mono layout. It makes no sense to have a case for those as the data structure used (a bitmask) do not allow to represent this channel layout (a channel can only be present once). As such it was a non-functional layout * Fix up cubeb_pulse compilation using C++ keyword. * Remove the concept of preferred layout. Channel layout is derived by the content being played. The concept of preferred layout is meaningless. Either we have a layout defined, or we don't. There's no in-between. So we remove it. * Remove CHANNEL_MONO concept. * Add cubeb_sample_size convenience method. * Rework cubeb_mixer. This completely replace the existing remixer which had serious limitations: 1- Had no memory bound checks 2- Could only downmix 5.1 and 7.1 to stereo. This mixer allows to convert from any sane layout to any other and work directly on interleaved samples. This cubeb_mixer doesn't have an API compatible with the previous one. This commit is non-fonctional, and was split for ease of review. * Fix remixing on mac, windows and pulse backend. * Make cubeb_mixer creation infallible. Rather than ignore nonsensical layouts, we attempt to play it according to the stream channels count instead. The audio data will be played as-is, dropping the extra channels or inserting silence where needed. * User proper sample size when calculating offsets. Should the user data be of a different type to what the AudioUnit output is set to, we would have written outside the end of our allocated buffer. * Fix input mixing and clarify frames vs samples terminology * If a layout is unknown or invalid, always treat it as plain stereo or mono.