Out-of-sync issue

Hello everyone,

I compared the recordings of my Teensy board and a Tascam handy recorder.

- I set both recorders to 48k / 16 bit
- started recording on both devices and hand clapped
- recorded for 30 minutes, hand clapped again and stopped the recording
- I imported the files on my laptop's multitrack software
- aligned the first clap

...and the second clap was not at sync: the Teensy recording was a few seconds shorter.

Does anybody know why?
 
Unless you made intentional core file modifications, the Teensy records at a default rate of 44100, not 48000. Playing a recording made at this rate back at 48000 will cause it to complete in 92% of real time (faster).

Mark J Culross
 
You'll have to do it all over again with a stop-watch to find out which one has the poor time-keeping...
 
If "a few seconds" is "three", then the rate difference is 0.1667%, or 1667 parts per million. That is a more than I would expect from a pair of crystal-controlled clocks but not unheard-of. The project I work on is sensitive to timing precision and accuracy across multiple controllers (all Kinetis K60 and K66), and in our application we see differences in the 50-60 PPM range regularly.

Capacitor loading (easy to adjust in classical Kinetis parts like the Teensy 3 series) can affect these rates. I don't know about the Tascam and have not found a way to perform fine adjustments to the RT1062 clock rate in the Teensy 4 series (though to be honest, I have not looked closely as I've been swamped by work the last few years).
 
Based almost entirely on this post, a typical Teensy 4.1 might be expected to run at about -20ppm. Given that Tascam are pretty reputable, I'd be surprised if their kit is dramatically worse. A one second difference would be 555ppm, well outside what one might expect.
Ok so, if I do this:
unsigned long sampleRate = 48000;
...the module would record at 44.1k anyway?
Yes, absolutely - what made you think otherwise? I'd love for unsigned long myBankBalanceInGBP = 1000000; to work, but sadly not...

Kidding aside, you have to find the cores/teensy4/AudioStream.h file in your system, and edit #define AUDIO_SAMPLE_RATE_EXACT 44100.0f to 48000.0f to change the sampling frequency of the Audio library. Other changes may be needed, but as you haven't posted your code it's impossible to say. If you do so, please use the </> code tag to make it readable, and it should be a single simple file which could be compiled and run using the Arduino IDE without esoteric hardware if someone wanted to test it.
 
Hello guys, thanks for your help.
I managed to make it work.
I changed the #define AUDIO_SAMPLE_RATE_EXACT 48000.0f on the AudioStream.h
and a few modifications on the control_sgtl5000.cpp

Thank you!
 
Back
Top