Re: [linux-audio-dev] Realtime problems with midi/osc sequencer

From: Robin Gareus <robin@email-addr-hidden>
Date: Sun Mar 11 2007 - 22:51:13 EET

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 timeval tv = { 0, 0 };
>> tv.tv_sec = 0; tv.tv_usec = usec;
>
>> FD_ZERO(&fd);
>> if (remote_en) {
>> max_fd=remote_fd_set(&fd);
>> }
>
>> select(max_fd, &fd, NULL, NULL, &tv);
>
>> }
>
>
>
> Interesting timing approach.
> But I can't find remote_en and remote_fd_set in the man pages.
> What does these arguments stand for?

sorry, cut the 3 "if(remote_en)" lines - I was too quick with pasting &
sending the mail - remote_en is some global var. that allows to
interrupt the sleep, if some other-event occurs... - actually you'd only
needed "select (0,&fd,0,0,&tv);"

anyway clock_nanosleep seems better; at least it takes less code
to set it up. I did not know about it, and it's even POSIX, how cool!

#robin
Received on Mon Mar 12 00:15:04 2007

This archive was generated by hypermail 2.1.8 : Mon Mar 12 2007 - 00:15:04 EET