Git Product home page Git Product logo

Comments (5)

mhite avatar mhite commented on August 25, 2024

Just poking around @honusz Stagelinq repo and saw this:

https://github.com/honusz/StageLinq/blob/beatinfo/services/TimeSync.ts

Seems to just be a service for getting the uptime of the device?

from go-stagelinq.

honusz avatar honusz commented on August 25, 2024

Just poking around @honusz Stagelinq repo and saw this:

https://github.com/honusz/StageLinq/blob/beatinfo/services/TimeSync.ts

Seems to just be a service for getting the uptime of the device?

Oh, that was some remnant of some test exploring the service. I think I just copied beatinfo module over and was trying to get a response.

I've actually made a bit of progress with it, just haven't pushed the code up to Github.

I've been meaning to do a write-up about where I've gotten to, maybe if I get a chance tmw.

I think the service has something to do with either syncing clocks between devices, or determining latency.
When I push the proper code it will give a better idea. I'm like one step away from having it figured out, so I'm dying to get some input on it.

from go-stagelinq.

mhite avatar mhite commented on August 25, 2024

@honusz - Gotcha. Looking forward to seeing what you've discovered thus far!

from go-stagelinq.

honusz avatar honusz commented on August 25, 2024

@mhite sorry, I haven't forgotten, just been a bit busy.

It seems like the exchange of messages goes something like this:

Device sends a message,
4 bytes - message length
4 bytes - 0x1 (could either be a code for a 'request' or just the number of following 8-byte fields
8 bytes - bigint of the device's clock. Not sure it has any real value, it's just a running clock.

The software (soundswitch or timecode) replies:

4 bytes - message length
4 bytes - 0x2
8 bytes - bigint that the device sent
8 bytes - bigint timestamp that it received the message at (Unix epoch in ms)

That's it really. The software sometimes reverses this by sending a request with its epoch-in-ms time back as the first 8-byte bigint field, and the device responds with the timestamp (using its clock) of when it received the message.

I suppose the simplest utility this has is just letting the players know what latency there is between them.

I need to play around with it a bit more, but I think you can make the clock shift, like, bring the two clocks together. This might be nonsense, and just the result of some mistakes I made in some test replies.
I'm trying to strip down the JS library a bit and make a more performant experimental version, where it'll be a bit easier to experiment with new features and things that require tighter timing.

from go-stagelinq.

mhite avatar mhite commented on August 25, 2024

@honusz - No problem -- this is great information and certainly enough for me to get started poking at this, too! Thank you!

from go-stagelinq.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.