feat(IPC): Add Linux/Wine platform support to ARAIPCConnection#3
Open
samuel-asleep wants to merge 1 commit into
Open
feat(IPC): Add Linux/Wine platform support to ARAIPCConnection#3samuel-asleep wants to merge 1 commit into
samuel-asleep wants to merge 1 commit into
Conversation
- Remove #error on non-Apple/non-Windows platforms - Add ThreadRef = size_t for Linux (matches std::thread::id on 64-bit POSIX) - Add Connection members: std::queue + std::mutex + std::condition_variable - Implement dispatchToCreationThread() for Linux - Implement processPendingMessageOnCreationThreadIfNeeded() for Linux - Add Wine-compatible WaitableSingleMessageQueue using POSIX sem_t (std::binary_semaphore hangs under Wine due to broken futex mapping)
b728ebd to
057987b
Compare
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.
Add Linux platform support to ARAIPCConnection, enabling the ARA IPC
layer to work on Linux and under Wine (the Windows compatibility layer
used by yabridge to run Windows VST plugins on Linux).
Changes
ARAIPCConnection.h
the existing #else branch alongside the comment explaining their purpose
!defined(WINE) so Wine processes (which define both _WIN32 and
WINE) use the Linux/POSIX path instead
ARAIPCConnection.cpp
macros, and Win32 APC helpers with !defined(WINE) so Wine uses
the POSIX-compatible size_t path
sem_timedwait — std::binary_semaphore's try_acquire_for hangs under
Wine due to broken futex mapping
to _queue and signals _condition
Linux/Wine: drains _queue under the !defined(_WIN32) || defined(WINE)
guard (the existing #if defined(linux) guard was skipped by Wine
since Wine defines both _WIN32 and linux)
on Linux/Wine (no Windows handle or CFRunLoop needed)
Testing
Tested end-to-end with a Unix domain socketpair-based MessageChannel
on Linux (test infrastructure in samuel-asleep/ARA_Library):
Native Linux ARAPluginDemo (JUCE_ARA, Debug build):
GetFactoriesCount ✓, GetFactoryAtIndex ✓, InitializeARA ✓,
UninitializeARA ✓, clean exit, no ARA assertions
Windows ARAPluginDemo (MSVC Debug, via Wine):
Same round-trip, clean exit, no ARA assertions, no crashes
Both tests confirm the IPC threading model is correct and the Linux
platform additions do not regress macOS or Windows behavior.
Notes
The Wine-specific guards (!defined(WINE)) are needed because wineg++
defines both _WIN32 and WINE simultaneously. Without these guards,
Wine processes incorrectly take the Windows code path (Win32 handles,
int32_t ThreadRef, Windows semaphore) while the struct members declared
in the header follow the Linux path — causing type mismatches and crashes.