Browse Source

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
tags/v1.9.4
sletz 16 years ago
parent
commit
2cbaece993
4 changed files with 64 additions and 29 deletions
  1. +10
    -6
      ChangeLog
  2. +3
    -2
      common/JackShmMem.cpp
  3. +7
    -7
      common/JackShmMem.h
  4. +44
    -14
      common/Jackdmp.cpp

+ 10
- 6
ChangeLog View File

@@ -25,6 +25,10 @@ Paul Davis
Jackdmp changes log 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> 2009-11-13 Stephane Letz <letz@grame.fr>
* Better memory allocation error checking in ringbuffer.c, weak import improvements. * 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> 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. * Implement jack_client_real_time_priority and jack_client_max_real_time_priority API.
2008-12-18 Stephane Letz <letz@grame.fr> 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 JackOSSDriver.
* Use memops functions in JackOSSAdapter. * Use memops functions in JackOSSAdapter.
@@ -472,13 +476,13 @@ Paul Davis
2008-11-27 Stephane Letz <letz@grame.fr> 2008-11-27 Stephane Letz <letz@grame.fr>
* Add timing profiling code in JackOSSDriver. * 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> 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> 2008-11-19 Stephane Letz <letz@grame.fr>


+ 3
- 2
common/JackShmMem.cpp View File

@@ -1,6 +1,6 @@
/* /*
Copyright (C) 2001 Paul Davis 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 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 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) void JackShmMem::operator delete(void* obj)
{ {
if (obj)
if (obj) {
JackShmMem::operator delete(obj, 0); JackShmMem::operator delete(obj, 0);
}
} }


void LockMemoryImp(void* ptr, size_t size) void LockMemoryImp(void* ptr, size_t size)


+ 7
- 7
common/JackShmMem.h View File

@@ -1,6 +1,6 @@
/* /*
Copyright (C) 2001 Paul Davis 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 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 it under the terms of the GNU General Public License as published by
@@ -163,7 +163,7 @@ class JackShmReadWritePtr
if (jack_attach_shm(&fInfo)) { if (jack_attach_shm(&fInfo)) {
throw - 2; throw - 2;
} }
static_cast<T*>(fInfo.ptr.attached_at)->LockMemory();
GetShmAddress()->LockMemory();
} }
} }


@@ -184,7 +184,7 @@ class JackShmReadWritePtr
{ {
if (fInfo.index >= 0) { if (fInfo.index >= 0) {
jack_log("JackShmReadWritePtr::~JackShmReadWritePtr %ld", fInfo.index); jack_log("JackShmReadWritePtr::~JackShmReadWritePtr %ld", fInfo.index);
static_cast<T*>(fInfo.ptr.attached_at)->UnlockMemory();
GetShmAddress()->UnlockMemory();
jack_release_shm(&fInfo); jack_release_shm(&fInfo);
fInfo.index = -1; fInfo.index = -1;
} }
@@ -250,7 +250,7 @@ class JackShmReadWritePtr1
vanish till we exit (and release it). vanish till we exit (and release it).
*/ */
jack_destroy_shm(&fInfo); jack_destroy_shm(&fInfo);
static_cast<T*>(fInfo.ptr.attached_at)->LockMemory();
GetShmAddress()->LockMemory();
} }
} }


@@ -271,7 +271,7 @@ class JackShmReadWritePtr1
{ {
if (fInfo.index >= 0) { if (fInfo.index >= 0) {
jack_log("JackShmReadWritePtr1::~JackShmReadWritePtr1 %ld", fInfo.index); jack_log("JackShmReadWritePtr1::~JackShmReadWritePtr1 %ld", fInfo.index);
static_cast<T*>(fInfo.ptr.attached_at)->UnlockMemory();
GetShmAddress()->UnlockMemory();
jack_release_shm(&fInfo); jack_release_shm(&fInfo);
fInfo.index = -1; fInfo.index = -1;
} }
@@ -331,7 +331,7 @@ class JackShmReadPtr
if (jack_attach_shm_read(&fInfo)) { if (jack_attach_shm_read(&fInfo)) {
throw - 2; throw - 2;
} }
static_cast<T*>(fInfo.ptr.attached_at)->LockMemory();
GetShmAddress()->LockMemory();
} }
} }


@@ -352,7 +352,7 @@ class JackShmReadPtr
{ {
if (fInfo.index >= 0) { if (fInfo.index >= 0) {
jack_log("JackShmPtrRead::~JackShmPtrRead %ld", fInfo.index); jack_log("JackShmPtrRead::~JackShmPtrRead %ld", fInfo.index);
static_cast<T*>(fInfo.ptr.attached_at)->UnlockMemory();
GetShmAddress()->UnlockMemory();
jack_release_shm(&fInfo); jack_release_shm(&fInfo);
fInfo.index = -1; fInfo.index = -1;
} }


+ 44
- 14
common/Jackdmp.cpp View File

@@ -94,7 +94,9 @@ static void copyright(FILE* file)
static void usage(FILE* file) static void usage(FILE* file)
{ {
fprintf(file, "\n" 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" " [ --name OR -n server-name ]\n"
" [ --timeout OR -t client-timeout-in-msecs ]\n" " [ --timeout OR -t client-timeout-in-msecs ]\n"
" [ --loopback OR -L loopback-port-number ]\n" " [ --loopback OR -L loopback-port-number ]\n"
@@ -103,15 +105,26 @@ static void usage(FILE* file)
#ifdef __linux__ #ifdef __linux__
" [ --clocksource OR -c [ c(ycle) | h(pet) | s(ystem) ]\n" " [ --clocksource OR -c [ c(ycle) | h(pet) | s(ystem) ]\n"
#endif #endif
" [ --replace-registry OR -r ]\n"
" [ --replace-registry ]\n"
" [ --silent OR -s ]\n" " [ --silent OR -s ]\n"
" [ --sync OR -S ]\n" " [ --sync OR -S ]\n"
" [ --temporary OR -T ]\n" " [ --temporary OR -T ]\n"
" [ --version OR -V ]\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?? // 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 * audio_driver_ctl;
jackctl_driver_t * midi_driver_ctl; jackctl_driver_t * midi_driver_ctl;
jackctl_driver_t * loopback_driver_ctl; jackctl_driver_t * loopback_driver_ctl;
int replace_registry = 0;
#ifdef __linux__ #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 #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 #endif
struct option long_options[] = { struct option long_options[] = {
@@ -184,7 +198,8 @@ int main(int argc, char* argv[])
{ "name", 0, 0, 'n' }, { "name", 0, 0, 'n' },
{ "unlock", 0, 0, 'u' }, { "unlock", 0, 0, 'u' },
{ "realtime", 0, 0, 'R' }, { "realtime", 0, 0, 'R' },
{ "replace-registry", 0, 0, 'r' },
{ "no-realtime", 0, 0, 'r' },
{ "replace-registry", 0, &replace_registry, 0 },
{ "loopback", 0, 0, 'L' }, { "loopback", 0, 0, 'L' },
{ "realtime-priority", 1, 0, 'P' }, { "realtime-priority", 1, 0, 'P' },
{ "timeout", 1, 0, 't' }, { "timeout", 1, 0, 't' },
@@ -224,8 +239,16 @@ int main(int argc, char* argv[])
fprintf(stderr, "Failed to create server object\n"); fprintf(stderr, "Failed to create server object\n");
return -1; return -1;
} }
server_parameters = jackctl_server_get_parameters(server_ctl); 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; opterr = 0;
while (!seen_audio_driver && while (!seen_audio_driver &&
(opt = getopt_long(argc, argv, options, (opt = getopt_long(argc, argv, options,
@@ -315,11 +338,11 @@ int main(int argc, char* argv[])
jackctl_parameter_set_value(param, &value); jackctl_parameter_set_value(param, &value);
} }
break; break;
case 'r': case 'r':
param = jackctl_get_parameter(server_parameters, "replace-registry");
param = jackctl_get_parameter(server_parameters, "realtime");
if (param != NULL) { if (param != NULL) {
value.b = true;
value.b = false;
jackctl_parameter_set_value(param, &value); jackctl_parameter_set_value(param, &value);
} }
break; break;
@@ -361,7 +384,14 @@ int main(int argc, char* argv[])
goto fail_free1; 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) { if (show_version) {
printf( "jackdmp version " VERSION printf( "jackdmp version " VERSION
" tmpdir " jack_server_dir " tmpdir " jack_server_dir


Loading…
Cancel
Save