Problem with Audio playback after several hours

Status
Not open for further replies.

nlecaude

Well-known member
Hello,

I'm making an installation where I have 2 Teensy 3.1 with audio board. They each play a stereo file and I use a pin and and interrupt to sync playback. This works fine for several hours, then at some point I start having dropouts. Afterward, the dropouts continue even if I power cycle. Could it be heat ?

The first time it did this I swapped the SD cards for new ones and it worked for a few hours but it's failing again.

Thanks !

Here's the code: https://github.com/natcl/RpmCounter/tree/master/examples/RpmCounterAudio
 
I also wanted to mention that I tried with the new SD optimizations and it's worse, audio stutters constantly with this enabled...
 
Also, once there are dropouts, reformatting the card seems to fix the issue...
In my case that's not really practical as this is meant to run 24/24....
 
Afterward, the dropouts continue even if I power cycle.

After the card is not playing correctly, what happens if you try to access the card from your PC and play the audio?

Whether your PC can play the sound correctly could at least help isolate the problem to something wrong on the Teensy side, or an actual problem with the SD cards.
 
I just tried with the first pair of card that was misbehaving (which I did not reformat) and they seem to play fine on my mac.
I really find it odd that reformatting the card fixes the issue for a while...
 
If the problems would not persist through power cycling Teensy I could propose that something is running out of memory in some way or another;

quick flick through your sketch and source code behind AudioPlaySdWav object and I'd wonder (if not for persistence through reset) if SD library doesn't do as much as it should for '.close()'

not likely the problem but I think that AudioMemoryUsageMax() *may* report 8 pretty consistently with your project and your project *may* benefit from bumping up the amount of memory blocks you are assigning until AudioMemoryUsageMax() *always* reports (at least) one less than you assign.
 
SD cards contain microcontrollers to deal with bad blocks, etc. It's not hard to imagine that anything that accesses an SD card that doesn't perfectly match the protocols popular platforms implement would send the poor little SD microcontroller into a bad state. Also, power cycling a board with an SD card can definitely affect the SD card, much like ripping a flash drive out without unmounting it first.

Does the audio start glitching after a precise amount of time? If so, I'd wonder if there's some counter that's overflowing.

I wonder if there's some sort of "housekeeping" the SD card wants to do, but it's too busy to do it. I have no idea if SD cards actually do this sort of thing.
 
Status
Not open for further replies.
Back
Top