Re: [Jack-Devel] jack is broken on ARM without bogomips

PrevNext  Index
DateWed, 22 Jan 2014 17:06:06 -0800
From Fernando Lopez-Lezcano <[hidden] at ccrma dot Stanford dot EDU>
ToGrant <[hidden] at gmail dot com>
CcJACK <[hidden] at lists dot jackaudio dot org>
In-Reply-ToGrant Re: [Jack-Devel] jack is broken on ARM without bogomips
Follow-UpGrant Re: [Jack-Devel] jack is broken on ARM without bogomips
On 01/22/2014 02:37 PM, Grant wrote:
>>>      My gut feeling is that we should rely on a proper monotonic clock
>>>      instead and drop this /proc/cpuinfo parser altogether.
>>>
>>> agreed 100%.
>>
>>
>> In the meantime... (I'm also seeing this error on newer kernels)
>>
>> Would it make sense to just hardwire something in there if the existing
>> tests fail? Is there something that will break if I do that? (I'm going to
>> test that but I m asking anyway).
>
> Please share your patch if you get something working.

Hi Grant,

I just tried a hack. Can't be called a proper patch, I just used 1000MHz 
as the frequency - I thought that would work as, after all, the BogoMips 
numbers are, well, "bogus" anyway. At least on Pidora with 3.12.x it 
seems to start and work. Not much testing but got a sinewave going :-) 
Hack below (messages could be nicer, of course)...

It would be nice to have a proper fix.
-- Fernando


--- jack-1.9.9.5/linux/JackLinuxTime.c~	2012-12-10 01:26:57.000000000 -0800
+++ jack-1.9.9.5/linux/JackLinuxTime.c	2014-01-22 14:39:41.000000000 -0800
@@ -152,7 +152,9 @@
  		if (fgets(buf, sizeof(buf), f) == NULL) {
  			jack_error ("FATAL: cannot locate cpu MHz in "
  				    "/proc/cpuinfo\n");
-			exit(1);
+			fclose(f);
+			jack_log("Using 1GHz by default");
+			return (jack_time_t)1000;
  		}

  #if defined(__powerpc__)
@@ -176,6 +178,10 @@
  		{
  			fclose(f);
  			return (jack_time_t)mhz;
+		} else {
+			fclose(f);
+			jack_log("Using 1GHz by default");
+			return (jack_time_t)1000;
  		}
  	}
  }
PrevNext  Index

1390439184.29576_0.ltw:2,a <52E06AFE.4000308 at ccrma dot stanford dot edu>