snapclient icon indicating copy to clipboard operation
snapclient copied to clipboard

Volume quiet on LyraT 4.3

Open jonzobot opened this issue 1 year ago • 10 comments

Hi Carlos,

As requested under issue #68, that commit appears to have created a small problem relating to volume on LyraT 4.3. Specifically the volume levels have been reduced substantially. It may be that the fix and config changes for that issue may need to be limited to the board in question, i.e. AI Thinker. It is probably not an issue if one is using an external amplifier, but I am using the on-board amp.

jonzobot avatar Aug 13 '24 00:08 jonzobot

~~I had to uncomment https://github.com/CarlosDerSeher/snapclient/blob/master/components/audio_hal/driver/es8388/es8388.c#L462-L468 this section to restore audio volume on my Muse Luxe~~

Disregard that, i gaslit myself again

More real fix is to add reg -= 0x0c after https://github.com/CarlosDerSeher/snapclient/blob/master/components/audio_hal/driver/es8388/es8388.c#L442

and change 0x1E to 0x21 here:

https://github.com/CarlosDerSeher/snapclient/blob/master/components/audio_hal/driver/es8388/es8388.c#L339-L344

hjri avatar Aug 22 '24 13:08 hjri

@hjri what do you think about just reverting back to the original ADF driver and modify it only for AI thinker board? And what does this reg -= 0x0c do?

CarlosDerSeher avatar Jan 19 '25 20:01 CarlosDerSeher

It's been a long time, i don't remember exactly, according to documentation it should set amplifier gain to 0db instead of -3db or something, and it's still quiet

haven't experimented since, especially since snapclient just sorta dies after a while

hjri avatar Jan 20 '25 11:01 hjri

Ok then I'll just revert to the original driver and add the diff to the current one only for AI thinker.

And what do you mean by it dies? Did you try current master? Or you could try fix_20ms branch which is the newest implementation with some bug fixes.

CarlosDerSeher avatar Jan 20 '25 11:01 CarlosDerSeher

@hjri if you find time you you could try this and see if it makes things better for you

CarlosDerSeher avatar Jan 20 '25 21:01 CarlosDerSeher

i'll give it a try and also compared to one of the "stock" firmwares as well just to confirm i'm not gaslighting myself

hjri avatar Jan 20 '25 21:01 hjri

I found this bit in raspiaudio's own code for bluetooth speaker firmware:

https://github.com/RASPIAUDIO/Simple_Bluetooth_Speaker_ESP32/blob/master/LuxeBTFAB/LuxeBTFAB.ino#L46-L49

I'm guessing all you need is set pin46 to 1 and output mode, but looking at code in this repository there is no pin 46.

I'm trying to set it with raw values taken from elsewhere:

#define AMPLIFIER_ENABLE_GPIO 0x3ff49000 + 0x10
esp_err_t es8388_pa_power(bool enable) {
  esp_err_t res = ESP_OK;
  if (enable) {
    res = gpio_set_level(get_pa_enable_gpio(), 1);
    gpio_set_level(AMPLIFIER_ENABLE_GPIO, 1);
  } else {
    res = gpio_set_level(get_pa_enable_gpio(), 0);
    gpio_set_level(AMPLIFIER_ENABLE_GPIO, 0);
  }
  return res;

Unfortunately my museluxe started bootlooping with corrupt mac addres so i can't test it.

One thing i know for sure is that device is CERTAINLY capable of putting out MUCH louder sound, since bluetooth firmware did some LOUD beeps when i tried it.

hjri avatar Jun 17 '25 14:06 hjri

So this is still an issue?

CarlosDerSeher avatar Jun 17 '25 17:06 CarlosDerSeher

most likely it is, but my muse luxe is broken (BLK0/mac addres fail) so i can't test it anymore, sorry.

hjri avatar Jun 17 '25 17:06 hjri

For me, the volume is low on lyrat 4.3 and esp32 audio kit 2.2 when DSP is enabled. If DSP is turned off, the initial volume is kind of low (but might be better then with DSP, I don't remember right now) although the volume of the client is 100%. When I then change the volume, everything will get way louder. Especially 100% volume will be way louder than before. When I flash a board without DSP support, it seems to be incapable of changing volumes first. But after trying different things (like rebooting clients and/or server, stopping streams, ...) it works.

Maybe this information is helpful :)

I'm new to programming esps and this repo, but I've got some audio boards and a bit of time... so I would be happy to support the development of this project :) (I'd probably need some pointers, though)

blattm avatar Oct 15 '25 17:10 blattm