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

Synchronization Issues of Media Player States between MusicAssistant and HomeAssistant #2999

Open
1 task done
jojo141185 opened this issue Oct 4, 2024 · 2 comments
Open
1 task done
Labels
bug Something isn't working HA Integration Improvements or bugs in the integration

Comments

@jojo141185
Copy link

jojo141185 commented Oct 4, 2024

What version of Music Assistant has the issue?

2.3.0b29 (Tested on latest beta image)

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

2024.9.1 (Tested on latest HACS 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

Media Position is not synchronized correctly or updated frequently enough between MusicAssistant (MA) and HomeAssistant (HASS).

When adjusting the position of the current track in the MA web UI using the progress slider, the position is sometimes not transmitted to HASS or is not transmitted correctly. The same problem also exists the other way around.
image

Since the media_position is not updated regularly, it is only estimated in HASS based on the timestamp (media_position_updated_at), and there may be discrepancies between the progress indicator in HASS and MA.

It would probably be more robust to synchronize progress at a minimum interval of 10 seconds, for example.

How to reproduce

Change the progress bar in mediaplayer states via the Web-UI of MA or HASS and observe the reaction on the other side.

Music Providers

Tested with Spotify

Player Providers

Tested with Snapcast

Full log output

No response

Additional information

Home Assistant is authenticated as plugin provider in MA

What version of Home Assistant Core are your running

2024.9.3

What type of installation are you running?

Home Assistant Container

On what type of hardware are you running?

Linux

@Links2004
Copy link

Links2004 commented Oct 13, 2024

can confirmed,

Jumping via music-assistant UI, results in random progress added to Home Assistant e.g.:
music-assistant

the other way around does not work too, Home Assistant sends the correct seek and
music-assistant shows it, but the Home Assistant UI jumps all over.

Home Assistant

This is extremely notifiable if you seek back in time.

Note:
(top Home Assistant, bottom Music-Assistant)

Home Assistant: 2024.10.2
Music Assistant server: 2.2.7
Music Assistant addon (mass): 2024.9.1
Source: Local
Output: Snapcast

@OzGav OzGav added the HA Integration Improvements or bugs in the integration label Oct 14, 2024
@OzGav OzGav added bug Something isn't working and removed triage labels Oct 22, 2024
@marcelveldt
Copy link
Member

marcelveldt commented Oct 22, 2024

It would probably be more robust to synchronize progress at a minimum interval of 10 seconds, for example.

That is not allowed by Home Assistant, the time must be calculated, we may not push it regularly (to prevent overloading the state machine).

We'll see if we can fix this (that HA displays the wrong value) at some point

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working HA Integration Improvements or bugs in the integration
Projects
Status: NEXT
Development

No branches or pull requests

4 participants