/ mumble Public
JackAudio: remove locks from realtime callbacks, various improvements #3887
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge.
According to the JACK specification the process callback cannot have
anything that could block. JACK can also kill the process thread while
it is holding the lock which can cause a deadlock. Removing the locks prevents
both deadlocks in Mumble and xruns in the JACK processes.
There have also been some changes to the order in which the JACK clients
get activated. This is to make sure that they are fully set up before
the activate function is called. This prevents graph errors from showing
up in the JACK logs.
This way it's set up is to use JACK's lock-free ringbuffers. The callback threads just read and write from the buffers, and the run() does the actual processing of the audio. Because there should be at most, one frame of latency between audio being ready and audio sent to JACK this pull also sets usesOutputDelay to false.
There is one other change in the way it finds the ports to connect to. It does not pass in a name, since the names are actually meaningless.