hass-music-assistant icon indicating copy to clipboard operation
hass-music-assistant copied to clipboard

"Player does not support muting"?

Open OzGav opened this issue 1 year ago • 2 comments

Discussed in https://github.com/orgs/music-assistant/discussions/1817

Originally posted by krisnoble January 23, 2024 Not sure if this is a bug or an expected behaviour, or how long it's been the case, but when I try to mute my media players in HA I get an error saying the player does not support muting. I'm fairly sure they used to though?

All my players are RPi 3a running HifiberryOS as a Slimproto client, in case that's relevant.

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:238
Integration: Home Assistant WebSocket API
First occurred: 10:59:02 (1 occurrences)
Last logged: 10:59:02

[139923675569600] Player Bedroom does not support muting
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 238, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2149, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2186, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 272, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 882, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 952, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/mass/media_player.py", line 355, in async_mute_volume
    await self.mass.players.player_command_volume_mute(self.player_id, mute)
  File "/usr/local/lib/python3.11/site-packages/music_assistant/client/players.py", line 91, in player_command_volume_mute
    await self.client.send_command("players/cmd/volume_mute", player_id=player_id, muted=muted)
  File "/usr/local/lib/python3.11/site-packages/music_assistant/client/client.py", line 168, in send_command
    return await future
           ^^^^^^^^^^^^
music_assistant.common.models.errors.UnsupportedFeaturedException: Player Bedroom does not support muting
```</div>

OzGav avatar Feb 05 '24 04:02 OzGav

Just so it's all in one place to make it easy for the devs to check out, relevant comments from the discussion:

it looks like the cmd_volume_mute was taken out of the Slimproto provider in this commit in favour of a power based muting system?

So I think this may be a regression stemming from that commit since it seems like the mute command is intended to be supported (even if internally it's power based) on Slimproto and was in the past?

Also not 100% sure if this is relevant but just in case:

looked in the HA Websocket issues and found issue https://github.com/music-assistant/hass-music-assistant/issues/1792, I wonder if they may be related since both are in the realm of supported features?

I found that, through https://github.com/home-assistant/core/issues/108101 which is addressed in HA as of 2024.1.4 in https://github.com/home-assistant/core/pull/108102

So if I'm understanding correctly there may be a change in HA that needs a matching change in MA?

krisnoble avatar Feb 07 '24 17:02 krisnoble

I will take a look at this soon but it will have low prio. Problem is that this part is really badly documented in slimproto. In fact to power "on" a player the same command is used to unmute it, as you can understand that leads to confusion. Anyways, I'll chew on it a bit and it will be fixed some day before 2.0 drops.

marcelveldt avatar Feb 14 '24 08:02 marcelveldt

This should be fixed in b107. Let us know if not.

OzGav avatar Mar 11 '24 01:03 OzGav

Working for me, thanks 😄

krisnoble avatar Mar 11 '24 10:03 krisnoble

I have the same problem mute is not supported on Slimproto players I have (piCorePlayer and SqueezeESP32)

Core: 2024.7.4 Supervisor: 2024.08.0 Operating System: 12.4 piCorePlayer: v9.0.1 SqueezeESP32: I2S-4MFlash-1673 Music Assistant server (docker): 2.1.1

should I open a new issue?

katsaplias avatar Aug 06 '24 15:08 katsaplias

You should not post in closed issues as it might not get noticed. There is a PR open that might fix this. Keep an eye on the release notes for the next beta

OzGav avatar Aug 06 '24 22:08 OzGav