Sound Problems: Difference between revisions

From KDE UserBase Wiki
(New page: KDE 3.x uses the aRts sound system. This system has a number of benefits, but also seems to cause a lot of problems for users. Here are some tips which might help to solve your problem, o...)
 
No edit summary
 
(36 intermediate revisions by 9 users not shown)
Line 1: Line 1:
KDE 3.x uses the aRts sound system.  This system has a number of benefits, but also seems to cause a lot of problems for users. Here are some tips which might help to solve your problem, or at least to localize it:
<languages />
<translate>


* Check that sound is working independently of aRts: Make sure artsd isn&#039;t running (run &#039;killall artsd&#039;) and then run up xmms or some other program that isn&#039;t part of KDE. If that program doesn&#039;t play sound, then your general sound setup is probably broken and it&#039;s not a KDE problem.
==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.


* Try playing sound with &#039;artsplay /path/to/some/soundfile&#039; (this time with artsd running). Any error messages there might be useful in pointing you in the right direction.
<!--T:2-->
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.


* If artsplay will play .wav files but not .mp3 and .ogg files, you might be having problems with akode.If you compiled KDE yourself, run &#039;make uninstall&#039; in kdemultimedia/akode and then &#039;make install&#039; in kdemultimedia/mpeglib_artsplug . If you are using KDE packages from your distribution, try asking them about the problem.
<!--T:3-->
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
{{Input|1= mplayer -ao help}}


* Try setting the aRts output method to &#039;oss&#039;. In the Control Center, go to Sound &amp; Multimedia-&gt;Sound System and then to the Hardware tab. Under &#039;Select the audio device&#039;, choose &#039;Open Sound System&#039;. If you&#039;re running alsa, this will use the OSS emulation, which may give better results (or worse ones, YMMV).
<!--T:4-->
Here are some specific issues that you may meet.


* Running &#039;artsd -l 0&#039; (that&#039;s dash-ell-zero) will give a lot of debug output, some of which might help you to diagnose the problem.
===KDE 4 uses the wrong sound device.=== <!--T:5-->


* If you don&#039;t want artsd to block your sound device, you can tell it to use the &#039;null&#039; output device: In Control Center, go to Sound &amp; Multimedia-&gt;Sound System and on the Hardware page, select the output device &quot;No audio input/output&quot;. Note that this will prevent most KDE apps from playing sound at all, although no error messages will be shown.
<!--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.


* To get System Event Application sounds going For Fedora 3 with all the latest patches as at 11th Feb 2005  try setting the exernal player to /usr/bin/artsplay using the &quot;Player Settings&quot; button onthe page  Sound &amp; Multimedia-&gt;Sound System-&gt; System Notifications.
===Devices from /etc/asound.conf or ~/.asoundrc are not listed.=== <!--T:7-->


* If you don&#039;t hear KDE notifications, you can try to change the internal player in Control Center-&gt;System Notifications-&gt;Reproducer Settings, check &quot;external player&quot; and type &quot;artsplay&quot; or &quot;play&quot;
<!--T:8-->
[[Special:myLanguage/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 {
    show on
    description "Name to display for the device"
}
}}
 
<!--T:10-->
Here is a complete example that adds a new volume control named Phonon to your mixer:
 
<!--T:11-->
{{Input|1= 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=== <!--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
 
=== Low maximum volume with PulseAudio on KDE or pavucontrol shows more than 100% of volume, but KMix goes only up to 100% === <!--T:24-->
 
<!--T:25-->
Entering the following command
 
<!--T:26-->
{{Input|1=kwriteconfig -file kmixrc -group Global -key VolumeOverdrive -type bool true}}
 
<!--T:27-->
and restart [[Special:myLanguage/KMix|KMix]], '''KMix''' goes to 153% of volume .
 
<!--T:28-->
This is the same of edit <tt>$HOME/.kde/share/config/kmixrc</tt> and add:
 
<!--T:29-->
{{Input|1=[Global]
    VolumeOverdrive=true
}}
 
<!--T:30-->
References: {{Bug|297959}}, {{Bug|309597}}, [https://bugzilla.redhat.com/show_bug.cgi?id=704839 RHB#704839].
 
===  Can't mute event (system) sounds and other KMix strange problems === <!--T:31-->
 
<!--T:32-->
When '''KMix''' show strange bars, etc. or events sound bar doesn't work .
 
<!--T:33-->
Now with KDE 4.10+, '''PulseAudio''' is enabled by user session and we can check that with the following command
 
<!--T:34-->
{{Input|1=<nowiki>ps -ef |</nowiki> grep pulseau}}
 
<!--T:35-->
Example of output:
 
<!--T:36-->
{{Output|1=sergio    1880    1  0 12:15 ?        00:04:01 /usr/bin/pulseaudio --start --log-target=syslog}}
 
<!--T:37-->
Entering the following commands
 
<!--T:38-->
{{Input|1=killall kmix
rm -rf .pulse/
rm -rf .pulse-cookie
rm -rf .config/pulse/
kmix}}
 
<!--T:39-->
fixed this issue. Old configurations of '''PulseAudio''', can make this issue, if we create a new user, we won't have this issue .
 
<!--T:23-->
{{KDE3}}
 
===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:</menuchoice>  Set this to 1 second.
 
===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.
 
===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]
 
===You want to use an External Sound Card === <!--T:21-->
 
<!--T:22-->
See [[Special:myLanguage/Sound_Problems/External_Sound_Cards|the External Sound Card page]]
 
<!--T:20-->
[[Category:System]]
[[Category:Multimedia]]
</translate>

Latest revision as of 23:32, 13 January 2014

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

Low maximum volume with PulseAudio on KDE or pavucontrol shows more than 100% of volume, but KMix goes only up to 100%

Entering the following command

kwriteconfig -file kmixrc -group Global -key VolumeOverdrive -type bool true

and restart KMix, KMix goes to 153% of volume .

This is the same of edit $HOME/.kde/share/config/kmixrc and add:

[Global] 
    VolumeOverdrive=true

References: bug #297959, bug #309597, RHB#704839.

Can't mute event (system) sounds and other KMix strange problems

When KMix show strange bars, etc. or events sound bar doesn't work .

Now with KDE 4.10+, PulseAudio is enabled by user session and we can check that with the following command

ps -ef | grep pulseau

Example of output:

sergio    1880     1  0 12:15 ?        00:04:01 /usr/bin/pulseaudio --start --log-target=syslog

Entering the following commands

killall kmix
rm -rf .pulse/
rm -rf .pulse-cookie 
rm -rf .config/pulse/
kmix

fixed this issue. Old configurations of PulseAudio, can make this issue, if we create a new user, we won't have this issue .


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

You want to use an External Sound Card

See the External Sound Card page