-
Notifications
You must be signed in to change notification settings - Fork 5.2k
vc4: Set driver_name for card #3656
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
Conversation
Allows use of the same alsa conf file for hdmi1 Signed-off-by: Dom Cobley <[email protected]>
Just out of interest, how does it achieve its objective? |
I would guess that the ALSA configuration file allows you to select by type ( |
Currently we need a file
to handle its very quirky nature. That doesn't handle the second hdmi port which has the same quirky behaviour. So you either need to duplicate that file, set an alias in
or set the driver name which is also considered for matching the conf file. This PR seems the option that has the least chance for users to get it wrong. |
@JamesH65 alsa lib uses the driver name to look up the card configuration file. So a single "HDA-Intel.conf" or "USB-Audio.conf" file can be used for a wide variety of sound cards. As the ALSA drivers usually expose a fixed structure of devices, mixer controls etc that works fine. The conf file lookup happens in the "load_for_all_cards" block in /usr/share/alsa/alsa.conf https://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/conf/alsa.conf;h=0e01c887dc28023cd0f7b75f443bde73443afbe1;hb=HEAD#l35 private_string gets set to the driver name - see also the load_for_all_cards docs https://www.alsa-project.org/alsa-doc/alsa-lib/conf_8c.html#ac64a8c73293ee35ed3f3958d47bdc721 On the kernel side the ALSA driver name is stored in the "driver" member of snd_card https://github.com/raspberrypi/linux/blob/rpi-5.4.y/include/sound/core.h#L84 which is exposed to userspace via the card info control. For ASoC things are a bit more tricky, as completely different cards could be handled by a single generic driver (eg the simple audio card driver which is configured via DT). By default the ALSA driver name is set to the ASoC card name (which is either set in the ASoC driver or passed in via DT), but if we set driver_name that takes precendence: https://github.com/raspberrypi/linux/blob/rpi-4.19.y/sound/soc/soc-core.c#L2104-L2105 So, if we are sure that our ASoC driver will always expose the same device/control/... structure we can simply set driver_name to use a single ALSA card conf file. |
kernel: vc4: Set driver_name for card See: raspberrypi/linux#3656 kernel: configs: Add SND_SOC_MAX98357A=m See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=275919 kernel: Add Micro Crystal RV-1805 to i2c-rtc overlays See: raspberrypi/linux#3651 kernel: media: bcm2835-isp: fix bytes per line calculations for some image formats See: raspberrypi/linux#3645 kernel: media: bcm2835-unicam: change minimum number of vb2_queue buffers to 1 See: raspberrypi/linux#3638 kernel: media: i2c: imx477: Return correct result on sensor id verification See: raspberrypi/linux#3630 kernel: Clean up the VCHIQ 2711 DMA support See: raspberrypi/linux#3629 kernel: overlays: i2c-rtc-gpio: Fix trickle-resistor-ohms param See: raspberrypi/linux#3642 kernel: Enable hwmon for thermal zones See: raspberrypi/linux#3307
kernel: vc4: Set driver_name for card See: raspberrypi/linux#3656 kernel: configs: Add SND_SOC_MAX98357A=m See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=275919 kernel: Add Micro Crystal RV-1805 to i2c-rtc overlays See: raspberrypi/linux#3651 kernel: media: bcm2835-isp: fix bytes per line calculations for some image formats See: raspberrypi/linux#3645 kernel: media: bcm2835-unicam: change minimum number of vb2_queue buffers to 1 See: raspberrypi/linux#3638 kernel: media: i2c: imx477: Return correct result on sensor id verification See: raspberrypi/linux#3630 kernel: Clean up the VCHIQ 2711 DMA support See: raspberrypi/linux#3629 kernel: overlays: i2c-rtc-gpio: Fix trickle-resistor-ohms param See: raspberrypi/linux#3642 kernel: Enable hwmon for thermal zones See: raspberrypi/linux#3307
Thanks for the explanations everyone. |
Allows use of the same alsa conf file for hdmi1
From suggestion by @HiassofT