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

1287 Коммитов

Автор SHA1 Сообщение Дата
Jan Beich 9456b3687f build: simplify -ldl handling 2019-09-09 13:49:48 +12:00
Jan Beich f33f05a139 test: unbreak on non-GTEST_HAS_DEATH_TEST platforms
test/test_device_changed_callback.cpp:79:3: error: use of undeclared identifier 'ASSERT_DEATH'
  ASSERT_DEATH(
  ^
2019-09-06 08:56:54 +12:00
Alex Chronopoulos c303b042b0
tool: add an option to force stream drain (#536) 2019-09-05 11:08:07 +03:00
Paul Adenot 8c3e32bd24 Remove panning API from cubeb
This is best done by the host application, and had very little
implementation anyways.
2019-08-22 10:11:25 +12:00
Michael M 323ced8019 wasapi: add support for IAudioClient3 and lower latencies 2019-08-20 11:20:07 +12:00
Michael M 8f7481a741 wasapi: fix hns_to_frames being off-by-one
For example, when given a sample rate of 44100 Hz, and a period of 29025
hundred-nanoseconds, hns_to_frames calculates 128.00025 frames, and
rounds up to 129 frames.

The actual result here should be 128, but that can't be encoded directly
as a REFERENCE_TIME; it'd need to be 29024.9433107. I'm guessing WASAPI
just rounds/ceils to the closest whole number.

So, when calculating hns_to_frames, first subtract one from the hns
value to handle these cases.
2019-08-20 11:20:07 +12:00
Paul Adenot 0b5b52d371 Link pulse when building the rust pulse backend
This fixes #480.
2019-07-19 13:45:46 +12:00
Paul Adenot c6366e4e27 Add a rountrip latency testing mode to the tool 2019-07-18 15:23:45 +02:00
Paul Adenot abbdaa2f8e Allow going lower in latency. 2019-07-18 15:23:45 +02:00
Paul Adenot c64d242bec Fix audio output latency measurement. 2019-07-18 15:23:45 +02:00
Matthew Gregan 0f799155fc Reintroduce output channel limit (255) in validate_stream_params. 2019-07-12 10:04:52 +12:00
Matthew Gregan a89afa322b cubeb_pulse: Fix -Wimplicit-int-conversion warnings. 2019-07-12 10:04:52 +12:00
Matthew Gregan 41112cefeb cubeb-test: Fix -Wimplicit-int-conversion warning and handle EOF correctly. 2019-07-12 10:04:52 +12:00
Matthew Gregan 0d1d9d84fb Link pthread when building USE_PULSE.
This was working accidentally by picking up pthread via the common
configuration including USE_ALSA.
2019-07-02 13:48:36 +12:00
Matthew Gregan 98a1c8e61c
Enable Windows build on Travis. (#514) 2019-06-20 13:30:20 -07:00
nia 02bcf9cb26 cubeb_sun: Fixes to support high latency playback, and illumos build fix. (#513)
* cubeb_sun: High latency fixes.

Disable the non-blocking code completely, and use a measurement
of frames written from the kernel where supported.

* Spell cubeb_stream_params correctly.
2019-06-14 10:37:41 +12:00
nia 9f39687e7f sunaudio (NetBSD/illumos) backend (#510)
* Initial support. Device scanning and sanity checks work.

Playback and recording does not.

* stream_init fixes. Audio test now runs, though doesn't do anything.

* Set the prinfo type to the device type we'll later be limited to.

* Playback support.

Also implement stream_get_current_device and stream_device_destroy.

* AUDIO_SETINFO properly.

* Don't poll forever when recording.

Use the recommended number of latency_frames as our BUFSIZE.

* Fix typo.

* Don't allocate devid. Required for a sanity test.

* Fix some tests

* Initial attempt to support Solaris

* stdlib.h for calloc.

* undo local change

* Should probably be using "events" here, and the state change isn't
necessary now that it's done elsewhere.

* Avoid format truncation warning.

* more illumos fixes

* Performance improvements.

It seems polling for input is not a viable strategy.

* Protect volume and frames_written with a mutex.

* Protect running with a mutex.
2019-06-12 10:35:08 +12:00
Chun-Min Chang 03eb237c3b Fix tests warnings (#512)
* 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-06-11 12:22:33 +12:00
Chun-Min Chang acbed7de51 Add audiounit-rust backend (#511) 2019-06-08 14:06:30 +12:00
Matthew Gregan 421010c549
Update Travis builds: clang 3.6 -> 3.8, g++ 4.8 -> 5.x, XCode 6.4 -> 9.4. (#509) 2019-06-04 11:02:51 +12:00
Nathan Froyd 36437503f4 wasapi: return unique_ptr normally, without std::move (#443)
clang warns about using `return std::move($LOCAL)`.
2019-06-04 10:42:38 +12:00
Matthew Gregan 9ea8137a0a
Switch Travis builds to Ubuntu Xenial (16.04) to pick up a newer MinGW. (#508)
- Newer MinGW fails with std::threads as it defaults to Windows threads -
  force POSIX threads via cmake/toolchain-cross-mingw.cmake.
- Android fails during CMake generation due to incompatible
  cmake/toolchain-cross-android.cmake.  Switch to maintained toolchain file
  inside Android NDK.
- Android toolchain file in 13b NDK is broken.  Upgrade to 19c NDK.
- Upgrade Android API level from 15 to 16 to match Gecko (and minimum
  supported by 19c NDK).
2019-06-04 10:37:06 +12:00
Matthew Gregan b9e2c50e51
wasapi: Add flag to disable default device switching. (#507)
This has been merged in Gecko via BMO# 1427011 for quite some time.
2019-05-17 09:21:59 +12:00
achronop 64aa80f330 wasapi: notify when a device is disabled. BMO 1546872 2019-04-25 17:32:33 +02:00
Alex Chronopoulos 3570749942 wasapi: tie monitor lifetime with notification client lifetime. BMO 1545279 (#505)
wasapi: tie monitor lifetime with notification client lifetime. BMO 1545279
2019-04-24 13:04:01 +12:00
Alex Chronopoulos 162625ac91
test: add option to get the posotion of a stream (#504)
* test: add option to get the posotion of a stream

* Correct the errom message
2019-04-23 12:27:14 +03:00
Paul Adenot 241e3c7b8a Bug 1531833 - Only call opensl API when supported. r?achronop
Differential Revision: https://phabricator.services.mozilla.com/D27572
2019-04-16 17:39:01 +02:00
Chun-Min Chang 60084ea039 Replace 0 by kAudioObjectUnknown 2019-04-15 12:08:49 +02:00
Paul Adenot a609b30ab8 Failing to set the input type on an input stream on OpenSL ES should not be fatal
This allows supporting ancient Android versions.
2019-04-15 12:08:37 +02:00
Paul Adenot c0a71704ae Bug 1531833 - Add a cubeb pref to indicate the this audio input and output streams will transport voice. r?kinetik 2019-04-10 18:19:29 +02:00
Paul Adenot c2ed6c9e44 Bug 1531833 - Make setting the performance mode in OpenSL ES a non fatal error, it's not available on some Android versions that are supported. r?achronop
Differential Revision: https://phabricator.services.mozilla.com/D26727
2019-04-10 18:19:29 +02:00
Paul Adenot 751df98bd5 Bug 1531833 - Don't query the audio output latency at runtime, and use alternate latency querying method if available. r?achronop
Differential Revision: https://phabricator.services.mozilla.com/D23166
2019-04-10 18:19:29 +02:00
Paul Adenot 5f56039482 Bug 1531833 - Set the Android audio performance mode based on the requested latency. r?achronop
Differential Revision: https://phabricator.services.mozilla.com/D21747
2019-04-10 18:19:29 +02:00
Paul Adenot 7ce499eb26 Bug 1531833 - Set the right type for audio output streams on Android, depending on if it's outputing voice data. r?achronop
Differential Revision: https://phabricator.services.mozilla.com/D21746
2019-04-10 18:19:29 +02:00
Paul Adenot 4b53522e8f Bug 1531833 - Use the configuration interface on Android to pick the right microphone for the usage when recording audio in cubeb_opensl.c. r?achronop
Differential Revision: https://phabricator.services.mozilla.com/D21745
2019-04-10 18:19:29 +02:00
Paul Adenot 040e82357a Bug 1531833 - Automatically count the number of elements in the interface array for recording in cubeb_opensl.c. r?achronop
Differential Revision: https://phabricator.services.mozilla.com/D21744
2019-04-10 18:19:29 +02:00
Paul Adenot 8b7e9c8efe Bug 1531833 - Store whether a cubeb stream on Android is for voice. r?achronop
Differential Revision: https://phabricator.services.mozilla.com/D21743
2019-04-10 18:19:29 +02:00
Paul Adenot 86f8d957c9 Bug 1531833 - Only use two buffers instead of four in OpenSL ES backend for cubeb. r?achronop
This is what Oboe does.

Differential Revision: https://phabricator.services.mozilla.com/D21742
2019-04-10 18:19:29 +02:00
Paul Adenot 132abe0605 Bug 1531833 - Update vendored sles_definitions.h in cubeb with more recent API. r?snorp
I'm just copying this from the NDK, but keeping our notice.

Differential Revision: https://phabricator.services.mozilla.com/D21740
2019-04-10 18:19:29 +02:00
Paul Adenot 9f4f298632 Bug 1531833 - When doing a voice call on Windows, prefer the default communication devices. r?kinetik
Differential Revision: https://phabricator.services.mozilla.com/D21739
2019-04-10 18:19:29 +02:00
Matthew Gregan 7b7210bf63 Link ole32 in WASAPI backend for COM symbols.
Fixes build on aarch64.  We must've been picking ole32 up implicitly on x86
platforms.
2019-04-10 10:48:54 +02:00
Chun-Min Chang a4b68f3c8e audiounit: correct various typos (#494) 2019-04-05 08:11:48 +13:00
Alex Chronopoulos 66d9c48d91
audiounit: replace assert check with error handling. BMO 1541101 (#499) 2019-04-03 12:41:20 +03:00
Chun-Min Chang f8a6768684 Make sure data_callback and state_callback are not null (#496)
* Make sure data_callback and state_callback are not null

* Check callbacks are valid in cubeb.c

* Initialize stream with non-null callbacks
2019-03-30 10:17:03 +13:00
Chun-Min Chang 681d4b7ee6 Release the CFStringRef object when it's no longer needed 2019-03-11 15:12:10 -04:00
Chun-Min Chang b0140a50bf Release the dispatch queue when cubeb context is destroyed
The dispatch queue created within the cubeb context should be released when it's no longer needed, or the allocated memory of the queue will be leaked if it's not deallocated. The memory of the dispatch queue is allocated when the cubeb context is created, so the memory should be deallocated when the cubeb context is destroyed.
2019-03-11 15:12:10 -04:00
Matthew Gregan 6f2420de8f
wasapi: Assert COM is initialized in wasapi_init. (#493)
Per cubeb.h#L414, COM must be initialized by the caller before calling
cubeb_init.

This assert is intended to avoid unintentional fallback to the winmm backend
when the caller forgot to initialize COM before calling cubeb_init.
2019-02-25 12:18:56 +13:00
Alex Chronopoulos 3afc335006 wasapi: implement device collection changed callback (#488)
Add a new thread to the cubeb context that waits on events for input/output device collection changes and executes the user supplied callback(s) from this thread.  Register a new notification client as necessary when user callbacks are registered and dispatch callbacks to cubeb's thread via events.
2019-02-13 10:28:58 +13:00
achronop ca8edc6dec cubeb-test: add options to enable/disable logs. 2019-02-08 07:49:47 +13:00
Alex Chronopoulos 883f47f424
cubeb-test: improvements for testing collection changed callback (#489)
* cubeb-test: improvements for testing collection changed callback

* Apply review comments
2019-02-05 12:17:08 +02:00