[hi-res timers] Important for users of ALSA Midi, no Jack

MusE is a DAW for Linux with both MIDI and Audio editing. https://muse-sequencer.github.io

Moderators: MattKingUSA, khz, spamatica

Post Reply
Tim E. Real
Established Member
Posts: 660
Joined: Sat Sep 15, 2012 12:36 am
Has thanked: 36 times
Been thanked: 105 times

[hi-res timers] Important for users of ALSA Midi, no Jack

Post by Tim E. Real »

Hi, for a while I have noticed that here on my distro and apparently some others that MusE
will pick the lowly 250Hz ALSA system timer and you'll get a warning - unless Jack is run first,
even if Jack is subsequently stopped. I have noticed it in some users' bug reports and logs.

I just found out why.

Please ensure that the ALSA module snd-hrtimer is loaded before starting MusE if you have not started Jack yet.
Try "sudo modprobe snd-hrtimer".
It seems that because Jack uses the ALSA pcm api or some other, that causes the module to be loaded.

Loading the snd-hrtimer module will allow MusE to pick the ALSA hi-resolution 1000Hz timer.
This is important for midi timing.

I note that MusE uses the ALSA seq api but never the pcm api.
Even when MusE quits, snd-hrtimer module is *still* not loaded.

Therefore apart from warning users to load the module, I looking at a possible solution that maybe involves making
dummy calls to the pcm api or something, to get the snd-hrtimer module to load. Or some other means.

But... For better resolution try to set up your hardware RTC timer. MusE will detect it, and you can go
to Settings and set the frequency pretty high, beyond 1000Hz.
Note that I was informed by the ALSA team a while ago that recently a hard-coded 1000Hz limit was placed
on the hr-timer. In the past it had a theoretical limit of 0.001 us or 1Ghz.
It is now impossible for me to set it higher than 1000Hz.
See? That's why our Settings now fail to go any higher than that. For a brief period after adding hr timer support,
we were actually allowed to set it *very* high! It was paradise.

So, all you precision accuracy hounds, be sure to dust off that old RTC timer.

Tim.
artofmusic
Established Member
Posts: 90
Joined: Mon Mar 17, 2014 8:01 pm

Re: [hi-res timers] Important for users of ALSA Midi, no Jack

Post by artofmusic »

Huh since Arch Linux is built with Full Dyn Ticks I wonder if this is mute
Post Reply