Browse Source

(jack1) make realtime the default; add -L for "long latency" ; don't check for RT permission if not running realtime; don't check for freqscaling unless using RDTSC as clocksource

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@3443 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.117.0
paul 16 years ago
parent
commit
3bea13b9ee
5 changed files with 26 additions and 16 deletions
  1. +1
    -1
      config/os/generic/sanitycheck.c
  2. +5
    -4
      config/os/gnu-linux/sanitycheck.c
  3. +1
    -1
      config/os/macosx/sanitycheck.c
  4. +2
    -1
      jack/sanitycheck.h
  5. +17
    -9
      jackd/jackd.c

+ 1
- 1
config/os/generic/sanitycheck.c View File

@@ -1,7 +1,7 @@
#include <jack/sanitycheck.c>

int
sanitycheck ()
sanitycheck (int a, int b)
{
return 0;
}

+ 5
- 4
config/os/gnu-linux/sanitycheck.c View File

@@ -11,13 +11,14 @@
#include <jack/systemtest.h>
#include <jack/sanitycheck.h>

int sanitycheck()
int sanitycheck (int care_about_realtime,
int care_about_freqscaling)
{
int errors = 0;
int warnings = 0;
int relogin = 0;

if (!system_user_can_rtprio()) {
if (care_about_realtime && !system_user_can_rtprio()) {
errors++;
relogin++;
fprintf(stderr, "\nYou are not allowed to set realtime priority.\n");
@@ -43,13 +44,13 @@ int sanitycheck()
fprintf(stderr, " usermod -a -G audio %s\n", system_get_username());
}
}
if (system_has_frequencyscaling() && system_uses_frequencyscaling()) {
if (care_about_freqscaling && system_has_frequencyscaling() && system_uses_frequencyscaling()) {
warnings++;
fprintf(stderr, "\n--------------------------------------------------------------------------------\n");
fprintf(stderr, "WARNING: Your system seems to use frequency scaling.\n\n");
fprintf(stderr, " This can have a serious impact on audio latency. You have two choices:\n");
fprintf(stderr, "\t(1)turn it off, e.g. by chosing the 'performance' governor.\n");
fprintf(stderr, "\t(2)Use the HPET clocksource by passing \"-h h\" to JACK\n");
fprintf(stderr, "\t(2)Use the HPET clocksource by passing \"-c h\" to JACK\n");
fprintf(stderr, "\t (this second option only works on relatively recent computers)\n");
fprintf(stderr, "--------------------------------------------------------------------------------\n\n");
}


+ 1
- 1
config/os/macosx/sanitycheck.c View File

@@ -1,7 +1,7 @@
#include <jack/sanitycheck.c>

int
sanitycheck ()
sanitycheck (int a, int b)
{
return 0;
}

+ 2
- 1
jack/sanitycheck.h View File

@@ -16,6 +16,7 @@
*
**/

int sanitycheck();
int sanitycheck (int do_realtime_check,
int do_freqscaling_check);

#endif /* __jack_sanitycheck_h__ */

+ 17
- 9
jackd/jackd.c View File

@@ -56,7 +56,7 @@ static JSList *drivers = NULL;
static sigset_t signals;
static jack_engine_t *engine = NULL;
static char *server_name = NULL;
static int realtime = 0;
static int realtime = 1;
static int realtime_priority = 10;
static int do_mlock = 1;
static int temporary = 0;
@@ -510,26 +510,29 @@ main (int argc, char *argv[])

{
jack_driver_desc_t * desc;
const char *options = "-ad:P:uvshVRZTFlt:mn:Np:c:";
const char *options = "-ad:P:uvshVRLZTFlt:mn:Np:c:";
struct option long_options[] =
{
/* keep ordered by single-letter option code */

{ "clock-source", 1, 0, 'c' },
{ "driver", 1, 0, 'd' },
{ "verbose", 0, 0, 'v' },
{ "help", 0, 0, 'h' },
{ "tmpdir-location", 0, 0, 'l' },
{ "port-max", 1, 0, 'p' },
{ "no-realtime", 0, 0, 'L' },
{ "no-mlock", 0, 0, 'm' },
{ "name", 1, 0, 'n' },
{ "no-sanity-checks", 0, 0, 'N' },
{ "unlock", 0, 0, 'u' },
{ "port-max", 1, 0, 'p' },
{ "realtime-priority", 1, 0, 'P' },
{ "realtime", 0, 0, 'R' },
{ "replace-registry", 0, 0, 'r' },
{ "realtime-priority", 1, 0, 'P' },
{ "silent", 0, 0, 's' },
{ "timeout", 1, 0, 't' },
{ "temporary", 0, 0, 'T' },
{ "unlock", 0, 0, 'u' },
{ "version", 0, 0, 'V' },
{ "silent", 0, 0, 's' },
{ "clock-source", 1, 0, 'c' },
{ "verbose", 0, 0, 'v' },
{ "nozombies", 0, 0, 'Z' },
{ 0, 0, 0, 0 }
};
@@ -583,6 +586,10 @@ main (int argc, char *argv[])
printf ("%s\n", jack_tmpdir);
exit (0);

case 'L':
realtime = 0;
break;

case 'm':
do_mlock = 0;
break;
@@ -608,6 +615,7 @@ main (int argc, char *argv[])
break;

case 'R':
/* this is now the default */
realtime = 1;
break;

@@ -649,7 +657,7 @@ main (int argc, char *argv[])
}
}

if (do_sanity_checks && (0 < sanitycheck())) {
if (do_sanity_checks && (0 < sanitycheck (realtime, (clock_source = JACK_TIMER_CYCLE_COUNTER)))) {
return -1;
}



Loading…
Cancel
Save