adds shim revision check so we know if it gets out of sync
This commit is contained in:
parent
ead54a9bdd
commit
cbcfedbad0
3 changed files with 13 additions and 0 deletions
7
deps/src/shim.c
vendored
7
deps/src/shim.c
vendored
|
@ -3,6 +3,8 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#define SHIM_REVISION 2
|
||||||
|
|
||||||
int paCallback(const void *inputBuffer, void *outputBuffer,
|
int paCallback(const void *inputBuffer, void *outputBuffer,
|
||||||
unsigned long framesPerBuffer,
|
unsigned long framesPerBuffer,
|
||||||
const PaStreamCallbackTimeInfo* timeInfo,
|
const PaStreamCallbackTimeInfo* timeInfo,
|
||||||
|
@ -31,6 +33,11 @@ void synchronize_buffer(void *buffer)
|
||||||
sem_post(&CSemaphore);
|
sem_post(&CSemaphore);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int get_shim_revision(void)
|
||||||
|
{
|
||||||
|
return SHIM_REVISION;
|
||||||
|
}
|
||||||
|
|
||||||
PaError open_stream(unsigned int sampleRate, unsigned int bufSize)
|
PaError open_stream(unsigned int sampleRate, unsigned int bufSize)
|
||||||
{
|
{
|
||||||
PaError err;
|
PaError err;
|
||||||
|
|
BIN
deps/usr/lib/libportaudio_shim.so
vendored
BIN
deps/usr/lib/libportaudio_shim.so
vendored
Binary file not shown.
|
@ -8,6 +8,8 @@ typealias PaTime Cdouble
|
||||||
typealias PaHostApiTypeId Cint
|
typealias PaHostApiTypeId Cint
|
||||||
|
|
||||||
const PA_NO_ERROR = 0
|
const PA_NO_ERROR = 0
|
||||||
|
# expected shim revision, so we can notify if it gets out of sync
|
||||||
|
const SHIM_REVISION = 2
|
||||||
const libportaudio_shim = find_library(["libportaudio_shim",],
|
const libportaudio_shim = find_library(["libportaudio_shim",],
|
||||||
[Pkg.dir("AudioIO", "deps", "usr", "lib"),])
|
[Pkg.dir("AudioIO", "deps", "usr", "lib"),])
|
||||||
|
|
||||||
|
@ -60,6 +62,10 @@ function open_portaudio_stream(stream::PortAudioStream)
|
||||||
|
|
||||||
# TODO: handle more streams
|
# TODO: handle more streams
|
||||||
|
|
||||||
|
shim_rev = ccall((:get_shim_revision, libportaudio_shim), Cint, ())
|
||||||
|
if shim_rev != SHIM_REVISION
|
||||||
|
error("Expected shim revision $SHIM_REVISION, got $shim_rev. Run 'make' from AudioIO/deps/src")
|
||||||
|
end
|
||||||
fd = ccall((:make_pipe, libportaudio_shim), Cint, ())
|
fd = ccall((:make_pipe, libportaudio_shim), Cint, ())
|
||||||
|
|
||||||
info("Launching PortAudio Task...")
|
info("Launching PortAudio Task...")
|
||||||
|
|
Loading…
Reference in a new issue