On Sat, 29 Apr 2023 20:35:19 +0200, Ivan Orlov wrote:
Hello!
I have a question about the typical ALSA driver parameters, and maybe someone can answer me. Why it is necessary for ALSA module to have "index", "id" and "enable" parameters? They are mentioned as required in the "Writing an ALSA driver" and "Advanced Linux Sound Architecture
- Driver Configuration guide" articles and used in many ALSA drivers,
but for what purpose?
It's for either specifying the order of instances or controlling enable/disable of each one when there are multiple devices bound with the same driver. One of typical use cases would be the HD-audio driver; there are many machines that have two HD-audio controllers, one for HDMI/DP audio and another for onboard analog. In most cases, the second one (onboard analog) is the primary usage, and people would like to assign this as the first appearing card. Then you can pass the option like "index=1,0" to swap the assignment slot.
Nowadays with the sound backend like PA or PW that supports dynamic configuration, it's little use, but that was a help for static configuration in the past.
HTH,
Takashi