Проблеми зі звуком

From KDE UserBase Wiki
Revision as of 16:37, 18 September 2010 by Yurchor (talk | contribs) (Created page with '==Основи роботи звуку== Щоб зрозуміти принципи роботи звуку у KDE, вам слід зрозуміти принципи робо...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Основи роботи звуку

Щоб зрозуміти принципи роботи звуку у KDE, вам слід зрозуміти принципи роботи звуку у Linux (у цій главі ми припускаємо, що KDE працює у середовищі Linux). У Linux можуть працювати дві основні системи роботи зі звуковими даними: ALSA і OSS. У обох цих систем є власні драйвери звукових карток. ALSA може працювати лише у Linux, OSS працює у багатьох системах UNIX. У ALSA передбачено одночасний доступ декількох програм до звукової картки, у OSS — ні. У OSS передбачено один пристрій для виведення звукових даних. У будь-який момент часу доступ до цього пристрою може мати лише одна програма. Щоб уникнути негараздів з роботою програм, ALSA імітує роботу OSS і також надає для доступу програм до звукової картки один файл пристрою. У ALSA і OSS цей спільний пристрій називається /dev/dsp. Над цими системами у деяких дистрибутивах передбачено надбудову — PulseAudio. Цей сервер призначено для обробки декількох потоків звукових даних, отже, наприклад, ви можете отримувати звукове сповіщення одночасно з відтворенням музичного твору.

Usual sound problems are

  • You cannot play sound because you are using an application that tries to access the sound device /dev/dsp, but this device is already in use by another application.
  • You cannot use the system-wide mixer kmix to adjust the volume of an application using the sound device /dev/dsp.
  • Different applications play sound using different devices.

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 <menuchoice>Auto-suspend if idle after:</menucohice> 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