Skip to content

Commit

Permalink
Update architecture.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hifiberry authored Feb 26, 2020
1 parent aea869e commit b58fdb6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions doc/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,26 @@ Adding a services requires two steps:
2. Add the player module to the GUI. The simplest GUI would be just a UI that can only enable/disable the service.
You might add more options (e.g. configuration parameters that the user should be able to set)


## Dos and don'ts

### Automatic configuration

A player service should configure itself automatically. The user should not have to deal with device names, mixer controls or stuff like this. There might be services that might require some configuration (e.g. a server name), but try to keep this as minimal as possible. If a server can be automatically discovered using mDNS or similar mechanisms, you should use these and not provide a configuration for the IP address in the UI.

### Volume control

Volume control should be handled via ALSA. A service should not change the volume if it isn't active. It should also not change it when it starts or shuts down. The ALSA mixer device can vary between different sound cards. Therefore, use the control from /etc/hifiberry.state

### Systemd

All services need to be started by systemd. Use the correct dependencies and use restart, but make sure that a service that immediately crashes doesn't get restarted too fast.


~~~~
Restart=always
RestartSec=5
~~~~



0 comments on commit b58fdb6

Please sign in to comment.