Strange sound when using audioio.AudioOut

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ChrisDS
 
Posts: 4
Joined: Wed Oct 07, 2015 12:21 am

Strange sound when using audioio.AudioOut

Post by ChrisDS »

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

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

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

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?

User avatar
siddacious
 
Posts: 407
Joined: Fri Apr 21, 2017 3:09 pm

Re: Strange sound when using audioio.AudioOut

Post by siddacious »

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

User avatar
kevinjwalters
 
Posts: 1025
Joined: Sun Oct 01, 2017 3:15 pm

Re: Strange sound when using audioio.AudioOut

Post by kevinjwalters »

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

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

Re: Strange sound when using audioio.AudioOut

Post by imhavoc »

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

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

Re: Strange sound when using audioio.AudioOut

Post by imhavoc »

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

https://youtu.be/a6FuM3ZergE

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

Re: Strange sound when using audioio.AudioOut

Post by imhavoc »

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

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

Re: Strange sound when using audioio.AudioOut

Post by imhavoc »

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?

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

Re: Strange sound when using audioio.AudioOut

Post by imhavoc »

Image

User avatar
tannewt
 
Posts: 3304
Joined: Thu Oct 06, 2016 8:48 pm

Re: Strange sound when using audioio.AudioOut

Post by tannewt »

Try 7.0.0. It includes improvements to audio processing.

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

Re: Strange sound when using audioio.AudioOut

Post by imhavoc »

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.

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

Re: Strange sound when using audioio.AudioOut

Post by imhavoc »

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.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”