Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
dreimer1986 opened this issue Jun 18, 2024 · 15 comments
Closed
1 task done

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

dreimer1986 opened this issue Jun 18, 2024 · 15 comments
Labels
bug Something isn't working Fix to be Confirmed

Comments

@dreimer1986
Copy link

dreimer1986 commented Jun 18, 2024

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?

  • Yes

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 tetele/onju-voice-satellite#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
Copy link

43ndr1k commented Jun 21, 2024

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

@dreimer1986
Copy link
Author

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

@cociweb
Copy link

cociweb commented Jun 22, 2024

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

@dreimer1986
Copy link
Author

dreimer1986 commented Jun 22, 2024

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
Copy link

43ndr1k commented Jun 24, 2024

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
Copy link

heibertelf commented Jun 27, 2024

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

@heibertelf
Copy link

heibertelf commented Jun 29, 2024

Are there any another settings to permanently change stream from flac to mp3

@adoucette
Copy link

Same settings, same problem.

@heibertelf
Copy link

The first time I installed the beta version (I don't know why I chose that particular installation) and it worked fine.
Then YouTube got "broken" and some error started popping up.
I decided to delete the add-on and put the stable version.
And now it was no longer playing on ESP. Even when I restored the old beta from backup.
I don't understand what changed in my system. I have HAOS and no direct access to system files or hidden configs.
Maybe I need to fix literally one line somewhere, or delete some wrong config file.
So we are very much waiting for a response from the developers as to why this may be the case.

@cfamfl2019
Copy link

In case it happens to be relevant or useful... I am also experiencing this issue with a standard esp32 and have noticed that the device is sent a url with a .flac extension from MA. Same if I browse to my local media using the "media" tab on the left side tray. However, if i go to settings>devices>esphome and open the media player entity and from there select "browse media" I can play a song from from my local library and my device gets a .mp3 url and plays the song as expected. Could this perhaps indicate the root of the problem is something in HA and not MA?

@dreimer1986
Copy link
Author

Small update regarding the yesterday mentioned issue above. Adding "codec: auto" on the correct place in config indeed fixes the playback issues for my Onju Voice. No clue if this is a mere workaround, but as most ESPHome voice assistants seem to have problems here, it likely is not more than a hack fix.

@adoucette
Copy link

Adding "codec: auto" on the correct place in config indeed fixes the playback issues

Where does one add that, specifically?

@dreimer1986
Copy link
Author

Check the above linked report: gnumpi/esphome_audio#47

it has to go into the "media_player:" section

@marcelveldt
Copy link
Member

Sorry for the late reply. This issue should be fixed in music assistant server version 2.1.0 beta 12

@OzGav OzGav added bug Something isn't working Fix to be Confirmed and removed triage labels Jul 6, 2024
@adoucette
Copy link

Thank you - I can now play from Music Assistant to my ESP32-based onju-voice device for the first time. Appreciate the fix Marcel.

@OzGav OzGav closed this as completed Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fix to be Confirmed
Projects
None yet
Development

No branches or pull requests

8 participants