-
Notifications
You must be signed in to change notification settings - Fork 134
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
Prep work for PTP #49
Comments
It seems that Python 3.7 might be necessary for PTP. Example: def time_monotonic_ns(self):
# From PEP 564: Linux 1MHz. Win 10MHz. my macOS 88ns, ~11.3MHz
# The following if/else is nearly twice as slow as a direct call...
if sys.hexversion >= 0x3070000:
#Needs Python >= 3.7
return time.monotonic_ns()
else:
return int(time.monotonic() * 1e9) We could structure this as a try: call, and try |
ahh sorry not replying before. I'm testing this on Windows only, and have not run into any issue regarding port permissions |
I would just drop support for Python < 3.7. E.g. 3.6 is quite old and not receiving security security updates in just a few months https://en.wikipedia.org/wiki/History_of_Python#Table_of_versions |
While I agree that's true, it's still a common baseline for many OSes that
people might be on. 3.6 is still solid. I guess it's a balance of
convenience vs speed (if we use the example above). Python doesn't have an
#ifdef that I know of.
I didn't perf test a try:, only the if/else.
|
A quick search suggests this is a way around the problem:
https://stackoverflow.com/a/12524906
|
I'm for dropping Python 3.6 support :) |
I ended up doing this in the head of the PTP module: if sys.hexversion >= 0x3070000:
# Needs Python >= 3.7 - define only once at startup.
def time_monotonic_ns():
# TODO: calibrate a timing loop at startup to precalculate avg call time
# From PEP 564: Linux 1MHz. Win 10MHz. my macOS 88ns, ~11.3MHz
return time.monotonic_ns()
else:
def time_monotonic_ns():
return int(time.monotonic() * 1e9) This means we can have both. Win. |
@glmnet @LewdNeko
First question: what happens on your systems when you run PTP on port 319+320?
Do you need root privileges/run sudo? Or does it work OK to say, bind to '0.0.0.0' / '::'
I've not found a way that airplay sends PTP to any other port. I think the ports are baked in.
The text was updated successfully, but these errors were encountered: