0

Strange sound when using audioio.AudioOut
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Strange sound when using audioio.AudioOut

by ChrisDS on Sun Dec 06, 2020 3:16 pm

So I've been experimenting with audioio and I noticed this odd laser/woosh sound. I figured it was a bug in my own code and that I'd figure it out later. However, after debugging I found that the sound occurs even with this small snippet of code.

I'm running this code on a pybadge running `Adafruit CircuitPython 6.0.0 on 2020-11-16; Adafruit Pybadge with samd51j19`.

When I power on the pybadge the woosh sound will player after a few seconds.

Laser/woosh sound
Code: Select all | TOGGLE FULL SIZE
import board
import digitalio
import audioio
 
speakerEnable = digitalio.DigitalInOut(board.SPEAKER_ENABLE)
speakerEnable.switch_to_output(value=True)
audio = audioio.AudioOut(board.SPEAKER)
 
while True:
    pass


No Laser/woosh sound
Code: Select all | TOGGLE FULL SIZE
import board
import digitalio
import audioio
 
speakerEnable = digitalio.DigitalInOut(board.SPEAKER_ENABLE)
speakerEnable.switch_to_output(value=True)
#audio = audioio.AudioOut(board.SPEAKER)
 
while True:
    pass


With piezo on pin A0 (no woosh sound)
Code: Select all | TOGGLE FULL SIZE
import board
import digitalio
import audioio
 
self.audio = audioio.AudioOut(board.A0)
while True:
    pass
       


However, if I connect a piezo to pin A0 then there is no woosh sound. Does anyone know what's going on?

ChrisDS
 
Posts: 3
Joined: Wed Oct 07, 2015 12:21 am

Re: Strange sound when using audioio.AudioOut

by siddacious on Mon Dec 07, 2020 3:09 pm

I'm not sure but it sounds like a bug! Please create an issue here detailing what you're seeing:

https://github.com/adafruit/circuitpython/issues/new

siddacious
 
Posts: 406
Joined: Fri Apr 21, 2017 3:09 pm

Re: Strange sound when using audioio.AudioOut

by kevinjwalters on Mon Dec 07, 2020 6:21 pm

A video or recording of this would be interesting to see/hear.

kevinjwalters
 
Posts: 980
Joined: Sun Oct 01, 2017 3:15 pm

Re: Strange sound when using audioio.AudioOut

by imhavoc on Thu Jun 17, 2021 9:44 am

I'm experiencing the exact same symptom with Itsy Bitsy M4 and STEMMMA speaker. I'll try to shoot a video this weekend.

imhavoc
 
Posts: 42
Joined: Thu Oct 05, 2017 10:32 pm

Re: Strange sound when using audioio.AudioOut

by imhavoc on Thu Jun 17, 2021 9:33 pm

I video of the speaker making the word sound on initiation. Some times it does this two or three times.

https://youtu.be/a6FuM3ZergE

imhavoc
 
Posts: 42
Joined: Thu Oct 05, 2017 10:32 pm

Re: Strange sound when using audioio.AudioOut

by imhavoc on Fri Jun 18, 2021 1:46 pm

A video of the speaker making the wierd sound on initiation. Some times it does this two or three times. Sometimes after a file has been played.

https://youtu.be/a6FuM3ZergE

imhavoc
 
Posts: 42
Joined: Thu Oct 05, 2017 10:32 pm

Re: Strange sound when using audioio.AudioOut

by imhavoc on Mon Jul 05, 2021 6:14 pm

If there is no fix for this, is there a way to disable audoio so that I can turn it on when I want to use it and disable it (release the pins?) when I'm done?

imhavoc
 
Posts: 42
Joined: Thu Oct 05, 2017 10:32 pm

Re: Strange sound when using audioio.AudioOut

by imhavoc on Thu Sep 23, 2021 11:17 am

Image

imhavoc
 
Posts: 42
Joined: Thu Oct 05, 2017 10:32 pm

Re: Strange sound when using audioio.AudioOut

by tannewt on Fri Sep 24, 2021 7:41 pm

Try 7.0.0. It includes improvements to audio processing.

tannewt
 
Posts: 2630
Joined: Thu Oct 06, 2016 8:48 pm

Re: Strange sound when using audioio.AudioOut

by imhavoc on Sat Sep 25, 2021 1:00 am

Thanks, tannewt. Gave it a shot. It still makes that nasty noise. I also noticed that the controller is being soft reset periodically for no reason.

Now, I'm suspecting that it's the ItsyBitsy M4. I'm going to move everything over to another controller and see what happens.

imhavoc
 
Posts: 42
Joined: Thu Oct 05, 2017 10:32 pm

Re: Strange sound when using audioio.AudioOut

by imhavoc on Sat Sep 25, 2021 7:02 pm

Unfortunately, upgrading to CircuitPython 7 did not resolve the issue. I decided to move the project from the IstyBitsy M4 over to an ItsyBitsy RP2040. That worked!

Only after all the soldering was done, did it occur to me to try A1-A5 on the M4 board..... Oh, well.

Note to future reader: migrating from M4 to RP2040 requires very different audio libraries.

imhavoc
 
Posts: 42
Joined: Thu Oct 05, 2017 10:32 pm

Please be positive and constructive with your questions and comments.