* Fix crashes while capturing audio using openal with sndio backend.
* Proper function for mFds preallocation.
Now it is checked whether the returned value of the sin_nfds() function is not a negative number.
It will not be called while the device is running. If the first call succeeds,
a subsequent call that happens to fail must leave the existing device state as
it was so it can be resumed.
This is a rough first pass. It will fail when trying to re-open the same device
which can only be opened once (for instance, with direct hardware access, on
hardware that doesn't do its own mixing). Some backends won't guarantee the new
device is usable until the reset() or start() call.
So far the sndio backend only supports Mono and Stereo, but sndio
supports up to 16 channels (64 in their current git code).
This adds support for all the openal-soft formats (DevFmt*).
I tested this on Linux with 5.1 surround speakers.
The padding must be constant and sample type aligned (e.g. some fixed multiple
of two bytes between the start of two consecutive frames for 16-bit output).
The intent is to always have the ability for stereo output with WASAPI even if
the device has some other unsupported configuration, as long as front-left and
front-right exist.