声音问题

From KDE UserBase Wiki
Revision as of 15:36, 19 February 2011 by Qiii2006 (talk | contribs) (Created page with "常见的问题有 * 你不能播放声音,因为你正在使用一个程序试着访问声卡设备/dev/dsp,但是这个设备已经被另外一个程序占用了。 * 你...")

理解音效

为了理解KDE的音效,你必须了解Linux声音系统(这个章节假定你是在Linux上跑KDE)。有两种类型的声音系统运行在Linux上: ALSAOSS。两者都提供他们自己的声卡驱动。ALSA只能在Linux上用,OSS可以在多种UNIX系统上用。ALSA允许多个程序同时访问声卡,OSS 不行。OSS提供一个设备来输出声音。这个设备在一个时间只能被一个程序访问。为了减少混乱,ALSA模拟了OSS,也提供一个设备作为声卡的接口。通常 ALSA和OSS一样将声卡的设备命名为/dev/dsp。在某些发行版中用的 PulseAudio,提供了上述那些之上的另一层(layer)。它的任务是处理多个音频流,以便,举个例子,你可以在听音乐的同时接受到消息通知。

常见的问题有

  • 你不能播放声音,因为你正在使用一个程序试着访问声卡设备/dev/dsp,但是这个设备已经被另外一个程序占用了。
  • 你不能使用全系统设置用的混音器kmix来调节使用声卡设备/dev/dsp的某一个程序的音量。
  • 不同的程序用不同的设备播放声音。

Solutions: There is no silver bullet solving all your sound problems. The solution depends on the application you use to play sound. As an example, you can use mplayer with ALSA and OSS. For more info, see mplayer's documentation by calling

mplayer -ao help

Here are some specific issues that you may meet.

KDE 4 uses the wrong sound device.

That is not an error, but a configuration issue. To tell KDE 4 which soundcard to use (or prefer if available), open System Settings and go to Multimedia in the General tab.

Devices from /etc/asound.conf or ~/.asoundrc are not listed.

Phonon uses a function introduced in ALSA 1.0.14 to find those devices. To make this function list your entry you need to add a name hint. E.g.

hint {
     show on
     description "Name to display for the device"
 }

Here is a complete example that adds a new volume control named Phonon to your mixer:

pcm.softvolPhonon {
     type softvol
     slave.pcm "default:CARD=0"
     control {
         name "Phonon"
         card 0
     }
     min_dB -51.0
     max_dB 0.0
     resolution 100
     hint {
         show on
         description "My Soundcard with extra Volume Control"
     }
 }

After an update, PulseAudio gives you very low volume

PulseAudio has a 'normaliser' function which can cause this. To turn it off, set flat-volumes = no in /etc/pulse/daemon.conf


You are using KDE 3 and you keep losing sound. Sometimes it works, sometimes it doesn't.

KDE 3.x uses the aRts sound system. In earlier versions there were a number of problems, but in recent years the only problem remaining seems to be that aRts hangs on to the sound system when it has finished with it. To cure this, use kcontrol -> Sound & Multimedia. Towards the bottom of the General tab there is a setting for Auto-suspend if idle after: Set this to 1 second.

You have multimedia keys but KDE doesn't recognise them

This link has a clear description of what one user did to make his Volume-up and Volume-down keys work.

You tried all of the above but it still doesn't work (Ubuntu variants only)

Try replacing your sound card. If you still don't hear sound, check out this Ubuntu Community page