Commit b9395c1f authored by sletz's avatar sletz
Browse files

Backport of latest Paul alsa_seqmidi changes.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3023 0c269be4-1314-0410-8aa9-9f06e86f4224
parent b50078f9
......@@ -27,6 +27,7 @@ Michael Voigt
* Fix a crash in JackEngine::Close when backend cannot be loaded.
* Tim Blechmann optimization patch.
* Backport of latest Paul alsa_seqmidi changes.
2008-10-15 Stephane Letz <letz@grame.fr>
......
......@@ -44,7 +44,7 @@ enum {
#define NFRAMES_INF INT_MAX
enum {
#ifndef DEBUG
#ifndef JACK_MIDI_DEBUG
MAX_PFDS = 64,
MAX_PORTS = MAX_PFDS-1,
MAX_EVENTS = 4096,
......
......@@ -121,10 +121,10 @@ typedef struct alsa_midi_event alsa_midi_event_t;
struct process_info {
int dir;
int64_t nframes;
int64_t period_start;
uint32_t sample_rate;
int64_t cur_frames;
jack_nframes_t nframes;
jack_nframes_t period_start;
jack_nframes_t sample_rate;
jack_nframes_t cur_frames;
int64_t alsa_time;
};
......@@ -137,21 +137,21 @@ static void do_jack_output(alsa_seqmidi_t *self, port_t *port, struct process_in
typedef struct {
int alsa_mask;
int jack_caps;
char name[4];
char name[9];
port_jack_func jack_func;
} port_type_t;
static port_type_t port_type[2] = {
{
SND_SEQ_PORT_CAP_SUBS_READ,
JackPortIsOutput|JackPortIsPhysical|JackPortIsTerminal,
"in",
JackPortIsOutput,
"playback",
do_jack_input
},
{
SND_SEQ_PORT_CAP_SUBS_WRITE,
JackPortIsInput|JackPortIsPhysical|JackPortIsTerminal,
"out",
JackPortIsInput,
"capture",
do_jack_output
}
};
......@@ -278,7 +278,7 @@ int alsa_seqmidi_attach(alsa_midi_t *m)
snd_seq_set_client_name(self->seq, self->alsa_name);
self->port_id = snd_seq_create_simple_port(self->seq, "port",
SND_SEQ_PORT_CAP_READ|SND_SEQ_PORT_CAP_WRITE
#ifndef DEBUG
#ifndef JACK_MIDI_DEBUG
|SND_SEQ_PORT_CAP_NO_EXPORT
#endif
,SND_SEQ_PORT_TYPE_APPLICATION);
......@@ -459,37 +459,53 @@ void port_free(alsa_seqmidi_t *self, port_t *port)
static
port_t* port_create(alsa_seqmidi_t *self, int type, snd_seq_addr_t addr, const snd_seq_port_info_t *info)
{
snd_seq_client_info_t* client_info;
port_t *port;
char *c;
int err;
char name[64];
int jack_caps;
port = calloc(1, sizeof(port_t));
if (!port)
return NULL;
port->remote = addr;
if (port_type[type].jack_caps & JackPortIsOutput)
snprintf(name, sizeof(name) - 1, "system:midi_capture_%d", ++self->midi_in_cnt);
else
snprintf(name, sizeof(name) - 1, "system:midi_playback_%d", ++self->midi_out_cnt);
snprintf(port->name, sizeof(port->name), "%s-%d-%d-%s",
port_type[type].name, addr.client, addr.port, snd_seq_port_info_get_name(info));
snd_seq_client_info_alloca (&client_info);
snd_seq_get_any_client_info (self->seq, addr.client, client_info);
snprintf(port->name, sizeof(port->name), "%s/midi_%s_%d",
snd_seq_client_info_get_name(client_info), port_type[type].name, addr.port+1);
// replace all offending characters by -
for (c = port->name; *c; ++c)
if (!isalnum(*c))
if (!isalnum(*c) && *c != '/' && *c != '_' && *c != ':' && *c != '(' && *c != ')')
*c = '-';
port->jack_port = jack_port_register(self->jack,
name, JACK_DEFAULT_MIDI_TYPE, port_type[type].jack_caps, 0);
jack_caps = port_type[type].jack_caps;
/* mark anything that looks like a hardware port as physical&terminal */
if (snd_seq_port_info_get_type (info) & (SND_SEQ_PORT_TYPE_HARDWARE|SND_SEQ_PORT_TYPE_PORT|SND_SEQ_PORT_TYPE_SPECIFIC)) {
jack_caps |= (JackPortIsPhysical|JackPortIsTerminal);
}
port->jack_port = jack_port_register(self->jack,
port->name, JACK_DEFAULT_MIDI_TYPE, jack_caps, 0);
if (!port->jack_port)
goto failed;
jack_port_set_alias(port->jack_port, port->name);
/* generate an alias */
snprintf(port->name, sizeof(port->name), "%s:midi/%s_%d",
snd_seq_client_info_get_name (client_info), port_type[type].name, addr.port+1);
// replace all offending characters by -
for (c = port->name; *c; ++c)
if (!isalnum(*c) && *c != '/' && *c != '_' && *c != ':' && *c != '(' && *c != ')')
*c = '-';
jack_port_set_alias (port->jack_port, port->name);
if (type == PORT_INPUT)
err = alsa_connect_from(self, port->remote.client, port->remote.port);
......@@ -540,7 +556,7 @@ void update_port(alsa_seqmidi_t *self, snd_seq_addr_t addr, const snd_seq_port_i
if (port_caps & SND_SEQ_PORT_CAP_NO_EXPORT)
return;
update_port_type(self, PORT_INPUT, addr, port_caps, info);
update_port_type(self, PORT_OUTPUT, addr, port_caps, info);
update_port_type(self, PORT_OUTPUT,addr, port_caps, info);
}
static
......@@ -558,13 +574,15 @@ static
void update_ports(alsa_seqmidi_t *self)
{
snd_seq_addr_t addr;
snd_seq_port_info_t *info;
int size;
snd_seq_port_info_alloca(&info);
while ((size = jack_ringbuffer_read(self->port_add, (char*)&addr, sizeof(addr)))) {
snd_seq_port_info_t *info;
int err;
snd_seq_port_info_alloca(&info);
assert (size == sizeof(addr));
assert (addr.client != self->client_id);
if ((err=snd_seq_get_any_port_info(self->seq, addr.client, addr.port, info))>=0) {
......@@ -638,6 +656,12 @@ void set_process_info(struct process_info *info, alsa_seqmidi_t *self, int dir,
snd_seq_get_queue_status(self->seq, self->queue, status);
alsa_time = snd_seq_queue_status_get_real_time(status);
info->alsa_time = alsa_time->tv_sec * NSEC_PER_SEC + alsa_time->tv_nsec;
if (info->period_start + info->nframes < info->cur_frames) {
int periods_lost = (info->cur_frames - info->period_start) / info->nframes;
info->period_start += periods_lost * info->nframes;
debug_log("xrun detected: %d periods lost\n", periods_lost);
}
}
static
......@@ -645,7 +669,7 @@ void add_ports(stream_t *str)
{
port_t *port;
while (jack_ringbuffer_read(str->new_ports, (char*)&port, sizeof(port))) {
debug_log("jack: inserted port %s", port->name);
debug_log("jack: inserted port %s\n", port->name);
port_insert(str->ports, port);
}
}
......@@ -696,7 +720,7 @@ void do_jack_input(alsa_seqmidi_t *self, port_t *port, struct process_info *info
alsa_midi_event_t ev;
while (jack_ringbuffer_read(port->early_events, (char*)&ev, sizeof(ev))) {
jack_midi_data_t* buf;
int64_t time = ev.time - info->period_start;
jack_nframes_t time = ev.time - info->period_start;
if (time < 0)
time = 0;
else if (time >= info->nframes)
......@@ -754,8 +778,8 @@ void input_event(alsa_seqmidi_t *self, snd_seq_event_t *alsa_event, struct proce
return;
// fixup NoteOn with vel 0
if (data[0] == 0x90 && data[2] == 0x00) {
data[0] = 0x80;
if ((data[0] & 0xF0) == 0x90 && data[2] == 0x00) {
data[0] = 0x80 + (data[0] & 0x0F);
data[2] = 0x40;
}
......@@ -835,16 +859,28 @@ void do_jack_output(alsa_seqmidi_t *self, port_t *port, struct process_info* inf
snd_seq_ev_set_source(&alsa_event, self->port_id);
snd_seq_ev_set_dest(&alsa_event, port->remote.client, port->remote.port);
frame_offset = jack_event.time + info->period_start + info->nframes - info->cur_frames;
/* NOTE: in case of xrun it could become negative, so it is essential to use signed type! */
frame_offset = (int64_t)jack_event.time + info->period_start + info->nframes - info->cur_frames;
if (frame_offset < 0) {
frame_offset = info->nframes + jack_event.time;
error_log("internal xrun detected: frame_offset = %"PRId64"\n", frame_offset);
}
/* Ken Ellinwood reported problems with this assert.
* Seems, magic 2 should be replaced with nperiods. */
//FIXME: assert (frame_offset < info->nframes*2);
//if (frame_offset < info->nframes * info->nperiods)
// debug_log("alsa_out: BLAH-BLAH-BLAH");
out_time = info->alsa_time + (frame_offset * NSEC_PER_SEC) / info->sample_rate;
debug_log("alsa_out: frame_offset = %lld, info->alsa_time = %lld, out_time = %lld, port->last_out_time = %lld",
frame_offset, info->alsa_time, out_time, port->last_out_time);
// we should use absolute time to prevent reordering caused by rounding errors
if (out_time < port->last_out_time)
if (out_time < port->last_out_time) {
debug_log("alsa_out: limiting out_time %lld at %lld", out_time, port->last_out_time);
out_time = port->last_out_time;
else
} else
port->last_out_time = out_time;
out_rt.tv_nsec = out_time % NSEC_PER_SEC;
......
......@@ -602,6 +602,8 @@ int JackCoreAudioAdapter::SetupChannels(bool capturing,
jack_error("Cannot get input channel number");
printError(err);
return -1;
} else {
jack_log("Max input channels : %d", in_nChannels);
}
}
......@@ -611,6 +613,8 @@ int JackCoreAudioAdapter::SetupChannels(bool capturing,
jack_error("Cannot get output channel number");
printError(err);
return -1;
} else {
jack_log("Max output channels : %d", out_nChannels);
}
}
......@@ -730,7 +734,7 @@ int JackCoreAudioAdapter::OpenAUHAL(bool capturing,
int outchannels,
int in_nChannels,
int out_nChannels,
jack_nframes_t nframes,
jack_nframes_t buffer_size,
jack_nframes_t samplerate,
bool strict)
{
......@@ -740,6 +744,11 @@ int JackCoreAudioAdapter::OpenAUHAL(bool capturing,
jack_log("OpenAUHAL capturing = %ld playing = %ld inchannels = %ld outchannels = %ld in_nChannels = %ld out_nChannels = %ld ", capturing, playing, inchannels, outchannels, in_nChannels, out_nChannels);
if (inchannels == 0 && outchannels == 0) {
jack_error("No input and output channels...");
return -1;
}
// AUHAL
ComponentDescription cd = {kAudioUnitType_Output, kAudioUnitSubType_HALOutput, kAudioUnitManufacturer_Apple, 0, 0};
Component HALOutput = FindNextComponent(NULL, &cd);
......@@ -759,27 +768,48 @@ int JackCoreAudioAdapter::OpenAUHAL(bool capturing,
}
// Start I/O
enableIO = 1;
if (capturing && inchannels > 0) {
jack_log("Setup AUHAL input");
err1 = AudioUnitSetProperty(fAUHAL, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input, 1, &enableIO, sizeof(enableIO));
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input");
printError(err1);
if (strict)
return -1;
}
enableIO = 1;
jack_log("Setup AUHAL input on");
} else {
enableIO = 0;
jack_log("Setup AUHAL input off");
}
err1 = AudioUnitSetProperty(fAUHAL, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input, 1, &enableIO, sizeof(enableIO));
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input");
printError(err1);
if (strict)
return -1;
}
if (playing && outchannels > 0) {
jack_log("Setup AUHAL output");
err1 = AudioUnitSetProperty(fAUHAL, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Output, 0, &enableIO, sizeof(enableIO));
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioOutputUnitProperty_EnableIO,kAudioUnitScope_Output");
printError(err1);
if (strict)
return -1;
}
enableIO = 1;
jack_log("Setup AUHAL output on");
} else {
enableIO = 0;
jack_log("Setup AUHAL output off");
}
err1 = AudioUnitSetProperty(fAUHAL, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Output, 0, &enableIO, sizeof(enableIO));
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioOutputUnitProperty_EnableIO,kAudioUnitScope_Output");
printError(err1);
if (strict)
return -1;
}
AudioDeviceID currAudioDeviceID;
UInt32 size;
err1 = AudioUnitGetProperty(fAUHAL, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0, &currAudioDeviceID, &size);
if (err1 != noErr) {
jack_error("Error calling AudioUnitGetProperty - kAudioOutputUnitProperty_CurrentDevice");
printError(err1);
if (strict)
return -1;
} else {
jack_log("AudioUnitGetPropertyCurrentDevice = %d", currAudioDeviceID);
}
// Setup up choosen device, in both input and output cases
......@@ -790,10 +820,20 @@ int JackCoreAudioAdapter::OpenAUHAL(bool capturing,
if (strict)
return -1;
}
err1 = AudioUnitGetProperty(fAUHAL, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0, &currAudioDeviceID, &size);
if (err1 != noErr) {
jack_error("Error calling AudioUnitGetProperty - kAudioOutputUnitProperty_CurrentDevice");
printError(err1);
if (strict)
return -1;
} else {
jack_log("AudioUnitGetPropertyCurrentDevice = %d", currAudioDeviceID);
}
// Set buffer size
if (capturing && inchannels > 0) {
err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, 1, (UInt32*) & nframes, sizeof(UInt32));
err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, 1, (UInt32*)&buffer_size, sizeof(UInt32));
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_MaximumFramesPerSlice");
printError(err1);
......@@ -803,7 +843,7 @@ int JackCoreAudioAdapter::OpenAUHAL(bool capturing,
}
if (playing && outchannels > 0) {
err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, 0, (UInt32*) & nframes, sizeof(UInt32));
err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, 0, (UInt32*)&buffer_size, sizeof(UInt32));
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_MaximumFramesPerSlice");
printError(err1);
......
......@@ -31,6 +31,15 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
namespace Jack
{
static void Print4CharCode(char* msg, long c)
{
UInt32 __4CC_number = (c);
char __4CC_string[5];
*((SInt32*)__4CC_string) = EndianU32_NtoB(__4CC_number);
__4CC_string[4] = 0;
jack_log("%s'%s'", (msg), __4CC_string);
}
static void printError(OSStatus err)
{
switch (err) {
......@@ -95,7 +104,7 @@ static void printError(OSStatus err)
jack_log("error code : kAudioHardwareUnsupportedOperationError");
break;
default:
jack_log("error code : unknown");
Print4CharCode("error code : unknown", err);
break;
}
}
......@@ -245,6 +254,14 @@ OSStatus JackCoreAudioDriver::DeviceNotificationCallback(AudioDeviceID inDevice,
break;
case kAudioDevicePropertyStreamConfiguration:
jack_error("Cannot handle kAudioDevicePropertyStreamConfiguration : server may not work correctly anymore...");
return kAudioHardwareUnsupportedOperationError;
case kAudioDevicePropertyNominalSampleRate:
jack_error("Cannot handle kAudioDevicePropertyNominalSampleRate : server may not work correctly anymore...");
return kAudioHardwareUnsupportedOperationError;
/*
case kAudioDevicePropertyNominalSampleRate: {
UInt32 outSize = sizeof(Float64);
......@@ -254,7 +271,7 @@ OSStatus JackCoreAudioDriver::DeviceNotificationCallback(AudioDeviceID inDevice,
char capture_driver_name[256];
char playback_driver_name[256];
CFStringRef ref;
// Stop and restart
driver->Stop();
driver->RemoveListeners();
......@@ -306,6 +323,7 @@ error:
driver->CloseAUHAL();
break;
}
*/
}
return noErr;
}
......@@ -425,6 +443,7 @@ int JackCoreAudioDriver::SetupDevices(const char* capture_driver_uid, const char
if (strcmp(capture_driver_uid, "") != 0 && strcmp(playback_driver_uid, "") != 0) {
jack_log("JackCoreAudioDriver::Open duplex");
if (GetDeviceIDFromUID(playback_driver_uid, &fDeviceID) != noErr) {
jack_log("Will take default in/out");
if (GetDefaultDevice(&fDeviceID) != noErr) {
jack_error("Cannot open default device");
return -1;
......@@ -439,6 +458,7 @@ int JackCoreAudioDriver::SetupDevices(const char* capture_driver_uid, const char
} else if (strcmp(capture_driver_uid, "") != 0) {
jack_log("JackCoreAudioDriver::Open capture only");
if (GetDeviceIDFromUID(capture_driver_uid, &fDeviceID) != noErr) {
jack_log("Will take default input");
if (GetDefaultInputDevice(&fDeviceID) != noErr) {
jack_error("Cannot open default device");
return -1;
......@@ -453,6 +473,7 @@ int JackCoreAudioDriver::SetupDevices(const char* capture_driver_uid, const char
} else if (strcmp(playback_driver_uid, "") != 0) {
jack_log("JackCoreAudioDriver::Open playback only");
if (GetDeviceIDFromUID(playback_driver_uid, &fDeviceID) != noErr) {
jack_log("Will take default output");
if (GetDefaultOutputDevice(&fDeviceID) != noErr) {
jack_error("Cannot open default device");
return -1;
......@@ -479,6 +500,9 @@ int JackCoreAudioDriver::SetupDevices(const char* capture_driver_uid, const char
return 0;
}
/*
Return the max possible input channels in in_nChannels and output channels in out_nChannels.
*/
int JackCoreAudioDriver::SetupChannels(bool capturing, bool playing, int& inchannels, int& outchannels, int& in_nChannels, int& out_nChannels, bool strict)
{
OSStatus err = noErr;
......@@ -489,6 +513,8 @@ int JackCoreAudioDriver::SetupChannels(bool capturing, bool playing, int& inchan
jack_error("Cannot get input channel number");
printError(err);
return -1;
} else {
jack_log("Max input channels : %d", in_nChannels);
}
}
......@@ -498,6 +524,8 @@ int JackCoreAudioDriver::SetupChannels(bool capturing, bool playing, int& inchan
jack_error("Cannot get output channel number");
printError(err);
return -1;
} else {
jack_log("Max output channels : %d", out_nChannels);
}
}
......@@ -598,6 +626,11 @@ int JackCoreAudioDriver::OpenAUHAL(bool capturing,
jack_log("OpenAUHAL capturing = %ld playing = %ld inchannels = %ld outchannels = %ld in_nChannels = %ld out_nChannels = %ld ", capturing, playing, inchannels, outchannels, in_nChannels, out_nChannels);
if (inchannels == 0 && outchannels == 0) {
jack_error("No input and output channels...");
return -1;
}
// AUHAL
ComponentDescription cd = {kAudioUnitType_Output, kAudioUnitSubType_HALOutput, kAudioUnitManufacturer_Apple, 0, 0};
Component HALOutput = FindNextComponent(NULL, &cd);
......@@ -617,27 +650,48 @@ int JackCoreAudioDriver::OpenAUHAL(bool capturing,
}
// Start I/O
enableIO = 1;
if (capturing && inchannels > 0) {
jack_log("Setup AUHAL input");
err1 = AudioUnitSetProperty(fAUHAL, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input, 1, &enableIO, sizeof(enableIO));
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input");
printError(err1);
if (strict)
return -1;
}
enableIO = 1;
jack_log("Setup AUHAL input on");
} else {
enableIO = 0;
jack_log("Setup AUHAL input off");
}
err1 = AudioUnitSetProperty(fAUHAL, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input, 1, &enableIO, sizeof(enableIO));
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input");
printError(err1);
if (strict)
return -1;
}
if (playing && outchannels > 0) {
jack_log("Setup AUHAL output");
err1 = AudioUnitSetProperty(fAUHAL, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Output, 0, &enableIO, sizeof(enableIO));
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioOutputUnitProperty_EnableIO,kAudioUnitScope_Output");
printError(err1);
if (strict)
return -1;
}
enableIO = 1;
jack_log("Setup AUHAL output on");
} else {
enableIO = 0;
jack_log("Setup AUHAL output off");
}
err1 = AudioUnitSetProperty(fAUHAL, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Output, 0, &enableIO, sizeof(enableIO));
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioOutputUnitProperty_EnableIO,kAudioUnitScope_Output");
printError(err1);
if (strict)
return -1;
}
AudioDeviceID currAudioDeviceID;
UInt32 size;
err1 = AudioUnitGetProperty(fAUHAL, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0, &currAudioDeviceID, &size);
if (err1 != noErr) {
jack_error("Error calling AudioUnitGetProperty - kAudioOutputUnitProperty_CurrentDevice");
printError(err1);
if (strict)
return -1;
} else {
jack_log("AudioUnitGetPropertyCurrentDevice = %d", currAudioDeviceID);
}
// Setup up choosen device, in both input and output cases
......@@ -648,10 +702,20 @@ int JackCoreAudioDriver::OpenAUHAL(bool capturing,
if (strict)
return -1;
}
err1 = AudioUnitGetProperty(fAUHAL, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0, &currAudioDeviceID, &size);
if (err1 != noErr) {
jack_error("Error calling AudioUnitGetProperty - kAudioOutputUnitProperty_CurrentDevice");
printError(err1);
if (strict)
return -1;
} else {
jack_log("AudioUnitGetPropertyCurrentDevice = %d", currAudioDeviceID);
}
// Set buffer size
if (capturing && inchannels > 0) {
err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, 1, (UInt32*) & buffer_size, sizeof(UInt32));
err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, 1, (UInt32*)&buffer_size, sizeof(UInt32));
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_MaximumFramesPerSlice");
printError(err1);
......@@ -661,7 +725,7 @@ int JackCoreAudioDriver::OpenAUHAL(bool capturing,
}
if (playing && outchannels > 0) {
err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, 0, (UInt32*) & buffer_size, sizeof(UInt32));
err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, 0, (UInt32*)&buffer_size, sizeof(UInt32));
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_MaximumFramesPerSlice");
printError(err1);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment