Announcement

Collapse
No announcement yet.

ANNOUNCE: Squeezelite-ESP32 (dedicated thread)

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Originally posted by philippe_44
    Where did you buy that board exactly? I know it's 2.3 instead of 2.2 but I need a precise link if you want me to buy one and make a build for this new version of the ESP32-A1S
    Hi, this one:

    Comment


    • Originally posted by Diddlik
      I got the same board from the same seller but with a different link:


      Note: The board is still V2.2; only the chip module seems to be different from old A1S boards. Maybe you can identify the new (ES8338)) A1S by the missing antenna connector. At the old (AC101) modules there should have been a connector. The pictures at aliexpress show the old version although they send the new version.

      Comment


      • Originally posted by philippe_44

        Seems to me you should write a a dac_controlset

        Code:
        "init":[
         {"reg":"4","val":128,"mode":"or"},
         {"reg":"8","val":0}
        ]
        and dac_config

        Code:
        model=i2s,bck=5,ws=25,do=26,sda=18,scl=23,i2c=16
        This config does not work. No sound.

        Log:
        Code:
        [0;32mI (6160) DAC core: DAC uses I2C port:0, sda:18, scl:23[0m
        [0;32mI (6170) DAC external: DAC on I2C @16[0m
        [0;32mI (6170) I2S: DMA Malloc info, datalen=blocksize=2048, dma_buf_count=12[0m
        [0;32mI (6180) I2S: APLL: Req RATE: 44100, real rate: 44099.988, BITS: 16, CLKM: 1, BCK_M: 8, MCLK: 11289597.000, SCLK: 1411199.625000, diva: 1, divb: 0[0m
        [00:08:21.578279] output_init_i2s:318 i2s DAC using I2S bck:5, ws:25, do:26, mute:-1:0 (res:0)
        [00:08:21.589732] output_init_i2s:338 Initializing I2S mode normal with rate: 44100, bits per sample: 16, buffer frames: 512, number of buffers: 12 
        [00:08:21.601956] set_amp_gpio:180 setting amplifier GPIO 21 (active:1)

        Tried also the permutation of i2c:

        You can also try i2c = 32, 17 or 34

        i2c=32; no sound
        i2c=17; no sound
        i2c=34; no sound
        Last edited by jofland; 2021-07-19, 19:47.

        Comment


        • Let us summarize the documentation for the ESP32-A1S with ES8388 we have so far:




          Comment


          • Originally posted by philippe_44
            dac_config

            Code:
            model=i2s,bck=5,ws=25,do=26,sda=18,scl=23,i2c=16
            You can also try i2c = 32, 17 or 34
            Let us systematically start with the dac_config.

            I do not understand if this is only an example or why you chose these values?

            This is the ES8388 specification from https://fccid.io/2AHMR-ESP32A1S/User...l-4883471.pdf:
            Click image for larger version

Name:	Screenshot_20210719_211011.png
Views:	2
Size:	49.3 KB
ID:	1572909

            If I read it right I would assume the corresponding part of the dac_config should be:
            Code:
            model=i2s,[B]bck=27,ws=26,do=35,di=25,sda=33,scl=32[/B],i2c=17
            If I have it like this, the DAC would not be initialized:
            Code:
            E (6190) I2S: data_out_num error
            [00:45:41.684769] output_init_i2s:318 i2s DAC using I2S bck:27, ws:26, do:35, mute:-1:0 (res:-1)
            [00:45:41.696215] output_init_i2s:325 no DAC configured
            If I exchange do and di, the log looks good and I at least get a clicking noise once at reboot from the speakers:
            Code:
            model=i2s,bck=27,ws=26,[B]do=25,di=35[/B],sda=33,scl=32,i2c=17
            Maybe it is a matter of perspective for input and output pins from ES8388 or ESP32? What do you think?

            Why is di missing in your dac_config?

            Could you please explain where in the manual you found the number of the i2c parameter for the dac_config?

            Comment


            • Originally posted by jofland
              Let us systematically start with the dac_config.

              I do not understand if this is only an example or why you chose these values?

              This is the ES8388 specification from https://fccid.io/2AHMR-ESP32A1S/User...l-4883471.pdf:

              If I read it right I would assume the corresponding part of the dac_config should be:
              Code:
              model=i2s,[B]bck=27,ws=26,do=35,di=25,sda=33,scl=32[/B],i2c=17
              If I have it like this, the DAC would not be initialized:
              Code:
              [0;31mE (6190) I2S: data_out_num error[0m
              [00:45:41.684769] output_init_i2s:318 i2s DAC using I2S bck:27, ws:26, do:35, mute:-1:0 (res:-1)
              [00:45:41.696215] output_init_i2s:325 no DAC configured
              If I exchange do and di, the log looks good and I at least get a clicking noise once at reboot from the speakers:
              Code:
              model=i2s,bck=27,ws=26,[B]do=25,di=35[/B],sda=33,scl=32,i2c=17
              Maybe it is a matter of perspective for input and output pins from ES8388 or ESP32? What do you think?

              Why is di missing in your dac_config?

              Could you please explain where in the manual you found the number of the i2c parameter for the dac_config?


              and yes DO is 35, my bad (DI is optional)
              Last edited by philippe_44; 2021-07-19, 20:32.
              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


              • Originally posted by philippe_44
                Looking at 8388 datasheet ans espA1 schematics, you have, at least, to put the chip in slave mode reg8, bit7 = 1 and activate DAC reg4, bit 7,6 = 0 and 5,4 = 0 if you use out1 or 3,1 = 0 if you use out 2.

                Seems to me you should write a a dac_controlset

                Code:
                "init":[
                 {"reg":"4","val":128,"mode":"or"},
                 {"reg":"8","val":0}
                ]
                Although I am not sure about the dac_config I would like to have a look at the dac_controlset yet. We need the documentation: http://www.everest-semi.com/pdf/ES8388%20DS.pdf

                I will keep my dac_config constant at:
                Code:
                model=i2s,bck=27,ws=26,do=25,di=35,sda=33,scl=32,i2c=16
                First question: How are the bits are enumerated? Little or big endian? Does bit7=0 mean value 0 or 255? I assume it is value 0.

                I read from the manual the following:
                * put the chip in slave mode reg8, bit 7 = 0 (1 is for master mode)
                * activate DAC reg4, bit 7,6 = 0
                * for out1: reg4, bit 5,4 = 1 (0 is to disable)
                * for out2: reg4, bit 3,2 = 1 (bit 1 is missing in the doc)
                Maybe both outputs activated at same time is working?

                So for reg4 I set bits 5, 4, 3, 2 to value 1 equals decimal 120. Is this correct?

                Because I will set all 6 bits of reg4 explicitly I assume that I should use the keyword "or"?

                Leads to
                Code:
                "init":[{"reg":"4","val":120,"mode":"or"}, {"reg":"8","val":0}]
                Still no sound

                If I understood the readme right, if we set {"reg":"8","val":0} without the "mode" the whole bite would be written to 00000000. Right?
                I do not know how to only set bit 7 without touching the other bits of reg8. Maybe it has to be "and" 11111110? Then it should be decimal 254.

                Leads to
                Code:
                "init":[{"reg":"4","val":120,"mode":"and"}, {"reg":"8","val":254,"mode":"and"}]
                No sound. Log:
                Code:
                I (6150) DAC core: DAC uses I2C port:0, sda:33, scl:32
                I (6160) DAC external: DAC on I2C @16
                W (6160) DAC external: no i2c controlset found
                I (6170) I2S: DMA Malloc info, datalen=blocksize=2048, dma_buf_count=12
                I (6170) I2S: APLL: Req RATE: 44100, real rate: 44099.988, BITS: 16, CLKM: 1, BCK_M: 8, MCLK: 11289597.000, SCLK: 1411199.625000, diva: 1, divb: 0
                [01:32:13.823989] output_init_i2s:318 i2s DAC using I2S bck:27, ws:26, do:25, mute:-1:0 (res:0)
                [01:32:13.835468] output_init_i2s:338 Initializing I2S mode normal with rate: 44100, bits per sample: 16, buffer frames: 512, number of buffers: 12 
                [01:32:13.847832] set_amp_gpio:180 setting amplifier GPIO 21 (active:1)
                [01:32:13.859161] output_visu_init:75 Initialize VISUEXPORT 512 16 bits samples
                [01:32:13.859161] output_thread_i2s:452 Output state is -1
                [01:32:13.860517] output_init_embedded:98 init completed.
                [01:32:13.872242] output_thread_i2s:456 switching off amp GPIO 21

                ==> Maybe someone else could do the next steps.

                Comment


                • Should the numbers of the values also be in quotes as the regs are?

                  Comment


                  • Originally posted by jofland
                    Although I am not sure about the dac_config I would like to have a look at the dac_controlset yet. We need the documentation: http://www.everest-semi.com/pdf/ES8388%20DS.pdf

                    I will keep my dac_config constant at:
                    Code:
                    model=i2s,bck=27,ws=26,do=25,di=35,sda=33,scl=32,i2c=16
                    First question: How are the bits are enumerated? Little or big endian? Does bit7=0 mean value 0 or 255? I assume it is value 0.

                    I read from the manual the following:
                    * put the chip in slave mode reg8, bit 7 = 0 (1 is for master mode)
                    * activate DAC reg4, bit 7,6 = 0
                    * for out1: reg4, bit 5,4 = 1 (0 is to disable)
                    * for out2: reg4, bit 3,2 = 1 (bit 1 is missing in the doc)
                    Maybe both outputs activated at same time is working?

                    So for reg4 I set bits 5, 4, 3, 2 to value 1 equals decimal 120. Is this correct?

                    Because I will set all 6 bits of reg4 explicitly I assume that I should use the keyword "or"?

                    Leads to
                    Code:
                    "init":[{"reg":"4","val":120,"mode":"or"}, {"reg":"8","val":0}]
                    Still no sound

                    If I understood the readme right, if we set {"reg":"8","val":0} without the "mode" the whole bite would be written to 00000000. Right?
                    I do not know how to only set bit 7 without touching the other bits of reg8. Maybe it has to be "and" 11111110? Then it should be decimal 254.

                    Leads to
                    Code:
                    "init":[{"reg":"4","val":120,"mode":"and"}, {"reg":"8","val":254,"mode":"and"}]
                    No sound. Log:
                    Code:
                    I (6150) DAC core: DAC uses I2C port:0, sda:33, scl:32
                    I (6160) DAC external: DAC on I2C @16
                    W (6160) DAC external: no i2c controlset found
                    I (6170) I2S: DMA Malloc info, datalen=blocksize=2048, dma_buf_count=12
                    I (6170) I2S: APLL: Req RATE: 44100, real rate: 44099.988, BITS: 16, CLKM: 1, BCK_M: 8, MCLK: 11289597.000, SCLK: 1411199.625000, diva: 1, divb: 0
                    [01:32:13.823989] output_init_i2s:318 i2s DAC using I2S bck:27, ws:26, do:25, mute:-1:0 (res:0)
                    [01:32:13.835468] output_init_i2s:338 Initializing I2S mode normal with rate: 44100, bits per sample: 16, buffer frames: 512, number of buffers: 12 
                    [01:32:13.847832] set_amp_gpio:180 setting amplifier GPIO 21 (active:1)
                    [01:32:13.859161] output_visu_init:75 Initialize VISUEXPORT 512 16 bits samples
                    [01:32:13.859161] output_thread_i2s:452 Output state is -1
                    [01:32:13.860517] output_init_embedded:98 init completed.
                    [01:32:13.872242] output_thread_i2s:456 switching off amp GPIO 21

                    ==> Maybe someone else could do the next steps.
                    Yes, quotes everywhere are needed. Bit 7 = 128, mode = empty means value is simply written, straight
                    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


                    • Originally posted by jofland
                      If I understood the readme right, if we set {"reg":"8","val":0} without the "mode" the whole bite would be written to 00000000. Right?
                      I do not know how to only set bit 7 without touching the other bits of reg8. Maybe it has to be "and" 11111110? Then it should be decimal 254.

                      Leads to
                      Code:
                      "init":[{"reg":"4","val":120,"mode":"and"}, {"reg":"8","val":254,"mode":"and"}]
                      "and" is used to turn individual bits off. Any "0" bit in the "val" field will result in a "0" in the corresponding bit in the register.
                      Any "1" bit in the "val" field leaves the corresponding register bit alone.

                      {"reg":"4","val":120,"mode":"and"} 120 equates to 01111000, so after execution bits 0, 1, 2, and 7 will be "0" in register 4. All other bits will remain
                      unchanged.

                      "or" is used to turn individual bits on. Any "1" bit in the "val" field will result in a "1" in the corresponding bit in the register.
                      Any "0" bit in the "val" field leaves the corresponding register bit alone.

                      {"reg":"4","val":120,"mode":"or"} 120 equates to 01111000, so after execution bits 3, 4, 5, and 6 will be "1" in register 4. All other bits will remain
                      unchanged.

                      Been a LONG time since my S/370 Assembler days, but I think I have that right.

                      Mike

                      Comment


                      • Thank you. I have not been programming assembler for over 20 years. And I was not very good in it at all .

                        So let us summarize what we have:
                        * do should be 35
                        * values in quotes; eg: {"reg":"4","val":"60"}
                        * setting one bit just without the keyword "mode"
                        * switch off bits with "and"/0
                        * switch on bits with "or"/1


                        Let us try something:

                        If I set do to 35 I get:
                        Code:
                        E (6220) I2S: data_out_num error
                        [00:20:28.171233] output_init_i2s:318 i2s DAC using I2S bck:27, ws:26, do:35, mute:-1:0 (res:-1)
                        [00:20:28.172569] output_init_i2s:325 no DAC configured
                        If I set do to 25 I get:
                        Code:
                        [00:30:47.293148] output_init_i2s:318 i2s DAC using I2S bck:27, ws:26, do:25, mute:-1:0 (res:0)
                        [00:30:47.304628] output_init_i2s:338 Initializing I2S mode normal with rate: 44100, bits per sample: 16, buffer frames: 512, number of buffers: 12
                        I am confused because in table of the documentation I2S_SDOUT = 35. This gives me an error while 25 seems to be right...


                        Setting the registers; I will start with the default settings of the manual:
                        * reg8 default 10000000: Only setting bit7 = 0; leave all other bits untouched leads to: 00000000 = {"reg":"8","val":"0"}
                        * reg4 default 11000000: Inverting the whole bite, except bit0 and bit1 (unsused): both DACs power up; both outputs on both channels enabled: 00111100 = {"reg":"4","val":"60"}

                        So I do not need the keyword "mode". Leads to
                        Code:
                        "init":[{"reg":"8","val":"0"}, {"reg":"4","val":"60"}]
                        Result: Still no sound.

                        Comment


                        • Could you please explain where in the manual you found the number of the i2c parameter for the dac_config?

                          I cannot find the number of the i2c parameter of dac_config in this document. In which section did you see it?

                          What does the i2c parameter mean within the dac_config? Is this the i2c address or something else?

                          If it would be the address, should´nt it be 0x10 as this post said?
                          Originally posted by attz
                          My output in serial monitor is:

                          Scanning AC-101 address...
                          Scanning ES-8388 address...
                          ES-8388 I2C device found at address 0x10 !
                          done
                          Last edited by jofland; 2021-07-20, 17:32.

                          Comment


                          • Originally posted by jofland
                            Thank you. I have not been programming assembler for over 20 years. And I was not very good in it at all .

                            So let us summarize what we have:
                            * do should be 35
                            * values in quotes; eg: {"reg":"4","val":"60"}
                            * setting one bit just without the keyword "mode"
                            * switch off bits with "and"/0
                            * switch on bits with "or"/1
                            I think do should be 25. IO25 (ESP32) ---> I2S_SDIN (ES8388)

                            Leave the quotes off the value you are changing to...

                            {"reg":"4","val":60}

                            Have you played with the register functions in the browser UI? You can display/change resisters from there as well.
                            It's in the Advanced section.

                            Mike
                            Last edited by mboxler; 2021-07-20, 18:29.

                            Comment


                            • Originally posted by jofland
                              Could you please explain where in the manual you found the number of the i2c parameter for the dac_config?



                              I cannot find the number of the i2c parameter of dac_config in this document. In which section did you see it?

                              What does the i2c parameter mean within the dac_config? Is this the i2c address or something else?

                              If it would be the address, should´nt it be 0x10 as this post said?
                              Edit:

                              From the ES8388 User Guide

                              The chip address for I2C is 0x20 if CE pin is pulled down to DGND. The chip address for I2C is 0x22 if CE pin is pulled up to PVDD.

                              Maybe this will work in dac_config???

                              model=I2S,bck=27,ws=26,do=25,sda=33,scl=32,i2c=32

                              Mike
                              Last edited by mboxler; 2021-07-20, 18:54.

                              Comment


                              • Originally posted by mboxler
                                Edit:

                                From the ES8388 User Guide

                                The chip address for I2C is 0x20 if CE pin is pulled down to DGND. The chip address for I2C is 0x22 if CE pin is pulled up to PVDD.

                                Maybe this will work in dac_config???

                                model=I2S,bck=27,ws=26,do=25,sda=33,scl=32,i2c=32

                                Mike
                                I'm not sure I know what to believe when I look at the schematics. Maybe you're right and GPIO5 is not BCLK but I'm not sure SCL and SDA are 33/32, they are I2C_SCL not I2C_SCL_ESP, so I think they are 23 & 18

                                Click image for larger version

Name:	Sans titre.jpg
Views:	1
Size:	96.5 KB
ID:	1572911
                                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

                                Working...
                                X
                                😀
                                🥰
                                🤢
                                😎
                                😡
                                👍
                                👎