In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to configure the sound card in Linux, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to understand it.
Sound card configuration process
1. Configuration of kernel sound card driver
The main sound cards in use now are PCI and ISA. In linux system, the configuration process of these two types of sound cards is actually to generate the configuration file / etc/modules.conf and establish the correct corresponding relationship between the device alias and the sound card device driver. After setting the driver module correctly, use the mixer program to set the output volume of the sound card.
If your sound card is of the ISA PnP type, then if the sound card also works well under the dos (windows) system, then you can remember the working parameters of the sound card, including IRQ, DMA and Imax O. In general, the same parameters should be used under the linux system as under DOS.
If you don't know its working parameters, you can get the configuration space for the sound card through / proc/isapnp, which includes information such as dma, ioport, and irq. You can then check the / proc/interrupts,/proc/ioports and / proc/dma files to learn about the free irq, ioports, and dma in the system, from which you can choose the appropriate sound card configuration parameters.
In the 2.4.x kernel, ISA PnP support is implemented, and some sound card drivers now support automatic detection and configuration without using isapnp tools. For more information about sound card devices, you can also view the files in the kernel documentation / usr/src/linux/Documentation/sound/.
For PCI sound cards, their drivers include an automatic detection process, so you only need to insert the correct driver module and the sound card will generally work properly.
When the sound card module is referenced * times, the kernel will require the corresponding driver module to be loaded. The device alias corresponding to the sound card module is sound-slot-0 (0 represents a sound card in the system, and so on). For example, add to / etc/modules.conf:
Alias sound-slot-0 esssolo1
The ESS Solo-1 sound card is configured. This statement indicates that the module esssolo1 is automatically loaded when a sound card is needed.
Sometimes after loading the device module corresponding to sound-slot-0, it does not make all the functions of the sound card effective. At this point, the device requests access to the sound-service-0-n alias. N represents different devices:
The equipment corresponding to the number
0 mixer (Mixer)
2 MIDI
3,4 DSP
At this point, you are required to set the correct alias for the sound card service module so that the sound card can work properly. The device file for the sound card:
Device file name device description
/ dev/audio connects normally to / dev/audio0
/ dev/audio0 sun workstation compatible sound devices (only partially implemented, do not support sun ioctl interface, only support u-law coding)
/ dev/audio1 second sound device (used when installing multiple sound cards)
/ dev/dsp connects normally to / dev/dsp0
/ dev/dsp0 * digital sampling devices
/ dev/dsp1 second digital sampling device
/ dev/mixer connects normally to / dev/mixer0
/ dev/mixer0 * sound mixer
/ dev/mixer1 second sound mixer
/ dev/music Advanced Serialization Interface
/ dev/sequencer underlying MIDI,FM and GUS access
/ dev/sequencer2 connects normally to / dev/music
/ dev/midi00 * original MIDI port
/ dev/midi01 second original MIDI port
/ dev/midi02 third original MIDI port
/ dev/midi03 fourth original MIDI port
/ dev/sndstat displays the status of the sound driver
Pc speakers provide the following devices:
/ dev/pcaudio is equivalent to / dev/audio
/ dev/pcsp is equivalent to / dev/dsp
/ dev/pcmixer is equivalent to / dev/mixer
You can send the sound file directly to the corresponding device, for example, the .au sound file can be played by feeding it into / dev/audio, and the original sample can also be sent to / dev/dsp.
Cat sample.su > / dev/audio
However, the general effect of doing so is poor, and the play command should be used when playing. For wavplay and vplay (snd-util package), wav files are played with a * * effect, but they do not recognize Microsoft adpcm compressed wav files. After manually setting the correct parameters, splay is used to play most sound files.
The sampled data returned by reading / dev/audio and / dev/dsp can be redirected to a file. Vrec can make this process easier. A mixer program may be required to select the appropriate input device.
2. Configuration of ALSA sound card driver
For sound card drivers, in addition to the drivers that come with the kernel, you can also use the drivers provided by Advanced linux Sound Architecture (ALSA, http://www.alsa-project.org/). It supports a series of mainstream sound cards, and it is compatible with the sound structure of the kernel. To some extent, it can be said to be a supplement to the sound card driver module of the kernel.
The general naming convention for ALSA's sound card driver is snd-card-. Soundcard represents different types of sound cards. For example, for all 16-bit Soundblaster sound cards, their corresponding driver module is snd-card-sb16.
For backward compatibility with the linux kernel sound driver, you also need two modules, snd-pcm-oss and snd-mixer-oss. For multiple mixers set up by amixer, they are all for different devices. For example, the CD channel is set for CD players. Many applications, such as mpg123,xmms,realplayer, rely on the setting of the PCM channel. MIC stands for microphone. Different Gain parts can provide special gains for different uses.
By default, ALSA mutes all output. In order to obtain sound, you must unmute the main volume and the PCM volume.
Amixer-c 0 sset 'Master',0 100% unmute
Amixer-c 0 sset 'PCM', 0 100% unmute
Options include mute,unmute,capture,nocapture,rec,norec, numbers, or left:right. When amixer runs without parameters, it returns the settings of all channels on the sound card.
To turn on muting every time the sound card driver module is inserted, you can add the following statement to / etc/modules.conf:
Post-install snd-card-sb16 amixer-c 0 sset 'Master',0 100% unmute & & amixer-c 0 sset' PCM', 0 100% unmute
After successfully inserting the alsa sound card module, the system will appear in the / proc/asound directory, which describes the operation of the sound card and the device files created.
After you load the snd-pcm-oss device module, you can also access the sound card in an oss-compatible way, and the following mapping will be completed:
ALSA device OSS device secondary device number
/ dev/snd/pcmC0D0 / dev/audio0 (/ dev/audio) 4
/ dev/snd/pcmC0D0 / dev/dsp0 (/ dev/dsp) 3
/ dev/snd/pcmC0D1 / dev/adsp (/ dev/adsp) 12
/ dev/snd/pcmC1D0 / dev/audio1 20
/ dev/snd/pcmC1D0 / dev/dsp1 19
/ dev/snd/pcmC1D1 / dev/adsp1 28
/ dev/snd/pcmC2D0 / dev/audio2 36
/ dev/snd/pcmC2D0 / dev/dsp2 35
/ dev/snd/pcmC2D1 / dev/adsp2 44
For / dev/mixer devices, to load snd-mixer-oss, you can ensure compatibility with the old oss mixer. If the sound system does not work properly after you have plugged in the above device, you can run the snddevices command to establish the correct device file.
Since a large number of device aliases need to be set up for ALSA to work properly, here is an example of / etc/modules.conf, which can automatically configure the ESS Solo1 sound card. The settings of other ALSA devices are basically the same as this sound card.
# set the main setting number of the ALSA device, which is fixed to 116,
Alias char-major-116 snd
# set the main setting number of the OSS device, which is fixed to 14, which makes ALSA reuse OSS devices
Alias char-major-14 soundcore
# ALSA device alias
Alias sound-card-0 snd-card-es1938
# OSS device alias
Alias sound-slot-0 sound-card-0
# install different sound card services
Alias sound-service-0-0 snd-mixer-oss
Alias sound-service-0-1 snd-seq-oss
Alias sound-service-0-3 snd-pcm-oss
Alias sound-service-0-8 snd-seq-oss
Alias snd-minor-oss-12 snd-pcm-oss
# run the amixer command to turn on the sound output
Post-install snd-card-es1938 amixer-c 0 sset 'Master',0 100% unmute & & amixer-c 0 sset' PCM', 0 100% unmute
Thank you for reading this article carefully. I hope the article "how to configure a sound card in Linux" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.