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

Music Assistant stops responding (but does not crash entirely) #3366

Open
1 task done
bj61251 opened this issue Dec 24, 2024 · 9 comments
Open
1 task done

Music Assistant stops responding (but does not crash entirely) #3366

bj61251 opened this issue Dec 24, 2024 · 9 comments

Comments

@bj61251
Copy link

bj61251 commented Dec 24, 2024

What version of Music Assistant has the issue?

2.4.0b8

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

2024.12.2 (native home assistant version)

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

  • Yes

The problem

After playing a small amount of music (4-10 songs) Music Assistant becomes unresponsive. Music will stop playing mid-track, and the UI only displays a blank screen (does not say "add-on is not running", and doesn't return a 400 or 502 bad gateway error like when it's booting). Enabling Watch Dog to reboot does nothing because it seems to think the add-on is still running. I've also noticed that, though the add-on reports CPU usage, RAM usage is 0%.

I've experimented with cache clearing, various player settings (flow mode, crossfades, etc.), but nothing seems to help. I also don't think this issue is new to the current version of Home Assistant Server (beta), as I've had on and off issues like this for a while, but it seems to have gotten worse recently.

As you'll see below in the log output, the only noticeable thing I can see right before the crash is a selection of various Warnings

Once this starts happening, usually the music stops, and soon after the players provided by the add-on will go missing in Home Assistant, as the integration can no longer communicate with the add-on server.

How to reproduce

This happens any time I play a list of songs on my Chromecast speaker group, usually by the 4th song.

Music Providers

Deezer and Plex both exhibit this problem

Player Providers

Chromecast, group of 4 speakers (don't have any other players to try)

Full log output

d5369777_music_assistant_beta_2024-12-24T23-05-25.708Z.log

Additional information

No response

What version of Home Assistant Core are your running

2024.12.2

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Raspberry Pi

@bj61251 bj61251 added the triage label Dec 24, 2024
@OzGav
Copy link
Contributor

OzGav commented Dec 25, 2024

As per the instructions turn off debug and attach the FULL log

@bj61251
Copy link
Author

bj61251 commented Dec 25, 2024

d5369777_music_assistant_beta_2024-12-25T01-24-59.403Z.log

Here's the same timeframe stretching back as many lines as HA will export, with debug lines removed; note that looking back farther there is an entirely separate issue present from Deezer (where it can't find tracks 'Track token has no sufficient rights on requested media'), which is unrelated to this issue, since this one happens for Plex as well, and the Deezer one doesn't cause MA to hang.

@OzGav
Copy link
Contributor

OzGav commented Dec 25, 2024

The troubleshooting page tells you how to get the full log

@bj61251
Copy link
Author

bj61251 commented Dec 25, 2024

Problem is that log doesn't appear to persist after restarting the add-on, which I have to do to be able to get into the UI when it's hung like this, unless maybe there's something else I'm missing.

@bj61251
Copy link
Author

bj61251 commented Dec 25, 2024

music-assistant.log

I started the add-on again after that last hang, and this is all that it has.

@OzGav
Copy link
Contributor

OzGav commented Dec 25, 2024

I see some mdns problems. Are you using a simple flat network? If so then remove the cast provider and restart and then install the Snapcast provider and use that to stream to a browser

@bj61251
Copy link
Author

bj61251 commented Dec 25, 2024

I have my main network router that is connected to my internet, and a second router with a subnet that I use for all of my smart home devices. My Raspberry Pi with HA os and such is on both (one wired, the other wirelessly). Will attempt snapcast here momentarily and report back about what it does.

@bj61251
Copy link
Author

bj61251 commented Dec 29, 2024

So I finally had a chance after holiday stuff to mess around with Snapcast, and it definitely seemed to work better; I was able to have music play for like an hour and a half ( to both a desktop browser and my phone browser) without any hangs.

I also was just trying to keep a closer eye on error logs, and noticed something occur. I have a Plex server that contains my music, but also many TV shows, and almost all the time I have the TV shows casting to a Chromecast. I usually don't have music and TV playing at the same time though, but yesterday I just happened to start music in the background. Coincidentally (or perhaps not), the music paused and music assistant hung at the same time one of the episodes ended and the Chromecast started loading another episode. This would be consistent with my experience where music would seem to lock up after three or four songs on average, because there's a very good chance that whatever was casting to my Chromecast would end within half an hour to 40 minutes (or much sooner) depending on what TV show is on.

Running off of this, I thought about the fact that I don't use Music assistant to cast to my video Chromecasts, only to Chromecast audios and a couple of Wiim receivers that have Chromecast built in. I use home assistant's native Chromecast integration to cast TV shows, so I just went ahead and disabled the video Chromecasts inside of Music assistant. And guess what? I have TV casting, and I've had music playing for about 3 hours with no issues.

Obviously this is all anecdotal and I don't have any error logs to back it up, but it seems like maybe the Chromecast player provider, while trying to pay attention to what was happening on my video Chromecast (because it does appear in the list of available speakers when enabled, with just 'external source' as the content), might be confusing something, and now with the video Chromecast disabled, things are running more smoothly.

I'll obviously keep an eye on it, but perhaps this will provide some info of something to look into. Thanks for the suggestions and assistance! Feel free to close out this ticket if you'd like, especially since I don't think there's too much other hard evidence to go off of.

@OzGav
Copy link
Contributor

OzGav commented Dec 30, 2024

Thanks for the great follow up. I’ll leave this for now until Marcel has a read to see if this edge case is something that can be catered for or if we just add something to the documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants