Announcement

Collapse
No announcement yet.

ANNOUNCE: Squeezelite-ESP32 (dedicated thread)

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Originally posted by jofland
    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.
    Sorry if you already know this...

    Have you tried "Examine registers visible through the I2C bus"? It will show all the registers.

    I used "Set registers visible through the I2C bus" to change resisters quickly, then used dac_controlset later.

    I became real thankful for Hex <---> Decimal <---> Binary calculators!

    Good Luck!

    Comment


    • Originally posted by jofland
      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.
      I think this is the right config

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

      But you need to write register 23 and maybe 24, but at least 23 should be

      [0 0 011 00 X] = 24

      for 16 bits serial output, that's likely the reason of the noise

      Don't use the 32 bits version of squeezelite-esp32, I don't recommend it anyway

      [edit]: if you can make it work, I'll add it to the well-known codecs
      Last edited by philippe_44; 2021-07-22, 03:15.
      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 think this is the right config

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

        But you need to write register 23 and maybe 24, but at least 23 should be

        [0 0 011 00 X] = 24

        I've reproduced jofland's result of some garbled noise when streaming a song with the following settings:

        dac_config model=I2S,bck=27,ws=26,do=25,sda=18,scl=23,i2c=16
        set_GPIO 21=amp
        dac_controlset {"init":[{"reg":8,"val":0},{"reg":4,"val":60}]}
        With all other settings left at their defaults.

        I then added {"reg":23,"val":24} to dac_controlset with no change after rebooting.
        After that I added {"reg":24,"val":24} and tested all values from 0 to 24, rebooting each time however none of these settings made any change to the output audio.


        To me the noise I'm hearing sounds like the CPU noise you hear on a poor quality PC sound card. There is a audible 'pop' when rebooting the A1S and after pausing a song, the noise becomes quieter with less pops and clicks before muting after around 31 seconds. If the audio is simply not being parsed properly I would expect that the volume should work but as jofland reported, the volume has no effect. Not sure if this is useful but maybe a clue.

        If we're focusing on the dac_config settings above for now, let me know what dac_controlset values to try next and I'll keep testing.
        Last edited by Tonic; 2021-07-22, 04:16.

        Comment


        • I then added {"reg":23,"val":24} to dac_controlset with no change after rebooting.
          After that I added {"reg":24,"val":24} and tested all values from 0 to 24, rebooting each time however none of these settings made any change to the output audio.
          If we're focusing on the dac_config settings above for now, let me know what dac_controlset values to try next and I'll keep testing.
          Thanks - When you say all values form 0 to 24, do you mean for the val or reg? b/c the reg shall be 23, not 24
          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
            Thanks - When you say all values form 0 to 24, do you mean for the val or reg? b/c the reg shall be 23, not 24
            I tested values 0 to 24 for reg:24 while reg:23 was set to val:24. So there's no confusion, here's what I tried, none of which made any difference to the output sound:

            {"init":[{"reg":8,"val":0},{"reg":4,"val":60}]}
            {"init":[{"reg":8,"val":0},{"reg":4,"val":60},{"reg":23,"va l":24}]}
            {"init":[{"reg":8,"val":0},{"reg":4,"val":60},{"reg":23,"va l":24},{"reg":24,"val":0}]}
            {"init":[{"reg":8,"val":0},{"reg":4,"val":60},{"reg":23,"va l":24},{"reg":24,"val":1}]}
            ...
            {"init":[{"reg":8,"val":0},{"reg":4,"val":60},{"reg":23,"va l":24},{"reg":24,"val":23}]}
            {"init":[{"reg":8,"val":0},{"reg":4,"val":60},{"reg":23,"va l":24},{"reg":24,"val":24}]}

            It sounds like I misunderstood when you said "you need to write register 23 and maybe 24", let me know what you'd like me to test next.

            Edit: Not sure why the forum is adding a space in "val" above, the text I used has no spaces.
            Last edited by Tonic; 2021-07-22, 06:58.

            Comment


            • Originally posted by Tonic
              I tested values 0 to 24 for reg:24 while reg:23 was set to val:24. So there's no confusion, here's what I tried, none of which made any difference to the output sound:

              {"init":[{"reg":8,"val":0},{"reg":4,"val":60}]}
              {"init":[{"reg":8,"val":0},{"reg":4,"val":60},{"reg":23,"va l":24}]}
              {"init":[{"reg":8,"val":0},{"reg":4,"val":60},{"reg":23,"va l":24},{"reg":24,"val":0}]}
              {"init":[{"reg":8,"val":0},{"reg":4,"val":60},{"reg":23,"va l":24},{"reg":24,"val":1}]}
              ...
              {"init":[{"reg":8,"val":0},{"reg":4,"val":60},{"reg":23,"va l":24},{"reg":24,"val":23}]}
              {"init":[{"reg":8,"val":0},{"reg":4,"val":60},{"reg":23,"va l":24},{"reg":24,"val":24}]}

              It sounds like I misunderstood when you said "you need to write register 23 and maybe 24", let me know what you'd like me to test next.

              Edit: Not sure why the forum is adding a space in "val" above, the text I used has no spaces.
              Maybe try

              {"init":[{"reg":8,"val":0},{"reg":4,"val":0},{"reg":23,"val ":24}]}

              And if this still does not work, I don't know, I would need probably to try myself or we need to find some example code of that DAC in slave 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
                Maybe try

                {"init":[{"reg":8,"val":0},{"reg":4,"val":0},{"reg":23,"val ":24}]}

                And if this still does not work, I don't know, I would need probably to try myself or we need to find some example code of that DAC in slave mode
                reg:4 val:0 mutes the audio.

                Edit: Scratch that, reg:4 val:0 doesn't mute but the output is very quiet. Still garbled though unfortunately.
                Last edited by Tonic; 2021-07-22, 10:05.

                Comment


                • I think that maybe I had a similar noise problem with the ES9038 chip on this board:

                  https://a.aliexpress.com/_vEC3nr

                  It was also producing a heavily garbled output. The sound was hearable but with much noise added. Additionaly it seemed that only one channel was playing. My fix for this problem was to use the 32bit version of squeezelite-ESP32. The noise was gone and the board played fine on two channels.

                  I'm not an expert but I think philippe_44 is probably right with his suggestion to configure the DAC to use 16bit input. In a first step you could also try the 32bit version of squeezelite-ESP32 to see if it makes any difference.

                  Comment


                  • So I read the ES8388 User Guide and am up to speed on how the registers work. I've tried a bunch of different settings but no luck yet.

                    I also tried the 32 bit version of Squeezelite-ESP32 and set reg:23 to val:16 to set the DAC to 32bit but no change; still garbled output.

                    Perhaps another component other than the DAC has changed on this version of the A1S?

                    I'll keep testing...

                    Comment


                    • Originally posted by Tonic
                      So I read the ES8388 User Guide and am up to speed on how the registers work. I've tried a bunch of different settings but no luck yet.

                      I also tried the 32 bit version of Squeezelite-ESP32 and set reg:23 to val:16 to set the DAC to 32bit but no change; still garbled output.

                      Perhaps another component other than the DAC has changed on this version of the A1S?

                      I'll keep testing...
                      As I read it, Word length bits are 5:3 in DACWL.

                      Decimal 16 equals 00 010 000, so you are setting the DAC to 18 bits???

                      Seems like you should set reg:23 to val:32 (00 100 000) 32 bits, unless my coffee hasn't kicked in yet.

                      Mike

                      Comment


                      • Oops, forgot the last bit, nice pickup. I'll test again.

                        Edit: Unfortunately still the same with the 32bit Squeezelite-ESP32 and {"reg":23,"val":32}.
                        Last edited by Tonic; 2021-07-23, 14:21.

                        Comment


                        • Originally posted by Tonic
                          reg:4 val:0 mutes the audio.

                          Edit: Scratch that, reg:4 val:0 doesn't mute but the output is very quiet. Still garbled though unfortunately.
                          Yep, I was confusing reg 8 and 4. 4 is controlling DAC & outputs and should be set to enable L/R out but have you tried to enable just out1 whichs eems to be the one connected to the amp? It means reg4 = 48

                          reg8 = 0
                          reg4 = 32
                          reg23 = 24

                          use 16 bits version of squeezelite

                          After that, you best chance is to look at reg23 and see if there is something with the i2s format, polarity and justification. This is likely where the issue lies
                          Last edited by philippe_44; 2021-07-23, 18: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


                          • Enabling only the left channel with reg:4 val:32 works as expected; only the left output plays noise, however no change in the noise.

                            I've been testing a large number of reg settings one by one including most permutations of reg:23 but with no change.

                            Are we 100% sure the 'bck', 'ws' and 'do' settings are correct? Because when I test different values for these, most will still generate the same noise; there doesn't seem to be anything different in the sound with bck=27,ws=26,do=25.

                            Also does anyone know what the two red LEDs next to the earphones jack are for? They're labelled 'D4' and 'D5'. They lit up in testing once but after resetting the board I wasn't able to reproduce this. Probably just found their GPIO pins but maybe an indication of something.

                            Comment


                            • Originally posted by Tonic
                              Are we 100% sure the 'bck', 'ws' and 'do' settings are correct? Because when I test different values for these, most will still generate the same noise; there doesn't seem to be anything different in the sound with bck=27,ws=26,do=25.
                              I zoomed in on the datasheet. Maybe these are correct? bck=5,ws=25,do=26

                              Mike

                              Click image for larger version

Name:	Screenshot (45).jpg
Views:	1
Size:	85.0 KB
ID:	1572932

                              Comment


                              • I've tried this and all combinations of 5, 25, 26, 27, 35 for all three but to no effect. I even tried all values from 0 to 38 for bck with ws=26 do=25.

                                I think there's still something fundamental we're missing. I've scoured the registers but there just aren't that many options to try. This is the base configuration I'm deviating from, the bck, ws and do settings seem to to be the most likely to be wrong as the registers are well documented, the sda, scl and i2c settings are confirmed and with any other setting on the amp I get silence.
                                dac_config model=I2S,bck=27,ws=26,do=25,sda=18,scl=23,i2c=16
                                dac_controlset {"init":[{"reg":8,"val":0},{"reg":4,"val":48},{"reg":23,"va l":24}]}
                                set_GPIO 21=amp

                                (ignore the space in "val", that seems to be a forum formatting issue)

                                Would it be useful to record the noise I'm hearing? Perhaps it's a clue to more experienced ears?

                                Comment

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