Commit 3ee6e1f1 authored by sletz's avatar sletz
Browse files

Adapter -g parameter allows to change ringbuffer size.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3431 0c269be4-1314-0410-8aa9-9f06e86f4224
parent bbaefaee
......@@ -185,10 +185,11 @@ namespace Jack
fCaptureRingBuffer = new JackResampler*[fCaptureChannels];
fPlaybackRingBuffer = new JackResampler*[fPlaybackChannels];
if (fAdaptative) {
if (fAdaptative) {
jack_info("Ringbuffer automatic adaptative mode size = %d frames", fRingbufferCurSize);
} else {
fRingbufferCurSize = DEFAULT_RB_SIZE;
if (fRingbufferCurSize > DEFAULT_RB_SIZE)
fRingbufferCurSize = DEFAULT_RB_SIZE;
jack_info("Fixed ringbuffer size = %d frames", fRingbufferCurSize);
}
......@@ -246,7 +247,10 @@ namespace Jack
// Reset all ringbuffers in case of failure
if (failure) {
jack_error("JackAudioAdapterInterface::PushAndPull ringbuffer failure... reset");
GrowRingBufferSize();
if (fAdaptative) {
GrowRingBufferSize();
jack_info("Ringbuffer size = %d frames", fRingbufferCurSize);
}
ResetRingBuffers();
return -1;
} else {
......
......@@ -96,6 +96,7 @@ namespace Jack
fQuality = param->value.ui;
break;
case 'g':
fRingbufferCurSize = param->value.ui;
fAdaptative = false;
break;
}
......@@ -468,10 +469,10 @@ extern "C"
i++;
strcpy(desc->params[i].name, "ring-buffer");
desc->params[i].character = 'g';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = false;
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.ui = 32768;
strcpy(desc->params[i].short_desc, "Fixed ringbuffer size");
strcpy(desc->params[i].long_desc, "Fixed ringbuffer size (false = automatic adaptative)");
strcpy(desc->params[i].long_desc, "Fixed ringbuffer size (if not set => automatic adaptative)");
i++;
strcpy ( desc->params[i].name, "auto-connect" );
......
......@@ -77,6 +77,7 @@ namespace Jack
fQuality = param->value.ui;
break;
case 'g':
fRingbufferCurSize = param->value.ui;
fAdaptative = false;
break;
}
......@@ -284,10 +285,10 @@ extern "C"
i++;
strcpy(desc->params[i].name, "ring-buffer");
desc->params[i].character = 'g';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = false;
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.ui = 32768;
strcpy(desc->params[i].short_desc, "Fixed ringbuffer size");
strcpy(desc->params[i].long_desc, "Fixed ringbuffer size (false = automatic adaptative)");
strcpy(desc->params[i].long_desc, "Fixed ringbuffer size (if not set => automatic adaptative)");
return desc;
}
......
......@@ -378,6 +378,7 @@ JackCoreAudioAdapter::JackCoreAudioAdapter(jack_nframes_t buffer_size, jack_nfra
break;
case 'g':
fRingbufferCurSize = param->value.ui;
fAdaptative = false;
break;
}
......@@ -1079,10 +1080,10 @@ extern "C"
i++;
strcpy(desc->params[i].name, "ring-buffer");
desc->params[i].character = 'g';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = false;
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.ui = 32768;
strcpy(desc->params[i].short_desc, "Fixed ringbuffer size");
strcpy(desc->params[i].long_desc, "Fixed ringbuffer size (false = automatic adaptative)");
strcpy(desc->params[i].long_desc, "Fixed ringbuffer size (if not set => automatic adaptative)");
return desc;
}
......
......@@ -183,6 +183,7 @@ JackOSSAdapter::JackOSSAdapter(jack_nframes_t buffer_size, jack_nframes_t sample
break;
case 'g':
fRingbufferCurSize = param->value.ui;
fAdaptative = false;
break;
......@@ -748,10 +749,10 @@ extern "C"
i++;
strcpy(desc->params[i].name, "ring-buffer");
desc->params[i].character = 'g';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = false;
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.ui = 32768;
strcpy(desc->params[i].short_desc, "Fixed ringbuffer size");
strcpy(desc->params[i].long_desc, "Fixed ringbuffer size (false = automatic adaptative)");
strcpy(desc->params[i].long_desc, "Fixed ringbuffer size (if not set => automatic adaptative)");
return desc;
}
......
......@@ -97,6 +97,7 @@ namespace Jack
fQuality = param->value.ui;
break;
case 'g':
fRingbufferCurSize = param->value.ui;
fAdaptative = false;
break;
}
......@@ -297,10 +298,10 @@ extern "C"
i++;
strcpy(desc->params[i].name, "ring-buffer");
desc->params[i].character = 'g';
desc->params[i].type = JackDriverParamBool;
desc->params[i].value.i = false;
desc->params[i].type = JackDriverParamInt;
desc->params[i].value.ui = 32768;
strcpy(desc->params[i].short_desc, "Fixed ringbuffer size");
strcpy(desc->params[i].long_desc, "Fixed ringbuffer size (false = automatic adaptative)");
strcpy(desc->params[i].long_desc, "Fixed ringbuffer size (if not set => automatic adaptative)");
return desc;
}
......
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