aboutsummaryrefslogtreecommitdiff
path: root/en_US.ISO8859-1/books/handbook/sound/chapter.sgml
blob: 60b7ad1b7d5fe17d510918ca622a48e70317acaa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
<!--
     The FreeBSD Documentation Project

     $FreeBSD: doc/en_US.ISO_8859-1/books/handbook/sound/chapter.sgml,v 1.4 2000/12/06 21:27:12 dannyboy Exp $
-->

<chapter id="sound">
  <title>Sound</title>

  <para><emphasis>Contributed by Moses Moore
    <email>jm-moses@home.com</email>, 20 November 2000.</emphasis></para>

  <sect1>
    <title>Synopsis</title>

    <para>This chapter of the handbook deals with setting up sound on a
      FreeBSD system.</para>
  </sect1>

  <sect1>
    <title>Locating the Correct Device</title>

    <para>Before you begin, you should know the model of the card you
      have, the chip it uses, and whether it is a PCI or ISA card.
      FreeBSD supports a wide variety of both PCI and ISA cards.  If you
      do not see your card in the following list, check the &man.pcm.4;
      manual page.  This is not a complete list; however, it does list
      some of the most common cards.</para>

    <itemizedlist>
      <listitem>
	<para>Crystal 4237, 4236, 4232, 4231</para>
      </listitem>

      <listitem>
	<para>Yamaha OPL-SAx</para>
      </listitem>

      <listitem>
	<para>OPTi931</para>
      </listitem>

      <listitem>
	<para>Ensoniq AudioPCI 1370/1371</para>
      </listitem>

      <listitem>
	<para>ESS Solo-1/1E</para>
      </listitem>

      <listitem>
	<para>NeoMagic 256AV/ZX</para>
      </listitem>

      <listitem>
	<para>Sound Blaster Pro, 16, 32, AWE64, AWE128, Live</para>
      </listitem>

      <listitem>
	<para>Creative ViBRA16</para>
      </listitem>

      <listitem>
	<para>Advanced Asound 100, 110, and Logic ALS120</para>
      </listitem>

      <listitem>
	<para>ES 1868, 1869, 1879, 1888</para>
      </listitem>

      <listitem>
	<para>Gravis UltraSound</para>
      </listitem>

      <listitem>
	<para>Aureal Vortex 1 or 2</para>
      </listitem>
    </itemizedlist>

    <para>The driver you use in your kernel depends on the kind of card
      you have.  The sections below provide more information and what
      you will need to add to your <link linkend="kernelconfig">kernel
      configuration</link>.</para>

    <sect2>
      <title>Creative, Advance, and ESS Sound Cards</title>

      <para>If you have one of the above cards, you will need to
	add</para>
	
      <programlisting>device pcm</programlisting>

      <para>to your kernel.  If you have a PnP ISA card, you will also
	need to add</para>

      <programlisting>device sbc</programlisting>

      <para>to your kernel.  For a non-PnP ISA card, add</para>

      <programlisting>device pcm</programlisting>
      
      <para>and</para>

      <programlisting>device sbc0 at isa? port0x220 irq 5 drq 1 flags 0x15</programlisting>

      <para>to your kernel.  Those are the default settings.  You may
	need to change the IRQ, etc.  See the &man.sbc.4; man page for
	more information.</para>

      <note>
	<para>The Sound Blaster Live is not supported under FreeBSD 4.0
	  without a patch, which this document will not cover.  It is
	  recommended that you update to the latest -STABLE before
	  trying to use this card.</para>
      </note>
    </sect2>

    <sect2>
      <title>Gravis UltraSound Cards</title>

      <para>For a PnP ISA card, you will need to add</para>

      <programlisting>device pcm</programlisting>

      <para>and</para>

      <programlisting>device gusc</programlisting>

      <para>to your kernel.  If you have a non-PnP ISA card, you will
	need to add</para>

      <programlisting>device pcm</programlisting>

      <para>and</para>

      <programlisting>device gus0 at isa? port 0x220 irq 5 drq 1 flags 0x13</programlisting>

      <para>to your kernel.  You may need to change the IRQ, etc.  See
	the &man.gusc.4; man page for more information.</para>
    </sect2>

    <sect2>
      <title>Crystal Sound Cards</title>

      <para>For Crystal cards, you will need both</para>

      <programlisting>device pcm</programlisting>

      <para>and</para>

      <programlisting>device csa</programlisting>

      <para>in your kernel.</para>
    </sect2>

    <sect2>
      <title>Generic Support</title>

      <para>For PnP ISA or PCI cards, you will need to add</para>

      <programlisting>device pcm</programlisting>

      <para>to your kernel configuration.  If you have a non-PnP ISA
	sound card that does not have a bridge driver, you will need
	to add</para>

      <programlisting>device pcm0 at isa? irq 10 drq 1 flags 0x0</programlisting>

      <para>to your kernel configuration.  You may need to change the
	IRQ, etc., to match your hardware configuration.</para>
    </sect2>
  </sect1>

  <sect1>
    <title>Recompiling the Kernel</title>

    <para>After adding the driver(s) you need to your kernel
      configuration, you will need to recompile your kernel.  Please see
      <xref linkend="kernelconfig-building"> of the handbook for
      more information.</para>
  </sect1>

  <sect1>
    <title>Creating and Testing the Device Nodes</title>

    <para>After you reboot, log in and run <command>cat
      /dev/sndstat</command>.  You should see output similar to the
      following:</para>

    <programlisting>FreeBSD Audio Driver (newpcm) Sep 21 2000 18:29:53
Installed devices:
pcm0: &lt;Aureal Vortex 8830&gt; at memory 0xfeb40000 irq 5 (4p/1r +channels duplex)</programlisting>

    <para>If you see an error message, something went wrong earlier.  If
      that happens, go through your kernel configuration file again and
      make sure you chose the correct device.</para>

    <para>If it reported no errors and returned
      <devicename>pcm0</devicename>, <command>su</command> to
      <username>root</username> and do the following:</para>

    <screen>
&prompt.root; <userinput>cd /dev</userinput>
&prompt.root; <userinput>sh MAKEDEV snd0</userinput></screen>

    <para>If it reported no errors and returned
      <devicename>pcm1</devicename>, <command>su</command> to
      <username>root</username> and do the following:</para>

    <screen>
&prompt.root; <userinput>cd /dev</userinput>
&prompt.root; <userinput>sh MAKEDEV snd1</userinput></screen>

    <para>Please note that either of the above commands will
      <emphasis>not</emphasis> create a
      <devicename>/dev/snd</devicename> device!  Instead it creates a
      group of device nodes including:</para>

    <informaltable frame="none">
      <tgroup cols="2">
	<thead>
	  <row>
	    <entry>Device</entry>
	    <entry>Description</entry>
	  </row>
	</thead>

	<tbody>
	  <row>
	    <entry><devicename>/dev/audio</devicename></entry>
	    <entry>SPARC-compatible audio device</entry>
	  </row>

	  <row>
	    <entry><devicename>/dev/dsp</devicename></entry>
	    <entry>Digitized voice device</entry>
	  </row>

	  <row>
	    <entry><devicename>/dev/dspW</devicename></entry>
	    <entry>Like <devicename>/dev/dsp</devicename>, but 16 bits
	      per sample</entry>
	  </row>

	  <row>
	    <entry><devicename>/dev/midi</devicename></entry>
	    <entry>Raw midi access device</entry>
	  </row>

	  <row>
	    <entry><devicename>/dev/mixer</devicename></entry>
	    <entry>Control port mixer device</entry>
	  </row>

	  <row>
	    <entry><devicename>/dev/music</devicename></entry>
	    <entry>Level 2 sequencer interface</entry>
	  </row>

	  <row>
	    <entry><devicename>/dev/sequencer</devicename></entry>
	    <entry>Sequencer device</entry>
	  </row>

	  <row>
	    <entry><devicename>/dev/pss</devicename></entry>
	    <entry>Programmable device interface</entry>
	  </row>
	</tbody>
      </tgroup>
    </informaltable>

    <para>If all goes well, you should now have a functioning sound
      card.  If you do not, see the next section.</para>
  </sect1>

  <sect1>
    <title>Common Problems</title>

    <qandaset>
      <qandaentry>
	<question>
	  <para>I get an unsupported subdevice XX error!</para>
	</question>

	<answer>
	  <para>One or more of the device nodes wasn't created
	    correctly.  Repeat the steps above.</para>
	</answer>
      </qandaentry>

      <qandaentry>
	<question>
	  <para>I get a sb_dspwr(XX) timed out error!</para>
	</question>

	<answer>
	  <para>The I/O port is not set correctly.</para>
	</answer>
      </qandaentry>

      <qandaentry>
	<question>
	  <para>I get a bad irq XX error!</para>
	</question>

	<answer>
	  <para>The IRQ is set incorrectly.  Make sure that the set IRQ
	    and the sound IRQ are the same.</para>
	</answer>
      </qandaentry>

      <qandaentry>
	<question>
	  <para>I get a "xxx: gus pcm not attached, out of memory"
	    error.  What causes that?</para>
	</question>

	<answer>
	  <para>If this happens, it is because there is not enough
	    available memory to use the device.</para>
	</answer>
      </qandaentry>
    </qandaset>
  </sect1>
</chapter>