doug@xdos.UUCP (Doug Merritt) (02/14/90)
What's the maximum possible rate of PA_SOFTINT's you can do with the timer device? I was just trying 14Khz (71 us) with a really minimal overhead interrupt routine, and it seemed to actually get called far less often per second. If 71 us is too fast for PA_SOFTINT, what should I do instead? Ideally I want to be able to go down to around 30 us (about 30Khz). Doug -- Doug Merritt {pyramid,apple}!xdos!doug Member, Crusaders for a Better Tomorrow Professional Wildeyed Visionary
karl@sugar.hackercorp.com (Karl Lehenbauer) (02/15/90)
In article <667@xdos.UUCP> doug@xdos.UUCP (Doug Merritt) writes: >What's the maximum possible rate of PA_SOFTINT's you can do with >the timer device? I was just trying 14Khz (71 us) with a really >minimal overhead interrupt routine, and it seemed to actually get >called far less often per second. The timer device is unreliable at intervals anywhere near that speed. If two tasks are making requests down in the small-number-of-milliseconds range, for example your task and trackdisk.device, you will get your interrupts late, like many milliseconds late -- I don't have exact figures, but it was easy to hear my SMUS and MIDI file players screwing up when they worked this way and trackdisk.device was doing things, like seeking or even checking to see if a disk had been inserted into an empty drive. The solution, I'm afraid, is to take over one of the available timer devices. That's what I do (using the prescribed mechanism to be well-behaved, of course), and it works OK -- when I switched over to that, my timing inconsistencies went away. Oh yeah, you'll have a timing interval resolution of about 1.36 microseconds. Drift is minimal -- it runs off some division of the master crystal. You can get an interrupt every time an interval passes, or set the timer up as a one-shot. If you need some code, let me know. I'm thinking about posting my MIDI and SMPTE time servers. They're a lot like Apple's, except that they work. -- -- uunet!sugar!karl "As long as there is a legion of superheros, all else -- can surely be made right." -- Sensor Girl -- Usenet access: (713) 438-5018