audiosettings: add helper service to set ALSA defaults on RPI #3759
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a helper method that installs a
systemd
service meant to automatically configure ALSA with the HDMI 0 port when using the ARMvc4hdmi
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 using a service and creating the configuration on the device itself (on 1st boot):
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)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.