分类:
2008-06-02 17:34:00
Are you sure it doesn't work? Try turning up the volume first -- both on your speakers and in Linux. You can use the volume control in your desktop panel, or the sound mixer application in your applications menu, or run alsamixer or aumix in a terminal.
adduser your_user_name audio
id
uid=1000(rajulocal) gid=1000(rajulocal) groups=4(adm),20(dialout),24(cdrom),
25(floppy),29(audio),40(src),44(video),114(plugdev),1000(rajulocal)
One common case is when you find that your card starts working after you do a manual alsaconf. This usually happens because you have several sound cards and the audio is being output on the card you don't want. The solution consists of manually defining the default card. To solve this you could see this alsa
lspci -v This generates lot of output. Browse through the output to find sections about "audio controllers" -- your sound card(s). For example on my system, when I run the above command, I get
0000:00:1f.5 Multimedia audio controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller (rev 02)Be sure to post this piece of information if you are asking a question about sound problems on a mailing list such as debian-user.
Subsystem: Toshiba America Info Systems: Unknown device ff00
Flags: bus master, medium devsel, latency 0, IRQ 185
I/O ports at 1c00 [size=256]
I/O ports at 18c0 [size=64]
Memory at c0000c00 (32-bit, non-prefetchable) [size=512]
Memory at c0000800 (32-bit, non-prefetchable) [size=256]
Capabilities:
If a program gives vague error messages, installing an app which gives more detailed error messages may help. For example, xmms gives very good error messages. When you get it all working, please update this page with the specific error messages & symptoms to help other people who search for these details.
This error may occur is the sound system is not fully configured.
An [error] will occur, if the [user] does not have [permission] to use the [audio] device:
The user is required to be a member of the audio [group] to use the audio [device].
The /dev/dsp device is used by audio programs that use the open sound system. If the system is using udev, it may be necessary to install the oss-compat package:
apt-get install oss-compat
If the audio mixer application is reporting that no mixer is available, or gives an error:
It is necessary to load the snd-pcm-oss module.
Note to developers: it's helpful to remember that the easier it is to get an app running, particularly the first time after installation, the more likely the user is to start & keep on using your app. There are plenty of alternative apps! Having more detailed error messages (see xmms below) is extremely helpful to newer, as well as more experienced, users. Even experienced users won't be knowledgable in every speciality. OK, if you're developing an audio app, your audio infrastructure will already be set up, so looking here and in will give a good indication of alternative things which may need setting up before the app will work fully. It helps to have both detailed error messages in the code and guidance in the FAQ, etc. Some useful example messages to distinguish: device /dev/x does not exist; device /dev/dsp does not have write permissions for this user; device /dev/dsp is in use by another program ...
A: See "Install packages .." in
A: is free. It is the standard in Linux >= 2.6. It has features such as full duplex, digital I/O etc. (It also has an "OSS emulation" feature to support programs that still use the older OSS interface.)
A: is free, It was the standard in Linux <= 2.4. "OSS" refers to a tradditional, standard way for audio to work on various Unix-like systems. It has the poorest support for soundcards and features, and has various limitations that ALSA doesn't.
Q: Is there an introductory article anywhere that can explain what all the various pieces of the Linux sound "architecture" are; that is, what drivers are needed, what is a mixer and how many of those do I need installed, what is (Open Sound System), what is , etc?
A: I'll introduce "The Book of Linux Sound and Music" to you, which is by No Starch Press and Linux Journal Press. It contains much useful information about Linux sound and music. --
is the Open Sound System, which has been in the Kernel for ages already. It works with sound modules, and there was a non-free extension to support soundcards whose support in the kernel was weak.
supports more hardware. How difficult it is to set up depends if your card supports plug and play or if you have to find the irqs by hand. I had the kernel-source installed and then alsa-source, compiling it with the kernel-package. That worked brillantly for my .
Q: How do I check which of OSS (Open Sound System), ALSA, & etc. I have installed?
A1: At least on Sarge lsmod shows "oss" in the module names when using OSS.
A1: kernel mode emulation:
apt-get install alsa-ossand you can add snd_pcm_oss and snd_mixer_oss to /etc/modules to load them at boottime
modprobe snd_pcm_oss
modprobe snd_mixer_oss
A2: userspace mode emulation:
apt-get install alsa-oss
aoss program_to_use_oss
A: Run one of these commands in a terminal
/bin/fuser -v /dev/dsp
/usr/sbin/lsof | grep dsp
/usr/sbin/lsof | grep pcm
A: First enable OSS emulation if you are using ALSA (See above). set the volume fairly low and as root, just send any file to the audio device. In a terminal run:
cat anyfile >/dev/dsp
cat anyfile >/dev/dsp1
if the file is a WAV file that happens to be in the right internal format, it might play correctly:
cat example.wav >/dev/dsp
Q: xmms gives a dialog box with:
Please check that:
1. You have the correct output plugin selected.
2. No other programs is/are blocking the soundcards.
3. Your soundcard is configured properly.
A: run it from a terminal, where it gives more helpful detailed messages eg:
WARNING: oss_open(): Failed to open audio device (/dev/dsp): Device or resource busy
WARNING: oss_open(): Failed to open audio device (/dev/dsp): Permission denied
See or the next question for details on fixing these.
Q: mpg321 gives:
libao - OSS cannot set rate to 44100
Can't find a suitable libao driver. (Is device in use?)
Q: mpg321 gives:
Can't find a suitable libao driver. (Is device in use?), or
Can't open libao driver with device /dev/dsp (is device in use?)
A: See "use 'adduser. .. audio' " in
A: If you installed a 2.6 kernel for the first time, consider what smokybobo wrote at . In addition, consider running 'alsamixer' and unmute the channels you need and set them to an appropriate volume. Make sure you set the option to saving the mixer settings across reboots in the alsa-base configuration. At that point, e.g. XMMS should work with the output plugin ALSA. If you are running KDE and you want it's sound effects as well, you may have to tell it's aRts server explicitely to use ALSA. In that case, you'll have to set the output plugin for XMMS to aRts. --
A: I had installed a kernel image of 2.6.5-4 and found that coupled with the direction in the link above and an upgrade to 2.6.6-1, I had ALSA support in all of my applications. Also, if you have multiple capture cards (bttv, other tuner, radio card), try "cat /proc/asound/cards" to verify that your capture card is where you expect it. For my system, the tv card registered as card 0 and a SB Live! came up as card 1. --
Related Links: