Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JackAudio: remove locks from realtime callbacks, various improvements #3887

Merged
merged 1 commit into from Nov 11, 2019

Conversation

McKayJT
Copy link
Contributor

@McKayJT McKayJT commented Nov 10, 2019

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.

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.
This 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.
@McKayJT
Copy link
Contributor Author

McKayJT commented Nov 11, 2019

After a brief chat on IRC, I see no problem with the changes to this patch. Still fixes everything just a bit nicer looking and more in line with the standards wanted.

@davidebeatrici davidebeatrici changed the title Remove locks from JACK realtime callbacks JackAudio: remove locks from realtime callbacks, various improvements Nov 11, 2019
@davidebeatrici davidebeatrici merged commit a29b303 into mumble-voip:master Nov 11, 2019
@davidebeatrici
Copy link
Member

Thank you very much for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants