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

📄 381-383.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<HTML>

<HEAD>

<TITLE>Linux Unleashed, Third Edition:Multimedia Linux</TITLE>

<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!--ISBN=0672313723//-->

<!--TITLE=Linux Unleashed, Third Edition//-->

<!--AUTHOR=Tim Parker//-->

<!--PUBLISHER=Macmillan Computer Publishing//-->

<!--IMPRINT=Sams//-->

<!--CHAPTER=21//-->

<!--PAGES=381-383//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="377-381.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="383-386.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<H4 ALIGN="LEFT"><A NAME="Heading5"></A><FONT COLOR="#000077">Troubleshooting the Installation and Configuration</FONT></H4>

<P>As with any device, there can be problems that need to be corrected after installing and configuring your sound card. Of course, your system may be working perfectly, in which case you can skip this section.

</P>

<P>If after compiling the new kernel you have no sound card support and there are no messages during the boot sequence about sound cards, chances are high that you&#146;re not booting off the new kernel. The following command displays the details of the kernel that booted.</P>

<!-- CODE SNIP //-->

<PRE>

uname -a

</PRE>

<!-- END CODE SNIP //-->

<P>Check the time and date to see if it coincides with the recompilation. If not, you may have to use LILO to install the new kernel on your boot device, or repeat the entire recompilation process again.

</P>

<BLOCKQUOTE>

<P><FONT SIZE="-1"><HR><B>Tip:&nbsp;&nbsp;</B><BR>The <TT>/proc/version</TT> file on most Linux systems contains the same information as the <TT>uname -a</TT> command. You can use either to check the version of the kernel.<HR></FONT>

</BLOCKQUOTE>

<P>Assuming the version of the kernel is the one you just compiled, you need to check that the sound card is linked into the kernel itself. The file <TT>/proc/devices</TT> lists the character and block mode devices the kernel includes. Look for an entry for &#147;sound&#148; (usually number 14). If it&#146;s not there, the sound card components were not linked into this kernel and you need to redo the config routine.</P>

<P>If the <TT>/proc/devices</TT> file looks okay and you saw a message during the boot sequence about the sound card (you can replay all those messages using either the <TT>dmesg</TT> command or by looking at the <TT>/var/adm/messages</TT> file), chances are you&#146;re using a &#147;compatible&#148; card that isn&#146;t very compatible. This is common with SoundBlaster-compatible cards, where the drivers for the real card don&#146;t find the compatible card. Check the README files with the driver to see if there&#146;s any mention of your specific card and problems with it, and check the manufacturer&#146;s Web or FTP site.</P>

<P>Another way to check the status of your sound card installation is to look at the file <TT>/dev/sndstat</TT>. If you don&#146;t find this file, you haven&#146;t run the sound card installation script from the end of the file <TT>/usr/src/linux/drivers/sound/Readme.Linux</TT>. Cut the script from the file, make it executable, and run it. Then you should find a file called <TT>/dev/sndstat</TT> generated for you.</P>

<P>There are several error messages you may see in <TT>/dev/sndstat</TT> that help you determine the problem with your sound card. Table 21.2 shows the most common messages, the reason they are generated, and a possible solution. In each case the error message is preceded by the device name.</P>

<TABLE WIDTH="100%"><CAPTION ALIGN=LEFT><B>Table 21.2.</B> <TT>/dev/sndstat</TT> error messages.

<TR>

<TH COLSPAN="2"><HR>

<TR>

<TH WIDTH="45%" ALIGN="LEFT">Error message

<TH WIDTH="55%" ALIGN="LEFT">Reason generated and solution

<TR>

<TH COLSPAN="2"><HR>

<TR>

<TD VALIGN="TOP">No such device

<TD>The kernel does not contain the sound card drivers. Rebuild the kernel.

<TR>

<TD VALIGN="TOP">No such device or address

<TD>The sound card driver couldn&#146;t find the sound card at the configuration you specified. Check the configuration settings.

<TR>

<TD COLSPAN="2"><HR> 

</TABLE>

<H4 ALIGN="LEFT"><A NAME="Heading6"></A><FONT COLOR="#000077">Applications for Sound Cards</FONT></H4>

<P>There are quite a number of applications that work with your sound card, depending on what you want to do. Most of these applications are available from FTP sites or may be included with your CD-ROM Linux distribution. To check whether the files are on your system or your CD-ROM, use the <TT>find</TT> command to look for the executable program&#146;s name.</P>

<P>We&#146;re not going to look at each application that is available for Linux because there are several dozen. Instead, we&#146;ll pick a few representative examples. Checking out the FTP sites will show you all the others that are available.</P>

<P><FONT SIZE="+1"><B>vplay, vrec, splay, and srec</B></FONT></P>

<P>The <TT>vplay</TT> utility and its three partners are a suite of sound tools called <TT>snd-util</TT> developed by Hannu Savolainen and Michael Beck. These are straightforward sound recording and playback utilities developed in the early stages of Linux, but work well even today if you are willing to use a command-line interface instead of a fancy GUI. The <TT>srec</TT> tool records sounds and <TT>splay</TT> replays them. (To record, you need either a microphone or other input device such as a feed from a CD.)</P>

<BLOCKQUOTE>

<P><FONT SIZE="-1"><HR><B>Tip:&nbsp;&nbsp;</B><BR>The easiest source of the <TT>snd-util</TT> 3.0 package (the current version as this book went to press) is through FTP:

<!-- CODE SNIP //-->

<PRE>

<A HREF="ftp.sunsite.unc.edu/pub/linux/apps/sound/snd-util-3.0.tar.gz">ftp.sunsite.unc.edu/pub/Linux/apps/sound/snd-util-3.0.tar.gz</A>

</PRE>

<!-- END CODE SNIP //-->

<HR></FONT>

</BLOCKQUOTE>

<P>The <TT>srec</TT> utility lets you specify the amount of time to record, as well as the sampling rate. Sound is stored in the raw file format (<TT>.raw</TT> file extension). To record a twenty second sample of sound using a 21KHz sampling rate and store the output in the file <TT>sample.raw</TT>, use this command:</P>

<!-- CODE SNIP //-->

<PRE>

srec -t 20 -s 21000 sample.raw

</PRE>

<!-- END CODE SNIP //-->

<P>To replay the sound just recorded, you need the <TT>splay</TT> utility and must specify both the filename and the sampling rate:</P>

<!-- CODE SNIP //-->

<PRE>

splay -s 21000 sample.raw

</PRE>

<!-- END CODE SNIP //-->

<P>If you choose the wrong sampling rate you&#146;ll notice right away since the sound will not resemble the original.

</P>

<P>The <TT>vplay</TT> and <TT>vrec</TT> commands are based on <TT>splay</TT> and <TT>srec</TT> respectively, but add the ability to save files in <TT>.wav</TT> format and <TT>.voc</TT> format (used by SoundBlaster cards).</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="377-381.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="383-386.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>





</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

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