|
char * | snd_use_case_identifier (const char *fmt,...) |
| Create an identifier.
|
|
int | snd_use_case_free_list (const char *list[], int items) |
| Free a string list.
|
|
int | snd_use_case_get_list (snd_use_case_mgr_t *uc_mgr, const char *identifier, const char **list[]) |
| Obtain a list of entries.
|
|
int | snd_use_case_get (snd_use_case_mgr_t *uc_mgr, const char *identifier, const char **value) |
| Get current - string.
|
|
int | snd_use_case_geti (snd_use_case_mgr_t *uc_mgr, const char *identifier, long *value) |
| Get current - integer.
|
|
int | snd_use_case_set (snd_use_case_mgr_t *uc_mgr, const char *identifier, const char *value) |
| Set new.
|
|
int | snd_use_case_mgr_open (snd_use_case_mgr_t **uc_mgr, const char *card_name) |
| Open and initialise use case core for sound card.
|
|
int | snd_use_case_mgr_reload (snd_use_case_mgr_t *uc_mgr) |
| Reload and re-parse use case configuration files for sound card.
|
|
int | snd_use_case_mgr_close (snd_use_case_mgr_t *uc_mgr) |
| Close use case manager.
|
|
int | snd_use_case_mgr_reset (snd_use_case_mgr_t *uc_mgr) |
| Reset use case manager verb, device, modifier to deafult settings.
|
|
int | snd_use_case_parse_ctl_elem_id (snd_ctl_elem_id_t *dst, const char *ucm_id, const char *value) |
| Parse control element identifier.
|
|
int | snd_use_case_parse_selem_id (snd_mixer_selem_id_t *dst, const char *ucm_id, const char *value) |
| Parse mixer element identifier.
|
|
The use case manager works by configuring the sound card ALSA kcontrols to change the hardware digital and analog audio routing to match the requested device use case. The use case manager kcontrol configurations are stored in easy to modify text files.An audio use case can be defined by a verb and device parameter. The verb describes the use case action i.e. a phone call, listening to music, recording a conversation etc. The device describes the physical audio capture and playback hardware i.e. headphones, phone handset, bluetooth headset, etc.It's intended clients will mostly only need to set the use case verb and device for each system use case change (as the verb and device parameters cover most audio use cases).However there are times when a use case has to be modified at runtime. e.g.
- Incoming phone call when the device is playing music
- Recording sections of a phone call
- Playing tones during a call.
In order to allow asynchronous runtime use case adaptations, we have a third optional modifier parameter that can be used to further configure the use case during live audio runtime.This interface allows clients to :-
- Query the supported use case verbs, devices and modifiers for the machine.
- Set and Get use case verbs, devices and modifiers for the machine.
- Get the ALSA PCM playback and capture device PCMs for use case verb, use case device and modifier.
- Get the TQ parameter for each use case verb, use case device and modifier.
- Get the ALSA master playback and capture volume/switch kcontrols or mixer elements for each use case.
Open and initialise use case core for sound card.
- Parameters
-
uc_mgr | Returned use case manager pointer |
card_name | Sound card name. |
- Returns
- zero if success, otherwise a negative error code
By default only first card is used when the driver card name or long name is passed in the card_name argument.
The "strict:" prefix in the card_name defines that there is no driver name / long name matching. The straight configuration is used.
The "hw:" prefix in the card_name will load the configuration for the ALSA card specified by the card index (value) or the card string identificator.
The sound card might be also composed from several physical sound cards (for the default and strict card_name). The application cannot expect that the device names will refer only one ALSA sound card in this case.