Squeeze-ESP32 + Wondom amplifier

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • philippe_44
    Senior Member
    • May 2008
    • 9343

    #16
    Originally posted by frahe
    I had a look at the code and already before at the TAS datasheet. Looks pretty forward. Found the right registers. I would go for it. So far I installed the docker container and I'm able to compile the code via "make". The cmake version didn't work. Nevertheless. That's enough for testing. A POC where i set a fixed amplifier gain at startup worked. So i know the right registers and some values for changing the amplifier gain. Final step will be transforming the volume to the amplifier gain and implementing that in the volume function. I'm able to do that and test it here.

    I would like to have that in the code. This would reduce the load on the ESP and maybe improve audio quality (even if I'm actually satisfied).

    When I get a solution how would I be able to commit that? I'm not so common with git. Would someone else test also the solution and could commit it?

    Greetings,
    Florian
    I would see how this can be integrated. There are a couple of ramifications wrt how let user chose that or not and once you've moved to HW gain, I would have to re-check cross-fade, replaygain and a few other things to verify how they still behave. I initially did not do HW gain b/c soft gain is universal and integrates perfectly in squeezelite port. For HW gain, most configurations don't support it
    LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3

    Comment

    • frahe
      Junior Member
      • Jan 2020
      • 18

      #17
      Originally posted by philippe_44
      I would see how this can be integrated. There are a couple of ramifications wrt how let user chose that or not and once you've moved to HW gain, I would have to re-check cross-fade, replaygain and a few other things to verify how they still behave. I initially did not do HW gain b/c soft gain is universal and integrates perfectly in squeezelite port. For HW gain, most configurations don't support it
      Ok I see. Unfortunately there are a few more hurdles:
      1. gain <-> volume: The volume function get exponential gain, the TAS uses already a volume (dB) setting. To get a proper linear increase the volume setting needs to be transformed with a logarithmic funtion. Would that be possible here too. It would be sad to make some exponential volume calculation an then make the inverse. (In the ALSA part I found the calculation. It seems that this is generally done there. So it seems, that there is no way around for that.)
      2. return code "true" seems to mute software gain. My modifications don't work if i set the return value of the volume function to true. Then I don't get any output even at 100% where the amplifier is set to 0dB gain. 0dB gain is default value of that amplifier after startup. If I set the return value to "true" I get some output. This is only working around the 90% volume setting in LMS, since software gain and additionally the amplifier gain is applied. So we would just need to get this working.


      Question of mine: Is it worth to look after the source of the wrong interpretation (if I'm right... ?) of the return value or should we stop here?

      I think it should be possible to add an option for those who want hardware volume (this should perfectly work with SqueezeAMP). So far I just modified the init function (Just setting volume to mute -> not to start with loud music -> will be overridden by volume function. And setting volume control to both channels separate (is default, just to be sure)) and the volume function. So in general little impact.

      Greetings,
      Florian
      Last edited by frahe; 2020-09-06, 00:30.
      4 x Radio, 1 x Boom, 1 x Duet + controller, 1 x squeeze-ESP32 + WONDOM 230DI, 1 x piCore + Justboom AMP zero, 1 x Classic (retired :-(, not reliable anymore), Pi3+ as LMS

      Comment

      • frahe
        Junior Member
        • Jan 2020
        • 18

        #18
        Originally posted by frahe
        Ok I see. Unfortunately there are a few more hurdles:
        1. gain <-> volume: The volume function get exponential gain, the TAS uses already a volume (dB) setting. To get a proper linear increase the volume setting needs to be transformed with a logarithmic funtion. Would that be possible here too. It would be sad to make some exponential volume calculation an then make the inverse. (In the ALSA part I found the calculation. It seems that this is generally done there. So it seems, that there is no way around for that.)
        2. return code "true" seems to mute software gain. My modifications don't work if i set the return value of the volume function to true. Then I don't get any output even at 100% where the amplifier is set to 0dB gain. 0dB gain is default value of that amplifier after startup. If I set the return value to "true" I get some output. This is only working around the 90% volume setting in LMS, since software gain and additionally the amplifier gain is applied. So we would just need to get this working.

        Got the two points working. Volume transformation was easy, since there was a prototype.
        The set_volume function in output_embedded.c did not set any output.gainL/R in case of a return value of "true". I suppose these values were then initialized to 0 resulting in an 0 software gain. Setting them to "FIXED_ONE" (Maximum Gain) in case of a return value of "true" worked. Something similar is done in the ALSA related functions of squeezelite, so I suppose that's a valid way.

        Is there any interest of including the modifications?

        Greetings,
        Florian
        4 x Radio, 1 x Boom, 1 x Duet + controller, 1 x squeeze-ESP32 + WONDOM 230DI, 1 x piCore + Justboom AMP zero, 1 x Classic (retired :-(, not reliable anymore), Pi3+ as LMS

        Comment

        • sle118
          Senior Member
          • Dec 2009
          • 626

          #19
          Originally posted by frahe
          Is there any interest of including the modifications?
          Speaking for myself, there's always interest!

          You could submit a pull request where we could review and discuss the change. Ultimately, the volume control is Philippe's playground and I trust this judgment there.
          LMS 7.9 - 1xRadio, 1xBoom, 5xDuet,3xTouch, 1 SB2. Sony PlayStation, Emby, Chromecast v1 and v2 and...
          6xSqueezeAmp, several other ESP32-Wrover boards with jumper wires flying around, some with ethernet!

          Comment

          • philippe_44
            Senior Member
            • May 2008
            • 9343

            #20
            Originally posted by frahe
            Got the two points working. Volume transformation was easy, since there was a prototype.
            The set_volume function in output_embedded.c did not set any output.gainL/R in case of a return value of "true". I suppose these values were then initialized to 0 resulting in an 0 software gain. Setting them to "FIXED_ONE" (Maximum Gain) in case of a return value of "true" worked. Something similar is done in the ALSA related functions of squeezelite, so I suppose that's a valid way.

            Is there any interest of including the modifications?

            Greetings,
            Florian
            Originally posted by sle118
            Speaking for myself, there's always interest!

            You could submit a pull request where we could review and discuss the change. Ultimately, the volume control is Philippe's playground and I trust this judgment there.
            Yes, that's the logical thing to do. I candidly did not put too much thought into that initially, I was very busy building the whole thing and get these DAC to work, but at least there was a provision for HW volume ;-)

            I also verified and the good news is that replaygain and crossfade should continue to work at it is an "overlay" on top of the SW gain, so if it is FIXED_ONE, then it will apply on top of it, which again seems to me logical as the user can disable it if he wants purely HW gain.
            LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3

            Comment

            • frahe
              Junior Member
              • Jan 2020
              • 18

              #21
              Originally posted by sle118
              Speaking for myself, there's always interest!

              You could submit a pull request where we could review and discuss the change. Ultimately, the volume control is Philippe's playground and I trust this judgment there.
              Made my first pull request ever . We will see how good this was. I'm not really using git. So I had to find my way through....

              Greetings,
              Florian
              4 x Radio, 1 x Boom, 1 x Duet + controller, 1 x squeeze-ESP32 + WONDOM 230DI, 1 x piCore + Justboom AMP zero, 1 x Classic (retired :-(, not reliable anymore), Pi3+ as LMS

              Comment

              • zorglups
                Member
                • Nov 2008
                • 47

                #22
                [QUOTE=frahe;987354]Hi Rob,
                I made a "flying" setup:
                Click image for larger version

Name:	IMG_20200903_211603.jpg
Views:	1
Size:	217.4 KB
ID:	1569763

                Could you share the ESP32 board model ?
                I couldn't identify this kind of dev board but I like the way the I/O are exposed.

                Comment

                • Yatsushiro
                  Senior Member
                  • May 2017
                  • 125

                  #23
                  [QUOTE=zorglups;1047996]
                  Originally posted by frahe
                  Hi Rob,
                  I made a "flying" setup:
                  [ATTACH]31461[/ATTACH]

                  Could you share the ESP32 board model ?
                  I couldn't identify this kind of dev board but I like the way the I/O are exposed.
                  Here's where I got mine:

                  Comment

                  • zorglups
                    Member
                    • Nov 2008
                    • 47

                    #24
                    [QUOTE=Yatsushiro;1048018]
                    Originally posted by zorglups
                    Thank you.

                    Comment

                    • zorglups
                      Member
                      • Nov 2008
                      • 47

                      #25
                      I ordered an Wondom AA-AB32256 amp featuring a TAS5754 dac.

                      I did connect it like this:
                      So I connected my Wrover (TTGO T8) module to my TAS5754 DAC (Wondom AA-AB32256) as this:
                      AA-AB32256 pin TTGO T8 pin I2S signal
                      LRCK 25 ws
                      BCLK 33 bck
                      SDATA 32 do
                      GND GND
                      3V3 3V3
                      STBY 14
                      At first connection, I got is play music from squeezelite-esp32. Then I did some changes to the configuration to handle amongst other things the standby pin of the amp.
                      After a reboot of the squeezelite-esp32, nothing was working anymore.

                      I spent quite a few hours trying all kind of combinations, trying to understand what broke what worked initially.

                      Today, with the help of @sle118 and re-re-re-reading this full thread, I saw you were not connecting the i2c connector of the amp to the esp32.
                      Reading again, I understood that you were not using model=TAS57xx in the dac_config variable.
                      I then set my dac_config to:
                      Code:
                      model=I2S,bck=33,ws=25,do=32,mute=14:0
                      I rebooted and... voilà !!! I'm back on tracks.

                      Comment

                      • Haldi
                        Junior Member
                        • Dec 2022
                        • 7

                        #26
                        Compared to SqueezeAMP?

                        Hello,

                        These AA-AB32255 Boards seem pretty cool.
                        Especially for their pricepoint. 30$ + ESP32 chip.
                        The SqueezeAMP was 65$ + Shipping from Canada? to europe.

                        But how is the soundquality difference? Anyone here has both of them in usage and can give his opinion?

                        I'm still astonished how good my old 4$ Bluetooth amps with TPA3116D2 form aliexpress sound with 21V. In combination with Jamo S420 Surround speakers that do 60W at 6 Ohm.
                        But as i'm looking for a multiroom upgrade they have to get replaced.


                        regards,
                        Haldi

                        Comment

                        • philippe_44
                          Senior Member
                          • May 2008
                          • 9343

                          #27
                          Originally posted by Haldi
                          Hello,

                          These AA-AB32255 Boards seem pretty cool.
                          Especially for their pricepoint. 30$ + ESP32 chip.
                          The SqueezeAMP was 65$ + Shipping from Canada? to europe.

                          But how is the soundquality difference? Anyone here has both of them in usage and can give his opinion?

                          I'm still astonished how good my old 4$ Bluetooth amps with TPA3116D2 form aliexpress sound with 21V. In combination with Jamo S420 Surround speakers that do 60W at 6 Ohm.
                          But as i'm looking for a multiroom upgrade they have to get replaced.


                          regards,
                          Haldi
                          The wondom will probably sound equal or better, there is much more caution around the audio sections.

                          Bear in mind that although I’m an engineer, designing board is not my day-to-day activity and I don’t have a team to test and validate .

                          The objective of SqueezeAMP was also different: cram as much as possible in a little format and add battery charging.

                          I also want to repeat that cost is higher because I build them by tiny batches and some components are expensive. Please remember that I’m not making any profit of any kind. I just pass the cost of purchase and assembly that the PCB maker charges me. All my time for design, verification and then packaging and shipment is free.
                          LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3

                          Comment

                          • sle118
                            Senior Member
                            • Dec 2009
                            • 626

                            #28
                            Originally posted by philippe_44
                            The wondom will probably sound equal or better, there is much more caution around the audio sections.

                            Bear in mind that although I’m an engineer, designing board is not my day-to-day activity and I don’t have a team to test and validate .

                            The objective of SqueezeAMP was also different: cram as much as possible in a little format and add battery charging.

                            I also want to repeat that cost is higher because I build them by tiny batches and some components are expensive. Please remember that I’m not making any profit of any kind. I just pass the cost of purchase and assembly that the PCB maker charges me. All my time for design, verification and then packaging and shipment is free.
                            In other words, you are paying something out of every single unit being sold, because this is your (expensive but fun) hobby. I hope everyone will let that sink in.
                            LMS 7.9 - 1xRadio, 1xBoom, 5xDuet,3xTouch, 1 SB2. Sony PlayStation, Emby, Chromecast v1 and v2 and...
                            6xSqueezeAmp, several other ESP32-Wrover boards with jumper wires flying around, some with ethernet!

                            Comment

                            • Haldi
                              Junior Member
                              • Dec 2022
                              • 7

                              #29
                              Originally posted by philippe_44
                              The objective of SqueezeAMP was also different: cram as much as possible in a little format and add battery charging.
                              Indeed having a all in one PCB Solution is a HUGE benefit! Makes everything way more compact.
                              For a portable device a great advantage. It's an awesome project you started here, and you have my respect for still answering most questions in this forum here. I think i'd probably go insane after seeing people ask the same thing over and over again. ^^


                              Because this one is an official Wondom one it might actually be high quality. Because most Amplifier Boards you find on Aliexpress replace the components with similar looking cheaper ones. So sound Quality isn't as good as expected.

                              The official Raspberry Pi "IQaudio DigiAMP+" also looks quite neat. It does provide 2.5A on 5.1V so with an USB adapter you could power the ESP32 right away. No additional Step down board needed.
                              Not sure how much power you can get from the 3.3V pin.... that would make things even easier. But probably not enough.
                              Click image for larger version

Name:	9Rfqn5q.png
Views:	1
Size:	57.7 KB
ID:	1576374

                              and you even have i2c headers for control. Which does not seem to be the case on the Wondom Board. But as its a DAC-AMP together i don't think it would make any difference in the mute, or power draw.

                              but the main reason is that it seems easier to get around here....
                              really looking forward to the future where electronics aren't rarely available.

                              Comment

                              Working...