You could also try sigaction and setitimer.
I've had good timing results with this approach in the past.
(I haven't tried it for audio tasks though.)
Steve
On 3/11/07, Robin Gareus [EMAIL PROTECTED] wrote:
Christian wrote:
Robin Gareus schrieb:
usleep( iTick-(
Christian wrote:
Robin Gareus schrieb:
usleep( iTick-( passedTime-startTime ) );
AFAIR usleep is not exact! - did you
echo 1024 /proc/sys/dev/rtc/max-user-freq ?
try sth like:
void select_sleep (int usec) {
fd_set fd;
int max_fd=0;
struct
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi,
I'm writing on a sequencer system based on osc and midi.( No audio )
I'll first describe how it is build up.
As libs I'm using liblo and rtmidi.
The whole app is splitted into different small apps dealing with
specific data.
So there is a timer
usleep( iTick-( passedTime-startTime ) );
AFAIR usleep is not exact! - did you
echo 1024 /proc/sys/dev/rtc/max-user-freq ?
try sth like:
void select_sleep (int usec) {
fd_set fd;
int max_fd=0;
struct timeval tv = { 0, 0 };
tv.tv_sec = 0;
In addition to select() there's also clock_nanosleep(CLOCK_MONOTONIC,
0, tv, NULL), which in theory should give best resolution possible.
To set realtime privileges, use (taken from jack):
struct sched_param rtparam;
memset (rtparam, 0, sizeof (rtparam));
rtparam.sched_priority = priority;
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Robin Gareus schrieb:
usleep( iTick-( passedTime-startTime ) );
AFAIR usleep is not exact! - did you
echo 1024 /proc/sys/dev/rtc/max-user-freq ?
try sth like:
void select_sleep (int usec) {
fd_set fd;
int
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Dmitry Baikov schrieb:
In addition to select() there's also clock_nanosleep(CLOCK_MONOTONIC,
0, tv, NULL), which in theory should give best resolution possible.
To set realtime privileges, use (taken from jack):
struct sched_param rtparam;
On 3/10/07, Christian [EMAIL PROTECTED] wrote:
On the one hand this indicates the thread running stable in realtime but
having a restriction to ~4ms/4000µs. Perhaps this is an in-system value
4ms means you have 250Hz kernel tick. Set it to 1024Hz or better try
tickless setup.
of sleep and the
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Dmitry Baikov schrieb:
4ms means you have 250Hz kernel tick. Set it to 1024Hz or better try
tickless setup.
/proc/asound/timers says:
G0: system timer : 1000.000us (1000 ticks)
G1: RTC timer : 976.562us (1 ticks)
Seq24 for example is
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
I'd suggest using clock_nanosleep() and clock_gettime() with
clockid=CLOCK_MONOTONIC.
This is the more right approach than select/gettimeofday().
Dmitry.
Yeah clock_nanosleep did it!
I got a stable absolute bpm exact midi clock.
I'll test the
10 matches
Mail list logo