diff --git a/config/os/generic/sanitycheck.c b/config/os/generic/sanitycheck.c index d188729..45f9331 100644 --- a/config/os/generic/sanitycheck.c +++ b/config/os/generic/sanitycheck.c @@ -1,7 +1,7 @@ #include int -sanitycheck () +sanitycheck (int a, int b) { return 0; } diff --git a/config/os/gnu-linux/sanitycheck.c b/config/os/gnu-linux/sanitycheck.c index 8631f60..c29f541 100644 --- a/config/os/gnu-linux/sanitycheck.c +++ b/config/os/gnu-linux/sanitycheck.c @@ -11,13 +11,14 @@ #include #include -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"); } diff --git a/config/os/macosx/sanitycheck.c b/config/os/macosx/sanitycheck.c index d188729..45f9331 100644 --- a/config/os/macosx/sanitycheck.c +++ b/config/os/macosx/sanitycheck.c @@ -1,7 +1,7 @@ #include int -sanitycheck () +sanitycheck (int a, int b) { return 0; } diff --git a/jack/sanitycheck.h b/jack/sanitycheck.h index ecf3738..5c98896 100644 --- a/jack/sanitycheck.h +++ b/jack/sanitycheck.h @@ -16,6 +16,7 @@ * **/ -int sanitycheck(); +int sanitycheck (int do_realtime_check, + int do_freqscaling_check); #endif /* __jack_sanitycheck_h__ */ diff --git a/jackd/jackd.c b/jackd/jackd.c index e7fe570..ffc6ded 100644 --- a/jackd/jackd.c +++ b/jackd/jackd.c @@ -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; }