|
From: Hugo V. <hvw...@ya...> - 2005-01-05 18:41:35
|
--- Jean-Daniel Pauget <jd...@di...> wrote: > > new bruby patch for 2.4.29-pre3 (this last > kernel corrects some > security drills) and also speaker-correction as > suggested on this list. > > available here : > http://disjunkt.com/dualhead/ > > the pacth itself : > > http://disjunkt.com/dualhead/bruby-2.4.29-pre3-20050104.bz2 > > > right, I also corrected the timer creation > accordingly and your > following troubles should disappear : Terrific! Works! But... No pitch! e.g following code: try it! #include <sys/ioctl.h> /* for ioctl() */ #include <linux/kd.h> /* for KDMTONE */ #include <sys/types.h> /* for open() */ #include <sys/stat.h> /* for open() */ #include <fcntl.h> /* for open() */ #include <sys/ioctl.h> /* for ioctl() */ #include <stdio.h> /* for perror() */ #include <stdlib.h> /* for exit() */ #include <unistd.h> /* for close() */ int main( int argc, char **argv ) { int fd = open("/dev/tty1", O_WRONLY|O_NONBLOCK); // ioctl(fd, KDMKTONE, 0); unsigned short msec = 100; /* This is for now ignored */ unsigned short freq = 450; /* The frequency of the tone */ for(int i=0; i<100; i++){ freq += 5; /* Play sound */ int rc = ioctl(fd, KDMKTONE, (msec << 16) | (1193180 / freq)); if(rc<0){ perror("Error playing sound"); close(fd); exit(-1); } // printf("%d ",i); usleep((unsigned long) msec + 1000); // ioctl(fd, KDMKTONE, 0); // this here after KDMKTONE makes a tick! } // printf("\n"); close(fd); return 0; } What do we have to do to get the pitch variation to work? Hugo. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 |