> The more of these I see, the more guilt I feel over the condition of the
> portaudio module. There's a good chance that the performance issue you're
> seeing is a bad implementation of the portaudio library. Do you have any
> specific problems you ran into with portaudio? I'd love to revisit at
> some point...
Well, when I tried to push whole blocks instead of individual samples,
it seemed to miss some of these writes. It might do the same even now,
but it wouldn't be noticeable with a sample missing here and there
anyway.
The interface for writeStream is not very fortunate. It forces me to
pack samples into lists no matter what, even if the interleaved list is
actually easier to produce. So it should probably provide alternative
interfaces for interleaved lists (which would actually be possible right
away if writeStream didn't ignore its third argument altogether), and
maybe an array interface as well. I don't know if the callback interface
works better, maybe that's also worth a shot.
Ultimately, it would be probably best if it gave the programmer a higher
abstraction, where it is passed a potentially infinite list of samples,
and takes care of all the buffering duties. Also, this could be made to
play nice with stream fusion in order to get the maximum performance out
of it.
Gergely
--
http://www.fastmail.fm - One of many happy users:
http://www.fastmail.fm/docs/quotes.html