In Home Assistant the sound of my ESP MUSE PROTO is way to weak

Hello,
Recently i brought two ESP MUSE PROTO board to be used as a notification system for within my house.
For this i installed the latest version of espHome one it. And after that i was able to use the TTS option in Home-Assistant, perfect.
Sadly the sound was way to soft to hear what was being said. Although there is that option to boost the audio to 15db the sound is still to weak to be used in a big room.

Is there anyway to boost the audio more then it is now? or am i missing something.
Below is the code i use:

esphome:
  on_boot:
    priority: 10
    then:
     - lambda: |-
          gpio_reset_pin(GPIO_NUM_23);
          gpio_set_direction(GPIO_NUM_23, GPIO_MODE_OUTPUT);           
          gpio_set_pull_mode(GPIO_NUM_23, GPIO_PULLDOWN_ONLY);
          gpio_set_level(GPIO_NUM_23, 0);      

media_player:
  - platform: i2s_audio
    id: media_out
    name: ${device} player
    dac_type: external
    i2s_lrclk_pin: GPIO25
    i2s_dout_pin: GPIO26
    i2s_bclk_pin: GPIO5
    mode: mono
    mute_pin:
      number: GPIO21
      inverted: true

for the 15db, as you did gpio 23 must be in pull-down, I heve not tried your file (i’m away from my desk) but the line is maybe not necessary you could try to remove it as it might be cancelling the pull down mode : gpio_set_level(GPIO_NUM_23, 0);

Otherwise to have a louder sound, use an external passive closed speaker, 4ohm is louder than 8ohms. If using an external speaker you could also disable the internal sepaker by cutting the connection on the back of the board.

Yeah, i will do that, it did made any difference before and after adding that line anyway. I tried to follow the config on your radio demo, that’s why i added it.

This is the external speaker i currently use:
https://www.tinytronics.nl/shop/en/audio/speakers/speakers/waveshare-speaker-set-8ω-5w
It seems to be 8Ohm 5W. Could you provide me with a better but cheap option option that could be loader then this?

Could you a picture where you show me which connection i need to break exactly. I do not want to loss my warranty doing this. :wink:

If you just put your 2 speakers in parallel (the 2 red wires together, the 2 black wires together) you will get a 4ohm speaker.

HI,
Great project and I bought a few units but I can barely hear the audio on Maximum. I wish the default setting was +15dB but it isn’t and it’s not clear how exact to set this.

After lots of tweaking I managed to get ESPHOME on Homeassistant talking to the units, can created a config file which I can “install” - could @Raspiaudio , or anyone else that knows please check the config below and advise if Im on the right track because I tried many permutations and it seems to make zero difference to the volume level.

I tried both a boot config AND setting an OUTPUT pin to pulldown.
I tried setting a sensor to read the value back, but as it’s a pulldown I assume it’s just going to say OFF (I did try setting it to PULLUP to see what happened and that was OFF too, so assume the code is broken)

In desperation I created an account so I could try and get a resolution.

Thanks in advance.
MAdelaide

substitutions:
  name: raspiaudio-muse-proto-d52f9c
  friendly_name: "MUSE STUDY d52f9"
packages:
  raspiaudio.muse-proto: github://esphome/media-players/raspiaudio-muse-proto.yaml@main
esphome:
  name: ${name}
  name_add_mac_suffix: false
  on_boot:
    priority: 10
    then:
    - lambda: |-
          gpio_reset_pin(GPIO_NUM_23);
          gpio_set_direction(GPIO_NUM_23, GPIO_MODE_OUTPUT);           
          gpio_set_pull_mode(GPIO_NUM_23, GPIO_PULLDOWN_ONLY);
          
api:
  encryption:
    key: g3xxTIdecHEsFmfx3b+Dzv+Nlw8Ccu6LmehcEhW4oVg=

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

output:
  - platform: gpio
    id: gain23_OUTPUT
    pin: 
      number: GPIO23
      mode:
        output: true
        pulldown: true

binary_sensor:
  - platform: gpio
    name: "Pin GPIO0"
    pin: GPIO0

  - platform: gpio
    name: "Pin GPIO23"
    pin: GPIO23
1 Like

I also had problems with the low volume at the beginning. I managed to put together a config that worked for me. I can only provide my config from back then because I moved over to squeezelite in the meantime. Change the xxx to your IP setup if you do OTA or just remove the lines and give it a try.

substitutions:
  name: "raspiaudio-muse-proto"
  friendly_name: "RaspiAudio Muse Proto"

esphome:
  name: "${name}"
  name_add_mac_suffix: true
  project:
    name: raspiaudio.muse-proto
    version: "1.0"
  on_boot:
    priority: 10
    then:
      - lambda: |-
          gpio_set_pull_mode(GPIO_NUM_23, GPIO_PULLDOWN_ONLY);

esp32:
  board: esp-wrover-kit
  framework:
    type: arduino

logger:
api:
ota:

dashboard_import:
  package_import_url: github://esphome/media-players/raspiaudio-muse-proto.yaml@main

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  manual_ip:
    static_ip: xxx
    gateway: xxx
    subnet: xxx

captive_portal:

web_server:

improv_serial:

media_player:
  - platform: i2s_audio
    id: media_out
    name: ${friendly_name}
    dac_type: external
    i2s_lrclk_pin: GPIO25
    i2s_dout_pin: GPIO26
    i2s_bclk_pin: GPIO5
    mode: mono
    mute_pin:
      number: GPIO21
      inverted: true

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      inverted: true
      mode:
        input: true
        pullup: true
    name: ${friendly_name} Button
    on_click:
      - media_player.toggle: media_out

light:
  - platform: fastled_clockless
    name: ${friendly_name}
    pin: GPIO22
    chipset: SK6812
    num_leds: 1
    rgb_order: grb

Now that I sent my first message I remember two problems regarding low volume that had nothing to do with the software.

In the beginning I used two old stereo speakers in separate rooms and eventually realized one was way quieter than the other. For the quieter one it made a day and night difference to simply switch the cables (black to red and red to black on only one end).

Later I added another pair of speakers where once again one was quieter. This time I used an old phone charger as a power supply that apparently didn’t deliver enough power. Different charger and once again day and night difference.

Thankyou for the suggestions, so far no luck, but I’ll try again (I have two protos). What DID have a significant volume change, for both onboard and external speakers was @raspiaudio’s suggestion to flash in simple BT mode - massive volumes change, so the hardware is capable, just something wrong with the HA ESP32 build, and default Squeezelite build (because I tried that too, and it wasn’t loud either in vanilla form)

PS: MAYBE
'the config above is not working for me because of the following error - which I don’t know how to fix apart from commenting out the id: line

platform: i2s_audio
  
  ID media_out redefined! Check media_player->0->id.
  id: media_out

Hi Madelaide and welcome,

Thanks for reporting, we will have a look at the yalm of the Proto for Home Asssitant, moving your other post here.

1 Like

Hi @Raspiaudio

I have been struggling with hearing the audio from the muse photo using the esp32 install (see In Home Assistant the sound of my ESP MUSE PROTO is way to weak) but I read the advice above and tried it out.

WOW, what a difference, the max dB level with an external 4R speaker went from 85dB to 106 - it is actually great and just the audio level I wanted, so can you please advise what is happening on the Home Assist config/build and squeezelite vs the bluetooth build?

If somehow the other two builds can be configured with the same audio level as the BT one it’d be perfect - I hope to one day use the voice control in HA when that is supported and HA does not seem to support adding a simple BT speaker as a media sink, at least not easily.

I’ve tried all the PULLDOWN and Invert config options for GPIO23 and GPIO21 (see other thread).

Cheers
Madelaide, from Adelaide Australia.

EDIT: HA onboard speaker 95dB max, BT onboard speaker, 102dB max, so over twice as loud, technically 4x output power I believe so it is significant.

Hi Madelaide,

We have tried the config you have sent is working here to set the amp at the max gain, if the sound is too low could it comes from the software volume setting too low by default in HA?

Thanks for testing @Raspiaudio, and thank for making this board; it is just want I want to be cloud-free. To be clear, I updated my config as follows in the code block (which includes GPIO21 which apparently turns on the amplifier according to the docs).

Normalising the tests, no external speaker,

The volume level in HA is set to max, and lower and it can’t be heard in default, as installed and downloaded form.

I will rerun all the tests with another muse proto, including squeezelite, all playing the same mp3 file.

*Please note I have no hardware mods - no buttons or resistors connected, just USB power, and a 4R speaker, which I’ll remove for my next test round.

UPDATE:
#99dB BT, 104 dB squeezelite, 100dB HA from (ESPHome Media Players) , 101dB from https://raspiaudio.github.io/, soundcheck app, iphone, 5mm from onboard speaker

So squeezelite is the winner (3dB louder), and my other home devices can use it, not just HA.

I should rollback the config to default for HA and see what it’s like without the PULLDOWN, but I’m over testing for now.

II’ll await microphone/speech support in HA before I try the HA build again.

@Raspiaudio could I PLEASE request on the next spin you make the speaker solder trace bigger so it is easier to cut, I needed to get a very large magnifier to see where to cut - I actually tried but gave up it was so small and didn’t want to damage the track next to it.

substitutions:
  name: t-av-office-601d84
  friendly_name: "AV OFFICE 601D84"
  
  #99dB BT, 104 dB squeezelite, 100dB HA from (https://esphome.github.io/media-players/) , 101dB from https://raspiaudio.github.io/, soundcheck, iphone, 5mm from onboard speaker

# packages:
  # raspiaudio.muse-proto: github://esphome/media-players/raspiaudio-muse-proto.yaml@main

esphome:
  name: ${name}
  name_add_mac_suffix: false
  on_boot:
    priority: 10
    then:
      - lambda: |-
          gpio_reset_pin(GPIO_NUM_23);
          gpio_set_direction(GPIO_NUM_23, GPIO_MODE_OUTPUT);  
          gpio_set_pull_mode(GPIO_NUM_23, GPIO_PULLDOWN_ONLY);

esp32:
  board: esp-wrover-kit
  framework:
    type: arduino

logger:
ota:
captive_portal:
web_server:
improv_serial:

media_player:
  - platform: i2s_audio
    id: media_out
    name: ${friendly_name}
    dac_type: external
    i2s_lrclk_pin: GPIO25
    i2s_dout_pin: GPIO26
    i2s_bclk_pin: GPIO5
    mode: mono
    mute_pin:
      number: GPIO21
      inverted: true

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      inverted: true
      mode:
        input: true
        pullup: true
    name: ${friendly_name} Button
    on_click:
      - media_player.toggle: media_out

api:
  encryption:
    key: QcLZY9xhhrMvGhYGgyRyeL4aJwKk/0dTZdiNxV96+KI=

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    # Set this to the IP of the ESP
    static_ip: 10.0.xx
    # Set this to the IP address of the router. Often ends with .1
    gateway: 10.0.xx
    # The subnet of the network. 255.255.255.0 works for most home networks.
    subnet: 255.255.255.0
    dns1: 10.0.xx
    dns2: 10.0.xx

Anyone have any luck getting ESPHOME volume as high as squeeze image yet?

Hello,

The yalm file that Madelaide shared with us in the previous message is correct as it is setting the gain pin correctly.

Thus I guess that if the volume is low this could come from gain setting on the Media Player configuration.

Could this be the solution : Compensation - Home Assistant
?