Open nighi opened 3 months ago
Thank you for bringing this to my attention. Currently, I don't have access to external DACs to perform tests. It's unclear whether the adf_pipeline component is compatible with 'source: github://pr#5230'; it's likely incompatible. You may consider removing it since adf_pipeline already incorporates the idf-adf SDK. Additionally, could you experiment with a different TTS voice? The one you're currently using generates samples at a 24000 rate, which appears to be unsupported or at least not set correctly. You could also try testing if it is possible to stream radio stations using the radio browser component.
And I just noticed, you should remove the speaker component from you configuration when you use voice assistant with media_player ...
Can you try using the branch: 3-make-supported-i2s-sampling-rates-configurable
- source:
type: git
url: https://github.com/nighi/esphome_audio
ref: 3-make-supported-i2s-sampling-rates-configurable
components: [ adf_pipeline, i2s_audio ]
refresh: 0s
I removed any restriction on setting the i2s sampling rate and number of channels in this branch
Regarding the microphone:
Unfortunately I can't see any helpful information in you log. Could you set your use_wake_word switch to RESTORE_DEFAULT_OFF, wait until all components are set up and then switch the voice assistant component on manually? Hopefully the log will show more relevant information then...
Oh, good hint with the idf-adf, thought I'd removed it. I removed the external component and the speaker, but it seems to make no difference. Regarding the external DAC/ADC I'm wondering why the speaker works(ish) while the microphone not.
I've tried different audio sources, but nothing really works. Some tracks are even to fast or to slow. I even downloaded a sample file for 16K Sample rate and streamed it with HA local media. here Because I didn't know how to adjust the tts settings. This sample file works fine until I play something different with another sample rate. Then the file is again to slow until I reset the esp.
With your new branch Deutschlandfunk and BBC World from the radiobrowser works correctly.
[14:10:54][D][media_player:066]: Media URL: http://st01.dlf.de/dlf/01/128/mp3/stream.mp3
[14:10:55][I][HTTPStreamReader:046]: [ * ] Receive music info from mp3 decoder, sample_rates=48000, bits=16, ch=2
The tts engines and the 16K-sample doesn't work and sound is additionally distorted. If I reboot and play at first a tts or the 16k-sample (all ch=1) it works also fine. After a stereo channel media is played the mono channel media doesn't work anymore. So maybe it can't switch between channels?
Regarding the microphone I also realized that I only pasted the tail of my log. Here is the full:
Thanks, that's very helpful information to localise the bug! I will look into it...
Ok, I committed a fix for switching the number of channels into the 3-make-supported-i2s-sampling-rates-configurable branch. Can you check if it helps with your problem?
I will look into the microphone problem later...
Okay, it seems to be better. Switching from 2 to 1 channel still causes some problems, though. It sounds like the speed is right now. But there are still dropouts and distortion after the switch.
Do the problems only occur when you switch audio streams or also when you start an audio stream the first time? Could you maybe try a configuration which has only the media_player setup (no microphone and no voice assistant) and check if you run into the same problems?
Regarding the microphone, in your configuration you have set channel to left, but in the external component you are loading, the channel register on the ES8388 ist set hard coded to right: https://github.com/mulcmu/esphome-es8388-a1s/blob/a0599d7338682217874cce395c761f049f5053d5/components/es8388/es8388_component.cpp#L65
/@nightdav
// set to Mono Right
this->write_byte(0x0B, 0x10);
When the microphone component only receives zeros for a specific time, it sets its state to 'stopped'. This could be the reason why you receive the 'microphone is not running' error.
Yes, exactly this occurs only if I plqy first a 2 channel audio and than a 1 channel audio. I'll looking into it to only configure a mediaplayer.
Regarding the microphone: I changed the config to channel: right
and got the same error.
[14:58:42][D][esp-idf:000]: E (720488) I2S: register I2S object to platform failed
Thanks for testing, I just committed a new version to the 3-make-supported-i2s-sampling-rates-configurable branch. In this version the pcm format is read from the stream first, then the streamer is reset and and the actual pipeline is started. It would be great if you could test if this is of any help for your problem.
The playback works like a charm :tada:. Unfortunately, it isn't possible to change the volume anymore.
[08:11:09][D][media_player:059]: 's3-dev_media_player' - Setting
[08:11:09][D][media_player:069]: Volume: 0.13
[08:11:09][D][esp-idf:000]: W (115800) I2S_STREAM: The ALC don't be used. It can not be set.
[08:11:09][E][adf_i2s_out:131]: error setting volume to -24
[08:11:10][D][media_player:059]: 's3-dev_media_player' - Setting
[08:11:10][D][media_player:069]: Volume: 0.34
[08:11:10][D][esp-idf:000]: W (116824) I2S_STREAM: The ALC don't be used. It can not be set.
[08:11:10][E][adf_i2s_out:131]: error setting volume to -11
But re-enabling ALC does the trick .use_alc = true
. Is there a reason why you deactivated it? Or simply to reduce the complexity to identify the issue. If that is the case I have created a PR #6.
Perfect, yes that was exactly the reason for disabling it. I will make it configurable though, so people that use the volume control of their sound chip can disable alc.
Regarding the microphone, I guess the problem is within using the same i2s-controller for input and output. I will look into it, but I need to prepare some hardware for testing i2s in duplex-mode first. Is it possibility for you to test your microphone configuration alone? Without configuring any speaker or media_player component?
I tested the microphone with a silent voice assistant (without media_player or speaker). It seems to successfully register the microphone, but the wake word is not detected. I think the state change from the voice-assistant from STARTING_MICROPHONE
to WAIT_FOR_VAD
is missing.
After toggling use_wake_word
the old error microphone not running
appears back.
I could also do a i2s capture with a cheap logic analyzer if this helps.
the log file looks quite normal to me so far, maybe the sampling rate or channel settings or something like that is not correctly set. Could you check if you notice something wrong when listening to the audio that home assistant receives? You can configure that the assist-pipeline of HA stores the received audio file for debugging purposes: You have to add something like this to your home-assistant configuration file:
assist_pipeline:
debug_recording_dir: /config/debug
It seems like to create one empty .wav file. If I toggle use wake word, it repeatedly creates exactly this file. Every time the same 44 Bytes. Weirdly I can't even download these files??
➜ ~ cd media/assist-pipeline/3f14b00d61113444bb926dbf819e24f5/Home\ Assistant/591206133912532
➜ 591206133912532 hexdump -C 00_wake-wake_word.openwakeword_2.wav
00000000 52 49 46 46 24 00 00 00 57 41 56 45 66 6d 74 20 |RIFF$...WAVEfmt |
00000010 10 00 00 00 01 00 01 00 80 3e 00 00 00 7d 00 00 |.........>...}..|
00000020 02 00 10 00 64 61 74 61 00 00 00 00 |....data....|
0000002c
➜ 591206133912532 cd ..
➜ Home Assistant cd 590593051580302
➜ 590593051580302 hexdump -C 00_wake-wake_word.openwakeword_2.wav
00000000 52 49 46 46 24 00 00 00 57 41 56 45 66 6d 74 20 |RIFF$...WAVEfmt |
00000010 10 00 00 00 01 00 01 00 80 3e 00 00 00 7d 00 00 |.........>...}..|
00000020 02 00 10 00 64 61 74 61 00 00 00 00 |....data....|
0000002c
➜ 590593051580302 cd ../591206252426423
➜ 591206252426423 hexdump -C 00_wake-wake_word.openwakeword_2.wav
00000000 52 49 46 46 24 00 00 00 57 41 56 45 66 6d 74 20 |RIFF$...WAVEfmt |
00000010 10 00 00 00 01 00 01 00 80 3e 00 00 00 7d 00 00 |.........>...}..|
00000020 02 00 10 00 64 61 74 61 00 00 00 00 |....data....|
0000002c
Hey, It turned out that I messed up the detection for a pipeline status change in my last 'fix'. Hence, the microphone was not working anymore. I committed some fixes into the '8-random-speed-of-playback branch', could you try if this update helps with your problem too?
Hey, yes we are one step further. The wake word detection recorded playable .wav files. The sound is very damped, quiet and most of the time not recognizable. It is certainly not enough for any voice detection. I tried to adjust my settings but couldn't achieve better results.
voice_assistant:
volume_multiplier: 6
noise_suppression_level: 4
auto_gain: 20dBFS
These were my settings which I've tuned with my old yaml config and I think they should still apply anyway.
Without the high noise_suppression I got very noisy audio. A higher gain and volume multiplier seems to don't change anything. If I scream directly into the microphone I am able to trigger the wake word detection though. The audio is attached: sample.zip
I think (and correct me if I'm wrong) for the settings for sample_rate:
and bits_per_sample
I have to refer to the settings of my adc done during the initialisation by the es8388 component.
https://github.com/mulcmu/esphome-es8388-a1s/blob/a0599d7338682217874cce395c761f049f5053d5/components/es8388/es8388_component.cpp#L65
For the parallel use with the media player your fix doesn't help, which is expected I guess.
The wake work detection expects a mono signal with 16k sampling rate and 16bit bits_per_sample but these settings seem to be correct in your configuration and also in the es8388 register settings.
Ok, you have the old configuration which uses the components from pr#5230 and which is working, right? So I guess, we have to go through all the settings and parameters and see where we find any difference. Actually both implementations should do the same in the end. The difference is that the pipeline in pr#5230 is setup hardcoded, and in this repository it is setup according to the configuration.
I have added a version where the i2s controllers are released after stopping the pipeline. This doesn't allow full duplex yet but could you try if this helps with you hardware? Plese see #17
Ok, we are one step further. I think you mean by not full duplex yet that the voice-assistant and the media-player may not
be active at the same time. So the media player have to be stopped while the voice assistant wake word detection is active and vice versa.
In general I think both works although I weren't able to trigger the wakeword due to the very quiet recording. Could it be that the settings from the voiceassistant component aren't applied for the microphone pipeline? It seems like changing the settings doesn't change anything. I already tried to enable ALC for the input but no difference.
But there are still some reconnects/exceptions? And I was sometimes able to trigger the microphone not running errror loop.
Another thing I noticed: After stopping the mediaplayer by Command: STOP
and starting a new stream, the volume is set back to a louder (or max) volume as set before. The mediaplayer in homeassistant is still on the same setting and if I change the volume the volume setting is synced again.
Let me know if I can test any special scenario.
I would like to test if any of your fixes of the other issues has fix any of mine. But the duplex branch is not up to date and only partially merged to main. Is that correct or should main already contain all changes of the duplex branch?
I tried to merge it myself but couldn't figure out which changes I need.
Anyhow as I have seen there is also a custom voice assistant component. Should I ve tested with this? I'm pretty shure I didn't. Also is the esphome version important? Since there is a target version in the readme.
Hey, you could either try the main branch or the vad-test branch, they should both work in half duplex mode. The custom voice assistant component, ensures that the va pipeline gets only started when the microphone is ready and in the vad-test branch it allows using vad with adf pipeline.Am 31.03.2024 um 18:06 schrieb nighi @.***>: I would like to test if any of your fixes of the other issues has fix any of mine. But the duplex branch is not up to date and only partially merged to main. Is that correct or should main already contain all changes of the duplex branch? I tried to merge it myself but couldn't figure out which changes I need. Anyhow as I have seen there is also a custom voice assistant component. Should I ve tested with this? I'm pretty shure I didn't. Also is the esphome version important? Since there is a target version in the readme.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>
I just found my es8388 a1s in a box and started to look if the support for them is more stable now than when I last tried. I would love to give them another shot with the help of your amazing work.
Could you give me some hints on where to start testing as you provide several routes of integration and some of the problems discussed in this thread seem to be solved in the meantime…
And I noticed your integration of the init-code for the es8388-chips into this repo – so the external component by mulcmu shouldn't be needed anymore? Correct?
Any advice would be much appreciated and I would be a happy tester ;)
Thanks in advance!
Hey, sorry I couldn't find much time to test lately. I could provide my config with the new syntax. Maybe @gnumpi could doublecheck, if this is the intended use. Unfortunately there are still problems left.
esphome:
name: voice-sat
name_add_mac_suffix: false
on_boot:
- priority: -100
then:
- wait_until: api.connected
- delay: 1s
- if:
condition:
switch.is_on: use_wake_word
then:
- voice_assistant.start_continuous:
api:
logger:
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
captive_portal:
esp32:
board: esp-wrover-kit
framework:
type: esp-idf
external_components:
- source: github://mulcmu/esphome-es8388-a1s@nightdav-patch
components: [es8388]
refresh: 0s
- source:
type: git
url: https://github.com/gnumpi/esphome_audio
ref: main
components: [ adf_pipeline, i2s_audio]
refresh: 0s
i2c:
sda: GPIO33
scl: GPIO32
es8388:
i2s_audio:
id: i2s_in_out
i2s_lrclk_pin: GPIO25
i2s_bclk_pin: GPIO27
i2s_mclk_pin: GPIO0
access_mode: duplex
adf_pipeline:
# create an I2SWriter pipeline element
# using the i2s_out configuration
- platform: i2s_audio
type: audio_out
id: adf_i2s_out
i2s_audio_id: i2s_in_out
i2s_dout_pin: GPIO26
dac:
model: es8388
sample_rate: 16000
bits_per_sample: 16bit
fixed_settings: true
# create an I2SReader pipeline element
# using the i2s_in configuration
- platform: i2s_audio
type: audio_in
id: adf_i2s_in
i2s_audio_id: i2s_in_out
i2s_din_pin: GPIO35
channel: right
pdm: false
adc:
model: generic
bits_per_sample: 16bit
fixed_settings: true
microphone:
- platform: adf_pipeline
id: adf_microphone
pipeline:
- adf_i2s_in
- resampler
- self
media_player:
- platform: adf_pipeline
id: adf_media_player
name: s3-dev_media_player
internal: false
pipeline:
- self
- resampler
- adf_i2s_out
voice_assistant:
microphone: adf_microphone
media_player: adf_media_player
id: va
volume_multiplier: 8.0
noise_suppression_level: 4
auto_gain: 31dBFS
#vad_threshold: 3
on_end:
- delay: 100ms
- wait_until:
not:
media_player.is_playing:
- script.execute: reset_led
on_listening:
- light.turn_on: led
switch:
- platform: gpio
pin: GPIO21
name: "AMP Switch"
restore_mode: ALWAYS_OFF
- platform: template
name: Use wake word
id: use_wake_word
optimistic: true
restore_mode: ALWAYS_OFF #RESTORE_DEFAULT_ON
entity_category: config
on_turn_on:
- lambda: id(va).set_use_wake_word(true);
- if:
condition:
not:
- voice_assistant.is_running
then:
- voice_assistant.start_continuous
- script.execute: reset_led
on_turn_off:
- voice_assistant.stop
- lambda: id(va).set_use_wake_word(false);
- script.execute: reset_led
script:
- id: reset_led
then:
- if:
condition:
switch.is_on: use_wake_word
then:
- light.turn_on: led
else:
- light.turn_off: led
light:
- platform: binary
id: led
name: "Test LED 1"
output: light_output_1
- platform: binary
name: "Test LED 2"
output: light_output_2
output:
- id: light_output_1
platform: gpio
pin: GPIO22
inverted: true
- id: light_output_2
platform: gpio
pin: GPIO19
inverted: true
I tried to play different files and get different kind of errors and exceptions with reconnects. The only stream that worked is the "Deutschlandfunk" from the radio browser (Media URL: http://st01.dlf.de/dlf/01/128/mp3/stream.mp3).
Sorry for just pasting the whole log. If I should test something specific please tell me.
Hey, thanks for the config! Just to be sure: did you capture the log on latest main?
From looking around the code, my assumptions are:
Based on those assumptions you should remove the inclusion of the nightdev-custom-component as you are basically initializing the esp8388 two times. Not sure if that's a problem though…
Basically I wanted to get some baseline for my expectations before starting to test, to reduce friction and be sure to tackle real problems and not just repeating other peoples findings…
Yes, you were right. I was not sure whether I need this es8388
component anymore. But getting rid of it doesn't change anything from a functional point of view.
However, I could get other media sources to work by adding channel: right
to the i2s audio_out component.
I could also get the wakeword detection working, as I removed the - resampler
from the microphone
component. Although I still got worse audio quality compared to my old working config.yml without adf-pipelines.
Also, I could trigger exceptions with reconnect, if I play something on the mediaplayer when use_wake_word
is still on. But this doesn't happen with the response of the voice assistant.
Hey, yes you are right with your config you don’t need the es8388 component anymore but right now the implementation does only do a fixed initialization. The code is prepared to set the es8388 settings according to the the I2S settings but it is not fully implemented yet. As I don’t own an es8388 myself it’s not too easy to do the testing. Another idea is to use the work of https://github.com/gnumpi/esphome_audio/issues/27 and implement a generic ADF DAC device which uses the implementations already available as part of the adf sdk. It‘s on my list, but I still want to fix other issues first. Regarding your exceptions and reboots you can try the next-dev branch which includes some code rewrites addressing this issue…
I just wanted to try some testing and noticed that one of my two boards seem to be completely broken (no serial at all) and one has a broken headphone jack. I'll try to see if I can fix them or if I order some new ones in cn. But for the time being I might not be that helpful… ;)
That said, I still think that it would be worth to have a working implementation of ES8388 as those chips are the cheapest and easiest option to build your own ha/esphome audio-device out there.
Regarding the basic implementation of the code: It's basically the same as in most of the other esphome-repos regarding es8388. As far as I remember the es8388 has far more modes and capabilities and basically none of the repos implemented them according to the user-guide.
From my notes for reference:
@nighi try to set the sample_rate to 44100 and enable apll-timers (see readme) and see if that improves quality.
EDIT: @gnumpi I ordered 2 boards from aliexpress. Lead time ~2 weeks. If you are interested I would sent one over when they arrive.
@gnumpi got my new boards and started testing. Mp3-playback with a http-stream seems to be working fine, but ssl seems to be crashing:
[20:12:03][V][esp-idf:000]: I (24811) AUDIO_ELEMENT: [decoder] AEL_MSG_CMD_RESUME,state:1
[20:12:03]
[20:12:03][V][esp-idf:000]: I (24818) MP3_DECODER: MP3 opened
[20:12:03]
[20:12:09][E][esp_adf_pipeline:238]: Timeout while PREPARING. Stopping pipeline!
[20:12:09][D][esp_adf_pipeline:437]: [MediaPlayer] Pipeline changed from PREPARING to ABORTING. (REQ: 1)
[20:12:09][I][adf_media_player:167]: got new pipeline state: 10, while in MP state PLAYING
[20:12:09][I][adf_media_player:226]: current mp state: PLAYING
[20:12:09][I][adf_media_player:227]: anouncement: false
[20:12:09][I][adf_media_player:228]: play_intent: false
[20:12:09][I][adf_media_player:229]: current_uri_: yes
[20:12:09][D][adf_audio_element:324]: [http] Checking State for stopping, got 2
[20:12:09][D][adf_audio_element:324]: [decoder] Checking State for stopping, got 2
[20:12:09][V][esp-idf:000]: E (30731) AUDIO_ELEMENT: [decoder] Element already stopped
[20:12:09]
[20:12:12][V][esp-idf:000]: E (33431) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x2880
[20:12:12]
[20:12:12][V][esp-idf:000]: E (33433) esp-tls: Failed to open new connection
[20:12:12]
[20:12:12][V][esp-idf:000]: E (33433) TRANSPORT_BASE: Failed to open a new connection
[20:12:12]
[20:12:12][V][esp-idf:000]: E (33435) HTTP_CLIENT: Connection failed, sock < 0
[20:12:12]
[20:12:12][V][esp-idf:000]: E (33436) HTTP_STREAM: Failed to open http stream
[20:12:12]
[20:12:12][V][esp-idf:000]: E (33441) AUDIO_ELEMENT: [http] AEL_STATUS_ERROR_OPEN,28674
[20:12:12]
[20:12:12][V][esp-idf:000]: W (33452) AUDIO_ELEMENT: [http] audio_element_on_cmd_error,7
Any ideas? I'm on the dev-next
-branch and I'm using esp-idf
with the recommend
version…
Thank you for this component and your efforts, really appreciate.
Hardware:
DAC: es8388 Board: AI-Tinker ESP32-A1S
Problem 1: Audio output is much too slow
Audio output of the media player is working but is much too slow, maybe half of the original velocity.
Problem 2: Microphone not running
The log message
is present as soon as I start the voice-assistant. But no other error message on the log.
config.yaml
```yaml esphome: name: voice-sat name_add_mac_suffix: false on_boot: - priority: -100 then: - wait_until: api.connected - delay: 1s - if: condition: switch.is_on: use_wake_word then: - voice_assistant.start_continuous: api: logger: ota: wifi: ssid: !secret wifi_ssid password: !secret wifi_password captive_portal: esp32: board: esp-wrover-kit framework: type: esp-idf external_components: #- source: github://pr#3552 # DAC support https://github.com/esphome/esphome/pull/3552 - source: github://mulcmu/esphome-es8388-a1s@nightdav-patch components: [es8388] refresh: 0s - source: github://pr#5230 components: - esp_adf refresh: 0s - source: type: git url: https://github.com/nighi/esphome_audio ref: main components: [ adf_pipeline, i2s_audio ] refresh: 0s i2c: sda: GPIO33 scl: GPIO32 es8388: i2s_audio: id: i2s_in_out i2s_lrclk_pin: GPIO25 i2s_bclk_pin: GPIO27 adf_pipeline: # create an I2SWriter pipeline element # using the i2s_out configuration - platform: i2s_audio type: sink id: adf_i2s_out i2s_audio_id: i2s_in_out i2s_dout_pin: GPIO26 # create an I2SReader pipeline element # using the i2s_in configuration - platform: i2s_audio type: source id: adf_i2s_in i2s_audio_id: i2s_in_out i2s_din_pin: GPIO35 channel: left sample_rate: 16000 ##??? bits_per_sample: 16bit ##?? microphone: - platform: adf_pipeline id: adf_microphone pipeline: - adf_i2s_in - self speaker: - platform: adf_pipeline id: adf_speaker pipeline: - self - adf_i2s_out media_player: - platform: adf_pipeline id: adf_media_player name: s3-dev_media_player internal: false pipeline: - self - adf_i2s_out voice_assistant: microphone: adf_microphone media_player: adf_media_player id: va volume_multiplier: 6 noise_suppression_level: 4 auto_gain: 20dBFS on_end: - delay: 100ms - wait_until: not: speaker.is_playing: - script.execute: reset_led on_listening: - light.turn_on: led switch: - platform: gpio pin: GPIO21 name: "AMP Switch" restore_mode: ALWAYS_OFF - platform: template name: Use wake word id: use_wake_word optimistic: true restore_mode: RESTORE_DEFAULT_ON entity_category: config on_turn_on: - lambda: id(va).set_use_wake_word(true); - if: condition: not: - voice_assistant.is_running then: - voice_assistant.start_continuous - script.execute: reset_led on_turn_off: - voice_assistant.stop - lambda: id(va).set_use_wake_word(false); - script.execute: reset_led script: - id: reset_led then: - if: condition: switch.is_on: use_wake_word then: - light.turn_on: led else: - light.turn_off: led light: - platform: binary id: led name: "Test LED 1" output: light_output_1 - platform: binary name: "Test LED 2" output: light_output_2 output: - id: light_output_1 platform: gpio pin: GPIO22 inverted: true - id: light_output_2 platform: gpio pin: GPIO19 inverted: true ```As reference: working config.yml without adf-pipeline
```yaml esphome: name: m5stack-atom-echo-59aac0 friendly_name: check name_add_mac_suffix: false on_boot: - priority: -100 then: - wait_until: api.connected - delay: 1s - if: condition: switch.is_on: use_wake_word then: - voice_assistant.start_continuous: api: # Enable logging logger: ota: wifi: ssid: !secret wifi_ssid password: !secret wifi_password captive_portal: esp32: board: esp-wrover-kit framework: type: esp-idf external_components: #- source: github://pr#3552 # DAC support https://github.com/esphome/esphome/pull/3552 - source: github://mulcmu/esphome-es8388-a1s@nightdav-patch components: [es8388] refresh: 0s - source: github://pr#5230 components: - esp_adf refresh: 0s i2c: sda: GPIO33 scl: GPIO32 es8388: speaker: - platform: i2s_audio id: AudioKit i2s_dout_pin: GPIO26 dac_type: external mode: mono i2s_audio: i2s_lrclk_pin: GPIO25 i2s_bclk_pin: GPIO27 microphone: - platform: i2s_audio i2s_din_pin: GPIO35 id: mic1 adc_type: external pdm: false esp_adf: voice_assistant: microphone: mic1 speaker: AudioKit id: va volume_multiplier: 6 noise_suppression_level: 4 auto_gain: 20dBFS on_end: - delay: 100ms - wait_until: not: speaker.is_playing: - script.execute: reset_led on_listening: - light.turn_on: led switch: - platform: gpio pin: GPIO21 name: "AMP Switch" restore_mode: ALWAYS_OFF - platform: template name: Use wake word id: use_wake_word optimistic: true restore_mode: RESTORE_DEFAULT_ON entity_category: config on_turn_on: - lambda: id(va).set_use_wake_word(true); - if: condition: not: - voice_assistant.is_running then: - voice_assistant.start_continuous - script.execute: reset_led on_turn_off: - voice_assistant.stop - lambda: id(va).set_use_wake_word(false); - script.execute: reset_led script: - id: reset_led then: - if: condition: switch.is_on: use_wake_word then: - light.turn_on: led else: - light.turn_off: led light: - platform: binary id: led name: "Test LED 1" output: light_output_1 - platform: binary name: "Test LED 2" output: light_output_2 output: - id: light_output_1 platform: gpio pin: GPIO22 inverted: true - id: light_output_2 platform: gpio pin: GPIO19 inverted: true ```log output slow audio output
```log [21:59:38][D][media_player:059]: 's3-dev_media_player' - Setting [21:59:38][D][media_player:066]: Media URL: http://192.168.0.90:8123/api/tts_proxy/d555e0334f6ad942f00e7d91a189993c0c3a1143_de-de_f56410318a_cloud.mp3 [21:59:38][D][esp-idf:000]: I (31318) AUDIO_ELEMENT: [http-0x3ffd57dc] Element task created [21:59:38][D][esp-idf:000]: I (31321) AUDIO_ELEMENT: [decoder-0x3ffd5b68] Element task created [21:59:38][D][esp-idf:000]: I (31330) AUDIO_ELEMENT: [i2s_out-0x3ffda26c] Element task created [21:59:38][D][esp-idf:000]: I (31340) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:359, MEM Total:112280 Bytes [21:59:38][D][esp-idf:000]: I (31350) AUDIO_ELEMENT: [http] AEL_MSG_CMD_RESUME,state:1 [21:59:38][D][esp-idf:000]: I (31362) AUDIO_ELEMENT: [decoder] AEL_MSG_CMD_RESUME,state:1 [21:59:38][D][esp-idf:000]: I (31365) AUDIO_ELEMENT: [i2s_out] AEL_MSG_CMD_RESUME,state:1 [21:59:38][D][esp-idf:000]: I (31371) AUDIO_PIPELINE: Pipeline started [21:59:38][I][adf_audio:135]: got new pipeline state: 2 [21:59:38][W][component:214]: Component api took a long time for an operation (0.07 s). [21:59:38][W][component:215]: Components should block for at most 20-30ms. [21:59:38][I][esp_adf_pipeline:198]: [ * ] CMD: 8 status: 12 [21:59:38][I][adf_audio:135]: got new pipeline state: 2 [21:59:38][D][esp-idf:000]: I (31431) HTTP_CLIENT: Body received in fetch header state, 0x3ffe36bf, 1841 [21:59:38][D][esp-idf:000]: I (31437) HTTP_STREAM: total_bytes=10031 [21:59:38][I][esp_adf_pipeline:217]: [ * ] CMD: 10 Pipeline: 2 [21:59:38][I][esp_adf_pipeline:217]: [ * ] CMD: 8 Pipeline: 2 [21:59:38][I][esp_adf_pipeline:222]: [ http ] status: 12 [21:59:38][I][esp_adf_pipeline:217]: [ * ] CMD: 8 Pipeline: 2 [21:59:38][I][esp_adf_pipeline:222]: [ decoder ] status: 12 [21:59:38][I][HTTPStreamReader:046]: [ * ] Receive music info from mp3 decoder, sample_rates=24000, bits=16, ch=1 [21:59:38][I][esp_adf_pipeline:217]: [ * ] CMD: 9 Pipeline: 2 [21:59:39][D][esp-idf:000]: W (32236) HTTP_STREAM: No more data,errno:0, total_bytes:10031, rlen = 0 [21:59:39][D][esp-idf:000]: I (32242) AUDIO_ELEMENT: IN-[http] AEL_IO_DONE,0 [21:59:39][I][esp_adf_pipeline:217]: [ * ] CMD: 11 Pipeline: 2 [21:59:39][I][esp_adf_pipeline:217]: [ * ] CMD: 8 Pipeline: 2 [21:59:39][I][esp_adf_pipeline:222]: [ http ] status: 15 [21:59:39][D][esp-idf:000]: I (32747) AUDIO_ELEMENT: IN-[decoder] AEL_IO_DONE,-2 [21:59:40][D][esp-idf:000]: I (33257) MP3_DECODER: Closed [21:59:40][I][esp_adf_pipeline:217]: [ * ] CMD: 11 Pipeline: 2 [21:59:40][I][esp_adf_pipeline:217]: [ * ] CMD: 8 Pipeline: 2 [21:59:40][I][esp_adf_pipeline:222]: [ decoder ] status: 15 [21:59:40][D][esp-idf:000]: I (33448) AUDIO_ELEMENT: IN-[i2s_out] AEL_IO_DONE,-2 [21:59:42][I][esp_adf_pipeline:217]: [ * ] CMD: 11 Pipeline: 2 [21:59:42][I][esp_adf_pipeline:198]: [ * ] CMD: 8 status: 15 [21:59:42][I][adf_audio:135]: got new pipeline state: 4 [21:59:42][I][adf_audio:135]: got new pipeline state: 4 [21:59:42][I][esp_adf_pipeline:217]: [ * ] CMD: 8 Pipeline: 4 [21:59:42][I][esp_adf_pipeline:222]: [ i2s_out ] status: 15 [21:59:51][D][switch:012]: 'AMP Switch' Turning ON. [21:59:51][D][switch:055]: 'AMP Switch': Sending state ON [21:59:53][D][media_player:059]: 's3-dev_media_player' - Setting [21:59:53][D][media_player:069]: Volume: 0.47 [21:59:55][D][media_player:059]: 's3-dev_media_player' - Setting [21:59:55][D][media_player:063]: Command: PLAY [21:59:55][D][esp-idf:000]: I (48835) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:359, MEM Total:109920 Bytes [21:59:55][D][esp-idf:000]: I (48839) AUDIO_ELEMENT: [http] AEL_MSG_CMD_RESUME,state:1 [21:59:55][D][esp-idf:000]: I (48843) AUDIO_ELEMENT: [decoder] AEL_MSG_CMD_RESUME,state:1 [21:59:55][D][esp-idf:000]: I (48846) AUDIO_ELEMENT: [i2s_out] AEL_MSG_CMD_RESUME,state:1 [21:59:56][D][esp-idf:000]: I (48853) AUDIO_PIPELINE: Pipeline started [21:59:56][I][adf_audio:135]: got new pipeline state: 2 [21:59:56][I][esp_adf_pipeline:198]: [ * ] CMD: 8 status: 12 [21:59:56][I][adf_audio:135]: got new pipeline state: 2 [21:59:56][I][esp_adf_pipeline:217]: [ * ] CMD: 8 Pipeline: 2 [21:59:56][I][esp_adf_pipeline:222]: [ i2s_out ] status: 12 [21:59:56][I][esp_adf_pipeline:217]: [ * ] CMD: 10 Pipeline: 2 [21:59:56][I][esp_adf_pipeline:217]: [ * ] CMD: 8 Pipeline: 2 [21:59:56][I][esp_adf_pipeline:222]: [ http ] status: 12 [21:59:56][I][esp_adf_pipeline:217]: [ * ] CMD: 8 Pipeline: 2 [21:59:56][I][esp_adf_pipeline:222]: [ decoder ] status: 12 [21:59:56][I][HTTPStreamReader:046]: [ * ] Receive music info from mp3 decoder, sample_rates=24000, bits=16, ch=1 [21:59:56][I][esp_adf_pipeline:217]: [ * ] CMD: 9 Pipeline: 2 [21:59:56][D][esp-idf:000]: W (49644) HTTP_STREAM: No more data,errno:0, total_bytes:10031, rlen = 0 [21:59:56][D][esp-idf:000]: I (49650) AUDIO_ELEMENT: IN-[http] AEL_IO_DONE,0 [21:59:56][I][esp_adf_pipeline:217]: [ * ] CMD: 11 Pipeline: 2 [21:59:56][I][esp_adf_pipeline:217]: [ * ] CMD: 8 Pipeline: 2 [21:59:56][I][esp_adf_pipeline:222]: [ http ] status: 15 [21:59:57][D][esp-idf:000]: I (50155) AUDIO_ELEMENT: IN-[decoder] AEL_IO_DONE,-2 [21:59:57][D][esp-idf:000]: I (50665) MP3_DECODER: Closed [21:59:57][I][esp_adf_pipeline:217]: [ * ] CMD: 11 Pipeline: 2 [21:59:57][I][esp_adf_pipeline:217]: [ * ] CMD: 8 Pipeline: 2 [21:59:57][I][esp_adf_pipeline:222]: [ decoder ] status: 15 [21:59:58][D][esp-idf:000]: I (50857) AUDIO_ELEMENT: IN-[i2s_out] AEL_IO_DONE,-2 [21:59:58][D][media_player:059]: 's3-dev_media_player' - Setting [21:59:58][D][media_player:066]: Media URL: http://192.168.0.90:8123/api/tts_proxy/d555e0334f6ad942f00e7d91a189993c0c3a1143_de-de_f56410318a_cloud.mp3 [21:59:58][D][esp-idf:000]: E (50980) AUDIO_ELEMENT: [http] Element already stopped [21:59:58][D][esp-idf:000]: E (50983) AUDIO_ELEMENT: [decoder] Element already stopped [22:00:00][I][adf_audio:135]: got new pipeline state: 4 [22:00:00][I][adf_audio:135]: got new pipeline state: 4 [22:00:00][D][esp-idf:000]: I (52915) AUDIO_ELEMENT: [http-0x3ffd57dc] Element task created [22:00:00][D][esp-idf:000]: I (52918) AUDIO_ELEMENT: [decoder-0x3ffd5b68] Element task created [22:00:00][D][esp-idf:000]: I (52920) AUDIO_ELEMENT: [i2s_out-0x3ffda26c] Element task created [22:00:00][D][esp-idf:000]: I (52923) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:359, MEM Total:111964 Bytes [22:00:00][D][esp-idf:000]: I (52926) AUDIO_ELEMENT: [http] AEL_MSG_CMD_RESUME,state:1 [22:00:00][D][esp-idf:000]: I (52937) AUDIO_ELEMENT: [decoder] AEL_MSG_CMD_RESUME,state:1 [22:00:00][D][esp-idf:000]: I (52941) AUDIO_ELEMENT: [i2s_out] AEL_MSG_CMD_RESUME,state:1 [22:00:00][D][esp-idf:000]: I (52947) AUDIO_PIPELINE: Pipeline started [22:00:00][I][adf_audio:135]: got new pipeline state: 2 [22:00:00][W][component:214]: Component api took a long time for an operation (2.00 s). [22:00:00][W][component:215]: Components should block for at most 20-30ms. [22:00:00][D][esp-idf:000]: I (52999) HTTP_CLIENT: Body received in fetch header state, 0x3ffdefd3, 1841 [22:00:00][D][esp-idf:000]: I (53006) HTTP_STREAM: total_bytes=10031 [22:00:00][I][esp_adf_pipeline:198]: [ * ] CMD: 8 status: 12 [22:00:00][I][adf_audio:135]: got new pipeline state: 2 [22:00:00][I][esp_adf_pipeline:217]: [ * ] CMD: 8 Pipeline: 2 [22:00:00][I][esp_adf_pipeline:222]: [ i2s_out ] status: 12 [22:00:00][I][esp_adf_pipeline:217]: [ * ] CMD: 10 Pipeline: 2 [22:00:00][I][esp_adf_pipeline:217]: [ * ] CMD: 8 Pipeline: 2 [22:00:00][I][esp_adf_pipeline:222]: [ http ] status: 12 [22:00:00][I][esp_adf_pipeline:217]: [ * ] CMD: 8 Pipeline: 2 [22:00:00][I][esp_adf_pipeline:222]: [ decoder ] status: 12 [22:00:00][I][HTTPStreamReader:046]: [ * ] Receive music info from mp3 decoder, sample_rates=24000, bits=16, ch=1 [22:00:00][I][esp_adf_pipeline:217]: [ * ] CMD: 9 Pipeline: 2 [22:00:01][D][esp-idf:000]: W (53994) HTTP_STREAM: No more data,errno:0, total_bytes:10031, rlen = 0 [22:00:01][D][esp-idf:000]: I (54001) AUDIO_ELEMENT: IN-[http] AEL_IO_DONE,0 [22:00:01][I][esp_adf_pipeline:217]: [ * ] CMD: 11 Pipeline: 2 [22:00:01][I][esp_adf_pipeline:217]: [ * ] CMD: 8 Pipeline: 2 [22:00:01][I][esp_adf_pipeline:222]: [ http ] status: 15 [22:00:01][D][esp-idf:000]: I (54506) AUDIO_ELEMENT: IN-[decoder] AEL_IO_DONE,-2 [22:00:02][D][esp-idf:000]: I (55018) MP3_DECODER: Closed ```log output microphone not running
```log INFO ESPHome 2023.12.9 INFO Reading configuration /config/esphome/m5stack-atom-echo-59aac0.yaml... INFO Updating https://github.com/mulcmu/esphome-es8388-a1s.git@nightdav-patch INFO Updating https://github.com/esphome/esphome.git@pull/5230/head INFO Updating https://github.com/nighi/esphome_audio@main INFO Starting log output from 192.168.0.85 using esphome API INFO Successfully connected to voice-sat @ 192.168.0.85 in 0.033s INFO Successful handshake with voice-sat @ 192.168.0.85 in 0.074s [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][I][app:102]: ESPHome version 2023.12.9 compiled on Feb 16 2024, 16:21:00 [21:39:55][C][wifi:573]: WiFi: [21:39:55][C][wifi:405]: Local MAC: B8:D6:1A:59:AA:C0 [21:39:55][C][wifi:410]: SSID: XXXXXX [21:39:55][C][wifi:411]: IP Address: 192.168.0.85 [21:39:55][C][wifi:413]: BSSID: XXXXXXXXXX [21:39:55][C][wifi:414]: Hostname: 'voice-sat' [21:39:55][C][wifi:416]: Signal strength: -64 dB ▂▄▆█ [21:39:55][C][wifi:420]: Channel: 6 [21:39:55][C][wifi:421]: Subnet: 255.255.255.0 [21:39:55][C][wifi:422]: Gateway: 192.168.0.1 [21:39:55][C][wifi:423]: DNS1: 192.168.0.1 [21:39:55][C][wifi:424]: DNS2: 0.0.0.0 [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][C][logger:439]: Logger: [21:39:55][C][logger:440]: Level: DEBUG [21:39:55][C][logger:441]: Log Baud Rate: 115200 [21:39:55][C][logger:443]: Hardware UART: UART0 [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][C][i2c.idf:061]: I2C Bus: [21:39:55][C][i2c.idf:062]: SDA Pin: GPIO33 [21:39:55][C][i2c.idf:063]: SCL Pin: GPIO32 [21:39:55][C][i2c.idf:064]: Frequency: 50000 Hz [21:39:55][C][i2c.idf:067]: Recovery: bus successfully recovered [21:39:55][I][i2c.idf:077]: Results from i2c bus scan: [21:39:55][I][i2c.idf:083]: Found i2c device at address 0x10 [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][C][switch.gpio:068]: GPIO Switch 'AMP Switch' [21:39:55][C][switch.gpio:091]: Restore Mode: always OFF [21:39:55][C][switch.gpio:031]: Pin: GPIO21 [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][C][gpio.output:010]: GPIO Binary Output: [21:39:55][C][gpio.output:011]: Pin: GPIO22 [21:39:55][C][gpio.output:012]: Inverted: YES [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][C][gpio.output:010]: GPIO Binary Output: [21:39:55][C][gpio.output:011]: Pin: GPIO19 [21:39:55][C][gpio.output:012]: Inverted: YES [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][C][light:103]: Light 'Test LED 1' [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][C][light:103]: Light 'Test LED 2' [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][C][template.switch:068]: Template Switch 'Use wake word' [21:39:55][C][template.switch:091]: Restore Mode: restore defaults to ON [21:39:55][C][template.switch:057]: Optimistic: YES [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][C][captive_portal:088]: Captive Portal: [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][C][mdns:115]: mDNS: [21:39:55][C][mdns:116]: Hostname: voice-sat [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][C][ota:097]: Over-The-Air Updates: [21:39:55][C][ota:098]: Address: voice-sat.local:3232 [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][C][api:139]: API Server: [21:39:55][C][api:140]: Address: voice-sat.local:6053 [21:39:55][C][api:142]: Using noise encryption: YES [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][C][esp_adf.speaker:019]: ESP ADF Speaker Configs: [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][C][adf_audio:019]: ESP-ADF-MediaPlayer: [21:39:55][C][adf_audio:021]: Number of ASPComponents: 2 [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running [21:39:55][D][voice_assistant:118]: microphone not running ```Are external DACs already supported? Do I have to specify this in the config? If you need further details, feel free to ask.