This fixes audio on a Sony WH1000-xm3, test_duplex.exe, when set to use
16kHz sample-rate, now works. There is a bug in the resampling code
related to an off-by-one when rounding that prevents all rates to work.
This will be fixed in a subsequent patch.
This is simply wrong. Input data are accumulated into the buffer, and
the buffer is emptied into the resampler. The resampler controls the
buffering. It's certainly possible to not have input data here, and
having had two packet worth of data in a previous callback.
This fixes constant glitches on a Sony WH1000-mk3, and doesn't seem to
regress the wired/built-in devices I have.
Picking the default communication device was tried, and is not what
users expect it seems.
Using a lower setting for resampling voice prevent adding too much
latency: 120 frames for 16k->48k in DESKTOP vs 72 in VOICE, and lowers
CPU usage.
* Add input stream latency test
It calls the stream ops and ask for input latency if the output device
has type INPUT.
* Changes for pull 590
Co-authored-by: Corentin ARNOULD <corentin.arn@gmail.com>
* Only print the filename when logging
This keeps the logging message consistent after
https://github.com/djg/cubeb-rs/pull/50 is merged, which fixes the BMO
162132.
Instead of printing the full path to the file that is currently running,
we should print the filename only. As long as we have the filename and
the line, we know where the log comes from.
* Reformat `LOG_INTERNAL`
Align the `\` used for `LOG_INTERNAL` macro.
* Correct position of `__FILENAME__`
* Define `__FILENAME__` by `__FILE_NAME__` if possible
clang 11 provide a `__FILE_NAME__` [1] macro. We should use it if it
exists.
[1] https://clang.llvm.org/docs/LanguageExtensions.html#builtin-macros
* Use `strrchr` in `string.h` when building by MSVC
There is no `__builtin_strrchr` in MSVC, so we fullback to use the
`strrchr` in `string.h` to trim the path above the current file name.
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
We are running into some dangeous internal locking behavior in
_endthreadex when shutting down the monitor_device_notifications thread
in Windows Audio IPC. To avoid deadlock, this patch uses its own Windows
Event to synchronize the death of that thread with the Audio IPC Server
thread that governs its shutdown.
* 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