Print this page
12315 errors in section 7i of the manual
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man7i/mixer.7i
+++ new/usr/src/man/man7i/mixer.7i
1 1 .\" Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
2 2 .\" Copyright 2019, Joyent, Inc.
3 3 .\" The contents of this file are subject to the terms of the
4 4 .\" Common Development and Distribution License (the "License").
5 5 .\" You may not use this file except in compliance with the License.
6 6 .\"
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
7 7 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8 8 .\" or http://www.opensolaris.org/os/licensing.
9 9 .\" See the License for the specific language governing permissions
10 10 .\" and limitations under the License.
11 11 .\"
12 12 .\" When distributing Covered Code, include this CDDL HEADER in each
13 13 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14 14 .\" If applicable, add the following below this CDDL HEADER, with the
15 15 .\" fields enclosed by brackets "[]" replaced with your own identifying
16 16 .\" information: Portions Copyright [yyyy] [name of copyright owner]
17 -.Dd February 1, 2019
17 +.Dd February 17, 2020
18 18 .Dt MIXER 7I
19 19 .Os
20 20 .Sh NAME
21 21 .Nm mixer
22 22 .Nd generic mixer device interface
23 23 .Sh SYNOPSIS
24 24 .In sys/soundcard.h
25 25 .Sh DESCRIPTION
26 26 .Ss "Mixer Pseudo-Device"
27 27 The
28 28 .Pa /dev/mixer
29 29 pseudo-device is provided for two purposes:
30 30 .Bl -bullet -offset indent
31 31 .It
32 32 The first purpose is for applications that wish to learn about the list of
33 33 audio devices on the system, so that they can select (or provide for users to
34 34 select) an appropriate audio device.
35 35 The
36 36 .Pa /dev/mixer
37 37 pseudo-device
38 38 provides interfaces to enumerate all of the audio devices on the system.
39 39 .It
40 40 The second purpose is for mixer panel type applications which need to control
41 41 master settings for the audio hardware in the system, such as gain levels,
42 42 balance, port functionality, and other device features.
43 43 .El
44 44 .Pp
45 45 Ordinary audio applications should
46 46 .Em not
47 47 attempt to adjust their playback
48 48 or record volumes or other device settings using this device.
49 49 Instead, they
50 50 should use the
51 51 .Dv SNDCTL_DSP_SETPLAYVOL
52 52 and
53 53 .Dv SNDCTL_DSP_SETRECVOL
54 54 ioctls that are documented in
55 55 .Xr dsp 7I .
56 56 .Ss "Sndstat Device"
57 57 The
58 58 .Pa /dev/sndstat
59 59 device supports
60 60 .Xr read 2 ,
61 61 and can be read to
62 62 retrieve human-readable information about the audio devices on the system.
63 63 Software should not attempt to interpret the contents of this device.
64 64 .Sh IOCTLS
65 65 .Ss "Information IOCTLs"
66 66 The following ioctls are intended to aid applications in identifying the audio
67 67 devices available on the system.
68 68 These ioctls can be issued against either the
69 69 pseudo-device
70 70 .Pa /dev/mixer ,
71 71 or a against a file descriptor open to any
72 72 other audio device in the system.
73 73 .Pp
74 74 Applications should issue
75 75 .Dv SNDCTL_SYSINFO
76 76 first to learn what audio
77 77 devices and mixers are available on the system, and then use
78 78 .Dv SNDCTL_AUDIOINFO
79 79 or
80 80 .Dv SNDCTL_MIXERINFO
81 81 to obtain more information
82 82 about the audio devices or mixers, respectively.
83 83 .Bl -tag -width SNDCTL_AUDIOINFO
84 84 .It Dv OSS_GETVERSION
85 85 The argument is a pointer to an integer, which retrieves the version of the
86 86 .Sy OSS API
87 87 used.
88 88 The value is encoded with the major version (currently 4)
89 89 encoded in the most significant 16 bits, and a minor version encoded in the
90 90 lower 16 bits.
91 91 .It Dv SNDCTL_SYSINFO
92 92 The argument is a pointer to an
93 93 .Vt oss_sysinfo
94 94 structure, which has the following definition:
95 95 .Bd -literal -offset 2n
96 96 typedef struct oss_sysinfo {
97 97 char product[32]; /* E.g. SunOS Audio */
98 98 char version[32]; /* E.g. 4.0a */
99 99 int versionnum; /* See OSS_GETVERSION */
100 100 char options[128]; /* NOT SUPPORTED */
101 101
102 102 int numaudios; /* # of audio/dsp devices */
103 103 int openedaudio[8]; /* Reserved, always 0 */
104 104
105 105 int numsynths; /* NOT SUPPORTED, always 0 */
106 106 int nummidis; /* NOT SUPPORTED, always 0 */
107 107 int numtimers; /* NOT SUPPORTED, always 0 */
108 108 int nummixers; /* # of mixer devices */
109 109
110 110 /* Mask of midi devices are busy */
111 111 int openedmidi[8];
112 112
113 113 /* Number of sound cards in the system */
114 114 int numcards;
115 115
116 116 /* Number of audio engines in the system */
117 117 int numaudioengines;
118 118 char license[16]; /* E.g. "GPL" or "CDDL" */
119 119 char revision_info[256]; /* Reserved */
120 120 int filler[172]; /* Reserved */
121 121 } oss_sysinfo;
122 122 .Ed
123 123 .Pp
124 124 The important fields here are
125 125 .Fa numaudios ,
126 126 which is used to determine the
127 127 number of audio devices that can be queried with
128 128 .Dv SNDCTL_AUDIOINFO ,
129 129 .Fa nummixers
130 130 which provides a count of mixers on the system, and
131 131 .Fa numcards
132 132 which counts to total number of aggregate devices.
133 133 A
134 134 .Sy card
135 135 can consist of one or more audio devices and one or more mixers, although more
136 136 typically there is exactly one audio device and one mixer for each card.
137 137 .It Dv SNDCTL_AUDIOINFO
138 138 The argument is a pointer to an
139 139 .Vt oss_audioinfo
140 140 structure, which has the following structure:
141 141 .Bd -literal -offset 2n
142 142 typedef struct oss_audioinfo {
143 143 int dev; /* Device to query */
144 144 char name[64]; /* Human readable name */
145 145 int busy; /* reserved */
146 146 int pid; /* reserved */
147 147
148 148 /* PCM_CAP_INPUT, PCM_CAP_OUTPUT */
149 149 int caps;
150 150 int iformats; /* Supported input formats */
151 151 int oformats; /* Supported output formats */
152 152 int magic; /* reserved */
153 153 char cmd[64]; /* reserved */
154 154 int card_number;
155 155 int port_number; /* reserved */
156 156 int mixer_dev;
157 157
158 158 /* Obsolete field. Replaced by devnode */
159 159 int legacy_device;
160 160 int enabled; /* reserved */
161 161 int flags; /* reserved */
162 162 int min_rate; /* Minimum sample rate */
163 163 int max_rate; /* Maximum sample rate */
164 164 int min_channels; /* Minimum number of channels */
165 165 int max_channels; /* Maximum number of channels */
166 166 int binding; /* reserved */
167 167 int rate_source; /* reserved */
168 168 char handle[32]; /* reserved */
169 169 unsigned int nrates; /* reserved */
170 170 unsigned int rates[20]; /* reserved */
171 171 char song_name[64]; /* reserved */
172 172 char label[16]; /* reserved */
173 173 int latency; /* reserved */
174 174
175 175 /* Device special file name (absolute path) */
176 176 char devnode[32];
177 177 int next_play_engine; /* reserved */
178 178 int next_rec_engine; /* reserved */
179 179 int filler[184]; /* reserved */
180 180 } oss_audioinfo;
181 181 .Ed
182 182 .Pp
183 183 In the above structure, all of the fields are reserved except the following:
184 184 .Fa dev ,
185 185 .Fa name ,
186 186 .Fa card_number ,
187 187 .Fa mixer_dev ,
188 188 .Fa caps ,
189 189 .Fa min_rate ,
190 190 .Fa max_rate ,
191 191 .Fa min_channels ,
192 192 .Fa max_channels ,
193 193 and
194 194 .Fa devnode .
195 195 The reserved fields are provided for compatibility with other OSS
196 196 implementations, and available for legacy applications.
197 197 New applications should not attempt to use these fields.
198 198 .Pp
199 199 The
200 200 .Fa dev
201 201 field should be initialized by the application to the number of
202 202 the device to query.
203 203 This is a number between zero (inclusive) and value of
204 204 .Fa numaudios
205 205 (exclusive) returned by
206 206 .Dv SNDCTL_SYSINFO .
207 207 Alternatively,
208 208 when issuing the ioctl against a real mixer or
209 209 .Sy dsp
210 210 device, the special
211 211 value
212 212 .Sy -1
213 213 can be used to indicate that the query is being made against the device opened.
214 214 If
215 215 .Sy -1
216 216 is used, the field is overwritten with the device
217 217 number for the current device on successful return.
218 218 .Pp
219 219 No other fields are significant upon entry, but a successful return contains
220 220 details of the device.
221 221 .Pp
222 222 The
223 223 .Fa name
224 224 field is a human readable name representing the device.
225 225 Applications should not try to interpret it.
226 226 .Pp
227 227 The
228 228 .Fa card_number
229 229 field indicates the number assigned to the aggregate device.
230 230 This can be used with the
231 231 .Dv SNDCTL_CARDINFO
232 232 ioctl.
233 233 .Pp
234 234 The
235 235 .Fa mixer_dev
236 236 is the mixer device number for the mixing device associated
237 237 with the audio device.
238 238 This can be used with the
239 239 .Dv SNDCTL_MIXERINFO
240 240 ioctl.
241 241 .Pp
242 242 The
243 243 .Fa caps
244 244 field contains any of the bits
245 245 .Dv PCM_CAP_INPUT ,
246 246 .Dv PCM_CAP_OUTPUT ,
247 247 and
248 248 .Dv PCM_CAP_DUPLEX .
249 249 Indicating whether the device
250 250 support input, output, and whether input and output can be used simultaneously.
251 251 All other bits are reserved.
252 252 .Pp
253 253 The
254 254 .Fa min_rate
255 255 and
256 256 .Fa max_rate
257 257 fields indicate the minimum and maximum sample rates supported by the device.
258 258 Most applications should try to use the maximum supported rate for the best
259 259 audio quality and lowest system resource consumption.
260 260 .Pp
261 261 The
262 262 .Fa min_channels
263 263 and
264 264 .Fa max_channels
265 265 provide an indication of the number of channels (1 for mono, 2 for stereo,
266 266 6 for 5\&.1, etc\&.) supported by the device.
267 267 .Pp
268 268 The
269 269 .Fa devnode
270 270 field contains the actual full path to the device node for this device, such as
271 271 .Pa /dev/sound/audio810:0dsp .
272 272 Applications should open this file to access the device.
273 273 .It Dv SNDCTL_CARDINFO
274 274 The argument is a pointer to a
275 275 .Vt struct oss_card_info ,
276 276 which has the following definition:
277 277 .Bd -literal -offset 2n
278 278 typedef struct oss_card_info {
279 279 int card;
280 280 char shortname[16];
281 281 char longname[128];
282 282 int flags; /* reserved */
283 283 char hw_info[400];
284 284 int intr_count; /* reserved */
285 285 int ack_count; /* reserved */
286 286 int filler[154];
287 287 } oss_card_info;
288 288 .Ed
289 289 .Pp
290 290 This ioctl is used to query for information about the aggregate audio device.
291 291 .Pp
292 292 The
293 293 .Fa card
294 294 field should be initialized by the application to the number of
295 295 the card to query.
296 296 This is a number between zero
297 297 .Pq inclusive
298 298 and value of
299 299 .Fa numcards
300 300 .Pq exclusive
301 301 returned by
302 302 .Dv SNDCTL_SYSINFO .
303 303 Alternatively,
304 304 when issuing the ioctl against a real mixer or
305 305 .Sy dsp
306 306 device, the special value
307 307 .Sy -1
308 308 can be used to indicate that the query is being made against the device opened.
309 309 If
310 310 .Sy -1
311 311 is used, the field is overwritten with the number
312 312 for the current hardware device on successful return.
313 313 .Pp
314 314 The
315 315 .Fa shortname ,
316 316 .Fa longname ,
317 317 and
318 318 .Fa hw_info
319 319 contain
320 320 .Sy ASCIIZ
321 321 strings describing the device in more detail.
322 322 The
323 323 .Fa hw_info
324 324 member can contain multiple lines of detail, each line ending in a NEWLINE.
325 325 .Pp
326 326 The
327 327 .Fa flag ,
328 328 .Fa intr_count ,
329 329 and
330 330 .Fa ack_count
331 331 fields are not used by this implementation.
332 332 .It Dv SNDCTL_MIXERINFO
333 333 The argument is a pointer to a
334 334 .Vt struct oss_mixer_info ,
335 335 which has the following definition:
336 336 .Bd -literal -offset 2n
337 337 typedef struct oss_mixerinfo {
338 338 int dev;
339 339 char id[16]; /* Reserved */
340 340 char name[32];
341 341 int modify_counter;
342 342 int card_number;
343 343 int port_number; /* Reserved */
344 344 char handle[32]; /* Reserved */
345 345 int magic; /* Reserved */
346 346 int enabled; /* Reserved */
347 347 int caps; /* Reserved */
348 348 int flags; /* Reserved */
349 349 int nrext;
350 350 int priority;
351 351
352 352 /* Deice special file name (absolute path) */
353 353 char devnode[32];
354 354 int legacy_device; /* Reserved */
355 355 int filler[245]; /* Reserved */
356 356 } oss_mixerinfo;
357 357 .Ed
358 358 .Pp
359 359 In the above structure, all of the fields are reserved except the following:
360 360 .Fa dev ,
361 361 .Fa name ,
362 362 .Fa modify_counter ,
363 363 .Fa card_number ,
364 364 .Fa nrext ,
365 365 .Fa priority ,
366 366 and
367 367 .Fa devnode .
368 368 The reserved fields are provided for compatibility with other
369 369 OSS implementations, and available for legacy applications.
370 370 New applications should not attempt to use these fields.
371 371 .Pp
372 372 The
373 373 .Fa dev
374 374 field should be initialized by the application to the number of
375 375 the device to query.
376 376 This is a number between zero inclusive and value of
377 377 .Fa nummixers
378 378 (exclusive) returned by
379 379 .Dv SNDCTL_SYSINFO ,
380 380 or by
381 381 .Dv SNDCTL_MIX_NRMIX .
382 382 Alternatively, when issuing the ioctl against a real mixer or
383 383 .Sy dsp
384 384 device, the special value
385 385 .Sy -1
386 386 can be used to indicate
387 387 that the query is being made against the device opened.
388 388 If
389 389 .Sy -1
390 390 is used,
391 391 the field is overwritten with the mixer number for the current open file on
392 392 successful return.
393 393 .Pp
394 394 No other fields are significant upon entry, but on successful return contains
395 395 details of the device.
396 396 .Pp
397 397 The
398 398 .Fa name
399 399 field is a human readable name representing the device.
400 400 Applications should not try to interpret it.
401 401 .Pp
402 402 The
403 403 .Fa modify_counter
404 404 is changed by the mixer framework each time the
405 405 settings for the various controls or extensions of the device are changed.
406 406 Applications can poll this value to learn if any other changes need to be
407 407 searched for.
408 408 .Pp
409 409 The
410 410 .Fa card_number
411 411 field is the number of the aggregate audio device this
412 412 mixer is located on.
413 413 It can be used with the
414 414 .Dv SNDCTL_CARDINFO
415 415 ioctl.
416 416 .Pp
417 417 The
418 418 .Fa nrext
419 419 field is the number of mixer extensions available on this mixer.
420 420 See the
421 421 .Dv SNDCTL_MIX_NREXT
422 422 description.
423 423 .Pp
424 424 The priority is used by the framework to assign a preference that applications
425 425 can use in choosing a device.
426 426 Higher values are preferable.
427 427 Mixers with priorities less than -1 should never be selected by default.
428 428 .Pp
429 429 The
430 430 .Fa devnode
↓ open down ↓ |
403 lines elided |
↑ open up ↑ |
431 431 field contains the actual full path to the device node for
432 432 the physical mixer, such as
433 433 .Pa /dev/sound/audio810:0mixer .
434 434 Applications
435 435 should open this file to access the mixer settings.
436 436 .El
437 437 .Ss "Mixer Extension IOCTLs"
438 438 The pseudo
439 439 .Pa /dev/mixer
440 440 device supports ioctls that can change the
441 -oarious settings for the audio hardware in the system.
441 +various settings for the audio hardware in the system.
442 442 .Pp
443 443 Those ioctls should only be used by dedicated mixer applications or desktop
444 -olumme controls, and not by typical ordinary audio applications such as media
444 +volume controls, and not by typical ordinary audio applications such as media
445 445 players.
446 446 Ordinary applications that wish to adjust their own volume settings
447 447 should use the
448 448 .Dv SNDCTL_DSP_SETPLAYVOL
449 449 or
450 450 .Dv SNDCTL_DSP_SETRECVOL
451 451 ioctls for that purpose.
452 452 See
453 453 .Xr dsp 7I
454 454 for more information.
455 455 Ordinary
456 456 applications should never attempt to change master port selection or hardware
457 457 settings such as monitor gain settings.
458 458 .Pp
459 459 The ioctls in this section can only be used to access the mixer device that is
460 460 associated with the current file descriptor.
461 461 .Pp
462 462 Applications should not assume that a single
463 463 .Pa /dev/mixer
464 464 node is able to access any physical settings.
465 465 Instead, they should use the ioctl
466 466 .Dv SNDCTL_MIXERINFO
467 467 to determine the device path for the real mixer device,
468 468 and issue ioctls on a file descriptor opened against the corresponding
469 469 .Fa devnode
470 470 field.
471 471 .Pp
472 472 When a
473 473 .Fa dev
474 474 member is specified in each of the following ioctls, the
475 475 application should specify
476 476 .Sy -1 ,
477 477 although for compatibility the mixer
478 478 allows the application to specify the mixer device number.
479 479 .Pp
480 480 .Bl -tag -width SNDCTL_MIX_ENUMINFO -compact
481 481 .It Dv SNDCTL_MIX_NRMIX
482 482 The argument is a pointer to an integer, which receives the number of mixer
483 483 devices in the system.
484 484 Each can be queried by using its number with the
485 485 .Dv SNDCTL_MIXERINFO
486 486 ioctl.
487 487 The same information is available using the
488 488 .Fa SNDCTL_SYSINFO
489 489 ioctl.
490 490 .Pp
491 491 .It Dv SNDCTL_MIX_NREXT
492 492 The argument is a pointer to an integer.
493 493 On entry, the integer should contain
494 494 the special value
495 495 .Sy -1 .
496 496 On return the argument receives the number of mixer
497 497 extensions (or mixer controls) supported by the mixer device.
498 498 More details
499 499 about each extension can be obtained by
500 500 .Fa SNDCTL_MIX_EXTINFO
501 501 ioctl.
502 502 .Pp
503 503 .It Dv SNDCTL_MIX_EXTINFO
504 504 The argument is a pointer to an
505 505 .Vt oss_mixext
506 506 structure which is defined as follows:
507 507 .Bd -literal -offset 2n
508 508 typedef struct oss_mixext {
509 509 int dev; /* Mixer device number */
510 510 int ctrl; /* Extension number */
511 511 int type; /* Entry type */
512 512 int maxvalue;
513 513 int minvalue;
514 514 int flags;
515 515 char id[16]; /* Mnemonic ID (internal use) */
516 516 int parent; /* Entry# of parent (-1 if root) */
517 517 int dummy; /* NOT SUPPORTED */
518 518 int timestamp;
519 519 char data[64]; /* Reserved */
520 520
521 521 /* Mask of allowed enum values */
522 522 unsigned char enum_present[32];
523 523 int control_no; /* Reserved */
524 524 unsigned int desc; /* NOT SUPPORTED */
525 525 char extname[32];
526 526 int update_counter;
527 527 int filler[7]; /* Reserved */
528 528 } oss_mixext;
529 529 .Ed
530 530 .Pp
531 531 On entry, the
532 532 .Fa dev
533 533 field should be initialized to the value
534 534 .Sy -1 ,
535 535 and
536 536 the
537 537 .Fa ctrl
538 538 field should be initialized with the number of the extension
539 539 being accessed.
540 540 Between 0, inclusive, and the value returned by
541 541 .Dv SNDCTL_MIX_NREXT ,
542 542 exclusive.
543 543 .Pp
544 544 Mixer extensions are organized as a logical tree, starting with a root node.
545 545 The root node always has a
546 546 .Fa ctrl
547 547 value of zero.
548 548 The structure of the tree can be determined by looking at the parent field,
549 549 which contains the extension number of the parent extension, or
550 550 .Sy -1
551 551 if the extension is the root extension.
552 552 .Pp
553 553 The type indicates the type of extension used.
554 554 This implementation supports the following values:
555 555 .Bl -column -offset 2n "MIXT_STEREOSLIDER" "Enumerated value, 0 to maxvalue"
556 556 .It Dv MIXT_DEVROOT Ta Root node for extension tree
557 557 .It Dv MIXT_GROUP Ta Logical grouping of controls
558 558 .It Dv MXIT_ONOFF Ta Boolean value, 0 = off, 1 = on.
559 559 .It Dv MIXT_ENUM Ta Enumerated value, 0 to maxvalue.
560 560 .It Dv MIXT_MONOSLIDER Ta Monophonic slider, 0 to 255.
561 561 .It Dv MIXT_STEREOSLIDER Ta Stereophonic slider, 0 to 255 (encoded as lower two bytes in value.)
562 562 .It Dv MIXT_MARKER Ta Place holder, can ignore.
563 563 .El
564 564 .Pp
565 565 The flags field is a bit array.
566 566 This implementation makes use of the following
567 567 possible bits:
568 568 .Bl -column -offset 2n "MIXF_WRITEABLE" "Extensions value is modifiable"
569 569 .It Dv MIXF_READABLE Ta Extension's value is readable.
570 570 .It Dv MIXF_WRITEABLE Ta Extension's value is modifiable.
571 571 .It Dv MIXF_POLL Ta Extension can self-update.
572 572 .It Dv MIXF_PCMVOL Ta Extension is for master PCM playback volume.
573 573 .It Dv MIXF_MAINVOL Ta Extension is for a typical analog volume
574 574 .It Dv MIXF_RECVOL Ta Extension is for master record gain.
575 575 .It Dv MIXF_MONVOL Ta Extension is for a monitor source's gain.
576 576 .El
577 577 .Pp
578 578 The
579 579 .Fa id
580 580 field contains an
581 581 .Sy ASCIIZ
582 582 identifier for the extension.
583 583 .Pp
584 584 The timestamp field is set when the extension tree is first initialized.
585 585 Applications must use the same timestamp value when attempting to change the
586 586 values.
587 587 A change in the timestamp indicates a change a in the structure of the
588 588 extension tree.
589 589 .Pp
590 590 The
591 591 .Fa enum_present
592 592 field is a bit mask of possible enumeration values.
593 593 If a
594 594 bit is present in the
595 595 .Fa enum_present
596 596 mask, then the corresponding enumeration value is legal.
597 597 The mask is in little endian order.
598 598 .Pp
599 599 The
600 600 .Fa desc
601 601 field provides information about scoping, which can be useful as
602 602 layout hints to applications.
603 603 The following hints are available:
604 604 .Bl -column -offset 2n "MIXEXT_SCOPE_MONITOR" "No scoping hint provided."
605 605 .It Dv MIXEXT_SCOPE_MASK Ta Mask of possible scope values.
606 606 .It Dv MIXEXT_SCOPE_INPUT Ta Extension is an input control.
607 607 .It Dv MIXEXT_SCOPE_OUTPUT Ta Extension is an output control.
608 608 .It Dv MIXEXT_SCOPE_MONITOR Ta Extension relates to input monitoring.
609 609 .It Dv MIXEXT_SCOPE_OTHER Ta No scoping hint provided.
610 610 .El
611 611 .Pp
612 612 The
613 613 .Fa extname
614 614 is the full name of the extension.
615 615 .Pp
616 616 The
617 617 .Fa update_counter
618 618 is incremented each time the control's value is changed.
619 619 .Pp
620 620 .It Dv SNDCTL_MIX_ENUMINFO
621 621 The argument is a pointer to an
622 622 .Vt oss_mixer_enuminfo
623 623 structure, which is defined as follows:
624 624 .Bd -literal -offset 2n
625 625 typedef struct oss_mixer_enuminfo {
626 626 int dev;
627 627 int ctrl;
628 628 int nvalues;
629 629 int version;
630 630 short strindex[255];
631 631 char strings[3000];
632 632 } oss_mixer_enuminfo;
633 633 .Ed
634 634 .Pp
635 635 On entry, the
636 636 .Fa dev
637 637 field should be initialized to the value
638 638 .Sy -1 ,
639 639 and
640 640 the
641 641 .Fa ctrl
642 642 field should be initialized with the number of the extension being accessed.
643 643 Between 0, inclusive, and the value returned by
644 644 .Dv SNDCTL_MIX_NREXT ,
645 645 exclusive.
646 646 .Pp
647 647 On return the
648 648 .Fa nvalues
649 649 field contains the number of values, and
650 650 .Fa strindex
651 651 contains an array of indices into the strings member, each index
652 652 pointing to an
653 653 .Sy ASCIIZ
654 654 describing the enumeration value.
655 655 .Pp
656 656 .It Dv SNDCTL_MIX_READ
657 657 .It Dv SNDCTL_MIX_WRITE
658 658 The argument is a pointer to an
659 659 .Vt oss_mixer_value
660 660 structure, defined as follows:
661 661 .Bd -literal -offset 2n
662 662 typedef struct oss_mixer_value {
663 663 int dev;
664 664 int ctrl;
665 665 int value;
666 666
667 667 /* Reserved for future use. Initialize to 0 */
668 668 int flags;
669 669
670 670 /* Must be set to oss_mixext.timestamp */
671 671 int timestamp;
672 672
673 673 /* Reserved for future use. Initialize to 0 */
674 674 int filler[8];
675 675 } oss_mixer_value;
676 676 .Pp
677 677 .Ed
678 678 On entry, the
679 679 .Fa dev
680 680 field should be initialized to the value
681 681 .Sy -1 ,
682 682 and the
683 683 .Fa ctrl
684 684 field should be initialized with the number of the extension
685 685 being accessed.
686 686 Between 0, inclusive, and the value returned by
687 687 .Dv SNDCTL_MIX_NREXT ,
688 688 exclusive.
689 689 Additionally, the timestamp member must be
690 690 initialized to the same value as was supplied in the
691 691 .Vt oss_mixext
692 692 structure
693 693 used with
694 694 .Dv SNDCTL_MIX_EXTINFO .
695 695 .Pp
696 696 For
697 697 .Dv SNDCTL_MIX_WRITE ,
698 698 the application should supply the new value for the extension.
699 699 For
700 700 .Dv SNDCTL_MIX_READ ,
701 701 the mixer returns the extensions current value in value.
702 702 .El
703 703 .Ss "Compatibility IOCTLs"
704 704 The following ioctls are for compatibility use only:
705 705 .Pp
706 706 .Bl -tag -offset 2n -width SNDCTL_MIX_ENUMINFO -compact
707 707 .It Dv SOUND_MIXER_READ_VOLUME
708 708 .It Dv SOUND_MIXER_READ_PCM
709 709 .It Dv SOUND_MIXER_READ_OGAIN
710 710 .It Dv SOUND_MIXER_READ_RECGAIN
711 711 .It Dv SOUND_MIXER_READ_RECLEV
712 712 .It Dv SOUND_MIXER_READ_IGAIN
713 713 .It Dv SOUND_MIXER_READ_RECSRC
714 714 .It Dv SOUND_MIXER_READ_RECMASK
715 715 .It Dv SOUND_MIXER_READ_DEVMASK
716 716 .It Dv SOUND_MIXER_READ_STEREODEVS
717 717 .It Dv SOUND_MIXER_WRITE_VOLUME
718 718 .It Dv SOUND_MIXER_WRITE_PCM
719 719 .It Dv SOUND_MIXER_WRITE_OGAIN
720 720 .It Dv SOUND_MIXER_WRITE_RECGAIN
721 721 .It Dv SOUND_MIXER_WRITE_RECLEV
722 722 .It Dv SOUND_MIXER_WRITE_IGAIN
723 723 .It Dv SOUND_MIXER_WRITE_RECSRC
724 724 .It Dv SOUND_MIXER_WRITE_RECMASK
725 725 .It Dv SOUND_MIXER_INFO
726 726 .It Dv SNDCTL_AUDIOINFO_EX
727 727 .It Dv SNDCTL_ENGINEINFO
728 728 .El
729 729 .Pp
730 730 These ioctls can affect the software volume levels associated with the calling
731 731 process.
732 732 They have no effect on the physical hardware levels or settings.
733 733 They should not be used in new applications.
734 734 .Sh FILES
735 735 .Bl -tag -width /dev/sndstat
736 736 .It Pa /dev/mixer
737 737 Symbolic link to the pseudo mixer device for the system
738 738 .It Pa /dev/sndstat
739 739 Sound status device
740 740 .El
741 741 .Sh ERRORS
742 742 An
743 743 .Xr ioctl 2
744 744 fails if:
745 745 .Bl -tag -width EINVAL
746 746 .It Er EINVAL
747 747 The parameter changes requested in the ioctl are invalid or are not supported
748 748 by the device.
749 749 .It Er ENXIO
750 750 The device or extension referenced does not exist.
751 751 .El
752 752 .Sh ARCHITECTURE
753 753 SPARC
754 754 x86
755 755 .Sh INTERFACE STABILITY
756 756 The information and mixer extension IOCTLs are Uncommitted.
757 757 The Compatibility IOCTLs are Obsolete Uncommitted.
758 758 The extension names are Uncommitted.
759 759 .Sh SEE ALSO
760 760 .Xr close 2 ,
761 761 .Xr ioctl 2 ,
762 762 .Xr open 2 ,
763 763 .Xr read 2 ,
764 764 .Xr attributes 5 ,
765 765 .Xr dsp 7I
766 766 .Sh BUGS
767 767 The names of mixer extensions are not guaranteed to be predictable.
↓ open down ↓ |
313 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX