Whitespace-only fixes. Translators, please ignore.

This commit is contained in:
Warren Block 2013-07-24 02:39:59 +00:00
parent 9dc994da05
commit 15d408c4f4
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=42407

View file

@ -42,14 +42,17 @@
multimedia applications to be ported without multimedia applications to be ported without
modification.</para> modification.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>Common code for processing sound data (format <para>Common code for processing sound data (format
conversions, virtual channels).</para> conversions, virtual channels).</para>
</listitem> </listitem>
<listitem> <listitem>
<para>A uniform software interface to hardware-specific audio <para>A uniform software interface to hardware-specific audio
interface modules.</para> interface modules.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>Additional support for some common hardware interfaces <para>Additional support for some common hardware interfaces
(ac97), or shared hardware-specific code (ex: ISA DMA (ac97), or shared hardware-specific code (ex: ISA DMA
@ -58,8 +61,9 @@
</itemizedlist> </itemizedlist>
<para>The support for specific sound cards is implemented by <para>The support for specific sound cards is implemented by
hardware-specific drivers, which provide channel and mixer interfaces hardware-specific drivers, which provide channel and mixer
to plug into the generic <devicename>pcm</devicename> code.</para> interfaces to plug into the generic <devicename>pcm</devicename>
code.</para>
<para>In this chapter, the term <devicename>pcm</devicename> will <para>In this chapter, the term <devicename>pcm</devicename> will
refer to the central, common part of the sound driver, as refer to the central, common part of the sound driver, as
@ -76,7 +80,6 @@
example, you can find a commented driver template at example, you can find a commented driver template at
<ulink url="http://people.FreeBSD.org/~cg/template.c"> <ulink url="http://people.FreeBSD.org/~cg/template.c">
http://people.FreeBSD.org/~cg/template.c</ulink></para> http://people.FreeBSD.org/~cg/template.c</ulink></para>
</sect1> </sect1>
<sect1 id="oss-files"> <sect1 id="oss-files">
@ -92,7 +95,6 @@
while the <filename>pci/</filename>, <filename>isa/</filename> while the <filename>pci/</filename>, <filename>isa/</filename>
and <filename>usb/</filename> directories have the drivers and <filename>usb/</filename> directories have the drivers
for PCI and ISA boards, and for USB audio devices.</para> for PCI and ISA boards, and for USB audio devices.</para>
</sect1> </sect1>
<sect1 id="pcm-probe-and-attach"> <sect1 id="pcm-probe-and-attach">
@ -107,11 +109,11 @@
<para>However, sound drivers differ in some ways:</para> <para>However, sound drivers differ in some ways:</para>
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para>They declare themselves as <devicename>pcm</devicename> <para>They declare themselves as <devicename>pcm</devicename>
class devices, with a <structname>struct class devices, with a
snddev_info</structname> device private structure:</para> <structname>struct snddev_info</structname> device private
structure:</para>
<programlisting> static driver_t xxx_driver = { <programlisting> static driver_t xxx_driver = {
"pcm", "pcm",
@ -122,11 +124,12 @@
DRIVER_MODULE(snd_xxxpci, pci, xxx_driver, pcm_devclass, 0, 0); DRIVER_MODULE(snd_xxxpci, pci, xxx_driver, pcm_devclass, 0, 0);
MODULE_DEPEND(snd_xxxpci, snd_pcm, PCM_MINVER, PCM_PREFVER,PCM_MAXVER);</programlisting> MODULE_DEPEND(snd_xxxpci, snd_pcm, PCM_MINVER, PCM_PREFVER,PCM_MAXVER);</programlisting>
<para>Most sound drivers<indexterm><primary>device drivers</primary> <para>Most sound drivers<indexterm><primary>device
<secondary>sound</secondary></indexterm> need to store additional private drivers</primary><secondary>sound</secondary></indexterm>
information about their device. A private data structure is need to store additional private information about their
usually allocated in the attach routine. Its address is device. A private data structure is usually allocated in
passed to <devicename>pcm</devicename> by the calls to the attach routine. Its address is passed to
<devicename>pcm</devicename> by the calls to
<function>pcm_register()</function> and <function>pcm_register()</function> and
<function>mixer_init()</function>. <function>mixer_init()</function>.
<devicename>pcm</devicename> later passes back this address <devicename>pcm</devicename> later passes back this address
@ -138,8 +141,8 @@
<para>The sound driver attach routine should declare its MIXER <para>The sound driver attach routine should declare its MIXER
or AC97 interface to <devicename>pcm</devicename> by calling or AC97 interface to <devicename>pcm</devicename> by calling
<function>mixer_init()</function>. For a MIXER interface, <function>mixer_init()</function>. For a MIXER interface,
this causes in turn a call to <link linkend="xxxmixer-init"> this causes in turn a call to <link
<function>xxxmixer_init()</function></link>.</para> linkend="xxxmixer-init"><function>xxxmixer_init()</function></link>.</para>
</listitem> </listitem>
<listitem> <listitem>
@ -170,7 +173,9 @@
</listitem> </listitem>
</itemizedlist> </itemizedlist>
<para>There are two possible methods to handle non-PnP devices:</para> <para>There are two possible methods to handle non-PnP
devices:</para>
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para>Use a <function>device_identify()</function> method <para>Use a <function>device_identify()</function> method
@ -180,6 +185,7 @@
device, creates a new pcm device which is then passed to device, creates a new pcm device which is then passed to
probe/attach.</para> probe/attach.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>Use a custom kernel configuration with appropriate hints <para>Use a custom kernel configuration with appropriate hints
for pcm devices (example: for pcm devices (example:
@ -192,7 +198,6 @@
<function>device_resume</function> and <function>device_resume</function> and
<function>device_shutdown</function> routines, so that power <function>device_shutdown</function> routines, so that power
management and module unloading function correctly.</para> management and module unloading function correctly.</para>
</sect1> </sect1>
<sect1 id="oss-interfaces"> <sect1 id="oss-interfaces">
@ -227,10 +232,10 @@
<para>The second parameter is a pointer to the private <para>The second parameter is a pointer to the private
channel data structure, except for channel data structure, except for
<function>channel_init()</function> which has a pointer to the <function>channel_init()</function> which has a pointer to
private device structure (and returns the channel pointer the private device structure (and returns the channel
for further use by <devicename>pcm</devicename>).</para> pointer for further use by
<devicename>pcm</devicename>).</para>
</sect3> </sect3>
<sect3> <sect3>
@ -281,9 +286,7 @@
free), and make appropriate updates to the free), and make appropriate updates to the
<structname>snd_dbuf</structname> structure.</para> <structname>snd_dbuf</structname> structure.</para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
</sect3> </sect3>
<sect3 id="xxxchannel-init"> <sect3 id="xxxchannel-init">
@ -306,7 +309,6 @@
}</programlisting> }</programlisting>
<calloutlist> <calloutlist>
<callout arearefs="co-chinit-params"> <callout arearefs="co-chinit-params">
<para><varname>b</varname> is the address for the channel <para><varname>b</varname> is the address for the channel
<structname>struct snd_dbuf</structname>. It should be <structname>struct snd_dbuf</structname>. It should be
@ -332,9 +334,7 @@
area used to control this channel. This will be passed area used to control this channel. This will be passed
as a parameter to other channel interface calls.</para> as a parameter to other channel interface calls.</para>
</callout> </callout>
</calloutlist> </calloutlist>
</sect3> </sect3>
<sect3> <sect3>
@ -358,7 +358,6 @@
<literal>AFMT_XXX value</literal> <literal>AFMT_XXX value</literal>
(<filename>soundcard.h</filename>).</para> (<filename>soundcard.h</filename>).</para>
</callout> </callout>
</calloutlist> </calloutlist>
</sect3> </sect3>
@ -376,7 +375,6 @@
... ...
return speed; return speed;
}</programlisting> }</programlisting>
</sect3> </sect3>
<sect3> <sect3>
@ -410,10 +408,8 @@
size. In case the block size is indeed changed, size. In case the block size is indeed changed,
<function>sndbuf_resize()</function> should be called to <function>sndbuf_resize()</function> should be called to
adjust the buffer.</para> adjust the buffer.</para>
</callout> </callout>
</calloutlist> </calloutlist>
</sect3> </sect3>
<sect3 id="channel-trigger"> <sect3 id="channel-trigger">
@ -435,8 +431,8 @@
<callout arearefs="co-chtrigger-params"> <callout arearefs="co-chtrigger-params">
<para><varname>go</varname> defines the action for the <para><varname>go</varname> defines the action for the
current call. The possible values are:</para> current call. The possible values are:</para>
<itemizedlist>
<itemizedlist>
<listitem> <listitem>
<para><literal>PCMTRIG_START</literal>: the driver <para><literal>PCMTRIG_START</literal>: the driver
should start a data transfer from or to the channel should start a data transfer from or to the channel
@ -460,16 +456,15 @@
stop the current transfer.</para> stop the current transfer.</para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
</callout> </callout>
</calloutlist> </calloutlist>
<note><para>If the driver uses ISA DMA, <note>
<function>sndbuf_isadma()</function> should be called before <para>If the driver uses ISA DMA,
performing actions on the device, and will take care of the <function>sndbuf_isadma()</function> should be called
DMA chip side of things.</para> before performing actions on the device, and will take
care of the DMA chip side of things.</para>
</note> </note>
</sect3> </sect3>
<sect3> <sect3>
@ -477,10 +472,9 @@
<para><function>xxxchannel_getptr()</function> returns the <para><function>xxxchannel_getptr()</function> returns the
current offset in the transfer buffer. This will typically current offset in the transfer buffer. This will typically
be called by <function>chn_intr()</function>, and this is how be called by <function>chn_intr()</function>, and this is
<devicename>pcm</devicename> knows where it can transfer how <devicename>pcm</devicename> knows where it can transfer
new data.</para> new data.</para>
</sect3> </sect3>
<sect3> <sect3>
@ -492,7 +486,6 @@
structures are dynamically allocated or if structures are dynamically allocated or if
<function>sndbuf_alloc()</function> was not used for buffer <function>sndbuf_alloc()</function> was not used for buffer
allocation.</para> allocation.</para>
</sect3> </sect3>
<sect3> <sect3>
@ -508,16 +501,14 @@
<callout arearefs="co-chgetcaps-return"> <callout arearefs="co-chgetcaps-return">
<para>The routine returns a pointer to a (usually <para>The routine returns a pointer to a (usually
statically-defined) <structname>pcmchan_caps</structname> statically-defined)
structure (defined in <structname>pcmchan_caps</structname> structure (defined
<filename>sound/pcm/channel.h</filename>. The structure holds in <filename>sound/pcm/channel.h</filename>. The
the minimum and maximum sampling frequencies, and the structure holds the minimum and maximum sampling
accepted sound formats. Look at any sound driver for an frequencies, and the accepted sound formats. Look at
example.</para> any sound driver for an example.</para>
</callout> </callout>
</calloutlist> </calloutlist>
</sect3> </sect3>
<sect3> <sect3>
@ -525,13 +516,13 @@
<para><function>channel_reset()</function>, <para><function>channel_reset()</function>,
<function>channel_resetdone()</function>, and <function>channel_resetdone()</function>, and
<function>channel_notify()</function> are for special purposes <function>channel_notify()</function> are for special
and should not be implemented in a driver without discussing purposes and should not be implemented in a driver without
it on the &a.multimedia;.</para> discussing it on the &a.multimedia;.</para>
<para><function>channel_setdir()</function> is deprecated.</para> <para><function>channel_setdir()</function> is
deprecated.</para>
</sect3> </sect3>
</sect2> </sect2>
<sect2> <sect2>
@ -573,7 +564,6 @@
<filename>soundcard.h</filename> <filename>soundcard.h</filename>
(<literal>SOUND_MASK_XXX</literal> values and (<literal>SOUND_MASK_XXX</literal> values and
<literal>SOUND_MIXER_XXX</literal> bit shifts).</para> <literal>SOUND_MIXER_XXX</literal> bit shifts).</para>
</sect3> </sect3>
<sect3> <sect3>
@ -593,10 +583,11 @@
<calloutlist> <calloutlist>
<callout arearefs="co-mxset-params"> <callout arearefs="co-mxset-params">
<para>The device is specified as a <literal>SOUND_MIXER_XXX</literal> <para>The device is specified as a
value</para> <para>The volume values are specified in <literal>SOUND_MIXER_XXX</literal> value</para>
range [0-100]. A value of zero should mute the
device.</para> <para>The volume values are specified in range [0-100].
A value of zero should mute the device.</para>
</callout> </callout>
<callout arearefs="co-mxset-return"> <callout arearefs="co-mxset-return">
@ -651,7 +642,6 @@
that the mixer hardware is powered up and any settings not that the mixer hardware is powered up and any settings not
controlled by <function>mixer_set()</function> or controlled by <function>mixer_set()</function> or
<function>mixer_setrecsrc()</function> are restored.</para> <function>mixer_setrecsrc()</function> are restored.</para>
</sect3> </sect3>
</sect2> </sect2>
@ -661,19 +651,20 @@
<indexterm><primary>AC97</primary></indexterm> <indexterm><primary>AC97</primary></indexterm>
<para>The <emphasis>AC97</emphasis> interface is implemented <para>The <emphasis>AC97</emphasis> interface is implemented
by drivers with an AC97 codec. It only has three methods:</para> by drivers with an AC97 codec. It only has three
methods:</para>
<itemizedlist> <itemizedlist>
<listitem>
<listitem><para><function>xxxac97_init()</function> returns <para><function>xxxac97_init()</function> returns the number
the number of ac97 codecs found.</para> of ac97 codecs found.</para>
</listitem> </listitem>
<listitem><para><function>ac97_read()</function> and <listitem>
<function>ac97_write()</function> read or write a specified <para><function>ac97_read()</function> and
register.</para> <function>ac97_write()</function> read or write a
specified register.</para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
<para>The <emphasis>AC97</emphasis> interface is used by the <para>The <emphasis>AC97</emphasis> interface is used by the
@ -681,7 +672,6 @@
level operations. Look at level operations. Look at
<filename>sound/pci/maestro3.c</filename> or many others under <filename>sound/pci/maestro3.c</filename> or many others under
<filename>sound/pci/</filename> for an example.</para> <filename>sound/pci/</filename> for an example.</para>
</sect2> </sect2>
</sect1> </sect1>
</chapter> </chapter>