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

1565 Коммитов

Автор SHA1 Сообщение Дата
Paul Adenot 51f413eac6 Don't account for unresampled data when computing how much input is needed. 2020-09-09 14:30:03 +02:00
Paul Adenot 7b1782b3ea Handle underrun without asserting when resampling an input stream in duplex mode 2020-09-09 14:30:03 +02:00
Paul Adenot a7b68885cb Pre-feed the resampler with zeros to compensate for its latency 2020-09-09 14:30:03 +02:00
Paul Adenot bdc2040367 Fix the input stream prefs check for deciding if a stream is for voice 2020-09-09 14:30:03 +02:00
Paul Adenot 68fba2c8a6 When opening an output device after having opened an input device, try to match to the same physical device, if the output device is not specified (i.e. use default).
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.
2020-09-09 14:30:03 +02:00
Paul Adenot acd2067b19 Rename input_device and output_device as input_device_id and output_device_id 2020-09-09 14:30:03 +02:00
Paul Adenot a73d53c9a7 Add logging to latency queriying methods 2020-09-09 14:30:03 +02:00
Paul Adenot 410bdd2112 Don't return early when there is no input data.
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.
2020-09-09 14:30:03 +02:00
Paul Adenot 955bb94769 Separate the role and the fact that the stream is being used for voice. Use a resampler setting to lower latency when the stream is for voice
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.
2020-09-09 14:30:03 +02:00
Paul Adenot 2929eac322 Add logging to make it clear what resampling setup is being usedd 2020-09-09 14:30:03 +02:00
Ka Ho Ng 98253b293c sun: Fix use-after-free of s->mutex in sun_stream_destroy. 2020-08-26 17:48:22 +12:00
Ka Ho Ng bf03cabbd6 sun: building fix in sun_stream_get_latency 2020-08-26 17:47:56 +12:00
Chun-Min Chang a971bf1a04 Bump the priority of audiounit-rust in default init 2020-07-07 11:53:43 +12:00
Matthew Gregan ea39471a98 Merge branch 'Filoppi-patch-1' 2020-07-03 19:25:06 +12:00
Matthew Gregan 2cc3a02cba Fix conversion from com_heap_ptr. 2020-07-03 19:24:04 +12:00
Matthew Gregan 0bd0338c9a Merge branch 'patch-1' of https://github.com/Filoppi/cubeb into Filoppi-patch-1 2020-07-03 19:16:42 +12:00
Alex Chronopoulos 575bd44389 resampler: avoid overflow on uint arithmetics 2020-06-30 22:57:45 +12:00
Filippo Tarpini b69886c0bf
As suggested 2020-06-30 11:26:01 +03:00
Filippo Tarpini 20cb7e03a6
Fixed small memory leak
Reference:
https://docs.microsoft.com/en-us/windows/win32/api/audioclient/nf-audioclient-iaudioclient-isformatsupported
2020-06-29 22:41:52 +03:00
Alex Chronopoulos 7bc4f13d51 Add in header doc the switching devices behavior. 2020-06-24 18:36:30 +12:00
Paul Adenot e2ffb10843 Clamp stream_delay calculation to zero
For the same reasons we do it in other methods: it's possible that we've
not written enough frames to be greater than the latency.
2020-06-10 13:03:04 +12:00
Koalab99 d5b033dfd3
Add input stream latency test (#590)
* 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>
2020-05-29 17:22:22 +02:00
Jan Beich 4cd6a9289f CI: add FreeBSD jobs 2020-05-25 17:36:37 +12:00
Paul Adenot eecb589778 QueryPerformanceCounter returns non-zero in case of success
I forgot to `git add` this bit...
2020-05-20 12:24:20 +02:00
nia 524a9c99b4 sun: Fix arithmetic on void pointer.
Noticed when building with a newer clang version.
2020-05-08 10:13:33 +12:00
Paul Adenot 80c3d838d2 Allow setting the voice flag for input OR output, depending on the param struct that has the flag 2020-05-07 17:49:36 +02:00
Paul Adenot c169a21375 Use the same workaround in get_latency than in get_position, in cubeb_wasapi.cpp 2020-05-07 15:58:35 +02:00
Paul Adenot 35190a8da6
Add a method to get audio input latency on a stream (#583) 2020-04-29 16:23:15 +02:00
Cameron Cawley 616d773441 tests: Fix crash when device enumeration is not supported 2020-04-26 13:50:49 +12:00
Chun-Min Chang 9caa5b113a
Only print the filename when logging (#581)
* 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.
2020-04-09 11:27:02 -07:00
nia 8a4170a863 sun: Line continuation character not needed 2020-04-07 14:51:50 +12:00
nia 9696902377 sun: POLL_TIMEOUT is no longer used 2020-04-07 14:51:50 +12:00
nia 159fb99b25 sun: Add my email address to the copyright header. 2020-04-07 14:51:50 +12:00
nia e3b409f447 sun: Refactoring: reduce duplication in stream structure.
Seperate out 'floating' value for record and play.
2020-04-07 14:51:50 +12:00
nia 36aa8b1d65 sun: Make the purpose of some variables clearer. 2020-04-07 14:51:50 +12:00
nia 16544688ae sun: Update header inclusion. 2020-04-07 14:51:50 +12:00
nia 38ef439f2c sun: Convert floats to LINEAR32 instead of LINEAR16 2020-04-07 14:51:50 +12:00
Chun-Min Chang 4dbacaefb0 Remove test for registering device changed callback twice
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-03-31 19:49:47 +13:00
Matthew Gregan 7f94e27fdc Force Rust builds to always rerun cargo. 2020-03-24 13:10:11 +13:00
Paul Adenot 3e23b257c1 Remove TODO, we've done all of those, or they don't apply anymore 2020-03-24 11:44:27 +13:00
David Parks 6e7e7659d3 Bug 1430907: Part 2 - Use Windows Event to signal death of monitor_device_notification thread
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.
2020-02-28 13:45:04 +13:00
Chun-Min Chang 50d1a01f0b Destroy stream properly 2020-02-27 23:05:27 +13:00
Paul Adenot 8fd6845c9e Increase input channel count limit.
The mixer supports 32 input channels, so this is safe. This is necessary
for professional audio gear and for testing with virtual devices.
2020-02-13 10:56:25 +13:00
Matthew Gregan 2b79f196c0 wasapi: Disable IAudioClient3 until BMO #1590902 is resolved. 2020-01-30 11:08:47 +01:00
Matthew Gregan d88feed570
Update README.md 2020-01-30 01:34:55 +01:00
Alex Chronopoulos d4b23d1e9b fix a few warnings (#571) 2020-01-22 12:00:49 +01:00
Alex Chronopoulos 0adc5ea965 resampler: avoid integer signed comparison mismatch (#570) 2020-01-22 12:00:23 +01:00
Alex Chronopoulos 6cdf2fd22b
resampler: handle explicitly the case that input frames are less than output 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-21 16:08:09 +02:00
Matthew Gregan be3005530f test_ring_buffer: Use `yield` instead of `sleep_for(10us)`. (#569)
See issue #567 for details.
2020-01-21 11:38:06 +01:00
Alex Chronopoulos 3b6cc572b3 tool: add an option to destroy a stream 2020-01-21 00:05:56 +13:00