Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
audiosettings: add helper service to set ALSA defaults on RPI
Added a helper method that installs a `systemd` service meant to automatically configure ALSA with the HDMI 0 port when using the ARM `vc4hdmi` RPI driver. The service will run once then disable itself. Since the default ALSA configuration on RaspiOS goes through the analog output (Heaphones) when the `vc4-kms-v3d` overlay is present, if we want to configure the HDMI output by default there needs to be an additional configuration. The additional configuration needs also to be applied when only one audio output is present, since the ALSA config is a bit more involved. There are a couple of reasons for which is a service: - the `vc4hdmi` device index can be different depending on the Pi model. Pi0(w)/Pi400 has no analog output by default and CM models may not have it also) - the card name can also be different (Pi4 with 2 devices vs Pi3/Pi2/Pi1 with 1 device) Note that the service will configure the 1st HDMI port/device, on Pi models with multiple HDMI ports (Pi4/Pi 400/Pi5/CM4) the user will still need to use the Audio settings dialog to change it if they want to. There may be a way to detect which HDMI port is active and has audio, but that's not implemented.
- Loading branch information