~ubuntu-branches/ubuntu/trusty/alsa-lib/trusty

« back to all changes in this revision

Viewing changes to include/use-case.h

  • Committer: Package Import Robot
  • Author(s): Luke Yelavich, Luke Yelavich
  • Date: 2013-07-26 10:54:32 UTC
  • mfrom: (1.1.17) (2.4.9 sid)
  • Revision ID: package-import@ubuntu.com-20130726105432-nbrwu6yk576ihzbb
Tags: 1.0.27.2-1ubuntu1
[ Luke Yelavich ]
* Merge from debian unstable.  Remaining changes:
  - debian/control: Add Vcs-Bzr URI
  - Show hints for non-standard devices that lack configuration files
  - Add a compile/run autopkg test
  - Add config file for the tegra alc5632 chip found in the AC100 netbook.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
 *  \{
50
50
 */
51
51
 
52
 
/**
 
52
/*! \page Usecase ALSA Use Case Interface
 
53
 * 
53
54
 * ALSA Use Case Interface
54
55
 *
55
56
 * The use case manager works by configuring the sound card ALSA kcontrols to
96
97
 * case verb will configure the audio hardware for HiFi Music playback
97
98
 * and capture.
98
99
 */
99
 
#define SND_USE_CASE_VERB_INACTIVE              "Inactive"
100
 
#define SND_USE_CASE_VERB_HIFI                  "HiFi"
101
 
#define SND_USE_CASE_VERB_HIFI_LOW_POWER        "HiFi Low Power"
102
 
#define SND_USE_CASE_VERB_VOICE                 "Voice"
103
 
#define SND_USE_CASE_VERB_VOICE_LOW_POWER       "Voice Low Power"
104
 
#define SND_USE_CASE_VERB_VOICECALL             "Voice Call"
105
 
#define SND_USE_CASE_VERB_IP_VOICECALL          "Voice Call IP"
106
 
#define SND_USE_CASE_VERB_ANALOG_RADIO          "FM Analog Radio"
107
 
#define SND_USE_CASE_VERB_DIGITAL_RADIO         "FM Digital Radio"
 
100
#define SND_USE_CASE_VERB_INACTIVE              "Inactive"              /**< Inactive Verb */
 
101
#define SND_USE_CASE_VERB_HIFI                  "HiFi"                  /**< HiFi Verb */
 
102
#define SND_USE_CASE_VERB_HIFI_LOW_POWER        "HiFi Low Power"        /**< HiFi Low Power Verb */
 
103
#define SND_USE_CASE_VERB_VOICE                 "Voice"                 /**< Voice Verb */
 
104
#define SND_USE_CASE_VERB_VOICE_LOW_POWER       "Voice Low Power"       /**< Voice Low Power Verb */
 
105
#define SND_USE_CASE_VERB_VOICECALL             "Voice Call"            /**< Voice Call Verb */
 
106
#define SND_USE_CASE_VERB_IP_VOICECALL          "Voice Call IP"         /**< Voice Call IP Verb */
 
107
#define SND_USE_CASE_VERB_ANALOG_RADIO          "FM Analog Radio"       /**< FM Analog Radio Verb */
 
108
#define SND_USE_CASE_VERB_DIGITAL_RADIO         "FM Digital Radio"      /**< FM Digital Radio Verb */
108
109
/* add new verbs to end of list */
109
110
 
110
111
 
114
115
 * Physical system devices the render and capture audio. Devices can be OR'ed
115
116
 * together to support audio on simultaneous devices.
116
117
 */
117
 
#define SND_USE_CASE_DEV_NONE           "None"
118
 
#define SND_USE_CASE_DEV_SPEAKER        "Speaker"
119
 
#define SND_USE_CASE_DEV_LINE           "Line"
120
 
#define SND_USE_CASE_DEV_HEADPHONES     "Headphones"
121
 
#define SND_USE_CASE_DEV_HEADSET        "Headset"
122
 
#define SND_USE_CASE_DEV_HANDSET        "Handset"
123
 
#define SND_USE_CASE_DEV_BLUETOOTH      "Bluetooth"
124
 
#define SND_USE_CASE_DEV_EARPIECE       "Earpiece"
125
 
#define SND_USE_CASE_DEV_SPDIF          "SPDIF"
126
 
#define SND_USE_CASE_DEV_HDMI           "HDMI"
 
118
#define SND_USE_CASE_DEV_NONE           "None"          /**< None Device */
 
119
#define SND_USE_CASE_DEV_SPEAKER        "Speaker"       /**< Speaker Device */
 
120
#define SND_USE_CASE_DEV_LINE           "Line"          /**< Line Device */
 
121
#define SND_USE_CASE_DEV_HEADPHONES     "Headphones"    /**< Headphones Device */
 
122
#define SND_USE_CASE_DEV_HEADSET        "Headset"       /**< Headset Device */
 
123
#define SND_USE_CASE_DEV_HANDSET        "Handset"       /**< Handset Device */
 
124
#define SND_USE_CASE_DEV_BLUETOOTH      "Bluetooth"     /**< Bluetooth Device */
 
125
#define SND_USE_CASE_DEV_EARPIECE       "Earpiece"      /**< Earpiece Device */
 
126
#define SND_USE_CASE_DEV_SPDIF          "SPDIF"         /**< SPDIF Device */
 
127
#define SND_USE_CASE_DEV_HDMI           "HDMI"          /**< HDMI Device */
127
128
/* add new devices to end of list */
128
129
 
129
130
 
145
146
 *  3. Call snd_use_case_get("PlaybackPCM") to get ALSA PCM sink name for
146
147
 *     ringtone pcm data.
147
148
 */
148
 
#define SND_USE_CASE_MOD_CAPTURE_VOICE          "Capture Voice"
149
 
#define SND_USE_CASE_MOD_CAPTURE_MUSIC          "Capture Music"
150
 
#define SND_USE_CASE_MOD_PLAY_MUSIC             "Play Music"
151
 
#define SND_USE_CASE_MOD_PLAY_VOICE             "Play Voice"
152
 
#define SND_USE_CASE_MOD_PLAY_TONE              "Play Tone"
153
 
#define SND_USE_CASE_MOD_ECHO_REF               "Echo Reference"
 
149
#define SND_USE_CASE_MOD_CAPTURE_VOICE          "Capture Voice"         /**< Capture Voice Modifier */
 
150
#define SND_USE_CASE_MOD_CAPTURE_MUSIC          "Capture Music"         /**< Capture Music Modifier */
 
151
#define SND_USE_CASE_MOD_PLAY_MUSIC             "Play Music"            /**< Play Music Modifier */
 
152
#define SND_USE_CASE_MOD_PLAY_VOICE             "Play Voice"            /**< Play Voice Modifier */
 
153
#define SND_USE_CASE_MOD_PLAY_TONE              "Play Tone"             /**< Play Tone Modifier */
 
154
#define SND_USE_CASE_MOD_ECHO_REF               "Echo Reference"        /**< Echo Reference Modifier */
154
155
/* add new modifiers to end of list */
155
156
 
156
157
 
162
163
 * audio driver in order to lower power consumption.
163
164
 *
164
165
 */
165
 
#define SND_USE_CASE_TQ_MUSIC           "Music"
166
 
#define SND_USE_CASE_TQ_VOICE           "Voice"
167
 
#define SND_USE_CASE_TQ_TONES           "Tones"
 
166
#define SND_USE_CASE_TQ_MUSIC           "Music"         /**< Music Tone Quality */
 
167
#define SND_USE_CASE_TQ_VOICE           "Voice"         /**< Voice Tone Quality */
 
168
#define SND_USE_CASE_TQ_TONES           "Tones"         /**< Tones Tone Quality */
168
169
 
169
170
/** use case container */
170
171
typedef struct snd_use_case_mgr snd_use_case_mgr_t;
197
198
 *                        (in pair cardname+comment)
198
199
 *   _verbs             - get verb list
199
200
 *                        (in pair verb+comment)
200
 
 *   _devices[/<verb>]  - get list of supported devices
 
201
 *   _devices[/{verb}]  - get list of supported devices
201
202
 *                        (in pair device+comment)
202
 
 *   _modifiers[/<verb>]- get list of supported modifiers
 
203
 *   _modifiers[/{verb}]- get list of supported modifiers
203
204
 *                        (in pair modifier+comment)
204
 
 *   TQ[/<verb>]        - get list of TQ identifiers
 
205
 *   TQ[/{verb}]        - get list of TQ identifiers
205
206
 *   _enadevs           - get list of enabled devices
206
207
 *   _enamods           - get list of enabled modifiers
207
208
 *
208
 
 *   _supporteddevs/<modifier>|<device>[/<verb>]   - list of supported devices
209
 
 *   _conflictingdevs/<modifier>|<device>[/<verb>] - list of conflicting devices
 
209
 *   _supporteddevs/{modifier}|{device}[/{verb}]   - list of supported devices
 
210
 *   _conflictingdevs/{modifier}|{device}[/{verb}] - list of conflicting devices
210
211
 *   Note that at most one of the supported/conflicting devs lists has
211
212
 *   any entries, and when neither is present, all devices are supported.
212
213
 *
230
231
 *   NULL               - return current card
231
232
 *   _verb              - return current verb
232
233
 *
233
 
 *   [=]<NAME>[/[<modifier>|</device>][/<verb>]]
234
 
 *                      - value identifier <NAME>
 
234
 *   [=]{NAME}[/[{modifier}|{/device}][/{verb}]]
 
235
 *                      - value identifier {NAME}
235
236
 *                      - Search starts at given modifier or device if any,
236
237
 *                          else at a verb
237
238
 *                      - Search starts at given verb if any,
281
282
 * \return Zero if success, otherwise a negative error code
282
283
 *
283
284
 * Known identifiers:
284
 
 *   _devstatus/<device>        - return status for given device
285
 
 *   _modstatus/<modifier>      - return status for given modifier
 
285
 *   _devstatus/{device}        - return status for given device
 
286
 *   _modstatus/{modifier}      - return status for given modifier
286
287
 */
287
288
int snd_use_case_geti(snd_use_case_mgr_t *uc_mgr,
288
289
                      const char *identifier,
299
300
 *   _verb              - set current verb = value
300
301
 *   _enadev            - enable given device = value
301
302
 *   _disdev            - disable given device = value
302
 
 *   _swdev/<old_device> - new_device = value
 
303
 *   _swdev/{old_device} - new_device = value
303
304
 *                      - disable old_device and then enable new_device
304
305
 *                      - if old_device is not enabled just return
305
306
 *                      - check transmit sequence firstly
306
307
 *   _enamod            - enable given modifier = value
307
308
 *   _dismod            - disable given modifier = value
308
 
 *   _swmod/<old_modifier> - new_modifier = value
 
309
 *   _swmod/{old_modifier} - new_modifier = value
309
310
 *                      - disable old_modifier and then enable new_modifier
310
311
 *                      - if old_modifier is not enabled just return
311
312
 *                      - check transmit sequence firstly
353
354
 * \param list Returned allocated list
354
355
 * \return Number of list entries if success, otherwise a negative error code
355
356
 */
356
 
static inline int snd_use_case_card_list(const char **list[])
 
357
static __inline__ int snd_use_case_card_list(const char **list[])
357
358
{
358
359
        return snd_use_case_get_list(NULL, NULL, list);
359
360
}
364
365
 * \param list Returned list of verbs
365
366
 * \return Number of list entries if success, otherwise a negative error code
366
367
 */
367
 
static inline int snd_use_case_verb_list(snd_use_case_mgr_t *uc_mgr,
 
368
static __inline__ int snd_use_case_verb_list(snd_use_case_mgr_t *uc_mgr,
368
369
                                         const char **list[])
369
370
{
370
371
        return snd_use_case_get_list(uc_mgr, "_verbs", list);