carla_host_control: import from pyliblo3 if available
pyliblo has not been touched upstream since 2015 and doesn't work out of the box with Python releases since 3.11. There is an actively-maintained fork called 'pyliblo3' at https://github.com/gesellkammer/pyliblo3 which does work with current upstream Python releases. It provides a library called 'pyliblo3' rather than 'liblo'. Let's support it, and prefer it over the dead library (though the dead one will still be used if it is present and pyliblo3 is not).
I tested that, on Fedora 41 with Python 3.13 and the pyliblo3 library installed, with this patch, carla-control starts up successfully and shows its main window. I have no idea how to actually use it so can't see if there are any sneaky issues beyond that, but it's much better than the alternative (it crashes on start because we have no 'liblo' library any more).
please test if it actually works. you can just have 1 carla instance open where OSC is enabled in its settings, then start carla-control and try to add a plugin. both instances should be in sync in terms of plugins loaded, connections on the patchbay and transport info
Well I'm not really sure I'm doing it right (I only vaguely know what any of this stuff is, I'm a distro quality/Python person, not an audio engineer :>) but it seems to work, yeah.
The pyliblo package is broken in more ways than one---it depends on long-deprecated and since-removed Python interfaces, and won't even build with new Cython. One way or another, this dependency has to go.
I backported this for Fedora 41 and, as I said, Carla seems to work as far as a non-specialist can test it. Haven't had any bug reports yet.
I successfully compiled Carla version 2.5.9 on Void Linux using a similar patch. However, I removed the try except ModuleNotFoundError block and imported pyliblo3 directly. It was built and tested with Python 3.13.
Following the explanation provided by falkTX:
please test if it actually works.
you can just have 1 carla instance open where OSC is enabled in its settings, then start carla-control and try to add a plugin. both instances should be in sync in terms of plugins loaded, connections on the patchbay and transport info
I verified the functionality, and it worked perfectly. When I add a plugin in Carla-Control linked to Carla, the plugin appears in Carla's "Rack" and "Patchbay." However, when attempting to add a new plugin, an error appears stating:
Failed to load plugin
A previous operation is still pending, please wait
This issue also occurs in the version compiled with pyliblo3 and pyliblo in version 2.5.9, as well as in version 2.5.8 with pyliblo. I have not tested this behavior in earlier versions. Additionally, I noticed that nothing appears in the "Rack" and "Patchbay" tabs of Carla-Control. I am unsure if this is the expected behavior.
The following log was generated in version 2.5.9 using pyliblo3 to establish the connection with carla-control:
Carla Log Output
======= Starting engine =======
======= Engine started ========
Carla engine started, details:
Driver name: PulseAudio
Sample rate: 44100
Process mode: Patchbay
[carla] OSC TCP backend registered to osc.tcp://void.lan:17159/ctrl, path: /ctrl, target: osc.tcp://:17159/ (host: , port: 17159)
[carla] CarlaEngineOsc::sendCallback(29:ENGINE_CALLBACK_ENGINE_STARTED, 0, 3, 1, 512, 44100,000000, "PulseAudio")
[carla] CarlaEngineOsc::sendCallback(20:ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, 1, 2, -1, 0, 0,000000, "Audio Input")
[carla] CarlaEngineOsc::sendCallback(24:ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, 1, 510, 2, 0, 0,000000, "Left")
[carla] CarlaEngineOsc::sendCallback(24:ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, 1, 511, 2, 0, 0,000000, "Right")
[carla] CarlaEngineOsc::sendCallback(20:ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, 2, 2, -1, 0, 0,000000, "Audio Output")
[carla] CarlaEngineOsc::sendCallback(24:ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, 2, 255, 3, 0, 0,000000, "Left")
[carla] CarlaEngineOsc::sendCallback(24:ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, 2, 256, 3, 0, 0,000000, "Right")
[carla] CarlaEngineOsc::sendCallback(20:ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, 3, 2, -1, 0, 0,000000, "Midi Input")
[carla] CarlaEngineOsc::sendCallback(24:ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, 3, 1530, 8, 0, 0,000000, "Capture 1")
[carla] CarlaEngineOsc::sendCallback(20:ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, 4, 2, -1, 0, 0,000000, "Midi Output")
[carla] CarlaEngineOsc::sendCallback(24:ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, 4, 1275, 9, 0, 0,000000, "Playback 1")
[carla] OSC UDP backend registered to osc.udp://void.lan:19002/ctrl, path: /ctrl, target: osc.udp://[::ffff:127.0.0.1]:19002/ (host: ::ffff:127.0.0.1, port: 19002)
[carla] CarlaEngineOsc::sendPluginInfo(0x5622983c4130)
[carla] CarlaEngineOsc::sendPluginPortCount(0x5622983c4130)
[carla] CarlaEngineOsc::sendPluginDataCount(0x5622983c4130)
[carla] CarlaEngineOsc::sendCallback(1:ENGINE_CALLBACK_PLUGIN_ADDED, 0, 1, 0, 0, 0,000000, "Audio File")
[carla] CarlaEngineOsc::sendCallback(5:ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, 0, -2, 0, 0, 1,000000, "(null)")
[carla] CarlaEngineOsc::sendCallback(20:ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, 5, 1, 0, 0, 0,000000, "Audio File")
[carla] CarlaEngineOsc::sendCallback(24:ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, 5, 510, 2, 0, 0,000000, "output_1")
[carla] CarlaEngineOsc::sendCallback(24:ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, 5, 511, 2, 0, 0,000000, "output_2")
[carla] CarlaEngineOsc::sendCallback(24:ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, 5, 1275, 9, 0, 0,000000, "events-in")
[carla] CarlaEngineOsc::sendCallback(24:ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, 5, 1530, 8, 0, 0,000000, "events-out")
When I added a plugin directly in Carla, I received the following log:
[carla] CarlaEngineOsc::sendPluginInfo(0x559e3c5cc940)
[carla] CarlaEngineOsc::sendPluginPortCount(0x559e3c5cc940)
[carla] CarlaEngineOsc::sendPluginDataCount(0x559e3c5cc940)
[carla] CarlaEngineOsc::sendCallback(1:ENGINE_CALLBACK_PLUGIN_ADDED, 1, 1, 0, 0, 0,000000, "Bypass")
[carla] CarlaEngineOsc::sendCallback(5:ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, 1, -2, 0, 0, 1,000000, "(null)")
[carla] CarlaEngineOsc::sendCallback(20:ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, 6, 1, 1, 0, 0,000000, "Bypass")
[carla] CarlaEngineOsc::sendCallback(24:ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, 6, 255, 3, 0, 0,000000, "input")
[carla] CarlaEngineOsc::sendCallback(24:ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, 6, 510, 2, 0, 0,000000, "output")
[carla] CarlaEngineOsc::sendCallback(24:ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, 6, 1275, 9, 0, 0,000000, "events-in")
However, nothing appeared in Carla-Control after adding the plugin.
I previously tested Carla version 2.5.9 on Void Linux using a similar approach, testing both pyliblo and pyliblo3, and observed issues with synchronization in carla-control, as detailed in my previous comment.
Recently, I revisited the issue after noticing that the liblo package in Void Linux was outdated (version 0.31). I submitted a PR to update it to version 0.32 and retested carla-control. The same synchronization issues persisted. However, upon further investigation, I found that compiling liblo without the --enable-ipv6 flag resolved the issue. With this configuration, carla-control successfully connects and synchronizes correctly, eliminating the previously reported problems.
This behavior was confirmed with both pyliblo and pyliblo3, where removing the --enable-ipv6 flag resulted in proper synchronization in both cases. It seems that the IPv6 flag might be affecting OSC communication in some way.
ping, pyliblo has been expired and removed from the FreeBSD Ports tree, which means every consumer, carla included, has also been removed.
pyliblo was about to be removed, but @vishwin caught me in the act :)
https://github.com/NixOS/nixpkgs/pull/418925
NixOS updated Python to the newest version and that broke pyliblo(and Carla as a result) so we are replacing it with pyliblo3.
Unfortunately we had to use this PR as a patch for Carla to use pyliblo3.
This PR has to be resolved eventually, otherwise all distros will have no choice but to do the same.
I finally tested the PR on an updated system and seems to work fine. will merge, thanks!