Media player cards for Roon do not report correct current position/time

I have been playing with setting up a media player on an NSPanel Pro, and it seems to be mostly working aside from one quirk: after years of using the Roon app to directly control Roon, I’ve noticed that the media player in Home Assistant seems to periodically/randomly reset back to 0 seconds of progress while playing a track. This happens multiple times during track playback. I’ve attached a photo that shows the native Roon app on a tablet next to my NSPanel Pro - Roon correctly shows I’m nearly halfway through a track, but the media player is showing only 20 seconds have elapsed.

I first noticed the issue in the mini-media-player card I put on the dashboard for my NSPanel, but have also reproduced the issue with the standard media player.

Is there something weird on my end that could be causing this? All other features of the Roon integration seem to be working as expected (and I’ve been running it for ~2 years with no issues).

Ok - something else I just noticed: the time seems to reset every 29 seconds.

Also, if I skip to the middle of a track the progress bar will correctly indicate where I am - but only for ~29 seconds before resetting to 0.

This makes me think something weird is happening on my end, but I have no idea where to start looking - any ideas?

New day, new info.

It’s not always after 29 seconds… today it’s after more like 33 seconds. But, I enabled debug logging for the Roon integration and this is what shows up at the moment the playback position resets (with one line before and after that shows the normal logging). I am playing to a grouped zone in Roon of two devices, hence the two dict keys. (I also tried playback to only a single zone but that did not change the behavior)

Still no idea the implications of these async_update debug lines, and why that’s causing the playback position to reset

2024-03-20 11:55:44.973 DEBUG (Thread-3) [roonapi] _on_state_change zones_seek_changed
2024-03-20 11:55:45.073 DEBUG (MainThread) [homeassistant.components.roon.server] async_update_players dict_keys(['1601f5b404a572d9ed4cacef696fd23916d5', '1601af8ab780296fecd6aebbc8d126f70fdc'])
2024-03-20 11:55:45.073 DEBUG (MainThread) [homeassistant.components.roon.server] async_update_changed_players dict_keys(['1601f5b404a572d9ed4cacef696fd23916d5', '1601af8ab780296fecd6aebbc8d126f70fdc'])
2024-03-20 11:55:45.975 DEBUG (Thread-3) [roonapi] _on_state_change zones_seek_changed

I’ve noticed this too… It seems that normally madia player integration reports progress every few seconds and in meantime media card calculates proper time elapsed based on what was reported and some internal timer. Depending on media player integration I noticed this to be reported every10~15 seconds, so resetting the time every 30 sec by card is more than enough.
Now, roon integration misbehavies reporting progress only at restart of playback or start of new track - that is causing the progress to reset to when it was started every half a minute.
No practical dolution for this… either integration needs to be fixed or you can add some timer/automation and link it to progress via media player templaye integration. I was thinking about this some time ago, but finally dropped the idea as for me it was more hassle that it was worth. At some point of time I even opened bug report for this, but it was dropped by developer with comment that how it is now is the proper implementation :frowning:

Ah, wow. Thanks for the additional information.

Sucks that your bug was closed without being resolved - this is (seemingly) obviously not intended behavior :confused:

I’ve been thinking about going in with mod-card or something to try and tweak the mini media player display a bit for my use - maybe I’ll go overboard and also look into some sort of custom mod to try and approximate playback progress

@mirekmal I tried another bug report, and we might make some progress this time: Roon component resets reported position to 0 during playback (but not actual playback position) · Issue #113946 · home-assistant/core · GitHub

1 Like