Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:Update
jack
jack-remove-cycle-counter.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File jack-remove-cycle-counter.patch of Package jack
Remove dependency on bogomips The clock cycle counter was unreliable on any system for the last 10 years or so, and it got finally dropped on 1.9.10. this is a source and binary compatible backport of those upstream commits: commit 2b829044dff18b2e22afa504c9d8135ceee10de5 Author: Adrian Knoth <adi@drcomp.erfurt.thur.de> Date: Fri Mar 14 19:09:18 2014 +0100 Drop (c)ycle) from the list of allowed clock sources. commit c52f751b731f36e81c29a0e005f9789060119823 Author: Adrian Knoth <adi@drcomp.erfurt.thur.de> Date: Fri Mar 14 19:07:00 2014 +0100 Make -c c an alias for -c s The cycle counting clock is no longer supported. For backwards compatibility with scripts, allow the user to request the cycle clock on the command line, but use the system clock instead. Cross-ported from jackd1. commit d425d8035b761b4a362c538c41eca874ff4995f0 Author: Adrian Knoth <adi@drcomp.erfurt.thur.de> Date: Fri Mar 14 19:03:08 2014 +0100 Don't rely on CPU cycles to measure time. We have a proper clocksource in the kernel, use this instead. This commit also fixes jackd on ARM boards with newer Linux kernels where /proc/cpuinfo has changed. Cross-ported from jackd1. Index: jack-1.9.9.5/common/JackServerGlobals.cpp =================================================================== --- jack-1.9.9.5.orig/common/JackServerGlobals.cpp +++ jack-1.9.9.5/common/JackServerGlobals.cpp @@ -203,7 +203,11 @@ bool JackServerGlobals::Init() if (tolower (optarg[0]) == 'h') { clock_source = JACK_TIMER_HPET; } else if (tolower (optarg[0]) == 'c') { - clock_source = JACK_TIMER_CYCLE_COUNTER; + /* For backwards compatibility with scripts, allow + * the user to request the cycle clock on the + * command line, but use the system clock instead + */ + clock_source = JACK_TIMER_SYSTEM_CLOCK; } else if (tolower (optarg[0]) == 's') { clock_source = JACK_TIMER_SYSTEM_CLOCK; } else { Index: jack-1.9.9.5/common/Jackdmp.cpp =================================================================== --- jack-1.9.9.5.orig/common/Jackdmp.cpp +++ jack-1.9.9.5/common/Jackdmp.cpp @@ -108,7 +108,7 @@ static void usage(FILE* file) " [ --internal-client OR -I internal-client-name ]\n" " [ --verbose OR -v ]\n" #ifdef __linux__ - " [ --clocksource OR -c [ c(ycle) | h(pet) | s(ystem) ]\n" + " [ --clocksource OR -c [ h(pet) | s(ystem) ]\n" #endif " [ --replace-registry ]\n" " [ --silent OR -s ]\n" @@ -264,7 +264,11 @@ int main(int argc, char** argv) value.ui = JACK_TIMER_HPET; jackctl_parameter_set_value(param, &value); } else if (tolower (optarg[0]) == 'c') { - value.ui = JACK_TIMER_CYCLE_COUNTER; + /* For backwards compatibility with scripts, allow + * the user to request the cycle clock on the + * command line, but use the system clock instead + */ + value.ui = JACK_TIMER_SYSTEM_CLOCK; jackctl_parameter_set_value(param, &value); } else if (tolower (optarg[0]) == 's') { value.ui = JACK_TIMER_SYSTEM_CLOCK; Index: jack-1.9.9.5/linux/JackLinuxTime.c =================================================================== --- jack-1.9.9.5.orig/linux/JackLinuxTime.c +++ jack-1.9.9.5/linux/JackLinuxTime.c @@ -38,7 +38,6 @@ Foundation, Inc., 59 Temple Place - Suit #include <stdlib.h> #include <inttypes.h> -static jack_time_t __jack_cpu_mhz = 0; jack_time_t (*_jack_get_microseconds)(void) = 0; #if defined(__gnu_linux__) && (defined(__i386__) || defined(__x86_64__)) @@ -124,62 +123,6 @@ static jack_time_t jack_get_microseconds #endif /* HPET_SUPPORT */ -static jack_time_t jack_get_microseconds_from_cycles (void) { - return get_cycles() / __jack_cpu_mhz; -} - -/* - * This is another kludge. It looks CPU-dependent, but actually it - * reflects the lack of standards for the Linux kernel formatting of - * /proc/cpuinfo. - */ - -static jack_time_t jack_get_mhz (void) -{ - FILE *f = fopen("/proc/cpuinfo", "r"); - if (f == 0) - { - perror("can't open /proc/cpuinfo\n"); - exit(1); - } - - for (;;) - { - jack_time_t mhz; - int ret; - char buf[1000]; - - if (fgets(buf, sizeof(buf), f) == NULL) { - jack_error ("FATAL: cannot locate cpu MHz in " - "/proc/cpuinfo\n"); - exit(1); - } - -#if defined(__powerpc__) - ret = sscanf(buf, "clock\t: %" SCNu64 "MHz", &mhz); -#elif defined( __i386__ ) || defined (__hppa__) || defined (__ia64__) || \ - defined(__x86_64__) - ret = sscanf(buf, "cpu MHz : %" SCNu64, &mhz); -#elif defined( __sparc__ ) - ret = sscanf(buf, "Cpu0Bogo : %" SCNu64, &mhz); -#elif defined( __mc68000__ ) - ret = sscanf(buf, "Clocking: %" SCNu64, &mhz); -#elif defined( __s390__ ) - ret = sscanf(buf, "bogomips per cpu: %" SCNu64, &mhz); -#elif defined( __sh__ ) - ret = sscanf(buf, "bogomips : %" SCNu64, &mhz); -#else /* MIPS, ARM, alpha */ - ret = sscanf(buf, "BogoMIPS : %" SCNu64, &mhz); -#endif - - if (ret == 1) - { - fclose(f); - return (jack_time_t)mhz; - } - } -} - #define HAVE_CLOCK_GETTIME 1 #ifndef HAVE_CLOCK_GETTIME @@ -217,7 +160,7 @@ SERVER_EXPORT void JackSleep(long usec) SERVER_EXPORT void InitTime() { - __jack_cpu_mhz = jack_get_mhz (); + /* nothing to do on a generic system - we use the system clock */ } SERVER_EXPORT void EndTime() @@ -229,10 +172,6 @@ void SetClockSource(jack_timer_type_t so switch (source) { - case JACK_TIMER_CYCLE_COUNTER: - _jack_get_microseconds = jack_get_microseconds_from_cycles; - break; - case JACK_TIMER_HPET: if (jack_hpet_init () == 0) { _jack_get_microseconds = jack_get_microseconds_from_hpet; @@ -241,6 +180,7 @@ void SetClockSource(jack_timer_type_t so } break; + case JACK_TIMER_CYCLE_COUNTER: case JACK_TIMER_SYSTEM_CLOCK: default: _jack_get_microseconds = jack_get_microseconds_from_system;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor