Open mad-tunes opened 4 months ago
This fixed audio playback for me on my Onju voice devices too! Thanks for the tip!
I find the same after updating to esphome 2024.5.1 as I did with 2024.5.0.
version: recommended
occasionally plays the first sound but then nothing more, version: 4.4.6
plays everything OK.
I'm still having similar trouble after updating to 2024.5.5.
Playing either an mp3 or TTS only tend to work for the first time. After hearing the wake word, I speak to it and it just gets stuck and sits there. It might listen and respond to me once, but then it needs a restart to do anything else.
Still works OK if I go pack to esphome 2024.4., but setting version: 4.4.6
doesn't seem to make things work reliably with 2024.5.5 like it did with the earnlier 2024.5.*
I'm still having similar trouble with 2024.6.1
With version: recommended
, it might respond once but then gets stuck and needs a restart before it'll respond to anything else.
Setting version: 4.4.6
doesn't make it any better so I'll still have to stick with 2024.4.2 for now
I'm still having similar trouble with 2024.6.2
With version: recommended
, it might respond once but then gets stuck and needs a restart before it'll respond to anything else.
Setting version: 4.4.6
doesn't make it any better so I'll still have to stick with 2024.4.2 for now
The behaviours changed slightly since I installed esphome 24.6.6
.
With version: recommended
, it listens and responds OK first time, but on the second try it detects the wake word and starts listening, I ask something and then it gets stuck and needs a reset.
I see this in its log though, which I don't think I did prior to 24.6.6
:
[22:38:12][E][main:650]: ****MWW Wake word detected
[22:38:12][W][component:237]: Component micro_wake_word took a long time for an operation (63 ms).
[22:38:12][W][component:238]: Components should block for at most 30 ms.
[22:38:12][D][esp-idf:000]: I (32079) AUDIO_THREAD: The http task allocate stack on external memory
[22:38:12][D][esp-idf:000]: I (32082) AUDIO_ELEMENT: [http-0x3de17d34] Element task created
[22:38:12][D][esp-idf:000]: I (32085) AUDIO_THREAD: The decoder task allocate stack on external memory
[22:38:12][D][esp-idf:000]: I (32088) AUDIO_ELEMENT: [decoder-0x3de17eec] Element task created
[22:38:12][D][esp-idf:000][http]: I (32090) AUDIO_ELEMENT: [http] AEL_MSG_CMD_RESUME,state:1
[22:38:12][D][esp-idf:000][decoder]: I (32093) AUDIO_ELEMENT: [decoder] AEL_MSG_CMD_RESUME,state:1
[22:38:12][D][esp_audio_sources:097]: Streamer status: 2
[22:38:12][D][esp_audio_sources:098]: decoder status: 2
[22:38:13][D][esp-idf:000][http]: I (32159) HTTP_CLIENT: Body received in fetch header state, 0x3fcc211c, 1704
[22:38:13][D][esp-idf:000][http]: I (32163) HTTP_STREAM: total_bytes=2520
[22:38:13][D][esp-idf:000][http]: W (32179) HTTP_STREAM: No more data,errno:0, total_bytes:2520, rlen = 0
[22:38:13][D][esp-idf:000][http]: I (32182) AUDIO_ELEMENT: IN-[http] AEL_IO_DONE,0
[22:38:13][D][esp-idf:000][decoder]: I (32186) AUDIO_ELEMENT: IN-[decoder] AEL_IO_DONE,-2
[22:38:13][I][HTTPStreamReader:129]: [ * ] Receive music info from mp3 decoder, sample_rates=32000, bits=16, ch=1
[22:38:13][D][adf_i2s_out:114]: update i2s clk settings: rate:32000 bits:16 ch:1
[22:38:13][D][adf_i2s_out:127]: Set final i2s settings: 32000
[22:38:13][D][esp-idf:000][decoder]: W (32200) AUDIO_ELEMENT: OUT-[decoder] AEL_IO_ABORT
[22:38:13][D][esp-idf:000][decoder]: W (32205) MP3_DECODER: output aborted -3
[22:38:13][D][esp-idf:000][decoder]: I (32209) MP3_DECODER: Closed
[22:38:13][D][esp_adf_pipeline:302]: State changed from PREPARING to STARTING
[22:38:13][I][adf_media_player:135]: got new pipeline state: 2
[22:38:13][D][adf_i2s_out:127]: Set final i2s settings: 32000
[22:38:13][D][esp-idf:000]: I (32225) AUDIO_ELEMENT: [i2s_out-0x3de180b8] Element task created
[22:38:13][D][esp-idf:000]: I (32228) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:359, MEM Total:2123355 Bytes, Inter:165420 Bytes, Dram:165420 Bytes
[22:38:13][D][esp-idf:000][http]: I (32231) AUDIO_ELEMENT: [http] AEL_MSG_CMD_RESUME,state:1
[22:38:13][D][esp-idf:000][decoder]: I (32233) AUDIO_ELEMENT: [decoder] AEL_MSG_CMD_RESUME,state:1
[22:38:13][D][esp-idf:000][i2s_out]: I (32236) AUDIO_ELEMENT: [i2s_out] AEL_MSG_CMD_RESUME,state:1
[22:38:13][D][esp-idf:000][i2s_out]: I (32238) I2S_STREAM: AUDIO_STREAM_WRITER
[22:38:13][I][esp_adf_pipeline:214]: [ http ] status: 14
[22:38:13][I][esp_adf_pipeline:214]: [ i2s_out ] status: 12
[22:38:13][D][esp_adf_pipeline:131]: Check element [http] status, 2
[22:38:13][D][esp-idf:000][http]: I (32306) HTTP_CLIENT: Body received in fetch header state, 0x3fcbe770, 1704
[22:38:13][D][esp-idf:000][http]: I (32310) HTTP_STREAM: total_bytes=2520
[22:38:13][I][esp_adf_pipeline:214]: [ http ] status: 12
[22:38:13][D][esp_adf_pipeline:131]: Check element [http] status, 3
[22:38:13][D][esp_adf_pipeline:131]: Check element [decoder] status, 2
[22:38:13][I][esp_adf_pipeline:214]: [ decoder ] status: 12
[22:38:13][D][esp_adf_pipeline:131]: Check element [http] status, 3
ERROR Fatal error: protocol.data_received() call failed.
protocol: <aioesphomeapi._frame_helper.noise.APINoiseFrameHelper object at 0x7f95ad901590>
transport: <_SelectorSocketTransport fd=6 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
File "/usr/lib/python3.11/asyncio/selector_events.py", line 1009, in _read_ready__data_received
self._protocol.data_received(data)
File "aioesphomeapi/_frame_helper/noise.py", line 136, in aioesphomeapi._frame_helper.noise.APINoiseFrameHelper.data_received
File "aioesphomeapi/_frame_helper/noise.py", line 163, in aioesphomeapi._frame_helper.noise.APINoiseFrameHelper.data_received
File "aioesphomeapi/_frame_helper/noise.py", line 319, in aioesphomeapi._frame_helper.noise.APINoiseFrameHelper._handle_frame
File "/usr/local/lib/python3.11/dist-packages/noise/state.py", line 74, in decrypt_with_ad
plaintext = self.cipher.decrypt(self.k, self.n, ad, ciphertext)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/noise/backends/default/ciphers.py", line 13, in decrypt
return self.cipher.decrypt(nonce=self.format_nonce(n), data=ciphertext, associated_data=ad)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "src/chacha20poly1305_reuseable/__init__.py", line 127, in chacha20poly1305_reuseable.ChaCha20Poly1305Reusable.decrypt
File "src/chacha20poly1305_reuseable/__init__.py", line 147, in chacha20poly1305_reuseable.ChaCha20Poly1305Reusable.decrypt
File "src/chacha20poly1305_reuseable/__init__.py", line 263, in chacha20poly1305_reuseable._decrypt_with_fixed_nonce_len
File "src/chacha20poly1305_reuseable/__init__.py", line 273, in chacha20poly1305_reuseable._decrypt_data
cryptography.exceptions.InvalidTag
WARNING jarvis @ 192.168.5.55: Connection error occurred: jarvis @ 192.168.5.55: Invalid encryption key: received_name=jarvis
INFO Processing unexpected disconnect from ESPHome API for jarvis @ 192.168.5.55
WARNING Disconnected from API
INFO Successfully connected to jarvis @ 192.168.5.55 in 0.006s
INFO Successful handshake with jarvis @ 192.168.5.55 in 0.065s
[22:38:13][D][esp-idf:000][decoder]: I (32461) MP3_DECODER: Closed
[22:38:13][D][esp-idf:000][i2s_out]: I (32532) AUDIO_ELEMENT: IN-[i2s_out] AEL_IO_DONE,-2
[22:38:13][D][esp_adf_pipeline:400]: Called deinit_all
[22:38:13][D][esp-idf:000]: I (32663) AUDIO_PIPELINE: audio_pipeline_unlinked
[22:38:13][D][esp-idf:000]: W (32666) AUDIO_ELEMENT: [http] Element has not create when AUDIO_ELEMENT_TERMINATE
[22:38:13][D][esp-idf:000]: W (32668) AUDIO_ELEMENT: [decoder] Element has not create when AUDIO_ELEMENT_TERMINATE
[22:38:13][D][esp-idf:000]: W (32671) AUDIO_ELEMENT: [i2s_out] Element has not create when AUDIO_ELEMENT_TERMINATE
[22:38:13][D][esp-idf:000]: I (32674) I2S: DMA queue destroyed
[22:38:13][D][esp_adf_pipeline:302]: State changed from STOPPING to UNINITIALIZED
[22:38:13][I][adf_media_player:135]: got new pipeline state: 0
[22:38:16][D][sensor:094]: 'Uptime seconds': Sending state 35.54700 s with 0 decimals of accuracy
[22:38:33][D][sensor:094]: 'WiFi Signal dB': Sending state -65.00000 dBm with 0 decimals of accuracy
[22:38:33][D][sensor:094]: 'WiFi Signal': Sending state 70.00000 % with 0 decimals of accuracy
[22:38:42][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[22:38:42][D][esp32.preferences:114]: Saving 1 preferences to flash...
[22:38:42][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
Trying to play an mp3 (like media_player.play_media: http://IP/mp3.mp3
) still doesn't work, but I see nothng that looks wrong in its log. Same with TTS.
Setting version: 4.4.6
hasn't improved anything for the last few versions.
I still have to stick with esphome 2024.4
to be able to use it properly.
I still find the same with 2024.7.0
The problem
Media player doesn't play mp3s after update to 2024.5.0
Which version of ESPHome has the issue?
2024.5.0
What type of installation are you using?
Home Assistant Add-on
Which version of Home Assistant has the issue?
Core 2024.5.3, Supervisor 2024.05.1 ,Operating System 12.3, Frontend 20240501.1
What platform are you using?
ESP32
Board
ESP32-C3-Zero like here: https://www.aliexpress.com/item/1005006524672028.html
Component causing the issue
esp-idf framework / adf_pipeline media player
Example YAML snippet
yaml Anything using media_player.play_media, like this button, fails to play the .mp3
Any tts.speak from HA fails to play too:
Whole YAML for my assistant/smart speaker:
Anything in the logs that might be useful for us?
Additional information
Rolling back the update to 2024.5.0 and re-uploading to the device made it play mp3s reliably again.
I found that if I stick with 2024.5.0 and change
to
...then things play OK again