Announcement

Collapse
No announcement yet.

ANNOUNCE: Squeezelite-ESP32 (dedicated thread)

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • 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?
    Not 100% sure of your question, but the syntax of dac_config is in the README of the squeezelite-esp32 project. It has nothing to do with ES82388. ES8388 gives you the value to set, but the syntax is what I "invented" for squeezelite-esp32
    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


    • I was basing dac_config on this. I'm confused

      Click image for larger version

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

      Comment


      • Originally posted by mboxler
        I was basing dac_config on this. I'm confused
        This is from the FCC document? I'm not sure we should not better trust the schematics
        Last edited by philippe_44; 2021-07-20, 20:49.
        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


        • I would rather say

          model=i2s,bck=27,ws=25,do=26,sda=18,scl=23,i2c=32

          or

          model=i2s,bck=27,ws=25,do=26,sda=18,scl=23,i2c=34

          or

          model=i2s,bck=27,ws=25,do=26,sda=18,scl=23,i2c=16

          or

          model=i2s,bck=27,ws=25,do=26,sda=18,scl=23,i2c=17

          (I'm not sure what I did for i2c address, if there is a left shift for the R/W bit or not)
          Last edited by philippe_44; 2021-07-20, 20:52.
          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 mboxler
            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
            I am not sure with or without quotes for the values. I asked before and philippe said with quotes.

            No, I have not played with the register functions.



            Regarding the documentation:

            Originally posted by philippe_44
            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

            [ATTACH]35299[/ATTACH]
            I have seen this too and am confused too. If you look at the next schematics (yellow background) in this document you get more confused...


            Regarding the i2c address:

            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

            Originally posted by philippe_44
            Not 100% sure of your question, but the syntax of dac_config is in the README of the squeezelite-esp32 project. It has nothing to do with ES82388. ES8388 gives you the value to set, but the syntax is what I "invented" for squeezelite-esp32
            Thanks for this hint. Although I have read the Readme a few times, I may have overseen it.
            Code:
            bck=<gpio>,ws=<gpio>,do=<gpio>[,mute=<gpio>[:0|1][,model=TAS57xx|TAS5713|AC101|I2S][,sda=<gpio>,scl=gpio[,[B]i2c=<addr>[/B]]]
            Which notation <addr> should be? Decimal?

            i2c in dac_config uses the address. So we should try one of the following:
            * 0x10 as resulted from the test sketch posted some pages above
            * 0x20 see mboxler
            * 0x22 see mboxler

            I do not think we should use 16, 17, 32 or 34 as address as mentioned some posts before.


            To sum up: There are to many permutations to try. I would like to find some parameters we can consider to be sure and fix. So we can reduce complexity.

            Comment


            • Sorry, I didn't state something right.

              I leave quotes off both values...

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

              Here's what I have in dac_controlset

              { "init": [ {"reg":45,"val":52}, {"reg":45,"val":48}, {"reg":53,"val":8}, {"reg":54,"val":81}, {"reg":64,"val":24} ] }

              It seems to correctly change the registers for me.

              Mike

              Comment


              • Originally posted by jofland
                I am not sure with or without quotes for the values. I asked before and philippe said with quotes.

                No, I have not played with the register functions.

                Regarding the documentation:

                I have seen this too and am confused too. If you look at the next schematics (yellow background) in this document you get more confused...

                Regarding the i2c address:

                Thanks for this hint. Although I have read the Readme a few times, I may have overseen it.
                Code:
                bck=<gpio>,ws=<gpio>,do=<gpio>[,mute=<gpio>[:0|1][,model=TAS57xx|TAS5713|AC101|I2S][,sda=<gpio>,scl=gpio[,[B]i2c=<addr>[/B]]]
                Which notation <addr> should be? Decimal?

                i2c in dac_config uses the address. So we should try one of the following:
                * 0x10 as resulted from the test sketch posted some pages above
                * 0x20 see mboxler
                * 0x22 see mboxler

                I do not think we should use 16, 17, 32 or 34 as address as mentioned some posts before.

                To sum up: There are to many permutations to try. I would like to find some parameters we can consider to be sure and fix. So we can reduce complexity.
                - @addr is decimal and should be 16 or 17. I looked at my code () and I do the left shift for the R/W bit
                - You can leave the quote off, I always forgot that - my bad
                - I think you should try
                Code:
                model=i2s,bck=27,ws=25,do=26,sda=18,scl=23,i2c=16
                model=i2s,bck=27,ws=25,do=26,sda=18,scl=23,i2c=17
                Don't forget as well that this board has an amplifier that uses GPIO 21 for power up, so use "set_gpio" to "21=amp"
                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
                  To sum up: There are to many permutations to try. I would like to find some parameters we can consider to be sure and fix. So we can reduce complexity.
                  I have one of the ESP32-A1S boards with ES8388 and am happy to work through the permutations if that's helpful, I'll need step by step instructions though as I haven't set up Squeezelite-ESP32 before.

                  I suspect all new ESP32-A1S boards now come with ES8388. For reference I bought mine from the AliExpress store linked from the Squeezelite-ESP32 Github readme.

                  Comment


                  • Originally posted by piPlayer
                    When I try to start playback with the toggle command after booting, nothing happens. Once I have started playback with the play command, then the toggle command also works as desired. Only the first attempt after startup does not work with toggle.
                    No ideas?

                    Comment


                    • Originally posted by Tonic
                      I have one of the ESP32-A1S boards with ES8388 and am happy to work through the permutations if that's helpful, I'll need step by step instructions though as I haven't set up Squeezelite-ESP32 before.

                      I suspect all new ESP32-A1S boards now come with ES8388. For reference I bought mine from the AliExpress store linked from the Squeezelite-ESP32 Github readme.
                      I have now contacted many sellers on Aliexpress,all of them confirmed the boards have ES8388 chip

                      Comment


                      • Originally posted by piPlayer
                        No ideas?
                        I don't have time right now, but I'll look at that in a few days
                        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
                          I don't have time right now, but I'll look at that in a few days
                          Ok thanks. I don't want to rush you.

                          Comment


                          • OK, time for the next tries


                            Originally posted by philippe_44
                            Don't forget as well that this board has an amplifier that uses GPIO 21 for power up, so use "set_gpio" to "21=amp"
                            Of course I set this. My log shows the amp power up.


                            Originally posted by mboxler
                            I leave quotes off both values...

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

                            Here's what I have in dac_controlset

                            { "init": [ {"reg":45,"val":52}, {"reg":45,"val":48}, {"reg":53,"val":8}, {"reg":54,"val":81}, {"reg":64,"val":24} ] }
                            Thanks, I removed the qoutes and added the curly brackets, although "init" is the only element in the json list. Looks like:
                            {"init":[{"reg":8,"val":0}, {"reg":4,"val":60}]}


                            Originally posted by philippe_44
                            I would rather say
                            model=i2s,bck=27,ws=25,do=26,sda=18,scl=23,i2c=32
                            or
                            model=i2s,bck=27,ws=25,do=26,sda=18,scl=23,i2c=34
                            or
                            model=i2s,bck=27,ws=25,do=26,sda=18,scl=23,i2c=16
                            or
                            model=i2s,bck=27,ws=25,do=26,sda=18,scl=23,i2c=17
                            Originally posted by philippe_44
                            - @addr is decimal and should be 16 or 17. I looked at my code () and I do the left shift for the R/W bit
                            - I think you should try
                            Code:
                            model=i2s,bck=27,ws=25,do=26,sda=18,scl=23,i2c=16
                            model=i2s,bck=27,ws=25,do=26,sda=18,scl=23,i2c=17

                            Originally posted by Tonic
                            I have one of the ESP32-A1S boards with ES8388 and am happy to work through the permutations if that's helpful, I'll need step by step instructions though as I haven't set up Squeezelite-ESP32 before.
                            Because of our confusion with the documentation I still do not know which the right values for ws, do, sda and scl are. I will do some permutations and document it here. Tonic or someone else then can take over and document the next permutations until we have a working configuration.

                            @Tonic: For installation follow philippes manual of post #1 and my post #916 https://forums.slimdevices.com/showt...=1#post1025722
                            But install software I2S-4MFlash.16.699.master-cmake instead of A1S


                            For the permutations (out of our confusion from the documentation)

                            ws = {25, 26}
                            do = {26, 25, 35}
                            (of course ws != do)

                            sda = {33, 18}
                            scl = {32, 23}
                            (probably only first elements 33/32 together or second elements 18/23 together)

                            i2c = {16, 17}
                            ({10, 32, 34) maybe also possible)

                            reg8: set bit7 to 0
                            reg4: set bit7 and bit6 to 0 and bit2 - bit 5 to 1
                            (use explicit setting of the bit or only change the necessary bits (with "and"/"or")
                            ==> Maybe some assembler expert could help here

                            Let us start with the following permutations until we have success (sound):
                            * fix: dac_controlset = {"init":[{"reg":8,"val":0}, {"reg":4,"val":60}]}
                            * playing: 128kb/s CBR, mp3
                            * reboot after each permutation

                            Permutation of i2c
                            model=i2s,bck=27,ws=26,do=25,sda=33,scl=32,i2c=16 ==> I can her something from the speaker, but only random noise; no music; changing volume has no effect on noise; [0;33mW (6170) DAC core: I2C write failed
                            model=i2s,bck=27,ws=26,do=25,sda=33,scl=32,i2c=17 ==> random noise; changing volume has no effect on noise; [0;33mW (6160) DAC core: I2C write failed

                            Switch ws and do; change sda/scl; permutation of i2c
                            model=i2s,bck=27,ws=25,do=26,sda=18,scl=23,i2c=16 ==> random noise; changing volume has no effect on noise; [0;32mI (6170) DAC core: DAC uses I2C port:0, sda:18, scl:23
                            model=i2s,bck=27,ws=25,do=26,sda=18,scl=23,i2c=17 ==> random noise; changing volume has no effect on noise; [0;33mW (6160) DAC core: I2C write failed
                            model=i2s,bck=27,ws=25,do=26,sda=18,scl=23,i2c=10 ==> random noise; changing volume has no effect on noise; [0;33mW (6160) DAC core: I2C write failed
                            model=i2s,bck=27,ws=25,do=26,sda=18,scl=23,i2c=32 ==> random noise; changing volume has no effect on noise; [0;33mW (6160) DAC core: I2C write failed
                            model=i2s,bck=27,ws=25,do=26,sda=18,scl=23,i2c=14 ==> random noise; changing volume has no effect on noise; [0;33mW (6160) DAC core: I2C write failed

                            ==> I guess sda=18,scl=23,i2c=16 could be right because of missing error in the log?

                            Permutaion of ws and do again
                            model=i2s,bck=27,ws=26,do=25,sda=18,scl=23,i2c=16 ==> random noise; changing volume has no effect on noise; [0;32mI (6160) DAC core: DAC uses I2C port:0, sda:18, scl:23
                            model=i2s,bck=27,ws=25,do=35,sda=33,scl=32,i2c=16 ==> no sound; [0;33mW (6160) DAC core: I2C write failed
                            model=i2s,bck=27,ws=26,do=35,sda=18,scl=23,i2c=16 ==> random noise; changing volume has no effect on noise; [0;32mI (6160) DAC core: DAC uses I2C port:0, sda:18, scl:23

                            What do you think?

                            Maybe now it is time for the registers?

                            Comment


                            • One interesting thing:

                              If I use sda=33,scl=32 the "Scan I2C bus for devices" shows up nothing.

                              If I use sda=18,scl=23 I get
                              Code:
                                   0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
                              00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
                              10: 10 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
                              20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
                              30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
                              40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
                              50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
                              60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
                              70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
                              ------------------------------------------------------------------------------------
                              Detected the following devices (names provided by https://i2cdevices.org/addresses).
                              16 [10h]- VEML7700 VML6075
                              ------------------------------------------------------------------------------------
                              So it is definitively sda=18,scl=23 and i2c=16 (decimal) = 10 (hex).


                              Reading the registers 4 and 8 by "Read registers visible through the I2C bus" gives me:

                              Code:
                              I (293230) messaging: i2cget
                              0x3c 
                              I (297640) messaging: i2cget
                              0x00
                              That is what I set in the dac_controlset.
                              Last edited by jofland; 2021-07-21, 16:34.

                              Comment


                              • Setting reg4 = 48 turns sound (noise) on; reg4 = 12 turns it of. So the speaker output is mapped to OUT1.

                                Setting reg8 to 0, 128, 1 or 127 makes no difference to the random noise. Actually there is no change in master or slave mode recognizable.

                                ==> So I assume next we should concentrate on bck, ws and do.
                                Last edited by jofland; 2021-07-21, 16:56.

                                Comment

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