Repository navigation
Conversation
Kill() cannot interrupt a thread blocked in CFRunLoopRun() or sem_wait(), so jackd never exited when stopped. Stop the threads cooperatively instead. Also ignore CoreMIDI notifications until the driver is started and while it is closing, so Restart() cannot run alongside Attach().
Start and stop jackd with the coremidi driver several times in a row.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.Suggestion cannot be applied right now. Please check back later.
Hi @falkTX,
This fixes #1027 .
The CoreMIDI threads were stopped with
Kill(), which cannot wake a thread blocked inCFRunLoopRun()orsem_wait(). They are now asked to stop and joined.Once that worked, I also noticed a quick restart failed with
port_name "system_midi:capture_1" already exists. The previous server's endpoints disappearing triggeredRestart()while the new server was still inAttach(). Notifications are now ignored while closing and untilStart()is done, so a device change in that short window is only seen at the next notification.I also added
tests/jack_coremidi_shutdown_test.sh, which starts and stopsjackd -X coremidi -d dummya few times in a row. It fails on current develop and passes with this change.I tested it on macOS 26.7 (Apple Silicon) with the dummy and CoreAudio drivers.
Not tried: real MIDI hardware (I don't have any), long runs, and Intel, but I don't see any reason why it should not work on Intel also.
Feel free to ask me for changes if you see things differently. Thanks!