recorder example glitches?

Status
Not open for further replies.

mxxx

Well-known member
I've been playing around with the "Recorder.ino" example sketch from the audio library today when i ran into a weird glitch, which seems to happen only during the first 1-2 seconds of the recording, roughly at the same time, after which things proceed smoothly. i've attached two screen shots of a recorded sine wave, so it can be seen easily:


1.jpg

2.jpg


it kind of looks like as if recording stops intermittently; the glitchy part seems to be 512 samples long, invariably.

anyone else seeing this? it doesn't happen always, but in roughly ~ 60% of attempts (this is with a san disk ultra 16GB, which seems to behave nicely otherwise. i've tried with teensy both 1.23 and 1.25; and at 96MHz and 120MHz, doesn't seem to make a difference).
 
The Recorder example is supposed to automatically deal with SD card latency. The queue object is supposed to buffer the audio if the SD card takes too long.

Maybe there's a bug somewhere?
 
Looks like one of the SC card write delays, see e.g. https://forum.pjrc.com/threads/30100-Micro-SD-Card-performance

looks like it. i was just confused because i knew it had worked fairly glitch-free before. i've searched the house for various uSD cards, and it turns out (it seems) it's indeed the card. i've put in another sandisk ultra (8GB), which works flawlessly*, at least for mono recording; whereas a transcend class 10 4GB gives similar glitches, etc... so it's a bit of lottery.


* edit. sb
 
Last edited:
The queue object is supposed to buffer the audio if the SD card takes too long.

fwiw .. i've increased AudioMemory() to 150 (the example has 60), which seems to have improved things quite a bit. will need to test a little more, but looks as if that makes all the difference. thanks for the clue!
 
Would you try uncommenting those timing print 2 lines in the Recorder example and capture the results in the Arduino Serial Monitor?

How long are those lengthy SD writes *really* taking?
 
Im curious about the details of this as well, and have been looking into a possible multi codec solution, the VS1053 board I got from adafruit last year and totally forgot about when I started using teensy audio board actually seems like it could be worth testing. It has mp3 and other codec support as well as a midi synthesizer with reverb and stereo enhance effects that seem like interesting things to check out. I even checked out the midi demo on the manufacturer website and I was really impressed with the sound of it for MIDI.
 
Status
Not open for further replies.
Back
Top