Commit 2cbaece9 authored by sletz's avatar sletz
Browse files

Sync with JACK1 : -r parameter now used for no-realtime, realtime (-R) is now...

Sync with JACK1 : -r parameter now used for no-realtime, realtime (-R) is now default, usable backend given vie platform.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3791 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 9e263b52
......@@ -25,6 +25,10 @@ Paul Davis
Jackdmp changes log
---------------------------
2009-11-14 Stephane Letz <letz@grame.fr>
* Sync with JACK1 : -r parameter now used for no-realtime, realtime (-R) is now default, usable backend given vie platform.
2009-11-13 Stephane Letz <letz@grame.fr>
* Better memory allocation error checking in ringbuffer.c, weak import improvements.
......@@ -433,12 +437,12 @@ Paul Davis
2009-01-05 Stephane Letz <letz@grame.fr>
* Synchronize jack2 public headers with jack1 ones.
* Synchronize jack2 public headers with JACK1 ones.
* Implement jack_client_real_time_priority and jack_client_max_real_time_priority API.
2008-12-18 Stephane Letz <letz@grame.fr>
* For ALSA driver, synchronize with latest jack1 memops functions.
* For ALSA driver, synchronize with latest JACK1 memops functions.
* Use memops functions in JackOSSDriver.
* Use memops functions in JackOSSAdapter.
......@@ -472,13 +476,13 @@ Paul Davis
2008-11-27 Stephane Letz <letz@grame.fr>
* Add timing profiling code in JackOSSDriver.
* Report ringbuffer.c fixes from jack1.
* Report ringbuffer.c fixes from JACK1.
2008-11-21 Stephane Letz <letz@grame.fr>
* Report ringbuffer.c fixes from jack1.
* Better isolation of server and clients system resources to allow starting the server in several user account at the same time.
* Correct ressource cleanup in case of driver open failure.
* Report ringbuffer.c fixes from JACK1.
* Better isolation of server and clients system resources to allow starting the server in several user account at the same time.
* Correct ressource cleanup in case of driver open failure.
2008-11-19 Stephane Letz <letz@grame.fr>
......
/*
Copyright (C) 2001 Paul Davis
Copyright (C) 2004-2008 Grame
Copyright (C) 2004-2009 Grame
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -102,8 +102,9 @@ void JackShmMem::operator delete(void* p, size_t size)
void JackShmMem::operator delete(void* obj)
{
if (obj)
if (obj) {
JackShmMem::operator delete(obj, 0);
}
}
void LockMemoryImp(void* ptr, size_t size)
......
/*
Copyright (C) 2001 Paul Davis
Copyright (C) 2004-2008 Grame
Copyright (C) 2004-2009 Grame
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -163,7 +163,7 @@ class JackShmReadWritePtr
if (jack_attach_shm(&fInfo)) {
throw - 2;
}
static_cast<T*>(fInfo.ptr.attached_at)->LockMemory();
GetShmAddress()->LockMemory();
}
}
......@@ -184,7 +184,7 @@ class JackShmReadWritePtr
{
if (fInfo.index >= 0) {
jack_log("JackShmReadWritePtr::~JackShmReadWritePtr %ld", fInfo.index);
static_cast<T*>(fInfo.ptr.attached_at)->UnlockMemory();
GetShmAddress()->UnlockMemory();
jack_release_shm(&fInfo);
fInfo.index = -1;
}
......@@ -250,7 +250,7 @@ class JackShmReadWritePtr1
vanish till we exit (and release it).
*/
jack_destroy_shm(&fInfo);
static_cast<T*>(fInfo.ptr.attached_at)->LockMemory();
GetShmAddress()->LockMemory();
}
}
......@@ -271,7 +271,7 @@ class JackShmReadWritePtr1
{
if (fInfo.index >= 0) {
jack_log("JackShmReadWritePtr1::~JackShmReadWritePtr1 %ld", fInfo.index);
static_cast<T*>(fInfo.ptr.attached_at)->UnlockMemory();
GetShmAddress()->UnlockMemory();
jack_release_shm(&fInfo);
fInfo.index = -1;
}
......@@ -331,7 +331,7 @@ class JackShmReadPtr
if (jack_attach_shm_read(&fInfo)) {
throw - 2;
}
static_cast<T*>(fInfo.ptr.attached_at)->LockMemory();
GetShmAddress()->LockMemory();
}
}
......@@ -352,7 +352,7 @@ class JackShmReadPtr
{
if (fInfo.index >= 0) {
jack_log("JackShmPtrRead::~JackShmPtrRead %ld", fInfo.index);
static_cast<T*>(fInfo.ptr.attached_at)->UnlockMemory();
GetShmAddress()->UnlockMemory();
jack_release_shm(&fInfo);
fInfo.index = -1;
}
......
......@@ -94,7 +94,9 @@ static void copyright(FILE* file)
static void usage(FILE* file)
{
fprintf(file, "\n"
"usage: jackdmp [ --realtime OR -R [ --realtime-priority OR -P priority ] ]\n"
"usage: jackdmp [ --no-realtime OR -r ]\n"
" [ --realtime OR -R [ --realtime-priority OR -P priority ] ]\n"
" (the two previous arguments are mutually exclusive. The default is --realtime)\n"
" [ --name OR -n server-name ]\n"
" [ --timeout OR -t client-timeout-in-msecs ]\n"
" [ --loopback OR -L loopback-port-number ]\n"
......@@ -103,15 +105,26 @@ static void usage(FILE* file)
#ifdef __linux__
" [ --clocksource OR -c [ c(ycle) | h(pet) | s(ystem) ]\n"
#endif
" [ --replace-registry OR -r ]\n"
" [ --replace-registry ]\n"
" [ --silent OR -s ]\n"
" [ --sync OR -S ]\n"
" [ --temporary OR -T ]\n"
" [ --version OR -V ]\n"
" -d audio-driver [ ... driver args ... ]\n"
" where driver can be `alsa', `coreaudio', 'portaudio' or `dummy'\n"
" jackdmp -d driver --help\n"
" to display options for each driver\n\n");
" -d backend [ ... backend args ... ]\n"
#ifdef __APPLE__
" Available backends may include: coreaudio, dummy or net.\n\n"
#endif
#ifdef WIN32
" Available backends may include: portaudio, dummy or net.\n\n"
#endif
#ifdef __linux__
" Available backends may include: alsa, dummy, freebob, firewire, net, oss or sun.\n\n"
#endif
#if defined(__sun__) || defined(sun)
" Available backends may include: boomer, oss, dummy or net.\n\n"
#endif
" jackdmp -d backend --help\n"
" to display options for each backend\n\n");
}
// To put in the control.h interface??
......@@ -163,11 +176,12 @@ int main(int argc, char* argv[])
jackctl_driver_t * audio_driver_ctl;
jackctl_driver_t * midi_driver_ctl;
jackctl_driver_t * loopback_driver_ctl;
int replace_registry = 0;
#ifdef __linux__
const char *options = "-ad:X:P:uvrshVRL:STFl:t:mn:p:c:L:";
const char *options = "-ad:X:P:uvshVrRL:STFl:t:mn:p:c:L:";
#else
const char *options = "-ad:X:P:uvrshVRL:STFl:t:mn:p:L:";
const char *options = "-ad:X:P:uvshVrRL:STFl:t:mn:p:L:";
#endif
struct option long_options[] = {
......@@ -184,7 +198,8 @@ int main(int argc, char* argv[])
{ "name", 0, 0, 'n' },
{ "unlock", 0, 0, 'u' },
{ "realtime", 0, 0, 'R' },
{ "replace-registry", 0, 0, 'r' },
{ "no-realtime", 0, 0, 'r' },
{ "replace-registry", 0, &replace_registry, 0 },
{ "loopback", 0, 0, 'L' },
{ "realtime-priority", 1, 0, 'P' },
{ "timeout", 1, 0, 't' },
......@@ -224,8 +239,16 @@ int main(int argc, char* argv[])
fprintf(stderr, "Failed to create server object\n");
return -1;
}
server_parameters = jackctl_server_get_parameters(server_ctl);
// Default setting
param = jackctl_get_parameter(server_parameters, "realtime");
if (param != NULL) {
value.b = true;
jackctl_parameter_set_value(param, &value);
}
opterr = 0;
while (!seen_audio_driver &&
(opt = getopt_long(argc, argv, options,
......@@ -315,11 +338,11 @@ int main(int argc, char* argv[])
jackctl_parameter_set_value(param, &value);
}
break;
case 'r':
param = jackctl_get_parameter(server_parameters, "replace-registry");
param = jackctl_get_parameter(server_parameters, "realtime");
if (param != NULL) {
value.b = true;
value.b = false;
jackctl_parameter_set_value(param, &value);
}
break;
......@@ -361,7 +384,14 @@ int main(int argc, char* argv[])
goto fail_free1;
}
}
// Long option with no letter so treated separately
param = jackctl_get_parameter(server_parameters, "replace-registry");
if (param != NULL) {
value.b = replace_registry;
jackctl_parameter_set_value(param, &value);
}
if (show_version) {
printf( "jackdmp version " VERSION
" tmpdir " jack_server_dir
......
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