Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-doc
Path: blob/main/documentation/content/en/books/arch-handbook/sound/_index.po
18099 views
# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR The FreeBSD Project
# This file is distributed under the same license as the FreeBSD Documentation package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: FreeBSD Documentation VERSION\n"
"POT-Creation-Date: 2025-11-08 16:17+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#. type: YAML Front Matter: description
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:1
#, no-wrap
msgid "FreeBSD Sound Subsystem"
msgstr ""

#. type: YAML Front Matter: title
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:1
#, no-wrap
msgid "Chapter 15. Sound Subsystem"
msgstr ""

#. type: Title =
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:14
#, no-wrap
msgid "Sound Subsystem"
msgstr ""

#. type: Title ==
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:52
#, no-wrap
msgid "Introduction"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:55
msgid ""
"The FreeBSD sound subsystem cleanly separates generic sound handling issues "
"from device-specific ones. This makes it easier to add support for new "
"hardware."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:57
msgid ""
"The man:pcm[4] framework is the central piece of the sound subsystem. It "
"mainly implements the following elements:"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:59
msgid ""
"A system call interface (read, write, ioctls) to digitized sound and mixer "
"functions. The ioctl command set is compatible with the legacy _OSS_ or "
"_Voxware_ interface, allowing common multimedia applications to be ported "
"without modification."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:60
msgid ""
"Common code for processing sound data (format conversions, virtual channels)."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:61
msgid ""
"A uniform software interface to hardware-specific audio interface modules."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:62
msgid ""
"Additional support for some common hardware interfaces (ac97), or shared "
"hardware-specific code (ex: ISA DMA routines)."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:64
msgid ""
"The support for specific sound cards is implemented by hardware-specific "
"drivers, which provide channel and mixer interfaces to plug into the generic "
"[.filename]#pcm# code."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:66
msgid ""
"In this chapter, the term [.filename]#pcm# will refer to the central, common "
"part of the sound driver, as opposed to the hardware-specific modules."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:68
msgid ""
"The prospective driver writer will of course want to start from an existing "
"module and use the code as the ultimate reference. But, while the sound code "
"is nice and clean, it is also mostly devoid of comments. This document tries "
"to give an overview of the framework interface and answer some questions "
"that may arise while adapting the existing code."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:70
msgid ""
"As an alternative, or in addition to starting from a working example, you "
"can find a commented driver template at https://people.FreeBSD.org/~cg/"
"template.c[ https://people.FreeBSD.org/~cg/template.c]"
msgstr ""

#. type: Title ==
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:72
#, no-wrap
msgid "Files"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:75
msgid ""
"All the relevant code lives in [.filename]#/usr/src/sys/dev/sound/#, except "
"for the public ioctl interface definitions, found in [.filename]#/usr/src/"
"sys/sys/soundcard.h#"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:77
msgid ""
"Under [.filename]#/usr/src/sys/dev/sound/#, the [.filename]#pcm/# directory "
"holds the central code, while the [.filename]#pci/#, [.filename]#isa/# and "
"[.filename]#usb/# directories have the drivers for PCI and ISA boards, and "
"for USB audio devices."
msgstr ""

#. type: Title ==
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:79
#, no-wrap
msgid "Probing, Attaching, etc."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:82
msgid ""
"Sound drivers probe and attach in almost the same way as any hardware driver "
"module. You might want to look at the crossref:isa-driver[isa-driver,ISA] or "
"crossref:pci[pci,PCI] specific sections of the handbook for more information."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:84
msgid "However, sound drivers differ in some ways:"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:86
msgid ""
"They declare themselves as [.filename]#pcm# class devices, with a `struct "
"snddev_info` device private structure:"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:94
#, no-wrap
msgid ""
"          static driver_t xxx_driver = {\n"
"              \"pcm\",\n"
"              xxx_methods,\n"
"              sizeof(struct snddev_info)\n"
"          };\n"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:97
#, no-wrap
msgid ""
"          DRIVER_MODULE(snd_xxxpci, pci, xxx_driver, pcm_devclass, 0, 0);\n"
"          MODULE_DEPEND(snd_xxxpci, snd_pcm, PCM_MINVER, PCM_PREFVER,PCM_MAXVER);\n"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:100
msgid ""
"Most sound drivers need to store additional private information about their "
"device. A private data structure is usually allocated in the attach routine. "
"Its address is passed to [.filename]#pcm# by the calls to `pcm_register()` "
"and `mixer_init()`. [.filename]#pcm# later passes back this address as a "
"parameter in calls to the sound driver interfaces."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:103
msgid ""
"The sound driver attach routine should declare its MIXER or AC97 interface "
"to [.filename]#pcm# by calling `mixer_init()`. For a MIXER interface, this "
"causes in turn a call to crossref:sound[xxxmixer-init,`xxxmixer_init()`]."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:104
msgid ""
"The sound driver attach routine declares its general CHANNEL configuration "
"to [.filename]#pcm# by calling `pcm_register(dev, sc, nplay, nrec)`, where "
"`sc` is the address for the device data structure, used in further calls "
"from [.filename]#pcm#, and `nplay` and `nrec` are the number of play and "
"record channels."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:107
msgid ""
"The sound driver attach routine declares each of its channel objects by "
"calls to `pcm_addchan()`. This sets up the channel glue in [.filename]#pcm# "
"and causes in turn a call to crossref:sound[xxxchannel-"
"init,`xxxchannel_init()`]."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:108
msgid ""
"The sound driver detach routine should call `pcm_unregister()` before "
"releasing its resources."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:110
msgid "There are two possible methods to handle non-PnP devices:"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:112
msgid ""
"Use a `device_identify()` method (example: [.filename]#sound/isa/es1888.c#). "
"The `device_identify()` method probes for the hardware at known addresses "
"and, if it finds a supported device, creates a new pcm device which is then "
"passed to probe/attach."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:113
msgid ""
"Use a custom kernel configuration with appropriate hints for pcm devices "
"(example: [.filename]#sound/isa/mss.c#)."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:115
msgid ""
"[.filename]#pcm# drivers should implement `device_suspend`, `device_resume` "
"and `device_shutdown` routines, so that power management and module "
"unloading function correctly."
msgstr ""

#. type: Title ==
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:117
#, no-wrap
msgid "Interfaces"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:121
msgid ""
"The interface between the [.filename]#pcm# core and the sound drivers is "
"defined in terms of crossref:kobj[kernel-objects,kernel objects]."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:123
msgid ""
"There are two main interfaces that a sound driver will usually provide: "
"_CHANNEL_ and either _MIXER_ or _AC97_."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:125
msgid ""
"The _AC97_ interface is a very small hardware access (register read/write) "
"interface, implemented by drivers for hardware with an AC97 codec. In this "
"case, the actual MIXER interface is provided by the shared AC97 code in "
"[.filename]#pcm#."
msgstr ""

#. type: Title ===
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:126
#, no-wrap
msgid "The CHANNEL Interface"
msgstr ""

#. type: Title ====
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:128
#, no-wrap
msgid "Common Notes for Function Parameters"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:131
msgid ""
"Sound drivers usually have a private data structure to describe their "
"device, and one structure for each play and record data channel that it "
"supports."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:133
msgid ""
"For all CHANNEL interface functions, the first parameter is an opaque "
"pointer."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:135
msgid ""
"The second parameter is a pointer to the private channel data structure, "
"except for `channel_init()` which has a pointer to the private device "
"structure (and returns the channel pointer for further use by "
"[.filename]#pcm#)."
msgstr ""

#. type: Title ====
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:136
#, no-wrap
msgid "Overview of Data Transfer Operations"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:139
msgid ""
"For sound data transfers, the [.filename]#pcm# core and the sound drivers "
"communicate through a shared memory area, described by a `struct snd_dbuf`."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:141
msgid ""
"`struct snd_dbuf` is private to [.filename]#pcm#, and sound drivers obtain "
"values of interest by calls to accessor functions (`sndbuf_getxxx()`)."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:143
msgid ""
"The shared memory area has a size of `sndbuf_getsize()` and is divided into "
"fixed size blocks of `sndbuf_getblksz()` bytes."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:145
msgid ""
"When playing, the general transfer mechanism is as follows (reverse the idea "
"for recording):"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:148
msgid ""
"[.filename]#pcm# initially fills up the buffer, then calls the sound "
"driver's crossref:sound[channel-trigger,`xxxchannel_trigger()`] function "
"with a parameter of PCMTRIG_START."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:149
msgid ""
"The sound driver then arranges to repeatedly transfer the whole memory area "
"(`sndbuf_getbuf()`, `sndbuf_getsize()`) to the device, in blocks of "
"`sndbuf_getblksz()` bytes. It calls back the `chn_intr()`[.filename]#pcm# "
"function for each transferred block (this will typically happen at interrupt "
"time)."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:150
msgid ""
"`chn_intr()` arranges to copy new data to the area that was transferred to "
"the device (now free), and make appropriate updates to the `snd_dbuf` "
"structure."
msgstr ""

#. type: Title ====
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:152
#, no-wrap
msgid "channel_init"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:156
msgid ""
"`xxxchannel_init()` is called to initialize each of the play or record "
"channels.  The calls are initiated from the sound driver attach routine. "
"(See the crossref:sound[pcm-probe-and-attach,probe and attach section])."
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:168
#, no-wrap
msgid ""
"          static void *\n"
"          xxxchannel_init(kobj_t obj, void *data,\n"
"             struct snd_dbuf *b, struct pcm_channel *c, int dir) <.>\n"
"          {\n"
"              struct xxx_info *sc = data;\n"
"              struct xxx_chinfo *ch;\n"
"               ...\n"
"              return ch; <.>\n"
"           }\n"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:171
msgid ""
"`b` is the address for the channel `struct snd_dbuf`. It should be "
"initialized in the function by calling `sndbuf_alloc()`. The buffer size to "
"use is normally a small multiple of the 'typical' unit transfer size for "
"your device.`c` is the [.filename]#pcm# channel control structure pointer. "
"This is an opaque object. The function should store it in the local channel "
"structure, to be used in later calls to [.filename]#pcm# (ie: "
"`chn_intr(c)`).`dir` indicates the channel direction (`PCMDIR_PLAY` or "
"`PCMDIR_REC`)."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:173
msgid ""
"The function should return a pointer to the private area used to control "
"this channel. This will be passed as a parameter to other channel interface "
"calls."
msgstr ""

#. type: Title ====
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:174
#, no-wrap
msgid "channel_setformat"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:177
msgid ""
"`xxxchannel_setformat()` should set up the hardware for the specified "
"channel for the specified sound format."
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:187
#, no-wrap
msgid ""
"          static int\n"
"          xxxchannel_setformat(kobj_t obj, void *data, u_int32_t format) <.>\n"
"          {\n"
"              struct xxx_chinfo *ch = data;\n"
"               ...\n"
"              return 0;\n"
"           }\n"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:190
msgid ""
"`format` is specified as an `AFMT_XXX value` ([.filename]#soundcard.h#)."
msgstr ""

#. type: Title ====
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:191
#, no-wrap
msgid "channel_setspeed"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:194
msgid ""
"`xxxchannel_setspeed()` sets up the channel hardware for the specified "
"sampling speed, and returns the possibly adjusted speed."
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:204
#, no-wrap
msgid ""
"          static int\n"
"          xxxchannel_setspeed(kobj_t obj, void *data, u_int32_t speed)\n"
"          {\n"
"              struct xxx_chinfo *ch = data;\n"
"               ...\n"
"              return speed;\n"
"           }\n"
msgstr ""

#. type: Title ====
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:206
#, no-wrap
msgid "channel_setblocksize"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:209
msgid ""
"`xxxchannel_setblocksize()` sets the block size, which is the size of unit "
"transactions between [.filename]#pcm# and the sound driver, and between the "
"sound driver and the device. Typically, this would be the number of bytes "
"transferred before an interrupt occurs. During a transfer, the sound driver "
"should call [.filename]#pcm#'s `chn_intr()` every time this size has been "
"transferred."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:211
msgid ""
"Most sound drivers only take note of the block size here, to be used when an "
"actual transfer will be started."
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:221
#, no-wrap
msgid ""
"          static int\n"
"          xxxchannel_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)\n"
"          {\n"
"              struct xxx_chinfo *ch = data;\n"
"                ...\n"
"              return blocksize; <.>\n"
"           }\n"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:224
msgid ""
"The function returns the possibly adjusted block size. In case the block "
"size is indeed changed, `sndbuf_resize()` should be called to adjust the "
"buffer."
msgstr ""

#. type: Title ====
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:226
#, no-wrap
msgid "channel_trigger"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:229
msgid ""
"`xxxchannel_trigger()` is called by [.filename]#pcm# to control data "
"transfer operations in the driver."
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:239
#, no-wrap
msgid ""
"          static int\n"
"          xxxchannel_trigger(kobj_t obj, void *data, int go) <.>\n"
"          {\n"
"              struct xxx_chinfo *ch = data;\n"
"               ...\n"
"              return 0;\n"
"           }\n"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:242
msgid "`go` defines the action for the current call. The possible values are:"
msgstr ""

#. type: delimited block = 4
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:246
msgid ""
"If the driver uses ISA DMA, `sndbuf_isadma()` should be called before "
"performing actions on the device, and will take care of the DMA chip side of "
"things."
msgstr ""

#. type: Title ====
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:248
#, no-wrap
msgid "channel_getptr"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:251
msgid ""
"`xxxchannel_getptr()` returns the current offset in the transfer buffer. "
"This will typically be called by `chn_intr()`, and this is how "
"[.filename]#pcm# knows where it can transfer new data."
msgstr ""

#. type: Title ====
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:252
#, no-wrap
msgid "channel_free"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:255
msgid ""
"`xxxchannel_free()` is called to free up channel resources, for example when "
"the driver is unloaded, and should be implemented if the channel data "
"structures are dynamically allocated or if `sndbuf_alloc()` was not used for "
"buffer allocation."
msgstr ""

#. type: Title ====
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:256
#, no-wrap
msgid "channel_getcaps"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:265
#, no-wrap
msgid ""
"          struct pcmchan_caps *\n"
"          xxxchannel_getcaps(kobj_t obj, void *data)\n"
"          {\n"
"              return &xxx_caps; <.>\n"
"           }\n"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:268
msgid ""
"The routine returns a pointer to a (usually statically-defined) "
"`pcmchan_caps` structure (defined in [.filename]#sound/pcm/channel.h#. The "
"structure holds the minimum and maximum sampling frequencies, and the "
"accepted sound formats. Look at any sound driver for an example."
msgstr ""

#. type: Title ====
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:269
#, no-wrap
msgid "More Functions"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:272
msgid ""
"`channel_reset()`, `channel_resetdone()`, and `channel_notify()` are for "
"special purposes and should not be implemented in a driver without "
"discussing it on the {freebsd-multimedia}."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:274
msgid "`channel_setdir()` is deprecated."
msgstr ""

#. type: Title ===
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:275
#, no-wrap
msgid "The MIXER Interface"
msgstr ""

#. type: Title ====
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:278
#, no-wrap
msgid "mixer_init"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:281
msgid ""
"`xxxmixer_init()` initializes the hardware and tells [.filename]#pcm# what "
"mixer devices are available for playing and recording"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:289
#, no-wrap
msgid ""
"          static int\n"
"          xxxmixer_init(struct snd_mixer *m)\n"
"          {\n"
"              struct xxx_info   *sc = mix_getdevinfo(m);\n"
"              u_int32_t v;\n"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:291
#, no-wrap
msgid "              [Initialize hardware]\n"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:296
#, no-wrap
msgid ""
"              [Set appropriate bits in v for play mixers] <.>\n"
"              mix_setdevs(m, v);\n"
"              [Set appropriate bits in v for record mixers]\n"
"              mix_setrecdevs(m, v)\n"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:299
#, no-wrap
msgid ""
"              return 0;\n"
"          }\n"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:302
msgid ""
"Set bits in an integer value and call `mix_setdevs()` and `mix_setrecdevs()` "
"to tell [.filename]#pcm# what devices exist."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:304
msgid ""
"Mixer bits definitions can be found in [.filename]#soundcard.h# "
"(`SOUND_MASK_XXX` values and `SOUND_MIXER_XXX` bit shifts)."
msgstr ""

#. type: Title ====
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:305
#, no-wrap
msgid "mixer_set"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:308
msgid "`xxxmixer_set()` sets the volume level for one mixer device."
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:319
#, no-wrap
msgid ""
"          static int\n"
"          xxxmixer_set(struct snd_mixer *m, unsigned dev,\n"
"                           unsigned left, unsigned right) <.>\n"
"          {\n"
"              struct sc_info *sc = mix_getdevinfo(m);\n"
"              [set volume level]\n"
"              return left | (right << 8); <.>\n"
"          }\n"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:322
msgid ""
"The device is specified as a `SOUND_MIXER_XXX` value. The volume values are "
"specified in range [0-100]. A value of zero should mute the device."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:323
msgid ""
"As the hardware levels probably will not match the input scale, and some "
"rounding will occur, the routine returns the actual level values (in range "
"0-100) as shown."
msgstr ""

#. type: Title ====
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:324
#, no-wrap
msgid "mixer_setrecsrc"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:327
msgid "`xxxmixer_setrecsrc()` sets the recording source device."
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:334
#, no-wrap
msgid ""
"          static int\n"
"          xxxmixer_setrecsrc(struct snd_mixer *m, u_int32_t src) <.>\n"
"          {\n"
"              struct xxx_info *sc = mix_getdevinfo(m);\n"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:336
#, no-wrap
msgid "              [look for non zero bit(s) in src, set up hardware]\n"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:340
#, no-wrap
msgid ""
"              [update src to reflect actual action]\n"
"              return src; <.>\n"
"           }\n"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:343
msgid "The desired recording devices are specified as a bit field"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:344
msgid ""
"The actual devices set for recording are returned. Some drivers can only set "
"one device for recording. The function should return -1 if an error occurs."
msgstr ""

#. type: Title ====
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:345
#, no-wrap
msgid "mixer_uninit, mixer_reinit"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:348
msgid ""
"`xxxmixer_uninit()` should ensure that all sound is muted and if possible "
"mixer hardware should be powered down."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:350
msgid ""
"`xxxmixer_reinit()` should ensure that the mixer hardware is powered up and "
"any settings not controlled by `mixer_set()` or `mixer_setrecsrc()` are "
"restored."
msgstr ""

#. type: Title ===
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:351
#, no-wrap
msgid "The AC97 Interface"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:354
msgid ""
"The _AC97_ interface is implemented by drivers with an AC97 codec. It only "
"has three methods:"
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:356
msgid "`xxxac97_init()` returns the number of ac97 codecs found."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:357
msgid "`ac97_read()` and `ac97_write()` read or write a specified register."
msgstr ""

#. type: Plain text
#: documentation/content/en/books/arch-handbook/sound/_index.adoc:358
msgid ""
"The _AC97_ interface is used by the AC97 code in [.filename]#pcm# to perform "
"higher level operations. Look at [.filename]#sound/pci/maestro3.c# or many "
"others under [.filename]#sound/pci/# for an example."
msgstr ""