hass-music-assistant: Playback not working on Kodi/OSMC
I have a whole-house audio system using OSMC - It is showing up as player in Home Assistant, and I can control it from there (i.e. pause playback once it is playing). However, music assistant does not actually start playback on OSMC. The OSMC is online and fully functional.
Whenever I try to play something from music assistant to OSMC, I see this in the logs:
2022-06-16 10:08:59 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/streams.py", line 160, in serve_queue_stream
await queue_stream.subscribe(client_id, resp.write)
File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/streams.py", line 311, in subscribe
assert not self.done.is_set(), "Stream task is already finished"
AssertionError: Stream task is already finished
2022-06-16 10:09:00 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/streams.py", line 160, in serve_queue_stream
await queue_stream.subscribe(client_id, resp.write)
File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/streams.py", line 311, in subscribe
assert not self.done.is_set(), "Stream task is already finished"
AssertionError: Stream task is already finished
2022-06-16 10:09:00 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/streams.py", line 160, in serve_queue_stream
await queue_stream.subscribe(client_id, resp.write)
File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/streams.py", line 311, in subscribe
assert not self.done.is_set(), "Stream task is already finished"
AssertionError: Stream task is already finished
2022-06-16 10:09:00 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/streams.py", line 160, in serve_queue_stream
await queue_stream.subscribe(client_id, resp.write)
File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/streams.py", line 311, in subscribe
assert not self.done.is_set(), "Stream task is already finished"
AssertionError: Stream task is already finished
and
2022-06-16 10:03:03 ERROR (MainThread) [homeassistant.components.kodi.media_player] Error calling async_update on entity media_player.osmc: TransportError("Error calling method 'Player.GetActivePlayers': Transport Error", TimeoutError())
2022-06-16 10:03:17 ERROR (MainThread) [homeassistant.components.kodi.media_player] Error calling async_update on entity media_player.osmc: TransportError("Error calling method 'Player.GetActivePlayers': Transport Error", ClientConnectorError(ConnectionKey(host='192.168.1.49', port=80, is_ssl=False, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=1996882747), ConnectionRefusedError(111, "Connect call failed ('192.168.1.49', 80)")))
is this supposed to work? anything I can do to help?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 46 (27 by maintainers)
Cool, my mistake confirms that itโs indeed a head request being made. So if I fix the sloppy assignment issue I think it should work. Fingers crossed for next release ๐
What is the Kodi version/Os that you are using? Also, check the Kodi log to find out what Kodi player is actually used. It can depend on a number of factor (or could at the time I was involved, years ago).
Oh btw also some good news from this. I actually implemented ICY metadata now in the stream so that Kodi actually displays whatever is playing.
Added Kodi to the title because it is practically the same as OSMC and has this same issue.