Sound Problems: Difference between revisions

From KDE UserBase Wiki
(Markup edit)
(Marked this version for translation)
Line 2: Line 2:
<translate>
<translate>


==Understanding sound==
==Understanding sound== <!--T:1-->
In order to understand KDE sound, you have to understand Linux sound (this chapter assumes you are running your KDE on Linux). There are two types of sound systems that run on Linux: [http://en.wikipedia.org/wiki/Advanced_Linux_Sound_Architecture ''ALSA''] and [http://en.wikipedia.org/wiki/Open_Sound_System ''OSS'']. Both provide their own sound card drivers. ALSA only runs on Linux, OSS runs on many UNIX systems. ALSA allows several applications to access the sound card at the same time, OSS does not. OSS provides a device for sound output. This device can only be accessed by one application at a time. To decrease confusion, ALSA emulates OSS and also provides a device as interface to the sound card. As well ALSA as OSS calls the device for the sound card /dev/dsp usually. '''PulseAudio''', in some distros, provides another layer above these.  Its job is to handle multiple streams, so that, for instance, you can receive a message notification at the same time as listening to music.
In order to understand KDE sound, you have to understand Linux sound (this chapter assumes you are running your KDE on Linux). There are two types of sound systems that run on Linux: [http://en.wikipedia.org/wiki/Advanced_Linux_Sound_Architecture ''ALSA''] and [http://en.wikipedia.org/wiki/Open_Sound_System ''OSS'']. Both provide their own sound card drivers. ALSA only runs on Linux, OSS runs on many UNIX systems. ALSA allows several applications to access the sound card at the same time, OSS does not. OSS provides a device for sound output. This device can only be accessed by one application at a time. To decrease confusion, ALSA emulates OSS and also provides a device as interface to the sound card. As well ALSA as OSS calls the device for the sound card /dev/dsp usually. '''PulseAudio''', in some distros, provides another layer above these.  Its job is to handle multiple streams, so that, for instance, you can receive a message notification at the same time as listening to music.


<!--T:2-->
Usual sound problems are
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 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.
Line 10: Line 11:
* Different applications play sound using different devices.
* Different applications play sound using different devices.


<!--T:3-->
Solutions:
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  
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  
{{Input|1= mplayer -ao help}}
{{Input|1= mplayer -ao help}}


<!--T:4-->
Here are some specific issues that you may meet.
Here are some specific issues that you may meet.


===KDE 4 uses the wrong sound device.===
===KDE 4 uses the wrong sound device.=== <!--T:5-->


<!--T:6-->
That is not an error, but a configuration issue. To tell KDE 4 which soundcard to use (or prefer if available), open <menuchoice>System Settings</menuchoice> and go to <menuchoice>Multimedia</menuchoice> in the <menuchoice>General</menuchoice> tab.
That is not an error, but a configuration issue. To tell KDE 4 which soundcard to use (or prefer if available), open <menuchoice>System Settings</menuchoice> and go to <menuchoice>Multimedia</menuchoice> in the <menuchoice>General</menuchoice> tab.


===Devices from /etc/asound.conf or ~/.asoundrc are not listed.===
===Devices from /etc/asound.conf or ~/.asoundrc are not listed.=== <!--T:7-->


<!--T:8-->
[[Glossary#Phonon|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.
[[Glossary#Phonon|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.


<!--T:9-->
{{Input|1= hint {
{{Input|1= hint {
     show on
     show on
Line 30: Line 36:
}}
}}


<!--T:10-->
Here is a complete example that adds a new volume control named Phonon to your mixer:
Here is a complete example that adds a new volume control named Phonon to your mixer:


<!--T:11-->
{{Input|1= pcm.softvolPhonon {
{{Input|1= pcm.softvolPhonon {
     type softvol
     type softvol
Line 49: Line 57:
}}
}}


===After an update, PulseAudio gives you very low volume===
===After an update, PulseAudio gives you very low volume=== <!--T:12-->


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


{{KDE3}}
{{KDE3}}
===You are using KDE 3 and you keep losing sound.  Sometimes it works, sometimes it doesn't.===
===You are using KDE 3 and you keep losing sound.  Sometimes it works, sometimes it doesn't.=== <!--T:14-->


<!--T:15-->
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 <menuchoice>kcontrol -> Sound & Multimedia</menuchoice>.  Towards the bottom of the <menuchoice>General</menuchoice> tab there is a setting for <menuchoice>Auto-suspend if idle after:</menucohice>  Set this to 1 second.
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 <menuchoice>kcontrol -> Sound & Multimedia</menuchoice>.  Towards the bottom of the <menuchoice>General</menuchoice> 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===
===You have multimedia keys but KDE doesn't recognise them=== <!--T:16-->


<!--T:17-->
[http://www.lingnu.com/en/howto/58-kdevolume.html This link] has a clear description of what one user did to make his Volume-up and Volume-down keys work.
[http://www.lingnu.com/en/howto/58-kdevolume.html 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)===
===You tried all of the above but it still doesn't work (Ubuntu variants only)=== <!--T:18-->


<!--T:19-->
Try replacing your sound card.  If you still don't hear sound, check out [https://help.ubuntu.com/community/OpenSound this Ubuntu Community page]
Try replacing your sound card.  If you still don't hear sound, check out [https://help.ubuntu.com/community/OpenSound this Ubuntu Community page]


<!--T:20-->
[[Category:System]]
[[Category:System]]
[[Category:Multimedia]]
[[Category:Multimedia]]
</translate>
</translate>

Revision as of 16:19, 18 September 2010

Understanding sound

In order to understand KDE sound, you have to understand Linux sound (this chapter assumes you are running your KDE on Linux). There are two types of sound systems that run on Linux: ALSA and OSS. Both provide their own sound card drivers. ALSA only runs on Linux, OSS runs on many UNIX systems. ALSA allows several applications to access the sound card at the same time, OSS does not. OSS provides a device for sound output. This device can only be accessed by one application at a time. To decrease confusion, ALSA emulates OSS and also provides a device as interface to the sound card. As well ALSA as OSS calls the device for the sound card /dev/dsp usually. PulseAudio, in some distros, provides another layer above these. Its job is to handle multiple streams, so that, for instance, you can receive a message notification at the same time as listening to music.

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