last day (15 days later) » 

9:29 PM
Just seeing your updated answer now...
 
I'll be curious to see if it works for you
 
Me too.. implementing your changes now
Well, unless I've done something way wrong (which I'm pretty sure I haven't), I'm still seeing an offset of almost 800 frame with that strategy.
 
hmm
 
With headphones, smaller: 400 frames
 
It might be easier if I forked your repo and pushed my changes or you can commit yours for comparison
 
9:42 PM
Well, since mine definitely doesn't work, maybe if you fork it?
 
I'll do that and once the changes are committed you can try them out
 
Sure. I just pushed mine to a branch called 'nonFunctioningTest', too
One of the huge problems working on this issue has been that different machines seem to behave pretty differently. I'm very much crossing my fingers I made a coding error and you have the solution!
 
I bet you did it right. This is a frustrating problem
 
10:00 PM
Darn. No luck -- still ~700 sample offset. I will, however, have at least one other tester try it. Part of the craziness with all of this is trying to figure out what is dependent on what machine. Also I don't think I've done anything weird to my audio setup on this computer, but who knows.
I believe you said you're on a MBP -- just so I have a data point, what year?
 
I tested it with my MBP's built-in audio, the display audio, and a combination of the two
2019
 
I know there's a huge difference between some of the older machines (mine's 2013) and the newer ones in terms of latencies, although I'm not at all sure where the cutoff year is
FWIW, I tested a simple loopback test on Logic, too (just recording itself doing a click track) and got an offset as well, although not a huge one.
 
To make sure we're comparing the same thing, what/how are you using the measure the sample delta?
 
You mean how am I determining the offset (like the 750 samples)? Just by eyeballing the graphs the sample program is spitting out (assuming the vertical lines are at 1000 sample increments -- more obvious in light-mode)
 
OK. I've done that and tried to measure the peaks in Audacity/ocenaudio but it isn't perfect. And it doesn't line up that well.
The way you're doing it by syncing to a common host time seems to work
 
10:07 PM
Yeah, Audacity seems like a disaster in terms of its default setup. It ships with a 150ms latency compensation on top of the streamLatency, bufferSize, etc. On my machine it was way off on a loop back test.
They're latency compensation code is in here: github.com/audacity/audacity/blob/…
*Their
I'm starting to think that the only rational way to address this is by making the user go through a calibration process where I determine the latency by finding peaks during a loopback test
 
Using my sync method it's off by ~350 samples or so. I think that could be refined but I think measurement is really the only way to do it
If a user has an external DAC there is no way to figure it out other than measurement I don't believe
 
Yes, very true. I had hoped, maybe irrationally, that the stock hardware would report good enough numbers to do non-calibrated sync, but it doesn't seem to be panning out that way.
I'm actually starting to wonder if recording studios I've been in (pre-pandemic...) were actually doing correct compensation for all of this. My guess is no.
 
I will keep hacking away to try and get more accuracy
It's a fun challenge. And frustrating
 
StackOverflow-etiquette-wise, I'm at a loss of what to do here. You very much deserve the bounty for all of the effort and it's close to working on your machine. What do I do in terms of marking the question and giving the bounty? You obviously have more experience here than I do
 
It's completely up to you if you think the question is answered or not. I wouldn't say this is a great solution
If you are happy with the answer you can mark it as accepted, otherwise don't. It's no worry either way
 
10:15 PM
Well, I suppose we can at least get closer to the bounty expiration before making a decision. Anyway, I appreciate your insight very much. And, I look forward to checking out your SFBAudioEngine
 
Sounds good!
 

last day (15 days later) »