-
Notifications
You must be signed in to change notification settings - Fork 19
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
Bug: Music Assistant cannot play music in HASS.Agent media player #208
Comments
Fun thing, if I shut the Music Assistant server down, the music it was trying to play starts playing lol. |
Same here, judging from the log and the partial audio clip after shutting down MASS, it seems somehow stuck in one of the streaming chunks. After killing the server the agent just plays what it received, which in my case varies between 20 sec and 1 min. I remember it was working in October so maybe MASS break something in the update? |
Seems like the agent is trying to buffer the audio entirely to local when playing from an HTTP link. I tried to remove the following lines (which let the HASS.Agent/src/HASS.Agent/HASS.Agent/Media/MediaManager.cs Lines 397 to 409 in c75e2b9
Also seems like the stream mode in MASS player settings must be set to "No content length" (which is the default): |
Maybe HASS.Agent can detect when the stream is being sent with no content length and avoid buffering in such case? |
I believe the |
Looks like I'll finally have the incentive to install Music Assistant :D |
This is going to be an interesting journey I see.
|
The "Unknown Queue Item" error is because MASS detected non-playing state after a short period (which it assumes playback already finished), and removed the song from the queue. You can try the following which is rather interesting to me:
That's how I pinpointed that the problem is actually at the built-in player logic of the agent |
I was writing this comment while you posted yours :D |
So, good news and bad news. Good: I was able to ducktape (for now of course) a crude logic that differentiates between a "file" and "stream" based on the content length properly (MASS doesn't provide it, I assume since it's stream), with that fix it works as expected Bad: if you queue more than 1 media, MASS uses the same stream, i.e. HASS.Agent has no idea that the media changed Feels more like a workaround than a fix but MASS has been pretty inconsistent for me during the testing so it's also sometimes hard to pinpoint stuff. |
Thanks! I tried the "Force content length" option in MASS player settings and seems like it's sending a content length of |
@whc2001 @felipecrs if you have time and can, please try the test build with the fix - https://github.com/amadeo-alex/HASS.Agent/releases/tag/2.1.1-beta3-musicassistant - and let me know if it works for you. Since it's a test build, please always remember to backup the config :) |
@amadeo-alex, it works like a charm! Thank you so much! |
Sorry I'm not home right now, and I'll test it after returning. I think it should work fine |
Describe the bug
I am trying to make Music Assistant play music to my HASS.Agent media player but it simply doesn't work.
To Reproduce
Expected behavior
To work :)
Screenshots
N/A
Misc info (please complete the following information):
winver.exe
output):Please check what's applicable (multiple answers possible):
Additional context
The same issue doesn't happen to other speakers imported from Home Assistant.
Logs
The text was updated successfully, but these errors were encountered: