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.3k stars 47 forks source link

Players missing in Settings > Players #1993

Closed jaymunro closed 6 months ago

jaymunro commented 6 months ago

What version of Music Assistant has the issue?

2.0.0b107

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

2024.2.0

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

The problem

Same as #1919, this seems broken again in 2.0.0b107

The only player showing is a new speaker just added yesterday (it has 2 versions Chromecast & AirPlay) plus a Chromecast group, also added yesterday. Others added prior are missing in Settings > Players but are showing in the speaker selection list.

In addition, maybe due to troubleshooting in removing and adding, or renaming the new speaker, the new speaker is now duplicated in the receivers list.

IMG_0503

How to reproduce

Look at the Players listed in the Settings tab.

Music Providers

All are default:

Player Providers

All are default:

Relevant log output

No response

Additional information

No response

What version of Home Assistant Core are your running

2024.3.0

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Alternative

OzGav commented 6 months ago

Logs….

OzGav commented 6 months ago

And front room speakers looks like a group is it?

jaymunro commented 6 months ago

Logs from the Logs tab of the plugin:

2024-03-12 09:17:16.047 INFO (MainThread) [music_assistant] Starting Music Assistant Server (d77d3db1dff149feb09b5ed007cfa12b) version 2.0.0b107 - uvloop: False
2024-03-12 09:17:16.074 INFO (MainThread) [music_assistant.cache] Initializing cache controller...
2024-03-12 09:17:16.115 INFO (MainThread) [music_assistant.webserver] Starting server on  172.30.32.1:8095 - base url: http://172.30.32.1:8095
2024-03-12 09:17:16.264 INFO (MainThread) [music_assistant.music] Using a sync interval of 180 minutes.
2024-03-12 09:17:17.209 INFO (MainThread) [music_assistant.streams] Detected ffmpeg version 5.1.4 with libsoxr support
2024-03-12 09:17:17.209 INFO (MainThread) [music_assistant.streams] Starting server on  0.0.0.0:8096 - base url: http://192.168.0.10:8096
2024-03-12 09:17:21.891 INFO (MainThread) [music_assistant] Loaded player provider UPnP/DLNA Player provider
2024-03-12 09:17:21.894 INFO (MainThread) [music_assistant] Loaded metadata provider MusicBrainz Metadata provider
2024-03-12 09:17:21.898 INFO (MainThread) [music_assistant] Loaded music provider url
2024-03-12 09:17:21.907 INFO (MainThread) [music_assistant] Loaded player provider Universal Group Player
2024-03-12 09:17:21.909 INFO (MainThread) [music_assistant] Loaded player provider Chromecast
2024-03-12 09:17:21.912 INFO (MainThread) [aioslimproto.server] Starting SLIMProto server on port 3483
2024-03-12 09:17:21.915 INFO (MainThread) [music_assistant] Loaded player provider SONOS
2024-03-12 09:17:21.919 INFO (MainThread) [music_assistant] Loaded metadata provider TheAudioDB Metadata provider
2024-03-12 09:17:21.921 INFO (MainThread) [music_assistant] Loaded metadata provider fanart.tv Metadata provider
2024-03-12 09:17:22.242 INFO (MainThread) [music_assistant] Loaded music provider Tune-In Radio
2024-03-12 09:17:22.249 INFO (MainThread) [music_assistant.music] Sync task for URL completed
2024-03-12 09:17:22.629 INFO (MainThread) [aioslimproto.server.cli] Starting (legacy/telnet) SLIMProto CLI on port 9090
2024-03-12 09:17:22.651 INFO (MainThread) [aioslimproto.server.cli] Starting SLIMProto JSON RPC CLI on port 9000
2024-03-12 09:17:22.681 INFO (MainThread) [music_assistant] Loaded player provider Slimproto
2024-03-12 09:17:22.928 INFO (MainThread) [music_assistant.players] Player registered: 83f58325-b2bb-4e33-9146-9b25a69182dc/Front room speakers
2024-03-12 09:17:23.023 INFO (MainThread) [music_assistant] Loaded player provider Airplay
2024-03-12 09:17:23.125 INFO (MainThread) [music_assistant.players] Player registered: 85cba049-46e9-7ee8-0bfa-021def08114f/Kitchen Display
2024-03-12 09:17:23.358 INFO (MainThread) [music_assistant.players] Player registered: 729ecc14-44c8-453e-d915-2c185e2df215/Living speaker (right)
2024-03-12 09:17:25.224 INFO (MainThread) [music_assistant.providers.spotify] Successfully logged in to Spotify as hen8ltcinompq1c01kovtkrr2
2024-03-12 09:17:25.225 INFO (MainThread) [music_assistant] Loaded music provider Spotify
2024-03-12 09:17:26.558 INFO (MainThread) [music_assistant.music] Sync task for Tune-In Radio completed
2024-03-12 09:17:27.496 INFO (MainThread) [music_assistant] Loaded music provider RadioBrowser
2024-03-12 09:17:27.514 INFO (MainThread) [music_assistant.players] Player registered: ap785ea262328c/Living speaker (right)
2024-03-12 09:17:27.571 ERROR (MainThread) [music_assistant] Music Assistant instance with identical name present in the local network!
2024-03-12 09:17:28.730 INFO (MainThread) [music_assistant.players] Player registered: ap50ed3c51e207/HJM MacBook Air
2024-03-12 09:17:31.883 INFO (MainThread) [music_assistant.music] Sync task for Spotify completed
2024-03-12 09:17:31.884 INFO (MainThread) [music_assistant.music] Sync task for RadioBrowser completed
2024-03-12 09:17:57.809 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/streams.py", line 486, in serve_queue_item_stream
    await resp.prepare(request)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_response.py", line 415, in prepare
    return await self._start(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_response.py", line 423, in _start
    await self._write_headers()
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_response.py", line 503, in _write_headers
    await writer.write_headers(status_line, self._headers)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_writer.py", line 130, in write_headers
    self._write(buf)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_writer.py", line 75, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
jaymunro commented 6 months ago

And front room speakers looks like a group is it?

Yes that's the "... plus a Chromecast group" I mentioned in the description.

OzGav commented 6 months ago

Not sure about the last error at the moment but I would try removing all the players and restarting MA so they all get rediscovered and then check the logs again if there are any missing. Make sure all the speakers are powered on and connected to the same subnet

jaymunro commented 6 months ago

How can I remove them if they are not listed in the Players tab? I can remove the Living speaker and the group, but not the others that are not listed for configuration.

OzGav commented 6 months ago

Try reloading the provider?

OzGav commented 6 months ago

What was the MacBook Air? Airplay?

jaymunro commented 6 months ago

Try reloading the provider?

Like this?

...
ConnectionResetError: Cannot write to closing transport
2024-03-12 10:17:31.366 INFO (MainThread) [music_assistant] Loaded player provider Chromecast
2024-03-12 10:17:44.736 WARNING (MainThread) [music_assistant] Error while unload provider Airplay: 
2024-03-12 10:17:45.115 INFO (MainThread) [music_assistant] Loaded player provider Airplay

Results in no change in the Players list.

Yes, the MacBook Air should be Airplay being a MacOS device. It's actually one I'd like to remove, but can't as it's not shown.

jaymunro commented 6 months ago

Got it. Totally removed the player providers (Delete) and added them again. All players are now listed under Players.

IMG_0506

jaymunro commented 6 months ago

For the above operations, the log shows:

2024-03-12 10:26:26.223 INFO (MainThread) [music_assistant.players] Player removed: Living speaker (right)
2024-03-12 10:26:26.226 INFO (MainThread) [music_assistant.players] Player removed: Front room speakers
2024-03-12 10:26:26.228 INFO (MainThread) [music_assistant.players] Player removed: Kitchen Display
2024-03-12 10:26:39.712 INFO (MainThread) [music_assistant] Loaded player provider Chromecast
2024-03-12 10:26:39.954 INFO (MainThread) [music_assistant.players] Player registered: 729ecc14-44c8-453e-d915-2c185e2df215/Living speaker (right)
2024-03-12 10:26:40.149 INFO (MainThread) [music_assistant.players] Player registered: 83f58325-b2bb-4e33-9146-9b25a69182dc/Front room speakers
2024-03-12 10:26:40.332 INFO (MainThread) [music_assistant.players] Player registered: 85cba049-46e9-7ee8-0bfa-021def08114f/Kitchen Display

I did the same with the AirPlay and then did a restart of the plugin. So that portion of the log is gone.

I repeated the same Delete & Add with Chromecast but did not restart, it wasn't needed.

jaymunro commented 6 months ago

Let me know if you need anything more to help make the list more robust.

The duplicate of the Living speaker (right) was expected it turns out because it has Chromecast and AirPlay versions.

OzGav commented 6 months ago

Sorry I should have seen the different providers against those two speakers. I don’t think we can do anything more now unless you can reproduce the problem. Thanks for the report.