-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
audiosettings: add helper service to set ALSA defaults on RPI #3759
base: master
Are you sure you want to change the base?
Conversation
adffb9f
to
39f7203
Compare
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.
39f7203
to
e39d31c
Compare
Thanks for this. Where is this triggered from currently ? I can't see where the function is called - or is it for a future change ? |
@joolswills for now it's not hooked anywhere, my initial thought is to add it to the image generation, like xpad, based on the platform and image (i.e. only add it to RPI and bullseye and later). |
Thanks. I wonder if there is a way to do this without the duplication of alsa config. Also a function to remove the service would be needed, but I'm going to have a think about options. |
Initially the implementation called
I though about this also, was thinking to add a parameter to the new function call ( |
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.