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.
* 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.
* 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.
- 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).
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.
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.
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.