~ubuntu-branches/ubuntu/warty/alsa-lib/warty

« back to all changes in this revision

Viewing changes to doc/asoundrc.txt

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-09-23 19:38:45 UTC
  • Revision ID: james.westby@ubuntu.com-20040923193845-71lrqesgxij0yzn7
Tags: upstream-1.0.5
ImportĀ upstreamĀ versionĀ 1.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Configuration file syntax
 
2
 
 
3
# Include a new configuration file
 
4
<filename>
 
5
 
 
6
# Simple assign
 
7
name [=] value [,|;]
 
8
 
 
9
# Compound assign (first style)
 
10
name [=] {
 
11
        name1 [=] value [,|;]
 
12
        ...
 
13
}
 
14
 
 
15
# Compound assign (second style)
 
16
name.name1 [=] value [,|;]
 
17
 
 
18
# Array assign (first style)
 
19
name [
 
20
        value0 [,|;]
 
21
        value1 [,|;]
 
22
        ...
 
23
]
 
24
 
 
25
# Array assign (second style)
 
26
name.0 [=] value0 [,|;]
 
27
name.1 [=] value1 [,|;]
 
28
 
 
29
# ******************************************************************************
 
30
 
 
31
# Server definition
 
32
server.NAME {
 
33
  host STR              # host where the server is located (if map to local address 
 
34
                        # server is local, and then it may be started automatically)
 
35
  [socket STR]          # PF_LOCAL socket name to listen/connect
 
36
  [port INT]            # PF_INET port number to listen/connect
 
37
}
 
38
 
 
39
# PCM type definition
 
40
pcm_type.NAME {
 
41
  [lib STR]             # Library file (default libasound.so)
 
42
  [open STR]            # Open function (default _snd_pcm_NAME_open)
 
43
  [redirect {           # Redirect this PCM to an another
 
44
     [filename STR]     # Configuration file specification
 
45
     name STR           # PCM name specification
 
46
  }]
 
47
}
 
48
 
 
49
# PCM scope type definition
 
50
pcm_scope_type.NAME {
 
51
  [lib STR]             # Library file (default libasound.so)
 
52
  [open STR]            # Open function (default _snd_pcm_scope_NAME_open)
 
53
}
 
54
 
 
55
# PCM scope definition
 
56
pcm_scope.NAME {
 
57
  type STR              # Scope type
 
58
  ...
 
59
}
 
60
 
 
61
# Slave PCM definition
 
62
pcm_slave.NAME {
 
63
  pcm STR               # PCM name
 
64
  # or
 
65
  pcm { }               # PCM definition
 
66
  format STR            # Format
 
67
  channels INT          # Channels
 
68
  rate INT              # Rate
 
69
  period_time INT       # Period time
 
70
  buffer_time INT       # Buffer time
 
71
  etc.
 
72
}
 
73
 
 
74
# Hook arguments definition
 
75
hook_args.NAME {
 
76
  ...                   # Arbitrary arguments
 
77
}
 
78
 
 
79
# PCM hook type
 
80
pcm_hook_type.NAME {
 
81
  [lib STR]             # Library file (default libasound.so)
 
82
  [install STR]         # Install function (default _snd_pcm_hook_NAME_install)
 
83
}
 
84
 
 
85
# PCM hook definition
 
86
pcm_hook.NAME {
 
87
  type STR              # PCM Hook type (see pcm_hook_type)
 
88
  [args STR]            # Arguments for install function (see hook_args)
 
89
  # or
 
90
  [args { }]            # Arguments for install function
 
91
}
 
92
 
 
93
# PCM definition
 
94
pcm.NAME {
 
95
  type STR              # Type
 
96
  [comment ANY]         # Saved comments
 
97
 
 
98
 
 
99
# PCM types:
 
100
  type hw               # Kernel PCM
 
101
  card INT/STR          # Card name or number
 
102
  [device] INT          # Device number (default 0)     
 
103
  [subdevice] INT       # Subdevice number, -1 first available (default -1)
 
104
  mmap_emulation BOOL   # enable mmap emulation for ro/wo devices
 
105
 
 
106
 
 
107
  type hooks            # PCM with hooks
 
108
  slave STR             # Slave name (see pcm_slave)
 
109
  # or
 
110
  slave {               # Slave definition
 
111
    pcm STR             # Slave PCM name
 
112
    # or
 
113
    pcm { }             # Slave PCM definition
 
114
  }
 
115
  hooks {
 
116
    ID STR              # Hook name (see pcm_hook)
 
117
    # or
 
118
    ID { }              # Hook definition (see pcm_hook)
 
119
  }
 
120
 
 
121
  type plug             # Format adjusted PCM
 
122
  slave STR             # Slave name (see pcm_slave)
 
123
  # or
 
124
  slave {               # Slave definition
 
125
    pcm STR             # Slave PCM name
 
126
    # or
 
127
    pcm { }             # Slave PCM definition
 
128
    [format STR]        # Slave format (default nearest) or "unchanged"
 
129
    [channels INT]      # Slave channels (default nearest) or "unchanged"
 
130
    [rate INT]          # Slave rate (default nearest) or "unchanged"
 
131
  }
 
132
  route_policy STR      # route policy for automatic ttable generation
 
133
                        # STR can be 'default', 'average', 'copy', 'duplicate'
 
134
                        # average: result is average of input channels
 
135
                        # copy: only first channels are copied to destination
 
136
                        # duplicate: duplicate first set of channels
 
137
                        # default: copy policy, except for mono capture - sum
 
138
  ttable {              # Transfer table (bidimensional compound of 
 
139
                        # cchannels * schannels numbers)
 
140
    CCHANNEL {
 
141
      SCHANNEL REAL     # route value (0.0 ... 1.0)
 
142
    }
 
143
  }
 
144
 
 
145
 
 
146
  type copy             # Copy conversion PCM
 
147
  slave STR             # Slave name (see pcm_slave)
 
148
  # or
 
149
  slave {               # Slave definition
 
150
    pcm STR             # Slave PCM name
 
151
    # or
 
152
    pcm { }             # Slave PCM definition
 
153
  }
 
154
 
 
155
 
 
156
  type linear           # Linear format conversion PCM
 
157
  type adpcm            # IMA-ADPCM format conversion PCM
 
158
  type alaw             # A-Law format conversion PCM
 
159
  type mulaw            # Mu-Law format conversion PCM
 
160
  slave STR             # Slave name (see pcm_slave)
 
161
  # or
 
162
  slave {               # Slave definition
 
163
    pcm STR             # Slave PCM name
 
164
    # or
 
165
    pcm { }             # Slave PCM definition
 
166
    format STR          # Slave format
 
167
  }
 
168
 
 
169
 
 
170
  type rate             # Rate conversion PCM
 
171
  slave STR             # Slave name (see pcm_slave)
 
172
  # or
 
173
  slave {               # Slave definition
 
174
    pcm STR             # Slave PCM name
 
175
    # or
 
176
    pcm { }             # Slave PCM definition
 
177
    [format STR]        # Slave format (default client format)
 
178
    rate INT            # Slave rate
 
179
  }
 
180
 
 
181
 
 
182
  type route            # Attenuated static route PCM
 
183
  slave STR             # Slave name (see pcm_slave)
 
184
  # or
 
185
  slave {               # Slave definition
 
186
    pcm STR             # Slave PCM name
 
187
    # or
 
188
    pcm { }             # Slave PCM definition
 
189
    [format STR]        # Slave format (default client format)
 
190
    [channels INT]      # Slave channels (default client channels)
 
191
  }
 
192
  ttable {              # Transfer table (bidimensional compound of 
 
193
                        # cchannels * schannels numbers)
 
194
    CCHANNEL {
 
195
      SCHANNEL REAL     # route value (0.0 ... 1.0)
 
196
    }
 
197
  }
 
198
 
 
199
 
 
200
  type multi            # Linked PCMs (exclusive access to selected channels)
 
201
  slaves {              # Slaves definitions
 
202
    ID STR              # Slave name for slave N (see pcm_slave)
 
203
    # or
 
204
    ID {                # Slave definition for slave N
 
205
      pcm STR           # Slave PCM name
 
206
    # or
 
207
      pcm { }           # Slave PCM definition
 
208
      channels INT      # Slave channels
 
209
    }
 
210
  }
 
211
  bindings {            # Bindings table
 
212
    N {                 # Binding for client channel N
 
213
      slave STR         # Slave key
 
214
      channel INT       # Slave channel
 
215
    }
 
216
  }
 
217
  [master INT]          # Define the master slave
 
218
 
 
219
 
 
220
  type file             # File plugin
 
221
  slave STR             # Slave name (see pcm_slave)
 
222
  # or
 
223
  slave {               # Slave definition
 
224
    pcm STR             # Slave PCM name
 
225
    # or
 
226
    pcm { }             # Slave PCM definition
 
227
  }
 
228
  file STR              # File name
 
229
  # or
 
230
  file INT              # File descriptor
 
231
  [format STR]          # File format (NYI)
 
232
 
 
233
 
 
234
  type meter            # Meter PCM
 
235
  slave STR             # Slave name (see pcm_slave)
 
236
  # or
 
237
  slave {               # Slave definition or name
 
238
    pcm STR             # Slave PCM name
 
239
    # or
 
240
    pcm { }             # Slave PCM definition
 
241
  }
 
242
  [frequency INT]       # Updates per second
 
243
  scopes {              # Scopes
 
244
    ID STR              # Scope name (see pcm_scope)
 
245
  # or
 
246
    ID { }              # Scope definition (see pcm_scope)
 
247
  }
 
248
 
 
249
 
 
250
  type droute           # Attenuated dynamic route PCM (NYI)
 
251
  slave STR             # Slave name (see pcm_slave)
 
252
  # or
 
253
  slave {               # Slave definition
 
254
    pcm STR             # Slave PCM name
 
255
    # or
 
256
    pcm { }             # Slave PCM definition
 
257
    [format STR]        # Slave format (default client format)
 
258
    [channels INT]      # Slave channels (default client channels)
 
259
  }
 
260
  ctl STR               # Ctl name
 
261
  bindings {            # Bindings table
 
262
    ID {                # Binding entry
 
263
      cchannels {       # Client channels
 
264
        C INT           # Client channel
 
265
      }
 
266
      schannel {        # Slave channels
 
267
        S INT           # Slave channel
 
268
      }
 
269
      control STR       # Control name of C * S (or C values: only if C == S)
 
270
    }
 
271
  }
 
272
 
 
273
 
 
274
  type null             # Null endpoint plugin
 
275
  [time INT]            # Time related or not (NYI)
 
276
 
 
277
 
 
278
  type shm              # Shared memory client PCM
 
279
  server STR            # Server name
 
280
  pcm STR               # PCM name on server
 
281
 
 
282
 
 
283
  type share            # Share PCM
 
284
  slave STR             # Slave name (see pcm_slave)
 
285
  bindings {            # Bindings table
 
286
    N INT               # Slave channel for client channel N
 
287
  }
 
288
 
 
289
 
 
290
  type mix              # Mix PCM
 
291
  slave STR             # Slave name (see pcm_slave)
 
292
  bindings {            # Bindings table
 
293
    N INT               # Slave channel for client channel N
 
294
  }
 
295
 
 
296
 
 
297
  type ladspa           # LADSPA plugin PCM
 
298
  slave STR             # Slave name (see pcm_slave)
 
299
  path STR              # Path or paths (delimited with ':')
 
300
  plugins | playback_plugins | capture_plugins {
 
301
    N {                 # Configuration for LADSPA plugin N
 
302
      id #              # LADSPA plugin ID (for example 1043)
 
303
      label STR         # LADSPA plugin label (for example 'delay_5s')
 
304
      filename STR      # Full filename of .so library with LADPA plugin code
 
305
      policy STR        # Policy can be 'none' or 'duplicate'
 
306
      input | output {
 
307
        bindings {
 
308
          C INT or STR  # C - channel, INT - audio port index, STR - audio port name
 
309
        }
 
310
        controls {
 
311
          I INT or REAL # I - control port index, INT or REAL - control value
 
312
        }
 
313
      }
 
314
    }
 
315
  }
 
316
 
 
317
  type dmix             # Direct mixing plugin
 
318
  slave STR             # Slave name (see pcm_slave)
 
319
  ipc_key INT           # Unique ipc key
 
320
  ipc_perm INT          # ipc permissions (default 0600)
 
321
  ipc_key_add_uid BOOL  # Add current uid to ipc_key
 
322
  bindings {            # Bindings table
 
323
    N INT               # Slave channel for client channel N
 
324
  }
 
325
 
 
326
  type dsnoop           # Direct snoop (split one capture stream to more)
 
327
  slave STR             # Slave name (see pcm_slave)
 
328
  ipc_key INT           # Unique ipc key
 
329
  ipc_perm INT          # ipc permissions (default 0600)
 
330
  ipc_key_add_uid BOOL  # Add current uid to ipc_key
 
331
  bindings {            # Bindings table
 
332
    N INT               # Slave channel for client channel N
 
333
  }
 
334
 
 
335
  type dshare           # Share channels from one stream
 
336
  slave STR             # Slave name (see pcm_slave)
 
337
  ipc_key INT           # Unique ipc key
 
338
  ipc_perm INT          # ipc permissions (default 0600)
 
339
  ipc_key_add_uid BOOL  # Add current uid to ipc_key
 
340
  bindings {            # Bindings table
 
341
    N INT               # Slave channel for client channel N
 
342
  }
 
343
}
 
344
 
 
345
# CTL type definition
 
346
ctl_type.NAME {
 
347
  [lib STR]             # Library file (default libasound.so)
 
348
  [open STR]            # Open function (default _snd_ctl_NAME_open)
 
349
}
 
350
 
 
351
# CTL definition
 
352
ctl.NAME {
 
353
  type STR              # Type
 
354
  [comment ANY]         # Saved comments
 
355
 
 
356
# CTL types
 
357
  type hw
 
358
  card STR/INT          # Card name or number
 
359
 
 
360
 
 
361
  type shm              # Shared memory client CTL
 
362
  server STR            # Server name
 
363
  ctl STR               # CTL name on server
 
364
 
 
365
 
 
366
}
 
367
 
 
368
 
 
369
# RAWMIDI type definition
 
370
rawmidi_type.NAME {
 
371
  [lib STR]             # Library file (default libasound.so)
 
372
  [open STR]            # Open function (default _snd_rawmidi_NAME_open)
 
373
}
 
374
 
 
375
# RAWMIDI definition
 
376
rawmidi.NAME {
 
377
  type STR              # Type
 
378
  [comment ANY]         # Saved comments
 
379
 
 
380
# RAWMIDI types:
 
381
  type hw               # Kernel RAWMIDI
 
382
  card INT/STR          # Card name or number
 
383
  [device] INT          # Device number (default 0)     
 
384
  [subdevice] INT       # Subdevice number, -1 first available (default -1)
 
385
 
 
386
 
 
387
}
 
388
 
 
389
# SEQ type definition
 
390
seq_type.NAME {
 
391
  [lib STR]             # Library file (default libasound.so)
 
392
  [open STR]            # Open function (default _snd_seq_NAME_open)
 
393
}
 
394
 
 
395
# SEQ definition
 
396
seq.NAME {
 
397
  type STR              # Type
 
398
  [comment ANY]         # Saved comments
 
399
 
 
400
# SEQ types:
 
401
  type hw               # Kernel SEQ
 
402
 
 
403
 
 
404
}
 
405
 
 
406
# Aliases
 
407
DEF.NAME1 NAME2         # DEF.NAME1 is an alias for DEF.NAME2
 
408
 
 
409
Some examples:
 
410
 
 
411
pcm.trident {
 
412
        type hw
 
413
        card 0
 
414
        device 0
 
415
}
 
416
 
 
417
pcm.ice1712 {
 
418
        type hw
 
419
        card 1
 
420
        device 0
 
421
}
 
422
 
 
423
pcm.ice1712_spdif {
 
424
        type plug
 
425
        ttable.0.8 1
 
426
        ttable.1.9 1
 
427
        slave.pcm ice1712
 
428
}
 
429
 
 
430
pcm_slave.rs {
 
431
        pcm trident
 
432
        rate 44100
 
433
}
 
434
 
 
435
pcm.r {
 
436
        type rate
 
437
        slave rs
 
438
}
 
439
 
 
440
pcm.m {
 
441
        type meter
 
442
        slave.pcm plug:trident
 
443
        frequency 50
 
444
        scopes [
 
445
                {
 
446
                        type level
 
447
                }
 
448
        ]
 
449
}
 
450
 
 
451
pcm_scope_type.level {
 
452
        lib /home/abramo/scopes/liblevel.so
 
453
 
454
 
 
455
# an example command is 'aplay -D plug:ladspa <filename>'
 
456
# otherwise, the ladspa plugin expects FLOAT type which
 
457
# is very rare
 
458
pcm.ladspa {
 
459
        type ladspa
 
460
        slave.pcm "plughw:0,0";
 
461
        path "/home/perex/src/ladspa_sdk/plugins";
 
462
        plugins [
 
463
                {
 
464
                        label delay_5s
 
465
                        input {
 
466
                                controls [ 0.8 0.2 ]
 
467
                        }
 
468
                }
 
469
        ]
 
470
}
 
471
 
 
472
# an example command for dmix plugin to force 44100Hz mixing rate:
 
473
# aplay -D"plug:'dmix:RATE=44100'" <filename>
 
474
# an example command for dmix plugin to force 44100Hz and hw:1,0 output device
 
475
# aplay -Dplug:\'dmix:SLAVE=\"hw:1,0\",RATE=44100\' <filename>
 
476
# an example command for dmix plugin to force 32-bit signed little endian format
 
477
# aplay -D"plug:'dmix:FORMAT=S32_LE'" <filename>