Announcement

Collapse
No announcement yet.

ANNOUNCE: Squeezelite-ESP32 (dedicated thread)

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Originally posted by jofland
    According to the doc it should be 10000000. But if I read it from the DAC after booting with empty dac_controlset it shows 0x00.

    [ATTACH]35362[/ATTACH]
    Thanks! That seems to indicate that es8388.c is setting the DAC to slave mode. kheperV3 had to modify esp_app_main.c with this code

    // GPIO0 => CLK_OUT1
    PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0_CLK_OUT1);
    WRITE_PERI_REG(PIN_CTRL, READ_PERI_REG(PIN_CTRL)& 0xFFFFFFF0);

    to assign MCLK to GPIO0, allowing the ESP32 to supply the es8388 with MCLK (I hope I have this MASTER/SLAVE thing figured out).


    Originally posted by jofland
    It writes into register ES8388_MASTERMODE = 0x08 the value from the configuration struct. The return value will be ORed to the last return value; 1 indicates an error.
    Again, thanks. I'm an old COBOL programmer and am having trouble following this code.

    Comment


    • Originally posted by philippe_44
      Output to I2S DAC. Special drivers exist for TAS5754/56/13/80 and AC101 but most I2S-connected DAC will work and it's possible to configure rudimentary I2C commands.
      Sorry, but I've been reading up on I2S and now feel like I have enough knowledge to be dangerous .

      Is it true that the default I2S driver makes the ESP32 the I2S master when connected to a DAC? This means that the BCLK, LRCK, AND DATA pins
      are all outputs?

      The ESP32 derives an MCLK from it's internal 40mhz clock, getting an MCLK as close as possible to Freq * Bit Length * 2 * 8?

      Once MCLK is determined, BCLK and LRCK are derived from it?

      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

      I'm going to stop there, since any more questions are based on the above answers.

      Thanks, Mike

      Comment


      • Originally posted by mboxler
        Sorry, but I've been reading up on I2S and now feel like I have enough knowledge to be dangerous .

        Is it true that the default I2S driver makes the ESP32 the I2S master when connected to a DAC? This means that the BCLK, LRCK, AND DATA pins
        are all outputs?

        The ESP32 derives an MCLK from it's internal 40mhz clock, getting an MCLK as close as possible to Freq * Bit Length * 2 * 8?

        Once MCLK is determined, BCLK and LRCK are derived from it?

        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

        I'm going to stop there, since any more questions are based on the above answers.

        Thanks, Mike
        Yes, esp32 is master and bitclock as well as wordclock are outputs. Masterclock has to be generated by the DAC. All DAC I’ve used so far are capable of being slave in that mode
        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
          Yes, esp32 is master and bitclock as well as wordclock are outputs. Masterclock has to be generated by the DAC. All DAC I’ve used so far are capable of being slave in that mode
          Thank you so much!

          So in my example above, the DAC has to be able to generate a master clock of 11289597.000, or some other multiple of 1411199.6250? If it can't for some reason, then the ESP32 would need to connect an MCLK pin (GPIO 0) to the DAC? I assume WM8978 DAC has such an issue and that's why wm8978.c
          has code to output the ESP32's MCLK to GPIO 0...

          ESP_LOGI(TAG, "Configuring MCLK on pin:%d", 0);
          PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0_CLK_OUT1);
          REG_WRITE(PIN_CTRL, 0xFFFFFFF0);

          Mike

          Comment


          • Originally posted by mboxler
            Thank you so much!

            So in my example above, the DAC has to be able to generate a master clock of 11289597.000, or some other multiple of 1411199.6250? If it can't for some reason, then the ESP32 would need to connect an MCLK pin (GPIO 0) to the DAC? I assume WM8978 DAC has such an issue and that's why wm8978.c
            has code to output the ESP32's MCLK to GPIO 0...

            ESP_LOGI(TAG, "Configuring MCLK on pin:%d", 0);
            PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0_CLK_OUT1);
            REG_WRITE(PIN_CTRL, 0xFFFFFFF0);

            Mike
            I’ve never investigated the issue of wm8978, I’ve just accepted the PR. It’s surprising that a DAC cannot work w/o a mclk but I did not try (I have a wm8978 now but my days have only 24 hours ). I don’t like the idea of using GPIO0 as I need it for other purpose on some designs and I also intend to make some other development adding Ethernet and I know there are some difficulties there with gpio0. I’ll try the es8388 as soon as I receive my board, which should be this week
            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


            • ANNOUNCE: Squeezelite-ESP32 (dedicated thread)

              I've received my board. The main issue was the use of MCLK (master clock). This is a crappy codec...
              Anyway, please use the latest build and there is no need for dac_controlset, I've added it to the well-known codecs. You still need the dac_config
              Code:
              model=ES8388,bck=5,ws=25,do=26,sda=18,scl=23,i2c=16
              [edit]: corrected dac_config!
              Last edited by philippe_44; 2021-08-04, 21:26.
              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


              • Thank you. I will try it after my vacation, next week.

                Comment


                • thank you, should I use generic firmware and put your config?

                  Comment


                  • Originally posted by Diddlik
                    thank you, should I use generic firmware and put your config?
                    Yes - there is no A1S version anymore
                    Last edited by philippe_44; 2021-08-04, 15:47.
                    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've received my board. The main issue was the use of MCLK (master clock). This is a crappy codec...
                      Anyway, please use the latest build and there is no need for dac_controlset, I've added it to the well-known codec. You still need the dac_config
                      Code:
                      model=ES8388,bck=5,ws=26,do=25,sda=18,scl=23,i2c=16
                      Hi, thanks for the new version!

                      Just flashed it, set the dac_config and GPIO but all I get is the noise(gets louder if I turn volume down). Tried both 16 and 32bit versions.
                      What did I miss?
                      Last edited by attz; 2021-08-04, 19:18.

                      Comment


                      • Originally posted by attz
                        Hi, thanks for the new version!

                        Just flashed it, set the dac_config, but all I get is the noise on headphones(gets louder if I turn volume down). Tried to connect the outputs on speakers, but there's nothing coming out at all. GPIO is also set to 21. Tried both 16 and 32bit versions.
                        What did I miss?
                        Did you erase your dac_controlset? I’d guess not
                        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
                          Did you erase your dac_controlset? I’d guess not
                          I didn't even set it up, it's empty. I flashed new version (16bit) by flash download tool, later updated to 32 by OTA.

                          P.S. Got the output to amp, there was just my mistake. Also got the same noise from there tho.
                          Last edited by attz; 2021-08-04, 19:25.

                          Comment


                          • Originally posted by attz
                            I didn't even set it up, it's empty. I flashed new version (16bit) by flash download tool, later updated to 32 by OTA.

                            P.S. Got the output to amp, there was just my mistake. Also got the same noise from there tho.
                            I would advice to erase everything and start from a fresh flash. I just checked on my board and use the online version and it worked for me both on speaker and headset

                            [edit]: are you sure as well that you have a A1S audio kit board?
                            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 would advice to erase everything and start from a fresh flash. I just checked on my board and use the online version and it worked for me both on speaker and headset

                              [edit]: are you sure as well that you have a A1S audio kit board?
                              Just flashed my 2nd board with flash tool (erasing it before). Same story - noise.
                              Yes, the board is ESP32 Audio Kit V2.2 2957 with ESP32-A1S 2974 on it.

                              fw: I2S-4MFlash.16.710.master-cmake, flashed it, connected to my wlan, set_GPIO is set to 21=amp,22=green:0,39=jack:0 , dac_config is set to model=ES8388,bck=5,ws=26,do=25,sda=18,scl=23,i2c=1 6

                              Oh, and red LED is blinking every 3 seconds, stays red when playing(guess that's normal).
                              How can I view logs?
                              Last edited by attz; 2021-08-04, 20:30.

                              Comment


                              • Originally posted by attz
                                Just flashed my 2nd board with flash tool (erasing it before). Same story - noise.
                                Yes, the board is ESP32 Audio Kit V2.2 2957 with ESP32-A1S 2974 on it.

                                fw: I2S-4MFlash.16.710.master-cmake, flashed it, connected to my wlan, set_GPIO is set to 21=amp,22=green:0,39=jack:0 , dac_config is set to model=ES8388,bck=5,ws=26,do=25,sda=18,scl=23,i2c=1 6

                                Oh, and red LED is blinking every 3 seconds, stays red when playing(guess that's normal).
                                How can I view logs?
                                Just use any port reader (like putty) on the com port set by the board when connected with USB. You can also enable telnet and use putty as well over IP
                                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
                                😀
                                🥰
                                🤢
                                😎
                                😡
                                👍
                                👎