Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ucm2: use private alsa-lib's configuration by default
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
- Loading branch information
1e6297b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @perexg :
I found this change only expose hw device to application, while we create new device , and it will add _ucm0001. prefix for the new device, also the local config don`t have this device, and cause it is one "invalid ctl", how can we overcome it , can we revert this patch? many Thanks.
Best Regards
Fei
1e6297b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have special requirements, create own ucm.conf file. The purpose of the private alsa-lib configuration for ucm is to have all things self-contained. If you look to the included file, it contains the alsa-lib configuration (but only a very little part).
I cannot judge your requirement without knowledge of your special device. Basically, UCM should describe everything and don't rely on something else. So you may think to define your special device inside UCM, too. Just look for LibraryConfig blocks in the current configuration files for examples.
1e6297b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for you quick reply, so if "it contains the alsa-lib configuration (but only a very little part).", can I remove this line "Include.libgen.File "/lib/generic.conf" # private alsa-lib configuration", then there is no local_config. and it will always call "snd_config_update_ref(&top);" inside "snd_ctl_open/snd_pcm_open". or should I include another config file like add another line "" Include.libgen.File "/lib/pcmplugin.conf"".
btw, I don`t understand what is "_snd_is_ucm_device" mean, I understand the API, but what kind of device should be ucm_device ,then add prefix for it . it is very appreciate you can provide help .
Best Regards
Fei
1e6297b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The device prefix determines the private UCM configuration for alsa-lib and the _snd_is_ucm_device() is a helper to detect this prefix. It means that the system-wide alsa-lib configurations are not parsed (used) at all when the application gets the devices through UCM. In other words, if you define your device in /etc/asound.conf or ~/.asoundrc, it won't be visible, because this configuration is not used. You should define this special device in the LibraryConfig block (UCM).
EDIT: For the completion: If at least one LibraryConfig block is in the UCM configuration, the private alsa-lib configuration (private to UCM application) is activated (special device prefixes).
1e6297b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I summaries as below:
LibraryConfig.a_label.SubstiConfig {
# substituted library configuration like:
usr_share_dir "${ConfLibDir}"
}
LibraryConfig.b_label.Config {
# non-substituted library configuration like:
usr_share_dir "/usr/share/alsa"
}
LibraryConfig.c_label.SubstiFile "/some/path"
LibraryConfig.d_label.File "/some/path"
Best Regards
Fei
1e6297b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the private configuration is only for UCM.
It's not completely correct, if it's activated, only the configuration for alsa-lib defined in UCM configuration is used. By default, only hw:# devices are defined (see contents of the included file -
Include.libgen.File "/lib/generic.conf"
). Everything is configurable, you may start with an empty configuration for alsa-lib.Note that the standard configuration has only one base file
/usr/share/alsa/alsa.conf
, too. It defines all devices (and does the dynamic inclusion of the other files like/etc/asound.conf
etc.). Again, everything is configurable. The private configuration for UCM just does not use this file.Yes. The LibraryConfig block must be used for this.
Correct.
Note that
ucm2/ucm.conf
is used as the root configuration file to define the configuration lookups and the global configuration for all hardware variants (including plug-and-play hardware like USB). The per-hardware (profile) configurations should be defined in the specific card / verb UCM configuration files - including the LibraryConfig blocks.1e6297b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much , it is really very helpful you provide so much detailed comment, Thanks again .