I think ALSA would be better if it had actual documentation for more than like 10% of it.
-
@aeva Did you see
https://stackoverflow.com/questions/76714223/alsa-midi-getting-precise-timestamps-on-input ?It seems to explain this, I guess.
-
-
@jens @sixohsix @mcc ok let's rephrase the question: "I have a set of packets that have time stamps. Half of them have a known interval, but have an arbitrary uncorrelated origin. The other half have an unknown interval, and an arbitrary uncorrelated origin. In both cases, the origin can randomly *change* while playing. How do I put all of these into one common reference frame?"
The answer of "ALSA uses one of your system's clocks internally!" does not answer this question.
-
@jens @sixohsix @mcc ok let's rephrase the question: "I have a set of packets that have time stamps. Half of them have a known interval, but have an arbitrary uncorrelated origin. The other half have an unknown interval, and an arbitrary uncorrelated origin. In both cases, the origin can randomly *change* while playing. How do I put all of these into one common reference frame?"
The answer of "ALSA uses one of your system's clocks internally!" does not answer this question.
-
-
@aeva @jens @sixohsix I think RtMidi's solution to this is "each MIDI source/sink has a different, internally consistent but uncorrelated timescale, and you figure this out yourself" and it's been a real long time but I *think* CoreMidi uses the Darwin kernel's monotonic clock but they had some of the best audio programming engineers ever work on keeping it consistent…? Frankly I'm not sure there's a better solution than RtMidi's because the API doesn't know your program requirements
-
@aeva @jens @sixohsix I think RtMidi's solution to this is "each MIDI source/sink has a different, internally consistent but uncorrelated timescale, and you figure this out yourself" and it's been a real long time but I *think* CoreMidi uses the Darwin kernel's monotonic clock but they had some of the best audio programming engineers ever work on keeping it consistent…? Frankly I'm not sure there's a better solution than RtMidi's because the API doesn't know your program requirements
@aeva @jens @sixohsix In a sense *MIDI itself* is supposed to be the solution to this problem, you're supposed to connect all your equipment via MIDI cable and *the MIDI protocol* is what puts everything on a single clock with a single origin moment. And then we replaced MIDI transport with USB which not only unsolves the problem but probably adds additional timing uncertainty.
Maybe MIDI-2 solves this, but I don't see anyone using it and I'm concerned about the requirement to register devices.