Skip to content

Add volume sync between Spotify and AmpliPi#1063

Open
SteveMicroNova wants to merge 1 commit intoVolumeDeltaExpansionfrom
SpotifyVolumeReflection
Open

Add volume sync between Spotify and AmpliPi#1063
SteveMicroNova wants to merge 1 commit intoVolumeDeltaExpansionfrom
SpotifyVolumeReflection

Conversation

@SteveMicroNova
Copy link
Contributor

@SteveMicroNova SteveMicroNova commented Oct 31, 2025

What does this change intend to accomplish?

Make it so that Spotify side volume changes are reflected in AmpliPi and vice-versa

Checklist

  • Have you tested your changes and ensured they work?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • If applicable, have you updated the CHANGELOG?
  • Does your submission pass linting & tests? You can test on localhost using ./scripts/test
  • Have you written new tests for your core features/changes, as applicable?

@SteveMicroNova SteveMicroNova changed the title Add basic vol change functionality to spotify metadata reader Add volume sync between Spotify and AmpliPi Nov 4, 2025
@SteveMicroNova SteveMicroNova force-pushed the SpotifyVolumeReflection branch from 613d88c to c6ca6d4 Compare November 5, 2025 15:23
@SteveMicroNova SteveMicroNova marked this pull request as ready for review November 6, 2025 20:16
@SteveMicroNova
Copy link
Contributor Author

This branch depends on #1064 to function in the field

@SteveMicroNova
Copy link
Contributor Author

I'd like to take note that we stress tested this earlier with multiple people playing tug of war with the volume slider using a Spotify jam and the underlying Spotify stream failed before the script did, according to the logs

It's unclear how the underlying stream failed, and perhaps this is solved with the bump from go-librespot 0.5.0 to 0.5.2, but it's hard to say until we put it through another office-wide stress test (I simply am not able to input enough changes myself even though I am able to create a multi account jam session)

@linknum23
Copy link
Contributor

linknum23 commented Nov 8, 2025 via email

@SteveMicroNova SteveMicroNova force-pushed the SpotifyVolumeReflection branch from 5215cda to 20b7dd6 Compare November 10, 2025 16:10
@SteveMicroNova SteveMicroNova force-pushed the SpotifyVolumeReflection branch 2 times, most recently from f105529 to e125ac2 Compare November 17, 2025 22:10
@SteveMicroNova SteveMicroNova force-pushed the SpotifyVolumeReflection branch from 7de343e to e83de61 Compare November 26, 2025 14:41
@linknum23 linknum23 marked this pull request as draft November 26, 2025 16:14
@SteveMicroNova SteveMicroNova force-pushed the SpotifyVolumeReflection branch from e83de61 to 7fc8fd7 Compare November 26, 2025 17:42
@SteveMicroNova SteveMicroNova marked this pull request as ready for review December 1, 2025 19:21
@SteveMicroNova SteveMicroNova force-pushed the SpotifyVolumeReflection branch from 9e275c2 to 39d9455 Compare December 1, 2025 20:57
raise NotImplementedError("Function must be implemented by child classes")


class AmpliPiData:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still needed? I thought volume changes were coming in through the volume change fifo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AmpliPi side is handled through a fifo, stream side (Spotify side, airplay side in #1071) is handled through this function that is automatically run as a subthread by the __init__ of this class

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This volume scheme is going to need a pretty diagram somewhere in the code to preserve the sanity of the next person to look at this.

Copy link
Contributor Author

@SteveMicroNova SteveMicroNova Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How's this (the docstring under VolumeSynchronizer)?

@SteveMicroNova
Copy link
Contributor Author

Note that the vol sync will not work on systems that are effected by #1067, which are all systems that reboot while playing a persistent stream

@SteveMicroNova SteveMicroNova linked an issue Dec 5, 2025 that may be closed by this pull request
@SteveMicroNova SteveMicroNova force-pushed the SpotifyVolumeReflection branch 2 times, most recently from 61789c5 to 6d89922 Compare December 5, 2025 21:28
@linknum23
Copy link
Contributor

Volume is out of sync and stopped changing from spotify. I think this needs a little more testing.

Screenshot_20251207-191104.png

Screenshot_20251207-190720.png

@linknum23
Copy link
Contributor

Changing volume via amplipis app still works when it goes out of sync

@SteveMicroNova SteveMicroNova mentioned this pull request Dec 15, 2025
7 tasks
@SteveMicroNova SteveMicroNova force-pushed the SpotifyVolumeReflection branch 5 times, most recently from e8b8f83 to 0a1c3fc Compare February 26, 2026 21:11
@SteveMicroNova SteveMicroNova force-pushed the SpotifyVolumeReflection branch from 0a1c3fc to 9949d3e Compare March 3, 2026 21:22
@SteveMicroNova SteveMicroNova force-pushed the SpotifyVolumeReflection branch 2 times, most recently from adc957e to 7dab922 Compare March 3, 2026 21:34
@SteveMicroNova SteveMicroNova force-pushed the SpotifyVolumeReflection branch from 3edcbfd to 6cbee9f Compare March 3, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vsrc values drift on system reboot

2 participants