Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 10 of 10

Thread: MAX98390 5W DSP Audio Chip Paul has been testing?

  1. #1
    Junior Member
    Join Date
    Sep 2020
    Posts
    4

    MAX98390 5W DSP Audio Chip Paul has been testing?

    @PaulStoffregen , I saw this post of yours regarding the MAX98390 that I'm also looking at using and creating a breakout board for real quick.

    Here is what you posted about this chip on the Arduino forum, I couldn't post there so I am replying here on your forum.

    PUI sells some small speakers in a tuned sealed enclosure that is already tuned and the speaker laser test settings are already available to load onto the MAX Audio chip which is nice. Testing for other speakers by Maxim is free if you buy the Dev board their demo video says. I'm sure PUI has other speakers now that have also been tested already.

    https://www.digikey.com/product-deta...85-ND/10238520

    I'm reaching out to see if you know of anybody else who has created a breakout for this chip already?

    And more importantly, do you know of any C++ code that has been written to control this chip?

    I can't find any Breakouts or Arduino type libraries written for the chip yet but it looks to be a great solution after my testing of 5 different sizes and types of Micro speakers from PUI along with a 2.5w Class D Amp. This MAX chip could get me double the sound output.

    Until recently, I felt the same way as jremington & DVDdoug, that you can't get good sound quality without a large speaker, and without an enclosure trapping a substantial volume of air behind it.

    Recently I've been working with a new chip from Maxim Semi, part number MAX98390, which does really amazing tricks to get the most from tiny speakers. The results are really quite incredible. But the tech comes with many caveats, the hardest being an almost impossible to solder wafer-scale BGA package. I've been working with a contract manufacturer to try to get shields made with this amazing chip. They've managed to solder a few prototypes, but getting it to be reliable for production volume is still quite a challenge.

    If you're skeptical, and believe me I was quite skeptical before I started working with this chip, it senses the actual real-time current flow to the speaker, so it knows both the voltage it applied and the resulting current. Inside it has a small DSP engine that does many tricks. But that alone isn't the whole story. The DSP engine requires a pretty extensive set of calibration results from testing done with the actual speaker, mounted to the actual enclosure or frame. Some of the calibration stuff is proprietary "secret sauce" that Maxim won't disclose.

    But one of the parts I understand involve measuring the speaker+enclosure resonance frequency. I believe the DSP engine is implementing a deep, narrow notch filter, and then allows bass notes 2 octaves below the resonance to play. It make an incredibly tiny speaker sounds like a much larger one, with 2 octaves lower response.

    Another trick the chip does is computing the temperature of the copper wires inside the speaker. Again, this relies on an initial calibration measurement of the speaker, which has to be done also with a temperature sensor (that's assumed to be the same as the speaker before heavy use). The temp sensor isn't used while playing sound, only during calibration. The amplifier is capable of about 5 watts peak, which could burn up many tiny speakers. But this real-time temperature measurement of the winding (which is inferred by the current measurement compared to the original calibration) allows the chip to safely drive tiny speakers *much* harder for short peaks than you could safely do with a normal amplifier. For ordinary music, it makes a pretty amazing improvement in loudness.

    That chip has many other neat tricks, like a boost power supply that dynamically adjusts the power supply voltage (up to 10V with 3.6V battery power) only as needed by the actual audio. It delays the sound about 100 us, so it can look ahead and know how much voltage is needed.

    Of course, all this amazing tech doesn't turn a tiny 1 inch speaker into a 12 inch sub-woofer. But it does sound like a 3 inch speaker with a more powerful amp.

    The bass enhancement also does not work unless you have reasonably good acoustic pressure isolation between the front and back of the speaker, which usually means making a tiny sealed enclosure around the speaker, or mounting it to it a large & sturdy flat surface... which might work for a greeting card if you can use heavier card stock.

  2. #2
    Senior Member
    Join Date
    Jul 2020
    Posts
    390
    Its just an I2C interface to program a bunch of registers from what I can see - although there are interrupts you can also use if you want,
    but I suspect you just need an I2C library.

    It won't get you down to the bottom octave though, a real speaker is needed for that - there's a basic law of speaker design that you can't
    simultaneously optimize power efficiency, bass-extension and box size - one of them has to give. The basic trick they are using is
    sacrificing power efficiency just on the bass notes below the resonance, and then carefully monitoring for speaker overload. Can't work
    too well for bass-heavy sources as the speaker will eventually overload and it will have to throttle back noticably, but for occasional bass
    transients it will work - though the distortion may be quite high through pushing a small speaker hard.

    A good way to judge a speaker/enclosure is to tap the dome lightly with a fingertip and listen to its passive response - the lower and louder the sound, the better it will produce bass.

  3. #3
    Junior Member
    Join Date
    Sep 2020
    Posts
    4
    Yea it's simple I2C but really don't want to write a library if it's already been done.

    I found this at a minimum. https://lkml.org/lkml/2020/5/13/193

    Waiting for a reply from Maxim this week about a finished library.

    The chip makes a big difference with these smaller speakers that I'm using.

    Pretty impressed how good a 2 & 3-inch speaker in a proper enclosure sounds.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,669
    I worked with this chip months ago, but everything I was doing has been put on hold by the pandemic.

    I'm a bit reluctant to share code, as it's likely to only create more questions than it answers. So please understand this comes with absolutely no support. Do not email, message on social networks, or call. I may reply here on this forum thread, but even here, please do not expect me to help much. This is absolutely unsupported right now.

    With that in mind, here's a dump of some test code I wrote several months ago. It's an adaptation of the audio library's guitar synth example, but plays through a MAX98390 chip.

    https://github.com/PaulStoffregen/MAX98390_test

  5. #5
    Junior Member
    Join Date
    Sep 2020
    Posts
    4
    Quote Originally Posted by PaulStoffregen View Post
    I worked with this chip months ago, but everything I was doing has been put on hold by the pandemic.

    I'm a bit reluctant to share code, as it's likely to only create more questions than it answers. So please understand this comes with absolutely no support. Do not email, message on social networks, or call. I may reply here on this forum thread, but even here, please do not expect me to help much. This is absolutely unsupported right now.

    With that in mind, here's a dump of some test code I wrote several months ago. It's an adaptation of the audio library's guitar synth example, but plays through a MAX98390 chip.

    https://github.com/PaulStoffregen/MAX98390_test
    Thanks Paul! This is better than nothing.

    I did try to hit you up on Twitter, the Forum, and via email because I know your alive and I know you have worked with the chip recently.

    Maxim isn't replying supplying any code for the chip either even though they have it which seems weird. No reason they give for not wanting to supply the code just, they just choose to not reply.

    The chip looks pretty cool so I'm happy to try to get it working for me and others who may find it useful.

    Thanks again for supplying the code, I have purchased many Teensy products in the past and have been impressed with their speed.

  6. #6
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    634
    An alternative to getting good sound is to measure the response and then fix it with equalization. Most flexible is with fast, partitioned convolution, but other methods work.

    I'll admit that I haven't seen other solutions for adaptive bass equalization (to prevent overload at higher volumes).

  7. #7
    Junior Member
    Join Date
    Sep 2020
    Posts
    4
    Quote Originally Posted by PaulStoffregen View Post
    I worked with this chip months ago, but everything I was doing has been put on hold by the pandemic.

    I'm a bit reluctant to share code, as it's likely to only create more questions than it answers. So please understand this comes with absolutely no support. Do not email, message on social networks, or call. I may reply here on this forum thread, but even here, please do not expect me to help much. This is absolutely unsupported right now.

    With that in mind, here's a dump of some test code I wrote several months ago. It's an adaptation of the audio library's guitar synth example, but plays through a MAX98390 chip.

    https://github.com/PaulStoffregen/MAX98390_test
    Paul, I found the library that Maxim created for the Max98390 chip included in the Lunix drivers:

    https://elixir.bootlin.com/linux/lat...ecs/max98390.h

    https://elixir.bootlin.com/linux/lat...ecs/max98390.c

  8. #8
    Senior Member
    Join Date
    Jun 2018
    Posts
    127
    Paul, I found the library that Maxim created for the Max98390 chip included in the Lunix drivers:

    https://elixir.bootlin.com/linux/lat...ecs/max98390.h

    https://elixir.bootlin.com/linux/lat...ecs/max98390.c
    Having been through this before, I can say that the Linux drivers aren't a huge help in developing a driver for the Teensy Audio Library. My PCM5242 module had linux drivers that I thought would be helpful but they weren't all that helpful. What I eventually did was took hints from the control modules found in the Teensy Audio Library github (look for files starting with "control"). Paul's code seems to have been somehow generated by a EVM tool (mySpeakerTune2_reg.c, I could be wrong), that's the main initialization code, and then some control over volumes.

  9. #9
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    634
    I suspect that the software (and the laser characterization) included in the evaluation kit (MAX98390EVSYS) is useful.

  10. #10
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,669
    Quote Originally Posted by JayShoe View Post
    Paul's code seems to have been somehow generated by a EVM tool (mySpeakerTune2_reg.c, I could be wrong),
    Maxim publishes software for this chip called DSM Sound Studio. It's Windows only. Earlier it required registration to download, but now it seems download might be possible without giving Maxim your personal info. (EDIT - or maybe not.....)

    DSM Sound Studio creates a text file with the values to write to all of the chip's registers. I made a tunereg_to_cpp.pl Perl script which converts that text file to C code. mySpeakerTune2_reg.c was generated by that script, using the little speaker Maxim ships with their eval kit.

    After writing all those registers over I2C, the MAX98390 will "just work" when you send it data by I2S. The normal Teensy Audio Library I2S output works fine. Nothing special is needed for MAX98390, other than pretty simple code using the Wire library to write all those config registers.

    I haven't tried initializing the chip based only on the registers documented in the datasheet. But I did use the documented volume adjust registers, as you can see in the code.

    @RWB - I saw your PCB on Twitter. Just curious, what is the large "777" part?
    Last edited by PaulStoffregen; 10-06-2020 at 01:49 AM. Reason: seem like registration might still be a thing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •