Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SD Playback Is Buzzy/Static #37

Closed
chipaudette opened this issue Jun 10, 2021 · 6 comments
Closed

SD Playback Is Buzzy/Static #37

chipaudette opened this issue Jun 10, 2021 · 6 comments
Assignees
Labels
Milestone

Comments

@chipaudette
Copy link
Member

The example sketch SDWavPlayer generates lots of buzz and static. While the system functions, the audio is so bad that it is unusable.

This was first reported on the forum: https://forum.tympan.org/t/sd-wav-file-playback/300/4.

In the forum post, I show a sketch that relies primarily on the Teensy audio library for SD operations (not the Tympan audio library). I have confirmed that on my RevD this code produces clean audio. I have confirmed that switching over to the Tympan library (in my case, the develop branch using the beta #5 teensyduino) results in the audio exhibiting all the buzz/static.

Since it occurs when using the Tympan_Library and not when using just the Teensy Audio library, the problem must be in our code.

@chipaudette chipaudette added this to the RevE Release milestone Jun 10, 2021
@chipaudette chipaudette self-assigned this Jun 10, 2021
@chipaudette
Copy link
Member Author

Approach:

  1. I should digitally pipe the SD audio out the USB audio path to the PC to see exactly what the samples are so that I can see what kind of distortion is being caused. Maybe half the block is missing? Maybe just one sample? Maybe the samples in the block are backwards? Looking at the raw audio might give some clue about what to look for in the code.

  2. If the results of step 1 do not point to an obvious problem, the next step is to re-port the SD player class from the Teensy library into the Tympan library. My original port was way before T4 existed. I believe (?) that Teensy has made many changes, perhaps in response to T4 or in response to the (beta) update to the underlying SD classes.

@chipaudette
Copy link
Member Author

If anyone wants to volunteer to chase this down, I'm happy to make someone else the assignee!

@biomurph
Copy link
Member

Just for clarity, are you saying that:

  1. Teensy Audio Library produces clean audio when piping from the SD card to the USB
  2. Tympan Audio Library produces noisy audio when piping from the SD card to the USB

?

I would love to help but I don't know anything about how to read WAV files. Is there a sample number associated with the data? Does it need to be graphed?

@chipaudette
Copy link
Member Author

Sorry for confusion. USB has nothing to do with the problem; the problem is SD out to the headphone jack. I'm presuming that I will also see the bad audio via USB Audio output, but the bad audio is not caused by USB audio output.

In truth, I don't think I that I will lean much from my proposed step 1. I think that I'm going to have to simply blindly re-port the SD code from Teensy form into Tympan form.

@chipaudette
Copy link
Member Author

I think that i've now fixed this problem. I can also now record and play at the same time. I need to create an example for the library.

@chipaudette
Copy link
Member Author

Example created!

https://github.com/Tympan/Tympan_Library/tree/main/examples/02-Utility/SD_Card/SdPlay_and_SDWrite

I think that this problem is now solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants