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.38k stars 51 forks source link

Snapcast keeps increasing snapcast name #2955

Closed nimbling closed 1 month ago

nimbling commented 1 month ago

What version of Music Assistant has the issue?

2.3.0b26

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

2024.9.2

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

The problem

In my snapweb interface, the snapcast name keeps increasing indefinitely. I'm at 5053 now: image

This might be related to: https://github.com/badaix/snapcast/issues/1217 ? - though I can't find where to set "::" as an ip.

Thanks for having a look!

How to reproduce

Install MAS, use snapcast.

Music Providers

This happens independent of music provider. Though I have used Soundcloud and Spotify.

Player Providers

Snapcast

Full log output

Here's my log file (Please ignore the spotify authentication lines, I have created a new password)

music-assistant.log

Additional information

Once a connection has been selected, this plays fine. But on new sessions, the remote snapcast client needs to be told each time what the "new" snapcast server name is.

What version of Home Assistant Core are your running

2024.9.2

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Raspberry Pi

OzGav commented 1 month ago

@SantiagoSotoC

nimbling commented 1 month ago

Here's my log with the log level set to DEBUG

music-assistant.log

nimbling commented 1 month ago

Just musing on this: I have all my IP addresses on the local network set to fixed IP's in the router - could that be the cause of this? (intuitively, I'd say it should prevent it... but it wouldn't be the first time that network technology made a fool out of me...)

SantiagoSotoC commented 1 month ago

This is not a bug, it is how ma and snapcast work, it is the name of the stream and it is dynamic

SantiagoSotoC commented 1 month ago

@nimbling What is not clear to me, do you have to select it by hand? Or does it change by itself ?

OzGav commented 1 month ago

Quick question. Mine just says “default”?

nimbling commented 1 month ago

Are you syncing the speakers from Music Assistant? You shouldn't touch that from snapweb, music Assistant won't remember those changes you make from snapweb

@OzGav Yes, I have "default" listed there sometimes, too. But that only works if the numbered one is not present, I think. As per your observation, it now looks like this:

image

-but it will at one point start increasing that number again :(

Another log? music-assistant (1).log

@SantiagoSotoC I have to select the increased number by hand. The server increases it's own number, but I need to point the client at that "new" snapserver name (that increased). The second one would "forget" the "default" and would need to be told to use one of those "Music assistant 1234" servers.

SantiagoSotoC commented 1 month ago

Quick question. Mine just says “default”?

Play something, should change automatically

nimbling commented 1 month ago

I said default just now, and when I started to play, it shows this:

image

Default was the only available option in the dropdown, I selected "default" and my audio stopped, after waiting a bit "MusicAssistant--5030" showed up and now my sound is working again.

SantiagoSotoC commented 1 month ago

I don't know how to say that menu is not to be touched, it is for when snapcast is used manually, configuring the files, we use the api. The bug is that this value changes ? If you use ma from its interface something doesn't work ?

nimbling commented 1 month ago

Yes, the value changes out of it's own accord. "Default" does not give me sound output, and the "MusicAssistant--5091" (I'm at that number now) keeps increasing.

I was listening music just now and it lost the snapcast connection. music-assistant.log

(I just got a decent second hand amplifier... so the log might contain some of that)

SantiagoSotoC commented 1 month ago

Yes, streams are created and destroyed on demand, this is not a bug, if the connection was lost it is most likely a network issue, but in any case it is a snapcast bug and not a mussic asistant bug. That number has to change, default is used when there is nothing playing. That number is a port and it is random, it is programmed that way. This is the expected operation of Music Assistant