aboutsummaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2022-03-02Add a parameter to cubeb_resampler_create to enable reclockingreclock-paramPaul Adenot
2022-02-28wasapi: Avoid configuring output side of resampler when using dummy_output.Matthew Gregan
Possible fix for test_loopback assertion failure.
2022-02-28Assert device collection callbacks were unregistered before cubeb_destroy is ↵Matthew Gregan
called.
2022-02-02build: use libbsd when using OSS and glibcAndrea Pappacoda
Some systems offer OSS v4 but do not have BSD-only functions like strlcpy, used in cubeb_oss.c. An example is Debian GNU/kFreeBSD, that uses a FreeBSD kernel with GNU userspace utilities, like glibc. With this patch cubeb will be able to build on these systems thanks to the help of libbsd, that privides most libc functions that you would expect on BSD.
2022-02-02cubeb_oss: Force at maximum 32ms service intervals.Hans Petter Selasky
Also when the latency is specified to be very big. This might be a bug in some upper layer, although I see other cubeb audio drivers doing the same. This "fixes" audio sync with youtube videos.
2022-01-11waspi: Simplify default devices query and avoid nullptr deref.Matthew Gregan
2022-01-08Build fixes for MinGW - follow up to 3d598eff576ea5939b63119d54a8a54183eec144.Matthew Gregan
2022-01-07wasapi: Speed up enumerate_devices by caching default device IDs for each ↵Matthew Gregan
flow/role instead of requerying for every wasapi_create_device. Locally (on a machine with ~120 devices), this reduces a single enumerate_devices call from ~1100ms to ~250ms.
2021-12-08cubeb_oss: Fix recording buffer size computation.Hans Petter Selasky
When computing the maximum buffer size the "fragstotal" field should be used instead of "fragments" field. For recording the "fragments" field usually returns zero, so then no recorded audio may be received. While at it remove the not used "nfr" and "nfrags" fields from the oss_stream structure and use "bufframes" instead.
2021-12-08Fix build on MinGWPaul Adenot
Original downstream patch by Tom Ritter <[email protected]>.
2021-12-04mixer: Replace std::result_of with decltype.Matthew Gregan
Fixes issue #677.
2021-11-29cubeb_oss: Fix for buffer overrun.Hans Petter Selasky
The hardware buffer is typically bigger than the software buffer. Make sure to properly limit the available buffer size values obtained from the DSP device. While at it ensure to retry-polling in case either recording or playback cannot move any data.
2021-11-23CI: Add Android (API level 26) builds.Matthew Gregan
2021-11-23aaudio: Fix formatting.Matthew Gregan
2021-11-23aaudio: Fix build after a4e701ff602eb38d12f24e6ea2424336b470e225.Matthew Gregan
Fixes #676.
2021-11-23build: Bump minimum CMake to 3.14.Matthew Gregan
This is required since the install() cleanup in e690fc21bbfbedaf61a704fbc86c4bbdc304b5ed.
2021-11-10cubeb_oss: Fix warningsKa Ho Ng
There were some type mismatch and signed/unsigned comparison warnings in the initialization path. Sponsored by: The FreeBSD Foundation
2021-11-10cubeb_oss: clang-formattedKa Ho Ng
2021-11-10cubeb_oss: changes to buffering logicKa Ho Ng
The change is to reduce the number of dropped frames when playing YouTube videos. The most significant part is to set trigger threshold to be low enough, such that as long as the audio hardware's DMA engine moves data the callback is triggered without waiting longer. Besides that, unify oss_wait_*fd_for_space() for both directions into a single function. Buffer size is also not required to match the other direction. Sponsored by: The FreeBSD Foundation
2021-11-10build: minor CMake cleanupsAndrea Pappacoda
These are minor cleanups that do not affect the behaviour of the script. In particular, I removed most `DESTINATION` arguments from `install()`, since they are automatically deduced based on the type of file to be installed. In #662 I also added doxygen_add_docs and gtest_discover_tests, but they require CMake version 3.9 and 3.10 respectively, and I think that the advantages they provide are not worth dropping support for older versions
2021-11-10Tidy up `WRAP` definition for dlopen.Matthew Gregan
2021-11-09build: use system speex when possibleAndrea Pappacoda
Following https://github.com/mozilla/cubeb/issues/658#issuecomment-955998734, the speex library is now handled like a normal dependency: cubeb will link against the system version if available, and fall back to the bundled one if not. I've also added a BUNDLE_SPEEX option, so that you can force the use of the bundled library if needed (e.g. creating a standalone libcubeb on a system where libspeex is available). I also had to move the bundled library to a separate folder. As `src` is always added as an include path, the headers in `src/speex` would conflict with system headers. And it also clears the relationship between cubeb and speex. I choose the "subprojects" name to follow the Meson convention, since CMake does not have one. A bit OT, but if you're curious you can see their rationale here: https://mesonbuild.com/Subprojects.html#why-must-all-subprojects-be-inside-a-single-directory Lastly, I added cubeb_log.cpp to the list of sources of test_resampler, as I was getting linking errors when building with BUILD_SHARED_LIBS=true Fixes #658
2021-11-09build: add USE_SANITIZERS optionAndrea Pappacoda
This is useful to users who can't recursively clone the repo or that simply want to build the project from the downloadable tarball (like Linux distributions, for example)
2021-11-06build: add LAZY_LOAD_LIBS option and always link with threadsAndrea Pappacoda
Users can now disable the lazy loading of libraries, and use classic linkage instead. Previously, cubeb would link with threads only if using some backends. This caused linking issues when no backends were active, because cubeb wasn't linked against pthread or similar, while the library is needed by src/cubeb_log.cpp, as it uses std::thread. #cleanup
2021-11-04jack: possibility to disable lazy load of libAndrea Pappacoda
2021-11-02CI: Update apt package index before install.Matthew Gregan
2021-11-01build(cmake): add version and soversion to the built libraryAndrea Pappacoda
2021-11-01build(cmake): use system GTest when availableAndrea Pappacoda
This speeds up compilation times and makes downstream packaging easier.
2021-10-15android: Fix build errorpent0
2021-10-12wasapi: Use stream rate when converting latency to hns.Matthew Gregan
The caller's requested latency in frames is based on the stream's requested rate in `stream_params`. In the default case (when not overriding latency for BT headsets), use this rate when converting frames to hns.
2021-08-02winmm: clang-format fixes.Matthew Gregan
2021-08-01winmm: fix broken audio when sample count is overflowedmixit
Microsoft wave audio docs say "samples are the preferred time format in which to represent the current position", but relying on this causes problems on Windows XP, the only OS cubeb_winmm is used on. While the wdmaud.sys driver internally tracks a 64-bit position and ensures no backward movement, the WinMM API limits the position returned from waveOutGetPosition() to a 32-bit DWORD (this applies equally to XP x64). The higher 32 bits are chopped off, and to an API consumer the position can appear to move backward. In theory, even a 32-bit TIME_SAMPLES position should provide plenty of playback time for typical use cases before this pseudo wrap-around, e.g: (2^32 - 1)/48000 = ~24:51:18 for 48.0 kHz stereo; (2^32 - 1)/44100 = ~27:03:12 for 44.1 kHz stereo. In reality, wdmaud.sys doesn't provide a TIME_SAMPLES position at all, only a 32-bit TIME_BYTES position, from which wdmaud.drv derives TIME_SAMPLES: SamplePos = (BytePos * 8) / BitsPerFrame, where BitsPerFrame = Channels * BitsPerSample, Per dom\media\AudioSampleFormat.h, desktop builds always use 32-bit FLOAT32 samples, so the maximum for TIME_SAMPLES should be: (2^29 - 1)/48000 = ~03:06:25; (2^29 - 1)/44100 = ~03:22:54. This might still be OK for typical browser usage, but there's also a bug in the formula above: BytePos * 8 (BytePos << 3) is done on a 32-bit BytePos, without first casting it to 64 bits, so the highest 3 bits, if set, would get shifted out, and the maximum possible TIME_SAMPLES drops unacceptably low: (2^26 - 1)/48000 = ~00:23:18; (2^26 - 1)/44100 = ~00:25:22. To work around these limitations, we just get the position in TIME_BYTES, recover the 64-bit value, and do our own conversion to samples.
2021-07-28Add clang-format-check target to CMake and run on CI.Matthew Gregan
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-28winmm: Fix sorting of mm*.h headers.Matthew Gregan
2021-07-28winmm: Undo some header reordering to fix build.Matthew Gregan
2021-07-28Run .clang-formatChun-Min Chang
Format all the code under `include` and `src` except those files under `src/speex` with style setting in `.clang-format` file by the following script: ```sh FILE_LIST="$(find "include" "src" -not -path "src/speex/*" | grep -E ".*(\.cpp|\.c|\.h|\.hpp|\.hh)$")" echo "Files found to format:\n---\n$FILE_LIST\n---" clang-format --verbose -i $FILE_LIST ```
2021-07-27wasapi: Avoid a few copies in `wasapi_find_matching_output_device`.Matthew Gregan
See BMO #1722073.
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-07-20wasapi: Don't set AUDCLNT_STREAMFLAGS_NOPERSIST on IAudioClient (<3) ↵Matthew Gregan
streams. Closes #643.
2021-07-13Address review comments.Paul Adenot
2021-07-13Grab input frames on input available event and not on output available eventPaul Adenot
2021-07-13Use long buffers for inputPaul Adenot
2021-07-13Always use default buffer sizePaul Adenot
2021-07-13Log input and output framesPaul Adenot
2021-07-06don't run resampler unless we have enough framesRyan Hileman
(fixes #647)
2021-07-05sndio: default max_channels to 8 for OUTPUT and 2 for INPUTAlexandre Ratchov
cf https://bugzilla.mozilla.org/show_bug.cgi?id=1633769
2021-05-25wasapi: Adjust output stream volume internally rather than using ↵Matthew Gregan
IAudioStreamVolume.
2021-05-06memory_order_relaxed has changed in c++20Tomas Maly
2021-04-29oss: Use the minimum space of both direction in full-duplex pathHans Petter Selasky
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.