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

📄 lsg10.htm

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTM
📖 第 1 页 / 共 3 页
字号:


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

 -->


























<LINK REL="ToC" HREF="index.htm">







<LINK REL="Index" HREF="htindex.htm">







<LINK REL="Next" HREF="lsg11.htm">



















<A NAME="I0"></A>







<H2>Linux System Administrator's Survival Guide lsg10.htm</H2>







<P ALIGN=LEFT>







































<HR ALIGN=CENTER>







<P>







<UL>







<UL>







<UL>







<LI>







<A HREF="#E68E54" >Checking for Sound Card Support</A>







<LI>







<A HREF="#E68E55" >Configuring Your Sound Card</A>







<UL>







<LI>







<A HREF="#E69E87" >Understanding Sound Card Device Files</A>







<LI>







<A HREF="#E69E88" > Linking the Sound Card Files</A>







<LI>







<A HREF="#E69E89" >Providing Configuration Information</A>







<LI>







<A HREF="#E69E90" >Testing the Sound Card Drivers</A></UL>







<LI>







<A HREF="#E68E56" >Using the PC Speaker</A>







<LI>







<A HREF="#E68E57" >Sampling Linux Sound Applications</A>







<LI>







<A HREF="#E68E58" >Troubleshooting the Sound Card</A>







<UL>







<LI>







<A HREF="#E69E91" >Configuration Information</A>







<LI>







<A HREF="#E69E92" >Check the File /dev/sndstat</A>







<LI>







<A HREF="#E69E93" >No Such File or Device Errors</A>







<LI>







<A HREF="#E69E94" >Incomplete Playing of Sound Files</A>







<LI>







<A HREF="#E69E95" >Sounds Stop and Start When Playing</A></UL>







<LI>







<A HREF="#E68E59" >Summary</A></UL></UL></UL>







<HR ALIGN=CENTER>







<A NAME="E66E12"></A>







<H1 ALIGN=CENTER>







<CENTER>







<FONT SIZE=6 COLOR="#FF0000"><B>Chapter 10</B></FONT></CENTER></H1>







<BR>







<A NAME="E67E15"></A>







<H2 ALIGN=CENTER>







<CENTER>







<FONT SIZE=6 COLOR="#FF0000"><B>Sound Cards</B></FONT></CENTER></H2>







<BR>







<P>UNIX wasn't designed with sound cards in mind, and only a few applications make use of one (DOOM being the most popular). Linux also lets you load a special driver to make use of the PC speaker for more than the occasional beep, useful when you don't have a proper sound card. However, sound cards are a common accessory in PCs, especially those designed for multimedia applications. Making your sound card work under Linux is not difficult, as long as you know the manufacturer and model of your sound card. Software device drivers for the most common models are included with most Linux distribution software packages, and some other drivers are available from FTP and BBS sites. This chapter looks at how you can install the device drivers for your sound card and make sure they work properly under Linux.







<BR>







<P>Linux doesn't support many DOS sound file formats (such as .WAV and .MID), but relies instead on sound files and commands that are taken from the Sun workstation product line. Sun audio files are the general format for Linux, usually with the .au filetype appended. You can play other sound files, although some may need conversion to Sun format first. Sun workstation device drivers are used as the model for the sound card drivers in Linux, although the drivers are designed to work with standard PC sound cards.







<BR>







<P>A Linux system can support two sound cards, although most installations will involve only one card. The two cards must be different and cannot have any of the same configuration information (both must have different I/O addresses, IRQs, and DMAs). If you have a separate dedicated card for a MIDI interface, you may want to use two cards. For example, you may have a PC equipped with a Sound Blaster card for the usual game effects and a Roland MIDI card for professional sounding audio. Linux can support both types of devices at the same time. You can't use two cards that both support Sound Blaster, even as emulations, as the drivers will conflict unless you disable one card.







<BR>







<BLOCKQUOTE>







<BLOCKQUOTE>







<HR ALIGN=CENTER>







<BR>







<NOTE>The drivers and software associated with the device drivers for sound cards changes frequently, so check for the latest versions and examine any documentation that accompanies them. It may supersede the information in this chapter. Many versions of Linux now include automated installation scripts for sound cards or support the mkdev sound command. Check for the installation scripts before installing the sound card manually.</NOTE>







<BR>







<HR ALIGN=CENTER>







</BLOCKQUOTE></BLOCKQUOTE>







<BR>







<A NAME="E68E54"></A>







<H3 ALIGN=CENTER>







<CENTER>







<FONT SIZE=5 COLOR="#FF0000"><B>Checking for Sound Card Support</B></FONT></CENTER></H3>







<BR>







<P>The list of sound cards supported by Linux includes most of the popular models, and many others emulate one of these supported models and so can be run in emulation mode without a problem. The most popular supported models of sound cards are the following:







<BR>







<UL>







<LI>Creative Lab's Sound Blaster, Sound Blaster Pro, Sound Blaster 16, Sound Blaster AWE (as well as most Sound Blaster-compatible systems, including ATI's Stereo F/X, Thunderboard, and others)







<BR>







<BR>







<LI>Adlib's Adlib series and compatibles







<BR>







<BR>







<LI>ProAudioSpectrum 16 and Logitech's SoundMan 16







<BR>







<BR>







<LI>Gravis' Advanced Gravis UltraSound







<BR>







<BR>







<LI>Microsoft's Microsoft Sound System







<BR>







<BR>







<LI>Roland MPU 401 MIDI-based interfaces and sound boards







<BR>







<BR>







</UL>







<P>A complete list of supported sound boards is usually supplied with the Linux distribution software. Because the location of the files describing the sound support varies considerably, search for any files to do with sound using the find command. You can do this search easily with a CD-ROM distribution package. Mount the CD-ROM (see <A HREF="lsg09.htm">Chapter 9</A>, &quot;CD-ROM Drives,&quot; for more information) and issue a find command with the string sound as a starting point:







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">find / -name sound* -print</FONT></PRE>







<P>This search should at last point you to the directories that contain information about the sound boards, drivers, and C source code for the drivers. The sound drivers for the CD-ROM version of Linux included with this book, for example, are stored in /usr/src/linux-1.2.8/drivers/sound. Figure 10.1 shows the output from a find command run against this version of Linux. In this example, the find command reports matches in the DOS filesystem, too, because that is mounted as /dos. You may want to unmount your CD-ROM drive before issuing this command to save time.If you can't search your distribution media, or don't have a complete Linux distribution handy, check the README files that were supplied with your software for potential locations of drivers.







<BR>







<P><B> <A HREF="10LSG01.gif">Figure 10.1.</B>







<BR><B>You can search for the sound card drivers by issuing a </B><B>find</B><B> </B><B>command.</A></B>







<BR>







<BR>







<A NAME="E68E55"></A>







<H3 ALIGN=CENTER>







<CENTER>







<FONT SIZE=5 COLOR="#FF0000"><B>Configuring Your Sound Card</B></FONT></CENTER></H3>







<BR>







<P>Once you have determined that your model of sound card is supported, you can begin the process of making it available to Linux. Install the sound card, if necessary. This procedure usually involves nothing more complex than placing the card in an available slot on the motherboard. Because Linux uses its own device drivers, installing the DOS-based software has no effect on the card under Linux.







<BR>







<P>When you install the sound card, note the basic configuration information, such as the card's DMA, IRQ, and I/O address. Some cards have more configuration information, including 8-bit and 16-bit DMAs, MIDI addresses, and so on. Most sound cards use the default values without a problem, so you can check the card's documentation for these values. If you had to change some of the default settings to make the card work under DOS, have the changed values readily available for the Linux device configuration.







<BR>







<P>Later versions of Linux include sound card drivers for the most common cards as part of the basic driver package. In some cases, the setup or installation script includes a sound card configuration section. This script installs the proper drivers and relinks the kernel automatically. If your setup or install script handles the sound card setup for you, there is little else you need to do except reboot the system and test the sound card.







<BR>







<P>The sound card drivers are stored in different locations, depending on the Linux distribution. A good general location to look for drivers is the directory /usr/src/linux/drivers/sound, although the names tend to change somewhat. A quick method of finding the drivers is to search for the sound directory using the command







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">find / -name sound -print</FONT></PRE>







<P>If your Linux software is supplied on CD-ROM, you will want to search the CD-ROM as well as the hard disk filesystem because few installation routines copy all the drivers to the hard drive. The Slackware distribution CD-ROM, for example, keeps the sound drivers on the CD-ROM until they are explicitly installed. The Slackware release keeps the drivers in the directory /cdrom/live/usr/src/linux-1.2.8/drivers/sound (the version number changes with each release of Slackware Linux).







<BR>







<BR>







<A NAME="E69E87"></A>







<H4 ALIGN=CENTER>







<CENTER>







<FONT SIZE=4 COLOR="#FF0000"><B>Understanding Sound Card Device Files</B></FONT></CENTER></H4>







<BR>







<P>Linux uses a number of device files in association with a sound card. Each device driver is in the /dev directory by convention (although it can, in theory, be anywhere). Linux supports up to two different sound cards, so two device driver files are possible for each type of driver.







<BR>







<P>The system administrator can change the device driver files and their purposes, but the administrator should retain the basic names for ease of integration with applications that require specific device names. The sound card device drivers are the following:







<BR>







<UL>







<LI>/dev/audio is the first audio device (Sun compatible)





⌨️ 快捷键说明

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