music-assistant / hass-music-assistant

Turn your Home Assistant instance into a jukebox, hassle free streaming of your favorite media to Home Assistant media players.
Apache License 2.0
1.2k stars 44 forks source link

ESPHome based player stays silent even with enforced MP3 stream #2508

Open dreimer1986 opened 1 week ago

dreimer1986 commented 1 week ago

What version of Music Assistant has the issue?

2.1.0b6

What version of the Home Assistant Integration have you got installed?

2024.6.2

Have you tried everything in the Troubleshooting FAQ and reviewed the Open and Closed Issues and Discussions to resolve this yourself?

The problem

I use a Onju voice Assistant and tinkered with it a bit by now. As most ESPHome based players it should do fine with a enforced MP3 stream, but somehow Music Assistant does not care about setting it at all. I verified that MP3 streams are indeed working with the normal media menu inside Home Assistant to play a mp3 on it which works flawless. The stream arriving on my player still looks like this even with mp3 stream enforce activated: http://192.168.181.42:8097/flow/media_player.onju_voice_e27688_onju_voice_satellite_e27688/a9bab3d8c1b1408797a13ddf3334cd68.flac?ts=1718752804 aka it's a FLAC stream.

Later on the player confirms my assumption by logging this:

[01:20:06][D][esp-idf:000][decoder]: E (151704) MPEG_READER: Not find an effective frame, line:639.
[01:20:06][D][esp-idf:000][decoder]: E (151708) MPEG_READER: resync error (line 405)
[01:20:06][D][esp-idf:000][decoder]: E (151711) MP3_DECODER: Encountered error reading when MP3 init

Opeing the stream inside the webbrowser does work so the stream itself is not the problem, only the format of it.

How to reproduce

Get a ESPHome based player, verify the enforce lossy MP3 stream setting is selected and push play on any audio.

Music Providers

Plex, Spotify,, YT Music

Player Providers

Home Assistant Media Players: https://github.com/tetele/onju-voice-satellite and especially take a look at https://github.com/tetele/onju-voice-satellite/issues/52

Full log output

log.txt

Additional information

No response

What version of Home Assistant Core are your running

2024.6.3

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Generic x86-64 (e.g. Intel NUC)

43ndr1k commented 1 week ago

Hallo, I have the Same problem. Have you find a solution for this?

dreimer1986 commented 1 week ago

Not yet. I hope for a fix or explanation of my wrongdoing here, too ^^

cociweb commented 6 days ago

Is it an esp8266 or esp32? Is your url (all: player, music assistance, ha, music provider) tls secured (http or https)?

dreimer1986 commented 6 days ago

It's a ESP32-S3 based device. In my case it's unencrypted http as you can see on the URL I pasted above.

43ndr1k commented 4 days ago

in my case it is a esp32-s3 and http too

17:43:23][D][media_player:068]: Media URL: http://192.168.178.33:8097/flow/media_player.buero_media_assistant_media_player/23ca5ce125cb480cbf43cea09c330270.flac?ts=1719243803 [17:43:23][D][esp_audio_sources:098]: Set new uri: http://192.168.178.33:8097/flow/media_player.buero_media_assistant_media_player/23ca5ce125cb480cbf43cea09c330270.flac?ts=1719243803

And in the player settings is mp3 stream active.

Bildschirmfoto 2024-06-24 um 17 45 50
heibertelf commented 1 day ago

Same problem. I can see esphome player receives flac instead of mp3 stream.

[17:47:04][D][media_player:068]: Media URL: http://192.168.0.101:8097/single/media_player.esphome_web_fdabd0_stereo_1_2/36d70ed984a548a78d0e1ef6df52ebbb.flac?ts=1719499624

image "enforce mp3" enabled

Music Assistant 2.0.7 Core 2024.6.4 Supervisor 2024.06.2 Operating System 12.4