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

core: refactor to remove modes #541

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

core: refactor to remove modes #541

wants to merge 6 commits into from

Conversation

tmigone
Copy link
Contributor

@tmigone tmigone commented Jan 24, 2022

This PR removes modes from balenaSound as a user facing setting and replaces them with a mechanism that automatically upgrades the device to "multi-room" when possible; this is how it works:

  1. Devices boot into "standalone" mode, this means that multi-room is disabled initially and the device operates by itself routing audio from plugins directly into the output hardware.
  2. When the sound-supervisor starts it will check if the device is capable of being upgraded into "multi-room" mode. This is basically a check against a device-type blacklist that prevents the upgrade on low end devices.
  3. If the device can run as a "multi-room" server then the sound-supervisor will update the audio routes and restart multiroom-client so it picks up the multiroom server address.

Benefits
As a result of these changes the overall architecture is greatly simplified, most notably:

  • The audio service no longer depends on sound-supervisor; audio routing is no longer dependent on which mode the device is on. This means in the event of a sound-supervisor startup failure the device will at least have the "standalone" fallback and will function adequately.
  • The multiroom feature still depends on sound-supervisor but the services can startup regardless and won't be crash looping if it doesn't start:
    • multiroom-server no longer depends on sound-supervisor
    • multiroom-client service only relies on sound-supervisor to get the IP address of the multiroom master server, however it falls-back to localhost if the sound-supervisor is not available.

Removing the service inter-dependency is a huge win in terms of support as currently the vast majority of support threads are related to it. Currently the service dependency chain is: sound-supervisor > audio > multiroom-server > multiroom-client. Any one service failing to start will cause the application to fail.

To-do

  • Update documentation
  • Review env vars

Change-type: major
Signed-off-by: Tomás Migone [email protected]

@ghost
Copy link

ghost commented Jan 24, 2022

Your landr site preview has been successfully deployed to https://landr-balenalabs-repo-balena-sound-preview-541.netlify.app

Deployed with Landr 9.4.14

@tmigone tmigone marked this pull request as draft January 24, 2022 20:38
@tmigone tmigone force-pushed the simplify-modes branch 3 times, most recently from f92b70f to 78c6d4f Compare January 26, 2022 19:41
- Sound modes removed
- Devices will now start in "standalone" mode and upgrade if possible
- Service inter-dependency removed

Change-type: major
Signed-off-by: Tomás Migone <[email protected]>
Signed-off-by: Tomás Migone <[email protected]>
Signed-off-by: Tomás Migone <[email protected]>
Change-type: patch
Signed-off-by: Tomás Migone <[email protected]>
Change-type: patch
Signed-off-by: Tomás Migone <[email protected]>
Change-type: patch
Signed-off-by: Tomás Migone <[email protected]>
@maggie44 maggie44 added the enhancement New feature or request label Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants