* 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
Set CUBEB_BACKEND env var to the name of valid backend supported by
the current platform to prefer that backend over the default choice.
If CUBEB_BACKEND is not valid, backend selection falls back to the
standard behaviour.
A warning is printed to stderr if the chosen backend id doesn't match
the requested one.
This allows forcing of a particular backend by name,
*if* it was compiled in, otherwise default list is tried
in default order as before.
Tests updated to reflect new api. (Gecko change required)
Using JACK backend:
100% tests passed, 0 tests failed out of 13
Total Test time (real) = 183.75 sec
Signed-off-by: Damien Zammit <damien@zamaudio.com>
This is primarily required to fix Gecko integration bustage on the OS X
10.7 builders, where defining _XOPEN_SOURCE before including <iostream>
causes errors with _asprintf_l in the C++ <locale> header.
This is changing all the signatures of the `cubeb_stream_init` implementations,
the signature of the `data_callback` type, so that cubeb can support audio
input.
`cubeb_stream_init` now has two `cubeb_stream_params` pointers, one for input,
one for output. If two pointers are passed, a "duplex" stream is opened. If only
one pointer is passed, an input-only or output-only stream is created.
Duplex streams have the same sample rate, and sample type. They don't have to
have the same number of channels.
`data_callback` now has two pointers to audio buffers: an input buffer (`NULL`
if this is an output-only stream) containing input data (e.g. a microphone), and
an output buffer, to be filled, as usual, with the audio frames to play. The
two buffers always have the exact same number of audio frames, and are
temporally correlated in a way that ensures the minimal loop-back latency on
the system if one directly copies the input buffer to the output buffer.
No functionnal changes are present in this patch, just signature changes.
Asserts have been added to prevent users to try to use the input code path for
now.
Actual implementations with the input code for different platforms will follow.
Green `mozilla-central` push:
<https://treeherder.mozilla.org/#/jobs?repo=try&revision=15b4dd3cbbe8>