WAV playback sounds distorted

Status
Not open for further replies.
At this moment, there are no more known/reproducible bugs, as far as I know.

I'm not saying the wav player is necessarily bug free, though it did sound pretty good the other day after fixing that startup bug with stereo playing! I'm only saying I'm not aware of any more reproducible bug reports. There are a lot of messages about all sorts of challenges.

If any of those are actually bugs, I really need reproducible code+wav files posted.
 
Problems copying files to sdcard from PC and formatting.does it work for you always I am on WiFi with bad signal post may not go.

Back at base again.....As I posted on #121 I got the problem when after copying new files to the SDcard or reformatting and copying all the files back on together. But I cannot say it does it exacly the same problem each time because it doesn't happen with the same files and after doing it a few time it eventually becomes OK. If I cannot reproduce the problem reliably, can any other users please confirm this this doesn't happen with them. All I am doing is copying files on with PC and when playing with the teensy test routine we have been using, I started to get the problem of gaps between the files that wasn't there before. And reformatting and copying didn't cure it initially but that is all I did for a few times and eventually it was OK.
 
Last edited:
You might like this one then.

Files attached.

40BP.wav
PlayWavFromSD_Poly_Mixer_TEST.ino


The sketch loops 4 mixed wav objects at 100ms and pauses directly after. Then repeats.

I should say its suppose. It only plays the first 3 and the fourth one bit crushes and sounds like dirt.

Then it repeats and plays the first three properly. And continues to destroy the fourth wav object.


I really hope someone can reproduce this one! As soon as you remove the fourth wav object it works great.

CPU usage max with 3 wav objects is around 120. With the fourth its around 140. CPU usage avg while

running is around 70-80.
 

Attachments

  • PlayWavPolyTEST.zip
    111.1 KB · Views: 84
Youre missing my point.

Even at 3 wav objects its at 120% MAX peak usage. Avg is like 80%. And doing fine.
 
CPU readings while doing two voice polyphonic playback from SDcard:

avg 47% peak: 89%


Looks like one can only reliably do 2 voice. 3 voice if you want to try your hand at "luck".
 
You can double your luck with mono :rolleyes:

Funny, your 40BP looks like mono in audacity..both channels look identical (?) So this file simply wastes time...
 
Last edited:
Ok I ran the test. Here are my results:


SD Card Test
------------
SD card is connected :)
Card type is SDHC
File system space is 3972.01 Mbytes.
SD library is able to access the filesystem

Reading SDTEST1.WAV:
Overall speed = 0.74 Mbyte/sec
Worst block time = 1.32 ms
45.50% of audio frame time

Reading SDTEST1.WAV & SDTEST2.WAV:
Overall speed = 0.61 Mbyte/sec
Worst block time = 3.09 ms
106.47% of audio frame time

Reading SDTEST1.WAV & SDTEST2.WAV staggered:
Overall speed = 0.61 Mbyte/sec
Worst block time = 2.59 ms
89.13% of audio frame time

Reading SDTEST1.WAV, SDTEST2.WAV, SDTEST3.WAV:
Overall speed = 0.61 Mbyte/sec
Worst block time = 4.70 ms
162.10% of audio frame time

Reading SDTEST1.WAV, SDTEST2.WAV, SDTEST3.WAV staggered:
Overall speed = 0.61 Mbyte/sec
Worst block time = 3.50 ms
120.63% of audio frame time

Reading SDTEST1.WAV, SDTEST2.WAV, SDTEST3.WAV, SDTEST4.WAV:
Overall speed = 0.61 Mbyte/sec
Worst block time = 6.29 ms
216.83% of audio frame time

Reading SDTEST1.WAV, SDTEST2.WAV, SDTEST3.WAV, SDTEST4.WAV staggered:
Overall speed = 0.61 Mbyte/sec
Worst block time = 4.41 ms
151.96% of audio frame time
 
I am getting alot of "buzzing" playing the sketch from the zip, playing your file. I don't get any buzzing playing my files. Probably "alising"????????
I took out all the filter connections as played it as the test sketch we were doing yesterday and to me the file plays fine. Stops and starts between the files are tight.....no gaps and I thing it sounds a well as it can be...someone beating a drum..?????

I did see one or 2 glitches at the tail end of the file playing before the next start............but random can't repeat it "repeatably". I think that is the smae as sometimes gives a random gap between the files. Which I thought yesterday was in some way due to the files on the SD whether contiguous or not.....I seemed to sort it yesterday by formatting and copying several times. All I did today was use the same SDcard as I had yesterday and copy your latest 40BP.wav to it. I didn't re format the SD and copy all my files plus yours to the SD all in one paste.

My question earlier, I never got an answer yet.....Does anyone else have problems adding files to SDcards. Does it work always all times. Paul, do you have any problems.?.....How would you have added the file to the SD.
 
How did you test that you don't have any issues...????? Are you getting any random glitches. are all your files playing clean all the time no matter how often you add or delete files.

I don't have any issues adding or removing files either. All my files on my SDcard look OK. I can open them them with various software. And they all play on Teensy both SD adaptor and Audio Adaptor.

The problem is the problem Ihave been trying to highlight this last few days and there are numerous posting throughout this forum was various glitches and gaps generally noticed at random some times in sequences. And most others seem to cure this type of problem by formatting na copying the files on again or using the recomended Sandisk SD cards. And as my posting earlier in this thread suggest.....I tested the latest fix Paul did and thought all was OK. I only had the 4 test files on the SD. The next evening I copied the rest of my sound files on to my SD and then I noticed I was getting gaps between playing actually the test files and most of mine played OK. I formatted and copied several time and the problem went away. I amd using the same SD tonight with your file copied on and it works. I only seen one or 2 random glitches generally plays OK
 
Thats awesome Pensive.

Im modifying all my WAVs to mono RAWs I think.

When you say "moved them to flash", are you referring to using the memory module that you solder on yourself?
 
Thats awesome Pensive.

Im modifying all my WAVs to mono RAWs I think.

When you say "moved them to flash", are you referring to using the memory module that you solder on yourself?

Yes. I also had envelopes on them when I got those results from the flash rom. Frank b has added FIFO optimisations since I have yet to test. I'm not sure why you are having trouble, my card is fat32, when I modify its contents I format and then copy each file one by one by hand, in order (this helps with the flash code), but apart from that nothing magic. I've got a 30fps LCD update loop and a 150hz ish sequencer loop running too.

You should be fine
 
Ok I ran the test. Here are my results:


SD Card Test
------------
SD card is connected :)
Card type is SDHC
File system space is 3972.01 Mbytes.
SD library is able to access the filesystem

Reading SDTEST1.WAV:
Overall speed = 0.74 Mbyte/sec
Worst block time = 1.32 ms
45.50% of audio frame time

Reading SDTEST1.WAV & SDTEST2.WAV:
Overall speed = 0.61 Mbyte/sec
Worst block time = 3.09 ms
106.47% of audio frame time

Reading SDTEST1.WAV & SDTEST2.WAV staggered:
Overall speed = 0.61 Mbyte/sec
Worst block time = 2.59 ms
89.13% of audio frame time

Reading SDTEST1.WAV, SDTEST2.WAV, SDTEST3.WAV:
Overall speed = 0.61 Mbyte/sec
Worst block time = 4.70 ms
162.10% of audio frame time

Reading SDTEST1.WAV, SDTEST2.WAV, SDTEST3.WAV staggered:
Overall speed = 0.61 Mbyte/sec
Worst block time = 3.50 ms
120.63% of audio frame time

Reading SDTEST1.WAV, SDTEST2.WAV, SDTEST3.WAV, SDTEST4.WAV:
Overall speed = 0.61 Mbyte/sec
Worst block time = 6.29 ms
216.83% of audio frame time

Reading SDTEST1.WAV, SDTEST2.WAV, SDTEST3.WAV, SDTEST4.WAV staggered:
Overall speed = 0.61 Mbyte/sec
Worst block time = 4.41 ms
151.96% of audio frame time

Is Overall speed = 0.74 Mbyte/sec BAD or GOOD for my SD test?

Maybe its my SD cards?
 
Ok I checked your code.

Things you are doing I am not:

1) unmuting the line out
2) using DAC output
3) using delay() in your loop.

Try a while (or if then) loop for each wav, where it checks if it is playing, and if not, play it.

This a much more elegant looping test method which doesn't freeze your Teensy.
 
Status
Not open for further replies.
Back
Top