![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
Ubuntu 9.10 is out!!!
When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu. The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely. |
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 | ||||
|
Chocolate-Covered Ubuntu Beans
![]() Join Date: Nov 2005
Location: Ireland
Beans: 2,302
Ubuntu 9.04 Jaunty Jackalope
|
HOWTO: PulseAudio Fixes & System-Wide Equalizer Support
Overview: Note 1. Karmic & Jaunty users: If you have dist-upgraded from a previous release, I recommend that you follow the guide to remove obsolete configuration. If you have performed a clean installation, follow the guide only if you are experiencing issues. Note 2. Jaunty & Intrepid users: due to a bug in the ALSA libraries, your PCM mixer may occasionally become muted or reset to 0% volume. If you cannot hear sound - or hear a faint crackling - refer to Part A, Step 6. Note 3: OSSv4 users: PulseAudio does not support OSSv4, so this guide will serve no purpose to you. If you have chosen to install OSSv4 and experience issues, you should seek guidance within the threads dedicated to OSSv4. I do not recommend users to install OSSv4 due to compatibility and support issues. Note 4: Kubuntu users: Don't follow this guide - PulseAudio isn't used in your distribution. PulseAudio is an advanced sound server which has been included in Ubuntu (i.e. the standard GNOME version) since the release of Hardy Heron (8.04). Unfortunately, Hardy shipped with a suboptimal configuration of PulseAudio which has resulted in users experiencing various problems, ranging from sporadic crashes in Firefox to sound mixing being completely broken. PulseAudio in Intrepid should work by default, but it is quite possible that your configuration is suboptimal. For more information, refer to the FAQ below. For best results, I recommend all users who are interested in PulseAudio to install the latest release - Karmic Koala (9.10). The developers have done an excellent job with PulseAudio integration and configuration in this release - enough to make this guide virtually obsolete. When you are ready to follow this guide, this is all you need to know: Hardy users: Follow Part A & B. Intrepid users: Follow Part A & C. Jaunty users: Follow Part A. Karmic users: Follow Part A. Additionally:
The most common queries are answered here. Q. What exactly is PulseAudio? A. From the homepage: Quote:
Q. PulseAudio? Bleh! I don't want it on my system. A. Well... tough! PulseAudio is already installed and active on Hardy and Intrepid by default; it replaces ESD (ESound Daemon) for system sounds, and most of Ubuntu's default applications already use it (Totem, Rhythmbox, and any other applications using the GStreamer framework). Although some high-profile applications support PulseAudio natively (such as VLC and mplayer), most applications use plain ALSA or OSS output, and thus don't have native PulseAudio support. Q. If PulseAudio is already installed, why do I need this guide? A. While PulseAudio has been installed by default since Hardy Heron (8.04), we dropped the ball when it came to the configuration part. A quote from the main PulseAudio developer, Lennart Pöttering: Quote:
PulseAudio includes ALSA plugins (within the package "libasound2-plugins") which are designed make regular ALSA applications remap audio to the PulseAudio server (and thus avoid mixing problems as described above). Unfortunately, Hardy Heron shipped without these plugins enabled (or even installed) by default, which is causing many, many audio mixing issues for users. To compound the problem, the version of these PulseAudio ALSA plugins in the Hardy repositories do not function correctly, so updated versions are required for ALSA applications to work correctly with PulseAudio. By following this guide, your system will be configured to use these PulseAudio ALSA plugins for Hardy users (and updated versions of necessary packages will get installed from my PPA). Although Intrepid has these plugins installed and configured by default, following this guide is still worthwhile because a) it will ensure you have a clean PulseAudio configuration, and b) you will hopefully gain a better understanding of how PulseAudio works. Q. I'm glad to hear these issue are fixed in Intrepid, but why the hell aren't they fixed in Hardy already? A. The simplest answer to this question is: complexity. Hardy is a LTS (Long Term Support) release, and there is a very strict policy towards updates (SRU; even the most trivial of bugfixes are entered into a code review). In order to fix Hardy, many components will require updates and changes, including but not limited to: libflashsupport, ia32-libs, pulseaudio, libasound2, libasound2-plugins, flashplugin-nonfree, nspluginwrapper... Up until the last moment of Hardy's development cycle, the PulseAudio ALSA plugins weren't functioning correctly, and Flash 9 absolutely would not work without the "evil" libflashsupport library (I say evil, because it caused frequent random crashes in Firefox) - and so it wasn't possible to enact the required changes before the final release. It's possible now, but there would require a huge amount of effort to review and apply these changes. Q. I followed your guide and PulseAudio still doesn't work! A. Refer to Appendix A and provide the requested information in your post. Q. I can't get Skype/WINE/an OSS application/XYZ working correctly with PulseAudio, what can I do? A. Some applications require some extra configuration, and some applications don't work with PulseAudio - please refer to Appendix C for information on specific applications. Q. Where can I find the appropriate bug reports related to these issues? A. If you click on a step number it will link to the appropriate bug report, if one exists. Part A: Common instructions (Hardy, Intrepid, Jaunty & Karmic) All users must must follow the steps in this section to guarantee a fully working PulseAudio configuration. 1. Backup (and then delete) your previous configuration files: Code:
$ mkdir ~/pulse-backup && cp -r ~/.pulse ~/.asound* /etc/asound.conf /etc/pulse -t ~/pulse-backup/ $ rm -r ~/.pulse ~/.asound* $ sudo rm /etc/asound.conf Note: Don't worry if some of these files did not exist on your system. 2. Ensure you have the necessary PulseAudio libraries and configuration utilities installed: Code:
$ sudo apt-get install libasound2-plugins padevchooser libsdl1.2debian-pulseaudio Code:
$ sudo apt-get remove --purge libflashsupport flashplugin-nonfree-extrasound 4. (Karmic users - please skip this step, it's not necessary). Open System/Preferences/Sound. In the Devices section, ensure that all "Sound playback" options are set to Autodetect. Set the "Sound capture" item to "ALSA", or the appropriate hardware definition. Close the application when you're finished. Note: Choosing PulseAudio for sound capture may result in crashes, so you are advised to choose the "direct" ALSA device instead. 5. Open the PulseAudio Volume Control application ("pavucontrol", or you can launch "Applications/Sound & Video/PulseAudio Device Chooser" and select Volume Control from this applet's menu). In the Output Devices section you will see a listing of the playback devices available on your system. Right-click on the entry that you desire to be made the default playback device on your system and enable the "Default" checkmark. Similarly, navigate to Input Devices, then right-click on the device you wish to set as your default input device (microphone), and ensure the "Default" setting is checked. Close the application when you're finished. Note: If you are greeted with the error "Connection failed: Connection refused", manually launch PulseAudio before opening the PulseAudio Volume Control application: Code:
$ pulseaudio & pavucontrol Code:
$ alsamixer -Dhw 7. Continue to Part B if you are running Hardy Heron (8.04), or Part C if you are running Intrepid Ibex (8.10). If you are running Karmic Koala (9.10) or Jaunty Jackalope (9.04), you're finished - log out and back in for changes to take effect! Part B: Hardy Heron (8.04) Follow the steps in this section only if you are running the Hardy Heron release. Disclaimer: My PPA contains the necessary packages backported from Intrepid for: PulseAudio, ALSA, Flash 10 and nspluginwrapper. If you upgrade to a newer distribution, or Hardy receives official updates for any of these packages, you will not experience any issues. 0. 64-bit users only: Install "getlibs" and some extra 32-bit libraries that are required for Flash 10 & Skype to function properly: Code:
$ wget http://www.boundlesssupremacy.com/Cappy/getlibs/getlibs-all.deb && sudo dpkg -i getlibs-all.deb && rm getlibs-all.deb $ sudo getlibs -p libnss3-1d libnspr4-0d libcurl3 libasound2-plugins Code:
$ gksudo gedit /etc/apt/sources.list Code:
# PulseAudio Fixes - http://ubuntuforums.org/showthread.php?t=789578 deb http://ppa.launchpad.net/psyke83/ubuntu hardy main deb-src http://ppa.launchpad.net/psyke83/ubuntu hardy main Code:
$ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 16AE4E77 && sudo apt-get update && sudo apt-get dist-upgrade Code:
$ asoundconf set-pulseaudio 4. Log out & back in for changes to take effect! Part C: Intrepid Ibex (8.10) Follow the steps in this section only if you are running the Intrepid Ibex release. Disclaimer: Currently there are no updated packages for Intrepid in my PPA (except for an updated nspluginwrapper package for i386 users). I have decided to keep this step in the guide in case I upload any important updates that will not make it into the official repositories. I will never upload any "risky" packages (i.e. highly untested backports), only upgrades that seem compelling and relatively stable. 1. Edit /etc/apt/sources.list: Code:
$ gksudo gedit /etc/apt/sources.list Code:
# PulseAudio Fixes - http://ubuntuforums.org/showthread.php?t=789578 deb http://ppa.launchpad.net/psyke83/ubuntu intrepid main deb-src http://ppa.launchpad.net/psyke83/ubuntu intrepid main Code:
$ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 16AE4E77 && sudo apt-get update && sudo apt-get dist-upgrade Appendix A - General Troubleshooting This section will outline some general troubleshooting steps you can perform to help identify your problem, and the information I need to help with your issues:
If you require assistance with a particular application - or simply cannot get PulseAudio to work - provide the following information:
This appendix will explain some of the more advanced/technical features of PulseAudio. Q. Where are the PulseAudio configuration utilities? A. Providing you've followed this guide, you can gain access to all the utilities by launching "Applications/Sound & Video/PulseAudio Device Chooser". The applet's icon will appear in your notificiation tray - left-click to see the options. The main applications you will want to check are the Manager (to see the current server status) and Volume Control (to manipulate the volume and stream settings). Note: Please don't mess with any of the options until you have established a working configuration by following this guide - otherwise it'll be a nightmare to isolate your problem. Q. How can I tell if an application is using PulseAudio successfully? A. The application will give you result "A" from the troubleshooting steps of Appendix A. Q. How can I change the default playback and/or recording device for my system? A. Refer to Part A, Step 5. Q. Is it possible to change to a different playback and/or recording device for an individual application? A. Yes. Launch the desired application and play some sound (or begin recording), and open the PulseAudio Volume Control. Click the Playback or Recording tab (depending on which you want to change) and right-click on the desired application's entry. Choose the option "Move Stream..." and select the desired output device. Note: The volume level, sink (playback) and source (recording) settings will be saved automatically for every application you run, so PulseAudio should remember your settings. If you wish to view or delete these saved settings, they're stored in the file "~/.pulse/volume-restore.table". Q. If I plug in my USB/Bluetooth headset, my external speakers no longer work! A. This is normal behaviour, as PulseAudio supports "hotplugging" of audio devices. If you plug in a new device, PulseAudio may choose it as the default sink (audio device). Also see Part A, Step 5. Q. PulseAudio is working correctly, but I am noticing some stuttering on my system. Is there anything I can do to help? A. Edit the file /etc/pulse/daemon.conf: Code:
$ gksudo gedit /etc/pulse/daemon.conf Code:
default-fragments = 8 default-fragment-size-msec = 10 Note 1: you must restart pulseaudio for any configuration changes to take effect. Note 2: If your system was stuttering in versions of Ubuntu prior to Hardy, then you could be suffering from an ALSA kernel issue - these instructions probably won't help. Q. I'm unhappy about the audio quality / CPU usage of PulseAudio. How do I change this? A. For the record, PulseAudio should offer superior quality audio playback than ALSA's by default, as PulseAudio uses a higher quality audio resampler. This also means that PulseAudio may use more CPU usage compared to ALSA, unfortunately. If you wish to change the resampler: Edit /etc/pulse/daemon.conf: Code:
$ gksudo gedit /etc/pulse/daemon.conf Code:
resample-method = speex-float-1 Quote:
This appendix will explain how to configure specific applications that may require manual configuration to work with PulseAudio. OSS applications: You need to launch the application using the "padsp" wrapper. For more information, see "man padsp". Skype: The latest release of Skype has native PulseAudio support, and does not require special configuration. If you are using an older version, continue reading. Open Skype's Options, then go to Sound Devices. You need to set "Sound Out" and "Ringing" to the "pulse" device, and set "Sound In" to the hardware definition of your microphone. For example, my laptop's microphone is defined as "plughw:I82801DBICH4,0". WINE: Open the Wine Configuration application ("winecfg"). On the Audio tab, choose the ALSA driver, and leave everything else to default. If your sound stutters, choose the OSS driver instead, and use the "padsp" wrapper to launch the wine executable (via the terminal, or edit your shortcuts). Audacity (Intrepid users only, version in later distributions work correctly): From the PerfectSetup page: Quote:
Note: Many of the instructions on the PerfectSetup page are either outdated, too distro-agnostic to work on Ubuntu, or have been obsoleted by the fixes in this guide. You should ignore the advice for: ALSA applications, Flash, ESOUND, GNOME, GStreamer Applications, SDL, and Skype. Appendix D: System-Wide Equalizer In this section, we will configure PulseAudio to use equalized output, which is especially useful for laptops speakers which have very poor frequency response. If your sound is "tinny" or distorted at high ranges, then this will most likely enhance the quality of your audio. Warning 1: Karmic users - please ignore these instructions and use the PulseAudio Equalizer Script instead. Warning 2: Do not attempt to set up the equalizer until you have followed the other parts of this guide and verified that PulseAudio works correctly using "unmodified" output. Warning 3: The equalizer may not work on 64 bit systems, as extra 32-bit libraries could be required. If it doesn't work, simply revert the changes you made. Warning 4: The equalizer currently does not work for Jaunty users, as there seems to be missing LADSPA plugins in the libasound2-plugins package. I'm investigating the issue currently, though you may want to test the Karmic equalizer script (mentioned above). 1. Install the required LADSPA plugins and tools: Code:
$ sudo apt-get install swh-plugins ladspa-sdk Code:
$ gedit ~/.asoundrc Code:
pcm.equalized {
type plug
slave.pcm "equalizer";
}
pcm.equalizer {
type ladspa
# The output from the EQ can either go direct to a hardware device
# (if you have a hardware mixer, e.g. SBLive/Audigy) or it can go
# to the software mixer shown here.
slave.pcm "plughw"
#slave.pcm "plug:dmix"
# Sometimes you may need to specify the path to the plugins,
# especially if you've just installed them. Once you've logged
# out/restarted this shouldn't be necessary, but if you get errors
# about being unable to find plugins, try uncommenting this.
path "/usr/lib/ladspa"
plugins [
{
label mbeq
id 1197
input {
#this setting is here by example, edit to your own taste
#bands: 50hz, 100hz, 156hz, 220hz, 311hz, 440hz, 622hz, 880hz,
# 1250hz, 1750hz, 2500hz, 5000hz, 10000hz, 20000hz
#range: -70 to 30
controls [ -1 -1 -1 -1 -5 -10 -20 -17 -12 -7 -6 -5 -5 0 0 ]
}
}
]
}
Note 2: If you have multiple sound cards, the section of this text marked in blue may need to be modified slightly. If you have problems, ask in the thread. 3. Edit /etc/pulse/default.pa: Code:
$ gksudo gedit /etc/pulse/default.pa Code:
### Load audio drivers statically (it's probably better to not load ### these drivers manually, but instead use module-hal-detect -- ### see below -- for doing this automatically) #load-module module-alsa-sink #load-module module-alsa-source device=hw:1,0 #load-module module-oss device="/dev/dsp" sink_name=output source_name=input Code:
load-module module-alsa-sink device=equalized 4. Log out & back in for changes to take effect! That's all folks! Changelog Any notable changes to the guide will be mentioned here. v4.0 - 13/11/08 - Complete re-write. Completely reorganized; Hardy & Intrepid guides merged. Yes, I know it's ridiculously long v4.1 - 16/11/08 - Corrected some errors in the equalizer section, re-arranged guide to avoid problems with enabling ALSA plugins. Hardy users who followed the earlier revision of this guide: please run "asoundconf set-pulseaudio" to resolve any issues. v4.2 - 23/11/08 - Added a step in Part C; due to a bug in Intrepid, users should verify their PCM volume is not muted. v4.3 - 11/12/08 - Added a small note for OSSv4 users & information regarding PulseAudio-compatible Audacity packages available for testing. v4.4 - 06/01/09 - Fixed typo in Skype configuration section. v4.5 - 21/03/09 - Added note for Jaunty users. v4.6 - 01/04/09 - Note added to Part A, Step 4. v4.7 - 23/04/09 - Added Jaunty support. v4.8 - 12/05/09 - Note added regarding the equalizer for Jaunty users. v4.9 - 19/05/09 - Added instructions to add repository key, to prevent authentication warnings. v5.0 - 13/07/09 - Moved PCM zero-volume workaround to Part A. v5.1 - 24/10/09 - Updated instructions for Karmic users. Last edited by psyke83; 2 Weeks Ago at 08:46 PM.. |
||||
|
|
|
|
|
#2 |
|
May the Ubuntu Be With You!
![]() Join Date: Dec 2006
Beans: 1,555
Ubuntu 8.10 Intrepid Ibex
|
Re: HOWTO: PulseAudio Fixes & System-Wide Equalizer Support (Hardy Heron)
That's a rather interesting way of doing it. I've never thought of using this method for a system-wide equalizer. However, I'd like to point out a few things regarding your default.pa.txt.
This line "load-module module-alsa-sink device=equalized" conflicts with this line "load-module module-hal-detect" on systems where sound mixing is not supported. It doesn't matter if the equalized device's pcm is plug:dmix or plughw:#,#. Once module-alsa-sink is loaded, whether it uses dmix or plughw, Pulseaudio (using plughw) or dmix will grab the sound card all for itself. Then when module-hal-detect tries to load another ALSA sink from HAL, it'll just fail miserably. Pulseaudio will fail to start. This is because module-hal-detect always tries to load a plughw sink. My suggestion is that you comment out the line loading module-hal-detect. That's the only way it will work for those without hardware sound mixing. |
|
|
|
|
|
#3 |
|
First Cup of Ubuntu
![]() Join Date: Apr 2006
Beans: 1
|
Re: HOWTO: PulseAudio Fixes & System-Wide Equalizer Support (Hardy Heron)
thanks for this. pulse audio was unusable for me until I installed the new kernel. smooth as now, bro.
|
|
|
|
|
|
#4 |
|
Has an Ubuntu Drip
![]() |
Re: HOWTO: PulseAudio Fixes & System-Wide Equalizer Support (Hardy Heron)
When reinstalling libflashsupport and flashplugin-nonfree, I got a dependency error because it relied on the older version of libasound2-dev. Simply downloading the new dev package to go along with the new libasound2 fixed this.
Might want to mention that.
__________________
Linux User #460341 || Ubuntu User #19510 || Unanswered Posts Team |
|
|
|
|
|
#5 | |
|
Chocolate-Covered Ubuntu Beans
![]() Join Date: Nov 2005
Location: Ireland
Beans: 2,302
Ubuntu 9.04 Jaunty Jackalope
|
Re: HOWTO: PulseAudio Fixes & System-Wide Equalizer Support (Hardy Heron)
Quote:
My audio card does not support hardware audio mixing*, and PulseAudio works perfectly with concurrent audio streams here. Additionally, I do believe that other applications can get exclusive access through "pasuspender" (not recommended, but useful for people with specific needs) or perhaps by accident due to the "suspend-on-idle" module. I have a Philips VOIP080 USB Travel Phone; when I connect it while using the configuration in this HOWTO (i.e. with module-hal-detect active), PulseAudio picks up the phone, plays "startup3.wav" from the sample cache to signify it is working, and changes the default ALSA source to the phone's MIC. If I try to connect the phone without "module-hal-detect" loaded, PulseAudio does not detect its presence at all. If you can propose a solution that allows hotplugging to work, then please let me know. * Before PulseAudio was available, I used a LADSPA plugin via "asound.conf" and it was impossible to play concurrent sounds using "plughw", I was forced to use "plug:dmix" (which seemed to cause distorted output via the LADSPA definition). Now it is possible to mix sounds with PulseAudio using "plughw", which indications that a) my sound card doesn't support hardware mixing, and b) this configuration indeed works fine for people who do not have hardware mixing available on their sound cards. Last edited by psyke83; May 12th, 2008 at 07:54 AM.. |
|
|
|
|
|
|
#6 |
|
Way Too Much Ubuntu
![]() Join Date: Oct 2007
Location: Portugal
Beans: 230
|
Re: HOWTO: PulseAudio Fixes & System-Wide Equalizer Support (Hardy Heron)
Hi. I've followed this guide to sole a couple of problems I'm experiencing, but I may have done some damgae and I'm not sure how to roll back...
Installing the Debian packages has removed my flash, wine and teamspeak. I've tried apt-get --reinstall, but I get an error saying that the package cannot be downloadad. Using apt-get remove, says I also have to remove tons of stuff, like ubuntu-desktop. I'll tery and get the hardy deb packages and install them, to see if that solves my problem... And I tought this was looking really promissing! BTW, using AMD64 here. |
|
|
|
|
|
#7 |
|
Way Too Much Ubuntu
![]() Join Date: Oct 2007
Location: Portugal
Beans: 230
|
Re: HOWTO: PulseAudio Fixes & System-Wide Equalizer Support (Hardy Heron)
OK, so getting the .deb packages fou hardy did made the trick. I'm back with wine, teamspeak and flash. I didn't get back to ground 0 tough. The part about the quick flash did work for me. (strangely it was the part that was supposed not to work with AMD64).
Edit: Well, not so good after all. I seem to have lost sound altogether. Pulse audio manager does show up an output when I try to play sounds. Using native ALSA applications also gives me sound. I guess this means that it's an issue with the output of pulse audio... any ideas on how to solve this? Thanks Last edited by Stunts; May 12th, 2008 at 11:15 AM.. |
|
|
|
|
|
#8 | |
|
Chocolate-Covered Ubuntu Beans
![]() Join Date: Nov 2005
Location: Ireland
Beans: 2,302
Ubuntu 9.04 Jaunty Jackalope
|
Re: HOWTO: PulseAudio Fixes & System-Wide Equalizer Support (Hardy Heron)
Quote:
To revert the changes made, do the following: Code:
$ sudo apt-get update $ sudo apt-get remove --purge nspluginwrapper libflashsupport swh-plugins libasound2-dev $ sudo dpkg -P --force-depends pulseaudio $ sudo apt-get install pulseaudio libasound2/hardy libasound2-plugins/hardy ubuntu-desktop flashplugin-nonfree --reinstall $ sudo rm /etc/asound.conf Last edited by psyke83; May 12th, 2008 at 01:23 PM.. |
|
|
|
|
|
|
#9 | |
|
Chocolate-Covered Ubuntu Beans
![]() Join Date: Nov 2005
Location: Ireland
Beans: 2,302
Ubuntu 9.04 Jaunty Jackalope
|
Re: HOWTO: PulseAudio Fixes & System-Wide Equalizer Support (Hardy Heron)
Quote:
|
|
|
|
|
|
|
#10 |
|
Way Too Much Ubuntu
![]() Join Date: Oct 2007
Location: Portugal
Beans: 230
|
Re: HOWTO: PulseAudio Fixes & System-Wide Equalizer Support (Hardy Heron)
Hi and thanks for the quick answer.
I'll try and do what you suggest. I'm crossing my fingers. =-) I just thought I could reinstall wine, etc after the changes, when I did it the first time. Here we go again! =-) Edit: I have reread the guide with the changes, but: Code:
sudo apt-get install -f Don't get me wrong, I think this how to is very good, and simple to follow. I'll try again and see what I get. Last edited by Stunts; May 12th, 2008 at 02:27 PM.. |
|
|
|
| Bookmarks |
| Tags |
| audio, howto, pulseaudio, skype |
| Thread Tools | |
| Display Modes | |
|
|