Remote host and port should be configurable
Cardinal has a great feature to automatically update a remote embedded instance, originally for the MOD devices. I'm currently trying to get Cardinal onto Zynthian, where this functionality would also be very useful. Cardinal itself runs fine there as LV2, by the way (compiled on Raspberry Pi 4).
However, Cardinal has the remote host and port hardcoded to 192.168.51.1:2228. Zynthian is its own actual network device, and often doesn't have a fixed IP address or hostname. Hence, it'd be nice if this can be read from a configuration file.
I realize that no configuration file exists yet, and currently all user settings are stored as plugin data. I think we could do this in a few ways:
A) Introduce a configuration file B) Configure this from environment variables
(A) would be the way to go if there are other settings that might want to live there (e.g. framerate skip, which typically wouldn't differ from instance to instance)
(B) would work as an initial approach, but it'd be messy since you'd have to set the environment variables for the host running Cardinal (if not standalone) and hope they make it across.
Any thoughts?
My plan for this is to have a dedicated remote control tool that allows to input the IP to connect into, possibly also auto-detecting via known IPs too.
How to deal with port-conflicts when you have >1 instance running, though?
just have 5 ports, should be enough for this. the remote side can keep trying until it finds a free port.
connecting side can query all 5 to see which ones provide a response.
But how would you know which instance you are connecting to?
something on the remote side can display that info, can be just a number from 1 to 5 on the modgui.
@falkTX Ah, good to hear there's a plan :) Would you be OK with accepting a PR that does this based on environment variables in the meantime (once I confirm that gets the connection up and working)? That shouldn't be too hard to write.
On the multiple ports, I've actually seen subsequent instances not being able to grab a port if 8222 is already in use (on RPi). However, I'd have to test that more thoroughly to confirm.
@falkTX Ah, good to hear there's a plan :) Would you be OK with accepting a PR that does this based on environment variables in the meantime (once I confirm that gets the connection up and working)? That shouldn't be too hard to write.
No, that will clutter with the plans I have.
On the multiple ports, I've actually seen subsequent instances not being able to grab a port if 8222 is already in use (on RPi). However, I'd have to test that more thoroughly to confirm.
Should only be an issue if plugin is already there or loaded. The first iteration of this was only for testing, to verify if it could work. Now that we know it can, we can move it into doing more useful things.
No problem! Looking forward to the future developments :) Do let me know if I can test/contribute with something.
Added in cf45ff62fca5c1876fa308492ceacf40a2f6ab95, will be part of next release.