platforms.
Change doc comment for `PaUtil_AllocateMemory` to make zero-initialization
a documented behavior. Do the same for `PaUtil_GroupAllocateMemory`,
which uses `PaUtil_AllocateMemory`.
On Unix continue to call `malloc()` then follow with `memset(ptr, 0,
size)`. Using `calloc()` was considered but rejected becase it might
change alignment guarantee.
On Windows allocated memory was already being zeroed. Change to invoking
`GlobalAlloc()` with flags `GMEM_FIXED | GMEM_ZEROINIT`. Before this was
implied by using the `GPTR` flag.
This is work towards resolving #396
* Use mono in paex_record.c for both input and output.
* Make pa_fuzz.c use mono input
It was stereo and failing on devices with only mono input.
See #595
The sawtooth example is absurdly loud. If it's left as part of the default build steps, it will probably cause some hearing damage. This moves it into a separate section with a warning.
If an audio stream is only opened for capture in half-duplex
mode, then the self->playback.canMmap variable is false by
default. This triggers setup of a hostBufferSizeMode of
paUtilBoundedHostBufferSize, something that is only meant to
happen for playback streams under some conditions. This leads
to unnecessary processing.
Fix this by also checking for self->playback.pcm, ie. that
the playback component is actually used, so this setting
only gets applied for half-duplex playback or full-duplex
playback + capture streams if needed.
Tested to work correctly now for playback, capture, and
full-duplex playback + capture.
The specific commit which introduced the regression in May 2009 is this one:
85a522fc4a
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
I am no library versioning expert, but using ${PROJECT_VERSION} as
SOVERSION in the CMakeLists.txt file builds a dynamic libportaudio.so
with a SOVERSION (cfe. `objdump -p libportaudio.so | grep SONAME`) of
libportaudio.so.19.8.
This means that any executable compiled/linked against libportaudio.so
will encode a runtime dependency on libportaudio.so.19.8, whereas for
older v19.7 portaudio and earlier, the dependency was on libportaudio.so.2.
That means that any future application binary will have a dependency on
the specific portaudio version it was built against, even though it would
be api and abi compatible to other or older versions of libportaudio, so
upgrades of libportaudio.so to other versions become impossible without
rebuilding all applications that use libportaudio on that machine, or
playing tedious hacky games with symbolic links.
Hardcode the SOVERSION to 2, so the future libportaudio v19.8 will stay
compatible with applications built against v19.7 and earlier. I am not
sure if the old autotools/automake style build scripts also need a similar
update, as i only use the new cmake system.
My understanding is that the soversion should only be incremented if
libportaudio receives backwards incompatible abi changes, not on each
minor version release.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
OSMemoryBarrier() is deprecated and causes build failures
when "-Wall -Werror" are used.
Use memory_order_seq_cst for full barrier
Use CMake C_STANDARD 11
Fixes#639