monome / crow

Crow speaks and listens and remembers bits of text. A scriptable USB-CV-II machine
GNU General Public License v3.0
162 stars 34 forks source link

ASL is running at half speed #453

Closed trentgill closed 1 year ago

trentgill commented 2 years ago

This was a bug introduced in 3.0

Should be a simple fix, but i'm more worried why it's happening. Need to validate 48kHz sample rate etc.

daveriedstra commented 2 years ago

Hi, just ran into this manifesting as slews on outputs are taking roughly 2x the expected duration to complete. Verified with a timer at 5s / 30s / 1m. Crow v 3.0.1. Happy to do more testing if that would help!

joeweiss commented 1 year ago

Would this be something in the lua files, or something deeper? I might be able to take a stab if someone can point me in the right direction.

trentgill commented 1 year ago

it's very likely some change in C. It's either an issue in lib/slopes.c where timing values are being multiplied by 2, or it could be that the DSP loop has been slowed down by half. One helpful thing would be to measure the output samplerate. This is easily seen on a scope by setting a very fast lfo/oscillator on the output, and looking at the pacing of the staircase'd output.

trentgill commented 1 year ago

Confirmed today that the DAC itself is running at 24kHz when it should be 48kHz. I believe this regression happened when we went to v3.0 but i'm struggling to find a culprit at that point in time. Going to do some quick tests to check that the system clocks are running at their correct speed, and see if there's anything else running at the wrong frequency.