🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Mod to programmatically disable speaker whine/hiss.

    PRODUCTS
    8
    10
    25.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      Macaba
      last edited by

      Re: Noise on speaker

      Hi all,

      I've been working on porting the Teensy Audio Library to M5Stack to allow full (& easy) audio synthesis.

      0_1539790993131_IMG_0656-2.JPG

      However the background whine/hiss from the speaker when no audio is being played is very annoying (and quite loud on my M5Stack).

      My suggested modification in this case is to put a wire from Pin 1 of the speaker amplifer to GPIO5.

      0_1539790903732_IMG_0655-2.JPG

      Then it's just a simple case of digitalWrite(5, HIGH); to turn on the amplifier, and digitalWrite(5, LOW); to turn off the amplifier.

      There seems to be a 30-100ms delay for the amplifier to turn on, and very little delay for it to turn off so I sadly can't get my audio library to automatically turn the amplifier on/off because I would miss the beginning of any new audio playback.

      So I've just attached the amplifier control to BtnA for manual control so I can at least turn off the noise.

      Good luck to anyone else attempting this mod! :)

      C M 2 Replies Last reply Reply Quote 0
      • C
        cbrightly @Macaba
        last edited by

        @macaba I will have to look into this! Do you plan on sharing any of your work porting the audio libraries from the Teensy over to the M5Stack / ESP32?

        M 1 Reply Last reply Reply Quote 0
        • M
          Macaba
          last edited by

          Yep! It'll be going on GitHub at some point.

          It won't be compatible with the the original audio objects from the Teensy library;

          1. I've moved over to float datatype for audio samples (it makes certain audio algorithms so much easier) so I've been slowly porting across the objects when I use them.
          2. I've added some functionality that lets you get more detailed CPU reporting.

          You can see my handy 'Amp on/off' control now:
          0_1539868916364_adaacef8-3324-46f7-a94e-ae38e249f3e7-image.png

          1 Reply Last reply Reply Quote 0
          • M
            Macaba @cbrightly
            last edited by

            @cbrightly https://github.com/macaba/ESP32AudioLibrary

            Initial commit of ESP32/M5Stack audio library done. Not that many objects yet, I'll be adding more as time allows.

            1 Reply Last reply Reply Quote 0
            • C
              ChrisMicro
              last edited by

              Hello, I just flashed it and it works. Thankx :-)
              Do you use a software sigma-delta-DAC or the internal 8 Bit DAC?
              Probably you can add a second example which shows a little bit of the sound qualities of the lib.

              1 Reply Last reply Reply Quote 0
              • C
                Calin
                last edited by Calin

                You can mute the speaker very easy from code.
                Just call
                dacWrite (25,0);

                1 Reply Last reply Reply Quote 0
                • P
                  PlayTheGame
                  last edited by

                  @Calin Hold your ear on the "mute" speaker. There is still noise with your code.

                  THX for the hardware mod suggestion.

                  1 Reply Last reply Reply Quote 1
                  • N
                    Nifkuzyaire
                    last edited by

                    Hello,
                    Maybe you can port this teensy dalek voice sketch to m5stack
                    Thank you in advance.

                    https://pastebin.com/dYf49wp5

                    1 Reply Last reply Reply Quote 0
                    • M
                      masrodjie @Macaba
                      last edited by

                      @macaba Nice. I was trying all the way to avoid noise on speaker and none of luck. Then trying using this method and it's works! Thanks

                      1 Reply Last reply Reply Quote 0
                      • F
                        funghy
                        last edited by

                        It is probably better not to connect PIN 1 of the NS4148 but pin 3 the buck converter EA3036 to pin 5 since otherwise you have a bigger power consumption. You could also remove R23 in that case.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post