I don't see how Linux can ever do this - without expensive peripheral
devices.
> Instrumental performance is the most demanding of them all. If
> I am onstage in front of a live audience and playing an
> improvisation with other musicians, I wonder if even
> 5ms is fast enough. Buffering is useless because if I
> strike a note, the attack must be nearly instantaneous.
> If you have never done live improv with really good musicians
> you won't believe how tight this can be. [And if you've ever
> been on stage with bad sound trying to do this you know what
> pure hell is.]
That's where the pedal to the metal, shave every microsecond response
of something like RTLinux is all you can do.
BTW: despite the impression one sometimes gets, programming in RTLinux
does not require mastery of the Babylonian alphabet presented in octal.
The programming interface is pretty much POSIX threads with some
simplifications to make periodic tasks easier to define.
module_init(){
pthread_create(f,stacksize,priority,0);
}
/* don't write code like this without error checks */
void f(void *data){
fd_r = open("/dev/rtf0", O_READ);
fd_w = open("/dev/rtf1", O_WRITE);
fd_d = open("/dev/sound", O_READ);
while(1){
read(fd_d,buf,BUFSZ);
write(fd_w, buf,BUFSZ);
if(read(fd_r,command,COMMANDSIZE) >0)
process_command_from_linux_process(command);
pthread_wait_np(); /* wait for next period */
}
}
The user process looks like
main(){
fd_data = open("/dev/rtf1",O_READ);
fd_command = open("/dev/rtf0",O_WRITE);
while(1){
read(fd_data,buf,BUFSZ);
process_data(buf);
if(need_to_change_something)write(fd_command,command);
}
}
-- --------------------------------------------------------- Victor Yodaiken FSMLabs: www.fsmlabs.com www.rtlinux.com FSMLabs is a servicemark and a service of VJY Associates L.L.C, New Mexico.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/