⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sound-setup.html

📁 FreeBSD操作系统的详细使用手册
💻 HTML
📖 第 1 页 / 共 2 页
字号:
class="CITEREFENTRY"><span class="REFENTRYTITLE">cdcontrol</span>(1)</span></a>:</p><pre class="SCREEN"><samp class="PROMPT">%</samp> <kbd class="USERINPUT">cdcontrol -f /dev/acd0 play 1</kbd></pre><p>Various applications, such as <ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/audio/workman/pkg-descr"><ttclass="FILENAME">audio/workman</tt></a> can provide a friendlier interface. You may wantto install an application such as <ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/audio/mpg123/pkg-descr"><ttclass="FILENAME">audio/mpg123</tt></a> to listen to MP3 audio files. A quick way to testthe card is sending data to the <tt class="FILENAME">/dev/dsp</tt>, like this:</p><pre class="SCREEN"><samp class="PROMPT">%</samp> <kbd class="USERINPUT">cat <varclass="REPLACEABLE">filename</var> &gt; /dev/dsp</kbd></pre><p>where <var class="REPLACEABLE">filename</var> can be any file. This command lineshould produce some noise, confirming the sound card is actually working.</p><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> FreeBSD&nbsp;4.X users need to create the sound card device nodes beforebeing able to use it. If the card showed up in message buffer as <ttclass="DEVICENAME">pcm0</tt>, you will have to run the following as <ttclass="USERNAME">root</tt>:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">cd /dev</kbd><samp class="PROMPT">#</samp> <kbd class="USERINPUT">sh MAKEDEV snd0</kbd></pre><p>If the card detection returned <tt class="DEVICENAME">pcm1</tt>, follow the same stepsas shown above, replacing <tt class="DEVICENAME">snd0</tt> with <ttclass="DEVICENAME">snd1</tt>.</p><p><tt class="COMMAND">MAKEDEV</tt> will create a group of device nodes that will be usedby the different sound related applications.</p></blockquote></div><p>Sound card mixer levels can be changed via the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=mixer&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">mixer</span>(8)</span></a> command. Moredetails can be found in the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=mixer&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">mixer</span>(8)</span></a> manualpage.</p><div class="SECT3"><h3 class="SECT3"><a id="TROUBLESHOOTING" name="TROUBLESHOOTING">7.2.2.1 CommonProblems</a></h3><div class="INFORMALTABLE"><a id="AEN8349" name="AEN8349"></a><table border="0" frame="void" class="CALSTABLE"><col /><col /><thead><tr><th>Error</th><th>Solution</th></tr></thead><tbody><tr><td>``<tt class="ERRORNAME">unsupported subdevice XX</tt>''</td><td><p>One or more of the device nodes was not created correctly. Repeat the steps above.</p></td></tr><tr><td>``<tt class="ERRORNAME">sb_dspwr(XX) timed out</tt>''</td><td><p>The I/O port is not set correctly.</p></td></tr><tr><td>``<tt class="ERRORNAME">bad irq XX</tt>''</td><td><p>The IRQ is set incorrectly. Make sure that the set IRQ and the sound IRQ are thesame.</p></td></tr><tr><td>``<tt class="ERRORNAME">xxx: gus pcm not attached, out of memory</tt>''</td><td><p>There is not enough available memory to use the device.</p></td></tr><tr><td>``<tt class="ERRORNAME">xxx: can't open /dev/dsp!</tt>''</td><td><p>Check with <tt class="COMMAND">fstat | grep dsp</tt> if another application is holdingthe device open. Noteworthy troublemakers are <b class="APPLICATION">esound</b> and <bclass="APPLICATION">KDE</b>'s sound support.</p></td></tr></tbody></table></div></div></div><div class="SECT2"><h2 class="SECT2"><a id="AEN8384" name="AEN8384">7.2.3 Utilizing Multiple SoundSources</a></h2><i class="AUTHORGROUP"><span class="CONTRIB">Contributed by</span> Munish Chopra.</i> <p>It is often desirable to have multiple sources of sound that are able to playsimultaneously, such as when <b class="APPLICATION">esound</b> or <bclass="APPLICATION">artsd</b> do not support sharing of the sound device with a certainapplication.</p><p>FreeBSD lets you do this through <span class="emphasis"><i class="EMPHASIS">VirtualSound Channels</i></span>, which can be set with the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=sysctl&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">sysctl</span>(8)</span></a> facility.Virtual channels allow you to multiplex your sound card's playback channels by mixingsound in the kernel.</p><p>To set the number of virtual channels, there are two sysctl knobs which, if you arethe <tt class="USERNAME">root</tt> user, can be set like this:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">sysctl hw.snd.pcm0.vchans=4</kbd><samp class="PROMPT">#</samp> <kbd class="USERINPUT">sysctl hw.snd.maxautovchans=4</kbd></pre><p>The above example allocates four virtual channels, which is a practical number foreveryday use. <var class="VARNAME">hw.snd.pcm0.vchans</var> is the number of virtualchannels <tt class="DEVICENAME">pcm0</tt> has, and is configurable once a device has beenattached. <var class="LITERAL">hw.snd.maxautovchans</var> is the number of virtualchannels a new audio device is given when it is attached using <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=kldload&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">kldload</span>(8)</span></a>. Since the<tt class="DEVICENAME">pcm</tt> module can be loaded independently of the hardwaredrivers, <var class="VARNAME">hw.snd.maxautovchans</var> can store how many virtualchannels any devices which are attached later will be given.</p><p>If you are not using <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=devfs&sektion=5&manpath=FreeBSD+6-current"><span class="CITEREFENTRY"><span class="REFENTRYTITLE">devfs</span>(5)</span></a>, youwill have to point your applications at <tt class="FILENAME">/dev/dsp0</tt>.<varclass="REPLACEABLE">x</var>, where <var class="REPLACEABLE">x</var> is 0 to 3 if <varclass="VARNAME">hw.snd.pcm.0.vchans</var> is set to 4 as in the above example. On asystem using <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=devfs&sektion=5&manpath=FreeBSD+6-current"><span class="CITEREFENTRY"><span class="REFENTRYTITLE">devfs</span>(5)</span></a>, theabove will automatically be allocated transparently to the user.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN8427" name="AEN8427">7.2.4 Setting Default Values for MixerChannels</a></h2><i class="AUTHORGROUP"><span class="CONTRIB">Contributed by</span> Josef El-Rayes.</i> <p>The default values for the different mixer channels are hardcoded in the sourcecode ofthe <a href="http://www.FreeBSD.org/cgi/man.cgi?query=pcm&sektion=4"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">pcm</span>(4)</span></a> driver. Thereare a lot of different applications and daemons that allow you to set values for themixer they remember and set each time they are started, but this is not a clean solution,we want to have default values at the driver level. This is accomplished by defining theappropriate values in <tt class="FILENAME">/boot/device.hints</tt>. E.g.:</p><pre class="PROGRAMLISTING">hint.pcm.0.vol="100"</pre><p>This will set the volume channel to a default value of 100, as soon as the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=pcm&sektion=4"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">pcm</span>(4)</span></a> module getsloaded.</p><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> Only FreeBSD 5.3 and above support this.</p></blockquote></div></div></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="multimedia.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="sound-mp3.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Multimedia</td><td width="34%" align="center" valign="top"><a href="multimedia.html"accesskey="U">Up</a></td><td width="33%" align="right" valign="top">MP3 Audio</td></tr></table></div><p align="center"><small>This, and other documents, can be downloaded from <ahref="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/</a>.</small></p><p align="center"><small>For questions about FreeBSD, read the <ahref="http://www.FreeBSD.org/docs.html">documentation</a> before contacting &#60;<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>&#62;.<br />For questions about this documentation, e-mail &#60;<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>&#62;.</small></p></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -