[linux-audio-user] midi timings

James Stone jamesmstone at gmail.com
Sat Jan 27 14:55:20 EST 2007


> >
> > As an aside: does anyone know if it makes any difference if it is
> > 1000Hz or 8000Hz?
> 
> You are confusing the system timer with the realtime clock (RTC). Those are 
> two different timers. 
> 
> The system timer (the CONFIG_HZ) setting cannot be changed at runtime. It runs 
> with the frequency set at compile time (250hz is preconfigured). This is what 
> drives the kernel scheduler (there are some other things triggering it 
> though, processes going to sleep for example, etc.) and thus this is what 
> determines timer granularity if you use ordinary sleep() or posix timers.
> 
> Different apps use either the system timer or RTC to do their timing. Muse 
> afaik uses RTC. Rosegarden works best with the system timer..
> 
> The value in /proc/sys/dev/rtc/max-user-freq determines to what maximum 
> frequency ordinary users can set the RTC. You usually want to have your app 
> decide that, so set it to 8192, so the app can use whatever freq it wishes.
> 
> So to have your system prepared for all situations make sure your kernel is 
> configured with CONFIG_HZ set to 1000 AND setup max-user-freq. So whatever 
> timing mechanism the app choooses to use, the system will be ready.
> 
> You might also have to check the permissions on /dev/rtc to see whether 
> ordinary users may open it at all.
> 
> RTC has the drawback that only one app can use it at a time. But it can be 
> used as timing source with great success.

Thanks for clearing this up! It was really confusing me.

Do you know what effect (if any) the tickless RTC option in the
kernel config makes for audio work?

James



More information about the Linux-audio-user mailing list