getState API doesn't always return correct "seek" value when used with Spotify Web or Spotify Connect

Prerequisites

Volumio Information

Volumio Version: 3.449
Hardware: RPi 4
DAC: Topping E30

Steps to Reproduce

  1. Play a song through Spotify Connect or Spotify Web plugin
  2. Wait some random number of seconds e.g. 10s of playing song
  3. Call /getState API and read “seek” field

Expected:
“seek” field showing number of elapsed ms of the song

Actual:
“seek” field showing 0

This fields works quite ok with Tidal Connect, files played from storage. With Tidal Web it sometimes gets misaligned by 2-3 seconds. It gets corrected if playback is manually moved to a different position on the Volumio UI progress bar.

The issue applies to the REST API as well as to events emitted by socket.io. The same problem is on the UI, if instead of calling /getState endpoint the page will be refreshed - the progress bar will get misaligned with the song elapsed time.

I’m working on my custom screen showing synced lyrics of the song being played, everything would work excellent if Volumio reported precise values in the “seek” field in the API.

Thanks,
Dariusz