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

Feature Request: Namespace argument for auto generated server functions #3941

Open
Loxbie opened this issue May 28, 2024 · 0 comments
Open

Comments

@Loxbie
Copy link

Loxbie commented May 28, 2024

With older liquidsoap versions (2.1.0) you were able to reuse the same id and therefore set the same namespace for auto generated server functions. With newer versions (2.2.5+) enforcing unique ids, this is not possible anymore.

I therefore propose adding an argument to sources ( mix, input.stream, request.queue or other methods which create server functions on the fly), allowing to set a server namespace different from the id. For mix this is already implemented.

A current work around would be to create all auto generated server functions by hand and set them in the namespace you need. This does create a lot of duplicated code and creates a lot of unnecessary server functions.

For the playout that we have been working on, the upgrade from version 2.1.0 to 2.2.5 or new versions breaks the communication with our control unit. This is due to the fact that we expect the server functions in the same namespace.

An example of what doesn't work atm:

settings.log.level.set(3)
settings.server.telnet.set(true)
settings.server.telnet.bind_addr.set("0.0.0.0")
settings.server.telnet.port.set(1234)

# Create fallback playlist
fallback_folder =
  playlist(id="fallback_folder", "../audio/fallback", mode="randomize")
fallback_folder = mksafe(fallback_folder)

# Create mixer with one queue
in_queue = request.queue(id="in_queue")
input_queue_0 =
  amplify(id="in_queue", 1., override="replay_gain", in_queue)
mixer = mix(id="mixer", [input_queue_0.{id="in_queue"}])
stripped_mixer = blank.strip(max_blank=5., mixer)

# Output
main_out = fallback(track_sensitive=false, [stripped_mixer, fallback_folder])
output.jack(id="pcm.aura_engine", mksafe(main_out))

When you connect via telnet and call mixer.inputs and help you will see, that mixer.inputs returns in_queue.1 but the server functions for queue have the namespace in_queue. Therefore it is not possible anymore to get a list of available queues and then uses these further down the line.

A solution could be to add an optional namespace argument which would set the namespace for the generated server functions:

in_queue = request.queue(id="raw_queue", namespace="in_queue")
@Loxbie Loxbie changed the title Add a namespace argument for auto generated server functions Feature Request: Namespace argument for auto generated server functions Jun 20, 2024
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

1 participant