Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use two separate RtAudio streams when input != output device
RtAudio supports the creation of streams that are input-only, output-only, or input + output (duplex). Previously, we always used a single duplex stream even when the input and output devices differ. This is problematic because each device may have its own clock, and trigger callbacks at different points in time. RtAudio therefore needed to wait for both audio interfaces to trigger callbacks before it could trigger its own, reducing the interval of time that JackTrip has to perform its work. If the delta between the interface callbacks is small enough, relative to the work JackTrip is performing, everything work just fine. However, over time we've added more CPU intensive work in the JackTrip callbacks, such as PLC. If the delta is too short, callbacks get missed causing audio glitches. By using separate (simplex) RtAudio streams for input and output, we are able to decouple the two audio interfaces from one another, ensuring that JackTrip always has the maximum amount of time available to "do its thing."
- Loading branch information