mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-10 04:30:12 +02:00
Better describe Wine process shutdown
This commit is contained in:
@@ -9,10 +9,6 @@ There are a few things that should be done before making this public, including:
|
|||||||
- Implement missing features:
|
- Implement missing features:
|
||||||
- GUIs. Right now I'm just ignoring all of the opcodes related to GUIs so that
|
- GUIs. Right now I'm just ignoring all of the opcodes related to GUIs so that
|
||||||
the plugins don't crash when you open their GUI.
|
the plugins don't crash when you open their GUI.
|
||||||
- The Wine process seems to segfault on shutdown even though it doesn't seem
|
|
||||||
to cause any other problems. This can probably be fixed by catching
|
|
||||||
exceptions thrown in the threads caused by sockets being closed. It's
|
|
||||||
handled similarly in the native VST plugin.
|
|
||||||
- The initial host callback fails in Bitwig if the plugin is bridged, but it
|
- The initial host callback fails in Bitwig if the plugin is bridged, but it
|
||||||
works if it's directly loaded into Bitwig.
|
works if it's directly loaded into Bitwig.
|
||||||
- Check whether sidechaining and MPE work since they're unofficial additions
|
- Check whether sidechaining and MPE work since they're unofficial additions
|
||||||
|
|||||||
+15
-17
@@ -117,18 +117,15 @@ HostBridge::HostBridge(audioMasterCallback host_callback)
|
|||||||
// instead of asynchronous IO since communication has to be handled in
|
// instead of asynchronous IO since communication has to be handled in
|
||||||
// lockstep anyway
|
// lockstep anyway
|
||||||
host_callback_handler = std::thread([&]() {
|
host_callback_handler = std::thread([&]() {
|
||||||
while (true) {
|
try {
|
||||||
try {
|
while (true) {
|
||||||
passthrough_event(vst_host_callback, &plugin,
|
passthrough_event(vst_host_callback, &plugin,
|
||||||
host_callback_function,
|
host_callback_function,
|
||||||
std::pair<Logger&, bool>(logger, false));
|
std::pair<Logger&, bool>(logger, false));
|
||||||
} catch (const boost::system::system_error&) {
|
|
||||||
// TODO: This raises SIBABRT if not caught, fix similar issues
|
|
||||||
// in the Wine VST host
|
|
||||||
// This happens when the sockets got closed because the plugin
|
|
||||||
// is being shut down
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
} catch (const boost::system::system_error&) {
|
||||||
|
// This happens when the sockets got closed because the plugin
|
||||||
|
// is being shut down
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -236,14 +233,20 @@ intptr_t HostBridge::dispatch(AEffect* /*plugin*/,
|
|||||||
// correctly
|
// correctly
|
||||||
|
|
||||||
// Allow the plugin to handle its own shutdown
|
// Allow the plugin to handle its own shutdown
|
||||||
// TODO: Seems to cause segfaults in the Wine process, but doesn't
|
|
||||||
// seem to cause noticable problems
|
|
||||||
const auto return_value = send_event(
|
const auto return_value = send_event(
|
||||||
host_vst_dispatch, converter, opcode, index, value, data,
|
host_vst_dispatch, converter, opcode, index, value, data,
|
||||||
option, std::pair<Logger&, bool>(logger, true));
|
option, std::pair<Logger&, bool>(logger, true));
|
||||||
|
|
||||||
// XXX: Boost.Process will send SIGKILL to the process for us, is
|
// Boost.Process will send SIGKILL to the Wien host for us when this
|
||||||
// there a way to manually send a SIGTERM signal instead?
|
// class gets destroyed. Because the process is running a few
|
||||||
|
// threads Wine will say something about a segfault (probably
|
||||||
|
// related to `std::terminate`), but this doesn't seem to have any
|
||||||
|
// negative impact
|
||||||
|
|
||||||
|
// The `stop()` method will cause the IO context to just drop all of
|
||||||
|
// its work and immediately and not throw any exceptions that would
|
||||||
|
// have been caused by pipes and sockets being closed
|
||||||
|
io_context.stop();
|
||||||
|
|
||||||
// `std::thread`s are not interruptable, and since we're doing
|
// `std::thread`s are not interruptable, and since we're doing
|
||||||
// blocking synchronous reads there's no way to interrupt them. If
|
// blocking synchronous reads there's no way to interrupt them. If
|
||||||
@@ -255,11 +258,6 @@ intptr_t HostBridge::dispatch(AEffect* /*plugin*/,
|
|||||||
host_callback_handler.detach();
|
host_callback_handler.detach();
|
||||||
wine_io_handler.detach();
|
wine_io_handler.detach();
|
||||||
|
|
||||||
// The `stop()` method will cause the IO context to just drop all of
|
|
||||||
// its work and immediately and not throw any exceptions that would
|
|
||||||
// have been caused by pipes and sockets being closed
|
|
||||||
io_context.stop();
|
|
||||||
|
|
||||||
delete this;
|
delete this;
|
||||||
|
|
||||||
return return_value;
|
return return_value;
|
||||||
|
|||||||
Reference in New Issue
Block a user