Skip to content

Commit

Permalink
Merge pull request #1 from jackaudio/master
Browse files Browse the repository at this point in the history
Upstream Merge
  • Loading branch information
sreimers committed May 23, 2015
2 parents 3225446 + 89e6b8b commit 4c73156
Show file tree
Hide file tree
Showing 227 changed files with 38,936 additions and 410 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
build/
man/*.1
.waf*
.lock*
__pycache__
android/.server/
android/.client/
codeBlocks
2 changes: 1 addition & 1 deletion common/JackDriverLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ jack_constraint_add_enum(
sizeof(jack_driver_param_value_enum_t) * array_size);
if (possible_value_ptr == NULL)
{
jack_error("calloc() failed to (re)allocate memory for possible values array");
jack_error("realloc() failed to (re)allocate memory for possible values array");
return false;
}
constraint_ptr->constraint.enumeration.possible_values_array = possible_value_ptr;
Expand Down
5 changes: 5 additions & 0 deletions common/JackEngineControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ struct SERVER_EXPORT JackEngineControl : public JackShmMem
fRealTime = rt;
fSavedRealTime = false;
fServerPriority = priority;

#ifdef WIN32
fClientPriority = (rt) ? priority - 3 : 0;
#else
fClientPriority = (rt) ? priority - 5 : 0;
#endif
fMaxClientPriority = (rt) ? priority - 1 : 0;
fVerbose = verbose;
fPrevCycleTime = 0;
Expand Down
2 changes: 1 addition & 1 deletion common/JackGenericClientChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void JackGenericClientChannel::ClientCheck(const char* name, int uuid, char* nam
JackClientCheckRequest req(name, protocol, options, uuid, open);
JackClientCheckResult res;
ServerSyncCall(&req, &res, result);
*status = res.fStatus;
*status |= res.fStatus;
strcpy(name_res, res.fName);
}

Expand Down
15 changes: 9 additions & 6 deletions common/JackNetAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ extern "C"

typedef struct _jack_net_master jack_net_master_t;

LIB_EXPORT jack_net_master_t* jack_net_master_open(const char* ip, int port, const char* name, jack_master_t* request, jack_slave_t* result);
LIB_EXPORT jack_net_master_t* jack_net_master_open(const char* ip, int port, jack_master_t* request, jack_slave_t* result);
LIB_EXPORT int jack_net_master_close(jack_net_master_t* net);

LIB_EXPORT int jack_net_master_recv(jack_net_master_t* net, int audio_input, float** audio_input_buffer, int midi_input, void** midi_input_buffer);
Expand Down Expand Up @@ -153,7 +153,6 @@ struct JackNetExtMaster : public JackNetMasterInterface {

JackNetExtMaster(const char* ip,
int port,
const char* name,
jack_master_t* request)
{
fRunning = true;
Expand Down Expand Up @@ -386,10 +385,12 @@ struct JackNetExtMaster : public JackNetMasterInterface {
assert(audio_input == fParams.fReturnAudioChannels);

for (int audio_port_index = 0; audio_port_index < audio_input; audio_port_index++) {
assert(audio_input_buffer[audio_port_index]);
fNetAudioPlaybackBuffer->SetBuffer(audio_port_index, audio_input_buffer[audio_port_index]);
}

for (int midi_port_index = 0; midi_port_index < midi_input; midi_port_index++) {
assert(((JackMidiBuffer**)midi_input_buffer)[midi_port_index]);
fNetMidiPlaybackBuffer->SetBuffer(midi_port_index, ((JackMidiBuffer**)midi_input_buffer)[midi_port_index]);
}

Expand Down Expand Up @@ -437,10 +438,12 @@ struct JackNetExtMaster : public JackNetMasterInterface {
assert(audio_output == fParams.fSendAudioChannels);

for (int audio_port_index = 0; audio_port_index < audio_output; audio_port_index++) {
assert(audio_output_buffer[audio_port_index]);
fNetAudioCaptureBuffer->SetBuffer(audio_port_index, audio_output_buffer[audio_port_index]);
}

for (int midi_port_index = 0; midi_port_index < midi_output; midi_port_index++) {
assert(((JackMidiBuffer**)midi_output_buffer)[midi_port_index]);
fNetMidiCaptureBuffer->SetBuffer(midi_port_index, ((JackMidiBuffer**)midi_output_buffer)[midi_port_index]);
}

Expand Down Expand Up @@ -860,9 +863,9 @@ struct JackNetExtSlave : public JackNetSlaveInterface, public JackRunnableInterf

// One cycle
Process();

// Then use PACKET_TIMEOUT * fParams.fNetworkLatency for next cycles
SetPacketTimeOut(PACKET_TIMEOUT * fParams.fNetworkLatency);
SetPacketTimeOut(std::max(int(PACKET_TIMEOUT), int(PACKET_TIMEOUT * fParams.fNetworkLatency)));
}

int Process()
Expand Down Expand Up @@ -1121,9 +1124,9 @@ LIB_EXPORT int jack_set_net_slave_error_callback(jack_net_slave_t *net, JackNetS

// Master API

LIB_EXPORT jack_net_master_t* jack_net_master_open(const char* ip, int port, const char* name, jack_master_t* request, jack_slave_t* result)
LIB_EXPORT jack_net_master_t* jack_net_master_open(const char* ip, int port, jack_master_t* request, jack_slave_t* result)
{
JackNetExtMaster* master = new JackNetExtMaster(ip, port, name, request);
JackNetExtMaster* master = new JackNetExtMaster(ip, port, request);
if (master->Open(result) == 0) {
return (jack_net_master_t*)master;
} else {
Expand Down
2 changes: 1 addition & 1 deletion common/JackNetInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace Jack
#define MANAGER_INIT_TIMEOUT 1000000 * 2 // in usec
#define MASTER_INIT_TIMEOUT 1000000 * 10 // in usec
#define SLAVE_INIT_TIMEOUT 1000000 * 1 // in usec
#define PACKET_TIMEOUT 500000 // in usec
#define PACKET_TIMEOUT 1000000 // in usec

#define NETWORK_DEFAULT_LATENCY 2
#define NETWORK_MAX_LATENCY 30 // maximum possible latency in network master/slave loop
Expand Down
2 changes: 0 additions & 2 deletions common/JackNetTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,6 @@ namespace Jack

UpdateParams(max(params->fReturnAudioChannels, params->fSendAudioChannels));

fSubPeriodBytesSize = fSubPeriodSize * sizeof(sample_t);

fCycleDuration = float(fSubPeriodSize) / float(params->fSampleRate);
fCycleBytesSize = params->fMtu * (fPeriodSize / fSubPeriodSize);

Expand Down
Loading

0 comments on commit 4c73156

Please sign in to comment.