Forum Rule: Always post complete source code & details to reproduce any issue!
Page 6 of 8 FirstFirst ... 4 5 6 7 8 LastLast
Results 126 to 150 of 177

Thread: WAV playback sounds distorted

  1. #126
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    562
    I had the same problem, think Paul posted alternative build in audio thread

  2. #127
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,139
    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.

  3. #128
    Senior Member
    Join Date
    Apr 2014
    Posts
    319
    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 by Teenfor3; 01-23-2015 at 05:13 PM.

  4. #129
    Senior Member
    Join Date
    Jul 2014
    Posts
    210
    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.
    Attached Files Attached Files

  5. #130
    Senior Member
    Join Date
    Jul 2014
    Posts
    210
    BTW, you can comment out any one of the four wav objects and it will play accordingly.

  6. #131
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,963
    Quote Originally Posted by dsparks View Post
    CPU usage max with 3 wav objects is around 120. With the fourth its around 140.
    That's 20 or 40 too much. The usage max is in %, so 140% means the teensy is not fast enough to play it.
    Again: use flash or SPIflash.

  7. #132
    Senior Member
    Join Date
    Jul 2014
    Posts
    210
    Youre missing my point.

    Even at 3 wav objects its at 120% MAX peak usage. Avg is like 80%. And doing fine.

  8. #133
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,963
    No... at 120% you have luck, that's all. the buffers do their job... but at 140, luck is not enough...

  9. #134
    Senior Member
    Join Date
    Jul 2014
    Posts
    210
    Noted.

    So 4 voice and or more polyphonic play back from SD card is NOT possible then.

  10. #135
    Senior Member
    Join Date
    Jul 2014
    Posts
    210
    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".

  11. #136
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,963
    The Bitrate of your file is 1411kBit/s. 1411*4 = 5644kBit/s.
    How fast is your card with SPI?

  12. #137
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,963
    You can double your luck with mono

    Funny, your 40BP looks like mono in audacity..both channels look identical (?) So this file simply wastes time...
    Last edited by Frank B; 01-23-2015 at 07:21 PM.

  13. #138
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,139
    Quote Originally Posted by dsparks View Post
    So 4 voice and or more polyphonic play back from SD card is NOT possible then.
    Not with that code.

    Did you ever run the card test example, in the hardware testing folder?

  14. #139
    Senior Member
    Join Date
    Jul 2014
    Posts
    210
    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

  15. #140
    Senior Member
    Join Date
    Apr 2014
    Posts
    319
    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.

  16. #141
    Senior Member
    Join Date
    Jul 2014
    Posts
    210
    I never have issues adding or removing files on the SD card.

  17. #142
    Senior Member
    Join Date
    Apr 2014
    Posts
    319
    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

  18. #143
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    562
    Quote Originally Posted by dsparks View Post
    Noted.

    So 4 voice and or more polyphonic play back from SD card is NOT possible then.
    I got a solid 5 voices without maxing out with 44khz mono RAWs or WAVs. Then I moved them to flash and got 8 or 9

  19. #144
    Senior Member
    Join Date
    Jul 2014
    Posts
    210
    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?

  20. #145
    Senior Member
    Join Date
    Jul 2014
    Posts
    210
    Converted my files to mono RAW 44.1k

    And still can NOT play 4 samples polyphonic!

  21. #146
    Senior Member
    Join Date
    Jul 2014
    Posts
    210
    Im using Kingston 4Gb. mSD HC class 10 cards.

    Formatted as FAT32

  22. #147
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    562
    Quote Originally Posted by dsparks View Post
    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

  23. #148
    Senior Member
    Join Date
    Jul 2014
    Posts
    210
    I should be fine. But Im not.

    I have 7 Teensys with Audio adapters.

    Same issue across the board.

  24. #149
    Senior Member
    Join Date
    Jul 2014
    Posts
    210
    Quote Originally Posted by dsparks View Post
    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?

  25. #150
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    562
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •