0

Prop Maker featherwing static
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Prop Maker featherwing static

by tychodin on Tue Jan 07, 2020 4:12 am

I just got a prop maker featherwing and paired it with a feather m4, but I'm getting a lot of static through the speaker when I try to play looping sounds. I've tried two different speakers and many different wave files, and I get the same behavior. It is much more noticeable if I change the sample_rate on the audioio.WaveFile, but it's still there regardless of whether I do or not. Is there an obvious thing I should be looking for to fix, or is something broken?

tychodin
 
Posts: 19
Joined: Thu Dec 26, 2019 4:32 am

Re: Prop Maker featherwing static

by tychodin on Tue Jan 07, 2020 9:31 pm

here's a recording of the static.

https://www.youtube.com/watch?v=bubw7wweV3Q

tychodin
 
Posts: 19
Joined: Thu Dec 26, 2019 4:32 am

Re: Prop Maker featherwing static

by tychodin on Wed Jan 08, 2020 2:46 am

i've discovered a bit more about this behavior. it seems to correlate with polling the accelerometer data too often. the code example on the lightsaber build on adafruit.com polls the accelerometer on every execution of the main loop, and this, i believe, is overloading the processor perhaps?

in any case, if i simply add a time.sleep(0.1) before polling, the static goes away, and i can even ramp the sample rate of the sound up without incurring any static. so do i have a faulty board?

tychodin
 
Posts: 19
Joined: Thu Dec 26, 2019 4:32 am

Re: Prop Maker featherwing static

by adafruit_support_carter on Thu Jan 09, 2020 12:38 pm

It sounds like you are following this guide?
https://learn.adafruit.com/lightsaber-f ... g/overview

Are you running the code as is from that guide?

adafruit_support_carter
 
Posts: 14475
Joined: Tue Nov 29, 2016 2:45 pm

Re: Prop Maker featherwing static

by syndicate_x on Fri Jan 10, 2020 5:45 am

Having exact same issue, curious as to the solution.

syndicate_x
 
Posts: 10
Joined: Fri Jan 10, 2020 5:41 am

Re: Prop Maker featherwing static

by adafruit_support_carter on Fri Jan 10, 2020 1:41 pm

I just wired up a Feather M4 Express with a PropMaker and tried out the lightsaber code from the guide:
https://learn.adafruit.com/lightsaber-f ... g/software
and it ran OK for me. I did not need to add any delay.

Did you put your wave files in a folder named sounds in your CIRCUITPY folder?

adafruit_support_carter
 
Posts: 14475
Joined: Tue Nov 29, 2016 2:45 pm

Re: Prop Maker featherwing static

by tychodin on Fri Jan 10, 2020 5:28 pm

yes, i'm following that guide, and yes i put all the sounds into a sounds folder. i even tried a third speaker just to make absolutely sure, and it was staticky as well.

then i changed to using a 6dof breakout on the i2c bus instead of the built-in one, and while it was "less" staticky when polling that on every loop, the static was still there. and there's even a lot of static in the startup sound. this leads me to further believe there's something overloading the DAC.

so then i tried using the beta3 version of circuitpy 5.0 and using the audiocore and mixer objects. the "static" is gone, but i get very short popping noises whenever i change the level of a voice in a mixer.

tychodin
 
Posts: 19
Joined: Thu Dec 26, 2019 4:32 am

Re: Prop Maker featherwing static

by syndicate_x on Fri Jan 10, 2020 11:32 pm

I believe it is a DAC issue as well. I was able to fix it with the delay.

syndicate_x
 
Posts: 10
Joined: Fri Jan 10, 2020 5:41 am

Re: Prop Maker featherwing static

by jepler on Tue Jan 14, 2020 3:35 pm

Hi all. I am working on the audio functionality of CircuitPython for Adafruit so that we can have better audio output in 5.x.

Can you let me know which specific CircuitPython versions you are using? You can find this by using the instructions in this guide: https://learn.adafruit.com/welcome-to-c ... n/the-repl

Is the static affected by the position of the volume potentiometer on the Prop Maker board? how are your boards powered, USB or battery? I have experienced that speaker amplifiers can behave quite differently depending on volume and voltages.

Also, can you let me know whether the problems occur with the exact code *and wave files* from the guide, or whether you are substituting other wave files? (substituting wave files SHOULD be just fine, but with the M4s we have seen a situation in the past where different RawSample data actually was the difference between working properly and improperly)

Finally, @tychodin thanks for the tip about introducing a small delay. If I discover why this could make a difference, I'll let you know.

jepler
 
Posts: 10
Joined: Mon Oct 28, 2013 4:16 pm

Re: Prop Maker featherwing static

by tychodin on Wed Jan 15, 2020 1:40 pm

hey jepler,


jepler wrote:Is the static affected by the position of the volume potentiometer on the Prop Maker board? how are your boards powered, USB or battery? I have experienced that speaker amplifiers can behave quite differently depending on volume and voltages.


this was on battery and/or usb. it seems unrelated to the power source. the position of the potentiometer also didn't appear to affect/eliminate the static.

jepler wrote:Also, can you let me know whether the problems occur with the exact code *and wave files* from the guide, or whether you are substituting other wave files? (substituting wave files SHOULD be just fine, but with the M4s we have seen a situation in the past where different RawSample data actually was the difference between working properly and improperly)


yeah this was apparent even with the exact code and wave files from the guide.

as for the version of circuitpy, i was originally using 4.something, and i upgraded to 5.0.0 beta3 to get access to the mixer methods. i will double-check tonight whether there is any difference in the static between versions. i suspect the delay made some difference because of garbage collection, but that is just a guess.

if you're working on the audio methods, maybe you could look into the other issue i also found that adding voices to the mixer object reduces the total gain of all voices to 1/n of maximum volume. so with 3 voices, each voice is 1/3rd as loud as it should be even with .level = 1.

tychodin
 
Posts: 19
Joined: Thu Dec 26, 2019 4:32 am

Re: Prop Maker featherwing static

by jepler on Thu Jan 30, 2020 11:21 pm

Hello. I think I may have produced the same or similar issue to what has been reported in this thread. We're also tracking it as a github issue here: https://github.com/adafruit/Adafruit_Le ... ssues/1010

I think that the bug lies in the core of CircuitPython, though a modified wave file may work around or at least minimize the bug's effects.

If you can, please let me know whether this wave file improves things. This would be helpful in confirming or refuting my theory:

https://github.com/adafruit/Adafruit_Learning_System_Guides/files/4137414/idle-trimmed.zip

jepler
 
Posts: 10
Joined: Mon Oct 28, 2013 4:16 pm

Re: Prop Maker featherwing static

by V2man on Fri Jan 31, 2020 1:56 am

@ jepler Are you interested in noise while playing mp3 files too?

V2man
 
Posts: 703
Joined: Mon Dec 03, 2018 12:38 am

Re: Prop Maker featherwing static

by jepler on Fri Jan 31, 2020 9:54 am

Yes, I'd likely be a person to look at problems with MP3 playback as well.

jepler
 
Posts: 10
Joined: Mon Oct 28, 2013 4:16 pm

Re: Prop Maker featherwing static

by tychodin on Fri Jan 31, 2020 1:00 pm

jepler wrote:Hello. I think I may have produced the same or similar issue to what has been reported in this thread. We're also tracking it as a github issue here: https://github.com/adafruit/Adafruit_Le ... ssues/1010

I think that the bug lies in the core of CircuitPython, though a modified wave file may work around or at least minimize the bug's effects.

If you can, please let me know whether this wave file improves things. This would be helpful in confirming or refuting my theory:

https://github.com/adafruit/Adafruit_Learning_System_Guides/files/4137414/idle-trimmed.zip


i'll give that new wave file a shot. like the poster on github, i was also able to eliminate the static with the mixer, but i still get pops pretty frequently (using the untrimmed idle sound) when the mixer's voice levels are being changed.

tychodin
 
Posts: 19
Joined: Thu Dec 26, 2019 4:32 am

Please be positive and constructive with your questions and comments.