Skip to content

Commit

Permalink
Use two separate RtAudio streams when input != output device
Browse files Browse the repository at this point in the history
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
mikedickey committed Jan 8, 2024
1 parent 7204b9c commit 4fe5bec
Show file tree
Hide file tree
Showing 7 changed files with 317 additions and 237 deletions.
14 changes: 7 additions & 7 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
option('wair', type : 'boolean', value : 'false', description: 'WAIR')
option('wair', type : 'boolean', value : false, description: 'WAIR')
option('rtaudio', type : 'feature', value : 'auto', description: 'Build with RtAudio Backend')
option('jack', type : 'feature', value : 'auto', description: 'Build with JACK Backend')
option('weakjack', type : 'boolean', value : 'false', description: 'Weak link JACK library')
option('nogui', type : 'boolean', value : 'false', description: 'Build without graphical user interface')
option('novs', type : 'boolean', value : 'false', description: 'Build without Virtual Studio support')
option('vsftux', type : 'boolean', value : 'false', description: 'Build with Virtual Studio first launch experience')
option('noupdater', type : 'boolean', value : 'false', description: 'Build without auto-update support')
option('nofeedback', type : 'boolean', value : 'false', description: 'Build without feedback detection')
option('weakjack', type : 'boolean', value : false, description: 'Weak link JACK library')
option('nogui', type : 'boolean', value : false, description: 'Build without graphical user interface')
option('novs', type : 'boolean', value : false, description: 'Build without Virtual Studio support')
option('vsftux', type : 'boolean', value : false, description: 'Build with Virtual Studio first launch experience')
option('noupdater', type : 'boolean', value : false, description: 'Build without auto-update support')
option('nofeedback', type : 'boolean', value : false, description: 'Build without feedback detection')
option('profile', type: 'combo', choices: ['default', 'development'], value: 'default', description: 'Choose build profile / Sets desktop id accordingly')
option('qtversion', type : 'combo', choices: ['', '5', '6'], description: 'Choose to build with either Qt5 or Qt6')
option('buildinfo', type : 'string', value : '', yield : true, description: 'Additional info used to describe the build')

0 comments on commit 4fe5bec

Please sign in to comment.