On Fri, Sep 4, 2015 at 11:47 AM Andrew Kelley <superjo...@gmail.com> wrote:
> >> >> >> And an observation: libsoundio has a read and a write callback. If I >> was >> >> writing an audio program that produced output based on the input (such >> as a >> >> reverb, for example), do I have any guarantee that a write callback >> will >> >> only come after a read callback, and that for every write callback >> there is >> >> a read callback? >> > >> > >> > I don't think that every sound driver guarantees this. I see that >> PortAudio >> > supports this API but I think they have to do additional buffering to >> > accomplish it in a cross platform manner. >> > >> > If you're writing something that is reading from an input device and >> writing >> > to an output device, I think your best bet is to use a ring buffer to >> store >> > the input. >> > >> > But, if you're creating an effect such as reverb, why bother with sound >> > devices at all? Sounds like a good use case for JACK or LV2. >> > >> >> A ringbuffer introduces a buffer's worth of delay. Not good for >> applications that require low latency. A DAW would be a better example >> than a reverb. No low-latency monitoring with this arrangement. >> > > I'm going to look carefully into this. I think you brought up a potential > flaw in the libsoundio API, in which case I'm going to figure out how to > address the problem and then update the API. > I think you are right that duplex streams is a missing feature from libsoundio's current API. Upon reexamination, it looks like it is possible to support duplex streams on each backend. I noticed that PortAudio's API allows one to open a duplex stream with different stream parameters for each device. Does it actually make sense to open an input device and an output device with... * ...different sample rates? * ...different latency / hardware buffer values? * ...different sample formats? Regards, Andrew
_______________________________________________ dupswapdrop: music-dsp mailing list music-dsp@music.columbia.edu https://lists.columbia.edu/mailman/listinfo/music-dsp