docker: add ENABLE_NQPTP to opt out of starting NQPTP - #2288
Merged
Merged
Conversation
The container launcher starts NQPTP for every AirPlay 2 instance. When several AirPlay 2 instances run on one host they should share a single NQPTP (it needs exclusive use of ports 319/320 and is multi-client), so the extra per-instance NQPTPs are unwanted. Add an ENABLE_NQPTP environment variable, mirroring the existing ENABLE_AVAHI: set ENABLE_NQPTP=0 to skip starting NQPTP, for instances that use a separate, shared NQPTP. The default is unchanged -- NQPTP is started as before.
Owner
|
Thanks for this! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
Adds an
ENABLE_NQPTPenvironment variable to the Docker image's launcher (docker/run.sh) so a container can be told not to start its own NQPTP.Why
The launcher starts NQPTP for every AirPlay 2 container. When several AirPlay 2 instances run on one host they should share a single NQPTP — it needs exclusive use of ports 319/320 and is multi-client (it keeps a separate clock per shared-memory interface name). Today, running one instance per room means every container also starts its own NQPTP, and they contend for 319/320. The only way to avoid it was a custom entrypoint.
With this change, you run one dedicated NQPTP (e.g. a sidecar with
entrypoint: ["/usr/local/bin/nqptp"]) and setENABLE_NQPTP=0on each instance container:Notes
ENABLE_AVAHIconvention in the same script.ENABLE_NQPTPunset (or1), NQPTP is started exactly as before, so single-instance users and existing setups are unaffected.--service-type=classic/airplay1) already skip NQPTP; that is unchanged.Testing
Built container runs of the image with the modified launcher:
ENABLE_NQPTP=0→ the launcher does not print "Starting NQPTP" and nonqptpprocess is started;sh -n docker/run.shis clean.This supports the multi-instance-per-host setup discussed in #2266.