Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote host and port should be configurable #249

Closed
jypma opened this issue Jun 1, 2022 · 9 comments
Closed

Remote host and port should be configurable #249

jypma opened this issue Jun 1, 2022 · 9 comments

Comments

@jypma
Copy link

jypma commented Jun 1, 2022

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?

@falkTX
Copy link
Contributor

falkTX commented Jun 1, 2022

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.

@dromer
Copy link
Collaborator

dromer commented Jun 1, 2022

How to deal with port-conflicts when you have >1 instance running, though?

@falkTX
Copy link
Contributor

falkTX commented Jun 1, 2022

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.

@dromer
Copy link
Collaborator

dromer commented Jun 1, 2022

But how would you know which instance you are connecting to?

@falkTX
Copy link
Contributor

falkTX commented Jun 1, 2022

something on the remote side can display that info, can be just a number from 1 to 5 on the modgui.

@jypma
Copy link
Author

jypma commented Jun 1, 2022

@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
Copy link
Contributor

falkTX commented Jun 1, 2022

@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.

@jypma
Copy link
Author

jypma commented Jun 1, 2022

No problem! Looking forward to the future developments :) Do let me know if I can test/contribute with something.

@falkTX
Copy link
Contributor

falkTX commented May 22, 2023

Added in cf45ff6, will be part of next release.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants