https://wiki.archlinux.org/api.php?action=feedcontributions&user=C.m.brandenburg&feedformat=atomArchWiki - User contributions [en]2024-03-28T18:47:12ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Power_management/Suspend_and_hibernate&diff=400249Power management/Suspend and hibernate2015-09-17T13:18:09Z<p>C.m.brandenburg: Add note about needing to set `resume` and `resume_offset` kernel parameters before booting</p>
<hr />
<div>[[Category:Power management]]<br />
[[ja:サスペンドとハイバネート]]<br />
{{Related articles start}}<br />
{{Related|Uswsusp}}<br />
{{Related|TuxOnIce}}<br />
{{Related|systemd}}<br />
{{Related|pm-utils}}<br />
{{Related|hibernate-script}}<br />
{{Related|Power management}}<br />
{{Related articles end}}<br />
Currently there are three methods of suspending available: '''suspend to RAM''' (usually called just '''suspend'''), '''suspend to disk''' (usually known as '''hibernate'''), and '''hybrid suspend''' (sometimes aptly called '''suspend to both'''):<br />
<br />
* '''Suspend to RAM''' method cuts power to most parts of the machine aside from the RAM, which is required to restore the machine's state. Because of the large power savings, it is advisable for laptops to automatically enter this mode when the computer is running on batteries and the lid is closed (or the user is inactive for some time).<br />
<br />
* '''Suspend to disk''' method saves the machine's state into [[swap space]] and completely powers off the machine. When the machine is powered on, the state is restored. Until then, there is zero power consumption.<br />
<br />
* '''Suspend to both''' method saves the machine's state into swap space, but does not power off the machine. Instead, it invokes usual suspend to RAM. Therefore, if the battery is not depleted, the system can resume from RAM. If the battery is depleted, the system can be resumed from disk, which is much slower than resuming from RAM, but the machine's state has not been lost.<br />
<br />
There are multiple low level interfaces (backends) providing basic functionality, and some high level interfaces providing tweaks to handle problematic hardware drivers/kernel modules (e.g. video card re-initialization).<br />
<br />
== Low level interfaces ==<br />
<br />
Though these interfaces can be used directly, it is advisable to use some of [[#High level interfaces|high level interfaces]] to suspend/hibernate. Using low level interfaces directly is significantly faster than using any high level interface, since running all the pre- and post-suspend hooks takes time, but hooks can properly set hardware clock, restore wireless etc.<br />
<br />
=== kernel (swsusp) ===<br />
<br />
The most straightforward approach is to directly inform the in-kernel software suspend code (swsusp) to enter a suspended state; the exact method and state depends on the level of hardware support. On modern kernels, writing appropriate strings to {{ic|/sys/power/state}} is the primary mechanism to trigger this suspend.<br />
<br />
See [https://www.kernel.org/doc/Documentation/power/states.txt kernel documentation] for details.<br />
<br />
=== uswsusp ===<br />
<br />
The uswsusp ('Userspace Software Suspend') is a wrapper around the kernel's suspend-to-RAM mechanism, which performs some graphics adapter manipulations from userspace before suspending and after resuming.<br />
<br />
See main article [[Uswsusp]].<br />
<br />
=== tuxonice ===<br />
<br />
TuxOnIce is a fork of the kernel implementation of suspend/hibernate that provides kernel patches to improve the default implementation. It requires a custom kernel to achieve this purpose.<br />
<br />
See main article [[TuxOnIce]].<br />
<br />
== High level interfaces ==<br />
<br />
{{Note|The end goal of these packages is to provide binaries/scripts that can be invoked to perform suspend/hibernate. Actually hooking them up to power buttons or menu clicks or laptop lid events is usually left to other tools. To automatically suspend/hibernate on certain power events, such as laptop lid close or battery depletion percentage, you may want to look into running [[Acpid]].}}<br />
<br />
=== systemd ===<br />
<br />
[[systemd]] provides native commands for suspend, hibernate and a hybrid suspend, see [[Power management#Power management with systemd]] for details. This is the default interface used in Arch Linux.<br />
<br />
See [[Power management#Sleep hooks]] for additional information on configuring suspend/hibernate hooks. Also see {{ic|man systemctl}}, {{ic|man systemd-sleep}}, and {{ic|man systemd.special}}.<br />
<br />
=== pm-utils ===<br />
<br />
pm-utils is a set of shell scripts that encapsulate the backend's suspend/hibernate functionality. It comes with a set of pre- and post-suspend tweaks and various hooks to customize the process.<br />
<br />
See main article [[pm-utils]].<br />
<br />
== Hibernation ==<br />
<br />
In order to use hibernation, you need to create a [[swap]] partition or file. You will need to point the kernel to your swap using the {{ic|1=resume=}} kernel parameter, which is configured via the boot loader. You will also need to add the ''resume'' [[mkinitcpio#HOOKS|hook]] to the configuration file of the [[Wikipedia:initrd|initramfs]] generator, [[mkinitcpio]]. This tells the kernel to attempt resuming from the specified swap in early userspace. These three steps are described in detail below.<br />
<br />
=== About swap partition/file size ===<br />
<br />
Even if your swap partition is smaller than RAM, you still have a big chance of hibernating successfully. According to [https://www.kernel.org/doc/Documentation/power/interface.txt kernel documentation]:<br />
<br />
: ''{{ic|/sys/power/image_size}} controls the size of the image created by the suspend-to-disk mechanism. It can be written a string representing a non-negative integer that will be used as an upper limit of the image size, in bytes. The suspend-to-disk mechanism will do its best to ensure the image size will not exceed that number. However, if this turns out to be impossible, it will try to suspend anyway using the smallest image possible. In particular, if "0" is written to this file, the suspend image will be as small as possible. Reading from this file will display the current image size limit, which is set to 2/5 of available RAM by default.''<br />
<br />
You may either decrease the value of {{ic|/sys/power/image_size}} to make the suspend image as small as possible (for small swap partitions), or increase it to possibly speed up the hibernation process.<br />
<br />
=== Required kernel parameters ===<br />
<br />
The kernel parameter {{ic|1=resume=''swap_partition''}} has to be used. Either the name the kernel assigns to the partition or its [[UUID]] can be used as {{ic|''swap_partition''}}. For example:<br />
<br />
* {{ic|1=resume=/dev/sda1}}<br />
* {{ic|1=resume=UUID=4209c845-f495-4c43-8a03-5363dd433153}}<br />
* {{ic|1=resume=/dev/mapper/archVolumeGroup-archLogicVolume}} -- example if using LVM<br />
<br />
Generally, the naming method used for the {{ic|resume}} parameter should be the same as used for the {{ic|root}} parameter.<br />
<br />
The configuration depends on the used [[boot loader]], refer to [[Kernel parameters]] for details.<br />
<br />
==== Hibernation into swap file ====<br />
<br />
{{Warning|[[Btrfs#Swap file|Btrfs]] does not support swap files. Failure to heed this warning may result in file system corruption. While a swap file may be used on Btrfs when mounted through a loop device, this will result in severely degraded swap performance.}}<br />
<br />
Using a swap file instead of a swap partition requires an additional kernel parameter {{ic|1=resume_offset=''swap_file_offset''}}.<br />
<br />
The value of {{ic|''swap_file_offset''}} can be obtained by running {{ic|filefrag -v ''swap_file''}}, the output is in a table format and the required value is located in the first row of the {{ic|physical_offset}} column. For example:<br />
<br />
{{hc|# filefrag -v /swapfile|<nowiki><br />
Filesystem type is: ef53<br />
File size of /swapfile is 4294967296 (1048576 blocks of 4096 bytes)<br />
ext: logical_offset: physical_offset: length: expected: flags:<br />
0: 0.. 0: 38912.. 38912: 1: <br />
1: 1.. 22527: 38913.. 61439: 22527: unwritten<br />
2: 22528.. 53247: 899072.. 929791: 30720: 61440: unwritten<br />
...<br />
</nowiki>}}<br />
<br />
In the example the value of {{ic|''swap_file_offset''}} is {{ic|38912}}.<br />
<br />
{{Tip|The value of {{ic|''swap_file_offset''}} can also be obtained by running {{ic|swap-offset ''swap_file''}}. The ''swap-offset'' binary is provided by package {{AUR|uswsusp-git}}.}}<br />
<br />
{{Note|<br />
* The {{ic|resume}} kernel parameter specifies the device of the partition that contains the swap file, not swap file itself! The parameter {{ic|resume_offset}} informs the system where the swap file starts on the resume device.<br />
* If using [[uswsusp]], then these two parameters have to be provided in {{ic|/etc/suspend.conf}} via the keys {{ic|resume device}} and {{ic|resume offset}}.<br />
* The {{ic|resume}} and/or {{ic|resume_offset}} kernel parameters are not used merely for resuming but also for suspending. This means you cannot use a swap file to hibernate until after you've rebooted using the new {{ic|resume}} and {{ic|resume_offset}} kernel parameters. However, you may use [[uswsusp]] to get around this limitation and immediately use a new swap file for hibernating without the reboot step between creating the swap file and using it to hibernate. <br />
}}<br />
<br />
=== Configure the initramfs ===<br />
<br />
* When an [[initramfs]] with the {{ic|base}} hook is used, which is the default, the {{ic|resume}} hook is required in {{ic|/etc/mkinitcpio.conf}}. Whether by label or by UUID, the swap partition is referred to with a udev device node, so the {{ic|resume}} hook must go ''after'' the {{ic|udev}} hook. This example was made starting from the default hook configuration:<br />
<br />
:{{bc|1=HOOKS="base udev '''resume''' autodetect modconf block filesystems keyboard fsck"}}<br />
<br />
:Remember to [[Mkinitcpio#Image creation and activation|rebuild the initramfs]] for these changes to take effect.<br />
<br />
:{{Note|[[LVM]] users should add the {{ic|resume}} hook after {{ic|lvm2}}.}}<br />
<br />
* When an initramfs with the {{ic|systemd}} hook is used, a resume mechanism is already provided, and no further hooks need to be added.<br />
<br />
== Troubleshooting ==<br />
<br />
=== ACPI_OS_NAME ===<br />
<br />
You might want to tweak your '''DSDT table''' to make it work. See [[DSDT]] article<br />
<br />
=== VAIO Users ===<br />
<br />
Add acpi_sleep=nonvs kernel flag to your loader, and you are done!<br />
<br />
=== Suspend/hibernate doesn't work ===<br />
<br />
There have been many reports about the screen going black without easily viewable errors or the ability to do anything when going into and coming back from suspend and/or hibernate. These problems have been seen on both laptops and desktops. This is not an official solution, but switching to an older kernel, especially the LTS-kernel, will probably fix this.<br />
<br />
=== Wake-on-LAN ===<br />
<br />
If [[Wake-on-LAN]] is active, the network interface card will consume power even if the computer is hibernated.</div>C.m.brandenburghttps://wiki.archlinux.org/index.php?title=PulseAudio&diff=399925PulseAudio2015-09-14T21:38:36Z<p>C.m.brandenburg: minor grammar fixes</p>
<hr />
<div>[[Category:Sound]]<br />
[[cs:PulseAudio]]<br />
[[es:PulseAudio]]<br />
[[fr:PulseAudio]]<br />
[[it:PulseAudio]]<br />
[[ja:PulseAudio]]<br />
[[pt:PulseAudio]]<br />
[[ru:PulseAudio]]<br />
[[tr:PulseAudio]]<br />
[[zh-CN:PulseAudio]]<br />
{{Related articles start}}<br />
{{Related|PulseAudio/Examples}}<br />
{{Related|PulseAudio/Troubleshooting}}<br />
{{Related articles end}}<br />
[[Wikipedia:PulseAudio|PulseAudio]] is a sound server commonly used by desktop environments like [[GNOME]] or [[KDE]]. It serves as a proxy to sound applications using existing kernel sound components like [[ALSA]] or [[OSS]]. Since ALSA is included in Arch Linux by default, the most common deployment scenarios include PulseAudio with ALSA.<br />
<br />
== Installation ==<br />
<br />
* Required package: {{Pkg|pulseaudio}}<br />
* Optional GTK GUIs: {{Pkg|paprefs}} and {{Pkg|pavucontrol}}<br />
* Optional volume control via mapped keyboard keys: {{AUR|pulseaudio-ctl}}<br />
* Optional console (CLI) mixers: {{Pkg|ponymix}} and {{AUR|pamixer-git}}<br />
* Optional console (curses) mixer: {{AUR|pulsemixer-git}}<br />
* Optional web volume control: [https://github.com/Siot/PaWebControl PaWebControl]<br />
* Optional system tray icon: {{AUR|pasystray-git}}<br />
* Optional KDE4 plasma applet: {{Pkg|kdemultimedia-kmix}} and {{AUR|kdeplasma-applets-veromix}}{{Broken package link|{{aur-mirror|kdeplasma-applets-veromix}}}} (If KMix/Veromix fail to connect to PulseAudio at boot you may need to edit {{ic|/etc/pulse/client.conf}} to include {{ic|autospawn &#61; yes}} instead of {{ic|autospawn &#61; no}}.)<br />
* Optional KF5 plasma applet: {{Pkg|kmix}} and {{Pkg|plasma-pa}}<br />
* If you want to use Bluetooth Headsets or other Bluetooth Audio Devices together with PulseAudio see the [[Bluetooth headset]] Article.<br />
{{Note|Some confusion can be made between [[ALSA]] and PulseAudio. ALSA both includes a Linux kernel component with sound card drivers, and a userspace component, {{ic|libalsa}}. [http://www.alsa-project.org/main/index.php/Download] PulseAudio only builds on the kernel component, but offers compability with {{ic|libalsa}} through {{Pkg|pulseaudio-alsa}}. [http://www.freedesktop.org/wiki/Software/PulseAudio/FAQ/#index14h3]}}<br />
<br />
=== PulseAudio modules ===<br />
<br />
Some PulseAudio modules have been [https://www.archlinux.org/news/pulseaudio-split/ split] from the main package and must be installed separately if needed.<br />
<br />
== Configuration ==<br />
<br />
=== Configuration files ===<br />
<br />
{{Merge|PulseAudio/Configuration|Configuration should stay in the main article, so the linked page should be merged here. Split [[#Troubleshooting]] instead if this page is found too long.|section=Abandoned draft}}<br />
By default, PulseAudio is configured to automatically detect all sound cards and manage them. It takes control of all detected ALSA devices and redirect all audio streams to itself, making the PulseAudio daemon the central configuration point. The daemon should work mostly out of the box, only requiring a few minor tweaks. <br />
<br />
PulseAudio will first look for configuration files in home directory {{ic|~/.config/pulse}}, then in system wide {{ic|/etc/pulse}}.<br />
<br />
PulseAudio runs as a server daemon that can run either system-wide or on per-user basis using a client/server architecture. The daemon by itself does nothing without its modules except to provide an API and host dynamically loaded modules. The audio routing and processing tasks are all handled by various modules. You can find a detailed list of all available modules at [http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/ Pulseaudio Loadable Modules]. To enable them you can just add a line {{ic|load-module <module-name-from-list>}} to {{ic|~/.config/pulse/default.pa}}.<br />
<br />
{{Tip|<br />
* It is strongly suggested not to edit system wide configuration files, but rather edit user ones. Create the {{ic|~/.config/pulse}} directory, then copy the system configuration files into it and edit according to your need.<br />
* Make sure you keep user configuration in sync with changes to the packaged files in {{ic|/etc/pulse/}}. Otherwise, PulseAudio may refuse to start due to configuration errors.<br />
* There is no need to add your user to audio group, as it uses [[udev]] and ''logind'' to dynamically give access to the currently "active" user}}<br />
<br />
==== daemon.conf ====<br />
<br />
Defines base settings like the default sample rates used by modules, resampling methods, realtime scheduling and various other settings related to the server process. These can not be changed at runtime without restarting the PulseAudio daemon. The defaults are sensible for most users.<br />
<br />
{| class="wikitable"<br />
|+ Notable configuration options<br />
! Option || Description<br />
|+<br />
| system-instance || Run the daemon as a system-wide instance. Highly discouraged as it can introduce security issues. Useful on (headless) systems that have no real local users. Defaults to {{ic|no}}.<br />
|+<br />
| resample-method || Which resampler to use when audio with incompatible sample rates needs to be passed between modules (e.g. playback of 96kHz audio on hardware which only supports 48kHz). The available resamplers can be listed with {{ic|$ pulseaudio --dump-resample-methods}}. Choose the best tradeoff between CPU usage and audio quality for the present use-case. {{Tip|In some cases PulseAudio will generate a high CPU load. This can happen when multiple streams are resampled (individually). If this is a common use-case in a workflow, it should be considered to create an additional sink at a matching sample rate which can then be fed into the main sink, resampling only once.}}<br />
|+<br />
| flat-volumes ||{{ic|flat-volumes}} scales the device-volume with the volume of the "loudest" application. For example, raising the VoIP call volume will raise the hardware volume and adjust the music-player volume so it stays where it was, without having to lower the volume of the music-player manually. Defaults to {{ic|yes}}. {{Warning|The default behavior can sometimes be confusing and some applications, unaware of this feature, can set their volume to 100% at startup, potentially blowing your speakers or your ears. To restore the classic (ALSA) behavior set this to {{ic|no}}.}}<br />
|+<br />
| default-fragments || Audio samples are split into multiple fragments of {{ic|default-fragment-size-msec}} each. The larger the buffer is, the less likely audio will skip when the system is overloaded. On the downside this will increase the overall latency. Increase this value if you have issues.<br />
|}<br />
<br />
==== default.pa ====<br />
<br />
This file is a startup script and is used to configure modules. It is actually parsed and read after the daemon has finished initializing and additionnal commands can be sent at runtime using {{ic|$ pactl}} or {{ic|$ pacmd}}. The startup script can also be provided on the command line by starting PulseAudio in a terminal using {{ic|$ pulseaudio -nC}}. This will make the daemon load the CLI module and will accept the configuration directly from the command line, and output resulting information or error messages on the same terminal. This can be useful when debugging the daemon or just to test various modules before setting them permanently on disk. The manual page is quite self-explanatory, please consult {{ic|man pulse-cli-syntax}} for the details of the syntax.<br />
<br />
{{tip|<br />
* Run {{ic|<nowiki>$ pacmd list-sinks|egrep -i 'index:|name:'</nowiki>}} to list available sinks. The present default sink is marked with an asterix.<br />
* Edit {{ic|~/.config/pulse/default.pa}} to insert/alter the set-default-sink command using the sink's name as the numbering cannot be guaranteed repeatable.<br />
}}<br />
<br />
==== {{ic|client.conf}} ====<br />
This is the configuration file read by every PulseAudio client application. It is used to configure runtime options for individual clients. It can be used to set and configure the default sink and source statically as well as allowing (or disallowing) clients to automatically start the server if not currently running.<br />
<br />
=== Configuration command ===<br />
<br />
The main command to configure a server during runtime is {{ic|$ pacmd}}. Run {{ic|$ pacmd --help}} for a list options, or just run {{ic|$ pacmd}} to enter the shell interactive mode and {{ic|Ctrl+d}} to exit. All modifications will immediately be applied.<br />
<br />
Once your new settings have been tested and meet your needs, edit the {{ic|default.pa}} accordingly to make the change persistent. See [[PulseAudio/Examples]] for some basic settings.<br />
<br />
{{Tip|leave the {{ic|load-module module-default-device-restore}} line in the {{ic|default.pa}} file untouched. It will allow you to restart the server in its default state, thus dismissing any wrong setting.}}<br />
<br />
It is important to understand that the "sources" (processes, capture devices) and "sinks" (sound cards, servers, other processes) accessible and selectable through PulseAudio depend upon the current hardware "Profile" selected. These "Profiles" are those ALSA "pcms" listed by the command {{ic|aplay -L}}, and more specifically by the command {{ic|pacmd list-cards}}, which will include a line "index:", a list beginning "profiles:", and a line "active profile: <...>" in the output, among other things.<br />
<br />
The "active profile" can be set with the command {{ic|pacmd set-card-profile INDEX PROFILE}}, with ''no'' comma separating INDEX and PROFILE, where INDEX is just the number on the line "index:" and a PROFILE name is everything shown from the beginning of any line under "profile:" to just ''before'' the colon and first space, as shown by the command {{ic|pacmd list-cards}}. For instance, {{ic|pacmd set-card-profile 0 output:analog-stereo+input:analog-stereo}}.<br />
<br />
It may be easier to select a "Profile" with a graphical tool like {{ic|pavucontrol}}, under the "Configuration" tab, or KDE System Settings, "Multimedia/Audio and Video Settings", under the "Audio Hardware Setup" tab. Each audio "Card", which are those devices listed by the command {{ic|aplay -l}}, or again by the command {{ic|pacmd list-cards}}, will have its own selectable "Profile". When a "Profile" has been selected, the then available "sources" and "sinks" can be seen by using the commands {{ic|pacmd list-sources}} and {{ic|pacmd list-sinks}}. Note that the "index" of the available sources and sinks will change each time a card profile is changed.<br />
<br />
The selected "Profile" can be an issue for some applications, especially the Adobe Flash players, typically {{ic|/usr/lib/mozilla/plugins/libflashplayer.so}} and {{ic|/usr/lib/PepperFlash/libpepflashplayer.so}}. Often, these Flash players will only work when one of the Stereo profiles is selected, and otherwise, will play video with no sound, or will simply "crash". When all else fails, you might try selecting a different profile.<br />
<br />
Of course, when configuring some variation of Surround Sound in PulseAudio, the appropriate Surround profile will have to be selected, before Surround Sound will work, or in order to do things like remap the speaker channels.<br />
<br />
== Running ==<br />
<br />
By default, PulseAudio will be started automatically by the first client program trying to connect to it. This is autospawn, and it is enabled by default in {{ic|/etc/pulse/client.conf}}.<br />
<br />
Since [http://www.freedesktop.org/wiki/Software/PulseAudio/Notes/6.0/ version 6.0], PulseAudio also offers systemd socket activation. To use it instead of the default autospawn, set {{ic|1=autospawn=no}} in {{ic|~/.pulse/client.conf}} and [[enable]] {{ic|pulseaudio.socket}} for the [[systemd/User]] instance. Make sure that the [[systemd/User#D-Bus|D-Bus service]] is configured properly.<br />
<br />
{{Note|Many [[desktop environments]] autostart programs based on [[Desktop entries#Autostart|desktop files]] in the {{ic|/etc/xdg/autostart/}} directory. In this case, PulseAudio will be launched automatically regardless of the autospawn/socket activation.}}<br />
<br />
See also [http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Running/ PulseAudio: Running].<br />
<br />
=== Starting manually ===<br />
<br />
PulseAudio can be manually started with:<br />
$ pulseaudio --start<br />
<br />
And stopped with:<br />
$ pulseaudio --kill<br />
<br />
== Back-end configuration ==<br />
<br />
=== ALSA ===<br />
<br />
Install {{Pkg|pulseaudio-alsa}} from the [[official repositories]]. This package contains the necessary {{ic|/etc/asound.conf}} for configuring ALSA to use PulseAudio.<br />
<br />
Also install {{Pkg|lib32-libpulse}} and {{Pkg|lib32-alsa-plugins}} if you run a x86_64 system and want to have sound for 32-bit [[multilib]] programs like Wine, Skype and Steam.<br />
<br />
To prevent applications from using ALSA's OSS emulation and bypassing PulseAudio (thereby preventing other applications from playing sound), make sure the module {{ic|snd_pcm_oss}} is not being loaded at boot. If it is currently loaded ({{ic|<nowiki>lsmod | grep oss</nowiki>}}), disable it by executing:<br />
# rmmod snd_pcm_oss<br />
<br />
==== ALSA/dmix without grabbing hardware device ====<br />
<br />
{{Note|This section describes alternative configuration, which is generally '''not''' recommended.}}<br />
<br />
You may want to use ALSA directly in most of your applications while still being able to use applications which require PulseAudio at the same time. The following steps allow you to make PulseAudio use dmix instead of grabbing ALSA hardware device.<br />
<br />
* Remove package {{Pkg|pulseaudio-alsa}}, which provides compatibility layer between ALSA applications and PulseAudio. After this your ALSA apps will use ALSA directly without being hooked by Pulse.<br />
<br />
* Edit {{ic|/etc/pulse/default.pa}}.<br />
:Find and uncomment lines which load back-end drivers. Add '''device''' parameters as follows. Then find and comment lines which load autodetect modules.<br />
load-module module-alsa-sink '''device=dmix'''<br />
load-module module-alsa-source '''device=dsnoop'''<br />
# load-module module-udev-detect<br />
# load-module module-detect<br />
<br />
* ''Optional:'' If you use {{Pkg|kdemultimedia-kmix}} you may want to control ALSA volume instead of PulseAudio volume:<br />
$ echo export KMIX_PULSEAUDIO_DISABLE=1 > ~/.kde4/env/kmix_disable_pulse.sh<br />
$ chmod +x ~/.kde4/env/kmix_disable_pulse.sh<br />
<br />
* Now, reboot your computer and try running ALSA and PulseAudio applications at the same time. They both should produce sound simultaneously.<br />
:Use {{Pkg|pavucontrol}} to control PulseAudio volume if needed.<br />
<br />
=== OSS ===<br />
<br />
There are multiple ways of making OSS-only programs output to PulseAudio:<br />
<br />
==== ossp ====<br />
<br />
Install {{Pkg|ossp}} package and start {{ic|osspd.service}}.<br />
<br />
==== padsp wrapper ====<br />
<br />
Programs using OSS can work with PulseAudio by starting it with padsp (included with PulseAudio):<br />
<br />
$ padsp OSSprogram<br />
<br />
A few examples:<br />
<br />
$ padsp aumix<br />
$ padsp sox foo.wav -t ossdsp /dev/dsp<br />
<br />
You can also add a custom wrapper script like this: <br />
<br />
{{hc|/usr/local/bin/OSSProgram|<nowiki><br />
#!/bin/sh<br />
exec padsp /usr/bin/OSSprogram "$@"<br />
</nowiki>}}<br />
<br />
Make sure {{ic|/usr/local/bin}} comes before {{ic|/usr/bin}} in your '''PATH'''.<br />
<br />
=== GStreamer ===<br />
<br />
Install {{Pkg|gst-plugins-good}}, or {{Pkg|gstreamer0.10-good-plugins}} if your intended program has a legacy [[GStreamer]] implementation.<br />
<br />
=== OpenAL ===<br />
<br />
OpenAL Soft should use PulseAudio by default, but can be explicitly configured to do so: {{hc|/etc/openal/alsoft.conf|2=drivers=pulse,alsa}}<br />
<br />
=== libao ===<br />
<br />
Edit the libao configuration file:<br />
{{hc|/etc/libao.conf|2=default_driver=pulse}}<br />
Be sure to remove the {{ic|1=dev=default}} option of the alsa driver or adjust it to specify a specific Pulse sink name or number. <br />
<br />
{{Note|You could possibly also keep the libao standard of outputting to the ''alsa'' driver and its default device if you install {{pkg|pulseaudio-alsa}} since the ALSA default device then '''is''' PulseAudio.}}<br />
<br />
== Equalizer ==<br />
<br />
{{Out of date|{{pkg|pulseaudio}}-6.0-2 shows an error when {{ic|module-dbus-protocol}} is to be loaded, see [[Talk:PulseAudio#DBus module]].}}<br />
<br />
PulseAudio has an integrated 10-band equalizer system. In order to use the equalizer do the following:<br />
<br />
Install {{Pkg|pulseaudio-equalizer}}:<br />
<br />
=== Load equalizer sink and dbus-protocol module ===<br />
<br />
$ pactl load-module module-equalizer-sink<br />
$ pactl load-module module-dbus-protocol<br />
<br />
=== GUI front-end ===<br />
<br />
run:<br />
<br />
$ qpaeq<br />
<br />
{{Note|If qpaeq has no effect, install {{pkg|pavucontrol}} and change "ALSA Playback on" to "FFT based equalizer on ..." while the media player is running.}}<br />
<br />
=== Load equalizer and dbus module on every boot ===<br />
<br />
Edit the {{ic|/etc/pulse/default.pa}} or {{ic|~/.config/pulse/default.pa}} file with your favorite editor and append the following lines:<br />
<br />
### Load the integrated PulseAudio equalizer and D-Bus module<br />
load-module module-equalizer-sink<br />
load-module module-dbus-protocol<br />
<br />
{{Note|The equalizer sink needs to be loaded after the master sink is already available.}}<br />
<br />
== Applications ==<br />
<br />
=== QEMU ===<br />
<br />
{{Merge|QEMU|QEMU is the most complex of the "applications" described in this section, merging to the main article would provide better context.}}<br />
<br />
The audio driver used by QEMU is set with the {{ic|QEMU_AUDIO_DRV}} environment variable:<br />
<br />
$ export QEMU_AUDIO_DRV=pa<br />
<br />
Run the following command to get QEMU's configuration options related to PulseAudio:<br />
<br />
$ qemu-system-x86_64 -audio-help | awk '/Name: pa/' RS=<br />
<br />
The listed options can be exported as environment variables, for example:<br />
<br />
{{bc|1=<br />
$ export QEMU_PA_SINK=alsa_output.pci-0000_04_01.0.analog-stereo.monitor<br />
$ export QEMU_PA_SOURCE=input<br />
}}<br />
<br />
{{Style|The following is not specific to PulseAudio.}}<br />
<br />
To get list of the supported emulation audio drivers<br />
$ qemu-system-x86_64 -soundhw help<br />
<br />
To use e.g. {{ic|ac97}} driver for the guest use the {{ic|-soundhw ac97}} commnad with QEMU.<br />
<br />
{{Note|Video graphic card emulated drivers for the guest machine may also cause a problem with the sound quality. Test one by one to make it work. You can list possible options with {{ic|<nowiki>qemu-system-x86_64 -h | grep vga</nowiki>}}.}}<br />
<br />
=== AlsaMixer.app ===<br />
<br />
Make {{AUR|alsamixer.app}} dockapp for the {{Pkg|windowmaker}} use pulseaudio, e.g.<br />
$ AlsaMixer.app --device pulse<br />
<br />
Here is a two examples where the first one is for ALSA and the other one is for pulseaudio. You can run multiple instances of it. Use the {{ic|-w}} option to choose which of the control buttons to bind to the mouse wheel.<br />
# AlsaMixer.app -3 Mic -1 Master -2 PCM --card 0 -w 1<br />
# AlsaMixer.app --device pulse -1 Capture -2 Master -w 2<br />
<br />
{{Note|It can use only those output sinks that set as default.}}<br />
<br />
=== XMMS2 ===<br />
<br />
Make it switch to pulseaudio output<br />
$ nyxmms2 server config output.plugin pulse<br />
and to alsa<br />
$ nyxmms2 server config output.plugin alsa<br />
To make xmms2 use a different output sink, e.g.<br />
$ nyxmms2 server config pulse.sink alsa_output.pci-0000_04_01.0.analog-stereo.monitor<br />
<br />
See also the official guide [https://xmms2.org/wiki/Using_the_application].<br />
<br />
=== KDE Plasma Workspaces and Qt4 ===<br />
<br />
PulseAudio will automatically be used by KDE/Qt4 applications. It is supported by default in the KDE sound mixer. For more information see the [http://www.pulseaudio.org/wiki/KDE KDE page in the PulseAudio wiki]. One useful tidbit from that page is to add {{ic|load-module module-device-manager}} to {{ic|/etc/pulse/default.pa}}.<br />
<br />
If the phonon-gstreamer backend is used for Phonon, GStreamer should also be configured as described in [[#GStreamer]].<br />
<br />
=== Audacious ===<br />
<br />
[[Audacious]] natively supports PulseAudio. In order to use it, set Audacious Preferences -> Audio -> Current output plugin to 'PulseAudio Output Plugin'.<br />
<br />
=== Java/OpenJDK 6 ===<br />
<br />
Create a wrapper for the Java executable using padsp as seen on the [[Java#Java_sound_with_PulseAudio|Java sound with PulseAudio]] page.<br />
<br />
=== Music Player Daemon (MPD) ===<br />
<br />
[http://mpd.wikia.com/wiki/PulseAudio configure] [[MPD]] to use PulseAudio. See also [[MPD/Tips and Tricks#MPD and PulseAudio]].<br />
<br />
=== MPlayer ===<br />
<br />
[[MPlayer]] natively supports PulseAudio output with the {{ic|-ao pulse}} option. It can also be configured to default to PulseAudio output, in {{ic|~/.mplayer/config}} for per-user, or {{ic|/etc/mplayer/mplayer.conf}} for system-wide:<br />
{{hc|/etc/mplayer/mplayer.conf|2=ao=pulse}}<br />
<br />
=== guvcview ===<br />
<br />
{{Pkg|guvcview}} when using the PulseAudio input from a [[Webcam]] may have the audio input suspended resulting in no audio being recorded. You can check this by executing:<br />
<br />
$ pactl list sources<br />
<br />
If the audio source is "suspended" then modifying the following line in {{ic|/etc/pulse/default.pa}} and changing:<br />
<br />
load-module module-suspend-on-idle<br />
to<br />
#load-module module-suspend-on-idle<br />
<br />
And then either restarting PulseAudio or your computer will only idle the input source instead of suspending it. guvcview will then correctly record audio from the device.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Keyboard volume control ===<br />
<br />
Map the following commands to your volume keys: {{ic|XF86AudioRaiseVolume}}, {{ic|XF86AudioLowerVolume}}, {{ic|XF86AudioMute}}<br />
<br />
To raise the volume:<br />
sh -c "pactl set-sink-mute 0 false ; pactl set-sink-volume 0 +5%"<br />
<br />
To lower the volume:<br />
sh -c "pactl set-sink-mute 0 false ; pactl -- set-sink-volume 0 -5%"<br />
<br />
To mute/unmute the volume:<br />
pactl set-sink-mute 0 toggle<br />
<br />
== Troubleshooting ==<br />
<br />
See [[PulseAudio/Troubleshooting]].<br />
<br />
== See also ==<br />
<br />
* [http://www.alsa-project.org/main/index.php/Asoundrc .asoundrc on ALSA wiki]<br />
* [http://www.pulseaudio.org/ PulseAudio official site]<br />
* [http://www.freedesktop.org/wiki/Software/PulseAudio/FAQ/ PulseAudio FAQ]</div>C.m.brandenburghttps://wiki.archlinux.org/index.php?title=PulseAudio&diff=178351PulseAudio2012-01-14T15:19:20Z<p>C.m.brandenburg: added note about setting equalizer as default sink when setting up qpaeq</p>
<hr />
<div>[[Category:Audio/Video (English)]]<br />
{{i18n|PulseAudio}}<br />
[[fr:PulseAudio]]<br />
<br />
'''PulseAudio''' is a general purpose sound server. For a list of features, see [[Wikipedia:PulseAudio#Features]].<br />
<br />
{{Tip|If you want to play sound from multiple applications, [[ALSA]] already provides a basic software mixer named "dmix" which is enabled by default.}}<br />
<br />
==Installation==<br />
To install PulseAudio:<br />
# pacman -S pulseaudio<br />
<br />
Optionally you can install some GTK front-ends for PulseAudio:<br />
# pacman -S paprefs pavucontrol<br />
<br />
==Running==<br />
If the D-Bus system daemon is not already running, start it:<br />
<br />
# /etc/rc.d/dbus start<br />
<br />
PulseAudio can be started with:<br />
$ pulseaudio --start<br />
<br />
Or if you use X11:<br />
$ start-pulseaudio-x11<br />
<br />
If you use KDE 4:<br />
$ start-pulseaudio-x11; start-pulseaudio-kde<br />
<br />
PulseAudio can be stopped with:<br />
$ pulseaudio --kill<br />
<br />
Note that in the case of most X11 environments, PulseAudio will be automatically started together with the X11 session. See the section on Desktop Environments for details.<br />
<br />
==Backend Configuration==<br />
<br />
===ALSA===<br />
For the applications that do not support PulseAudio and support ALSA it is '''recommended''' to install the PulseAudio plugin for ALSA. The simplest way of doing this is installing the pulseaudio-alsa package:<br />
<br />
# pacman -S pulseaudio-alsa<br />
<br />
This package also contains the necessary {{ic|/etc/asound.conf}} for configuring ALSA to use PulseAudio.<br />
<br />
If you are on Arch x86_64 and want to have sound for 32 bit programs (like Wine), make sure to install lib32-libpulse and lib32-alsa-plugins as well.<br />
<br />
To prevent applications from using ALSA's OSS emulation and bypassing Pulseaudio (thereby preventing other applications from playing sound), make sure the module {{ic|snd_pcm_oss}} is not in the {{ic|MODULES}} array in [[rc.conf|{{ic|/etc/rc.conf}}]]. If it's currently loaded you can disable it by executing:<br />
# rmmod snd_pcm_oss<br />
<br />
===OSS===<br />
There are multiple ways of making OSS-only programs play to PulseAudio:<br />
<br />
====osspd====<br />
This is the simplest method.<br />
<br />
Install '''ossp''' and start oospd with:<br />
/etc/rc.d/osspd start<br />
<br />
Afterwards, add it to DAEMONS in rc.conf.<br />
<br />
====padsp wrapper====<br />
If you have a program that uses OSS you can make it work with PulseAudio by starting it with padsp:<br />
$ padsp OSSprogram<br />
A few examples:<br />
$ padsp aumix<br />
$ padsp sox foo.wav -t ossdsp /dev/dsp<br />
<br />
If you prefer you can rename the program OSSprogram-bin and replace it with a script like this: <br />
{{hc|/usr/bin/OSSProgram|<nowiki><br />
#!/bin/sh<br />
if test -x /usr/bin/padsp; then<br />
exec /usr/bin/padsp /usr/bin/OSSprogram-bin "$@"<br />
else<br />
exec /usr/bin/OSSprogram "$@"<br />
fi<br />
</nowiki>}}<br />
<br />
===GStreamer===<br />
To make [[GStreamer]] use PulseAudio, execute {{ic|gstreamer-properties}} (part of ''gnome-media'' package) and select ''PulseAudio Sound Server'' in both Audio Input and Output. Alternatively, this can be done by setting the gconf variables {{ic|/system/gstreamer/0.10/default/audiosink}} to ''pulsesink'' and {{ic|/system/gstreamer/0.10/default/audiosrc}} to ''pulsesrc'':<br />
$ gconftool-2 -t string --set /system/gstreamer/0.10/default/audiosink pulsesink<br />
$ gconftool-2 -t string --set /system/gstreamer/0.10/default/audiosrc pulsesrc<br />
<br />
Some applications (like Rhythmbox) ignore the ''audiosink'' property, but rely instead on ''musicaudiosink'', which can't be configured using {{ic|gstreamer-properties}} but needs to be manually set using {{ic|gconf-editor}} or the {{ic|gconftool-2}}:<br />
$ gconftool-2 -t string --set /system/gstreamer/0.10/default/musicaudiosink pulsesink<br />
<br />
===OpenAL===<br />
OpenAL Soft should use PulseAudio by default, but can be explicitly configured to do so: {{hc|/etc/openal/alsoft.conf|2=drivers=pulse,alsa}}<br />
<br />
===libao===<br />
Edit the libao configuration file:<br />
{{hc|/etc/libao.conf|2=default_driver=pulse}}<br />
<br />
===PortAudio===<br />
The current binary of PortAudio in the community repository does not support PulseAudio and non-mmap audio devices. This can be remedied by building PortAudio from ABS and applying [http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/portaudio/current/SOURCES/portaudio-19-alsa_pulse.patch?revision=313993 a patch]{{Linkrot|2011|09|05}} to the sources.<br />
There is an [http://aur.archlinux.org/packages.php?ID=51583 AUR] package for portaudio with pulse support.<br />
<br />
===ESD===<br />
PulseAudio is a drop-in replacement for the enlightened sound daemon (ESD). While PulseAudio is running, ESD clients should be able to output to it without configuration.<br />
<br />
==Desktop Environments==<br />
<br />
===General X11===<br />
Start Pulseaudio after the X session using:<br />
$ start-pulseaudio-x11<br />
<br />
This will start PulseAudio and load the X11 plugins.<br />
<br />
Note that PulseAudio may already launch automatically. This is handled by either {{ic|/etc/X11/xinit/xinitrc.d/pulseaudio}} or the files in {{ic|/etc/xdg/autostart/}}.<br />
<br />
====X11 bell====<br />
To make PulseAudio play a sample when an X11 bell event happens (e.g. to make your terminal go 'Ping!' instead of 'Beep!'), add the following to<br />
{{ic|/etc/pulse/default.pa}}:<br />
# Prevent pulseaudio --start from failing when following commands fail (eg. when X is not active)<br />
.nofail<br />
load-sample-lazy x11-bell /usr/share/sounds/freedesktop/stereo/dialog-error.oga<br />
load-module module-x11-bell sample=x11-bell<br />
.fail<br />
<br />
You can also use another sample. {{ic|dialog-error.oga}} is provided by ''sound-theme-freedesktop''.<br />
<br />
===GNOME===<br />
As of GNOME 3, GNOME fully integrates with PulseAudio and no extra configuration is needed.<br />
<br />
===KDE 3===<br />
PulseAudio is ''not'' a drop-in replacement for aRts. If you use KDE 3, it is not currently possible to use PulseAudio. However note, recent versions of puleaudio may have eliminated the prohibition:<br />
<br />
See: http://www.pulseaudio.org/wiki/PerfectSetup KDE 3 uses the artsd sound server by default. However, artsd itself can be configured to use an Esound backend. Edit kcmartsrc (either in /etc/kde or /usr/share/config for global configuration or .kde/share/config to configure only one user) like this:<br />
<br />
[Arts]<br />
Arguments=\s-F 10 -S 4096 -a esd -n -s 1 -m artsmessage -c drkonqi -l 3 -f<br />
NetworkTransparent=true<br />
SuspendTime=1<br />
<br />
===KDE 4 and Qt4===<br />
If you've installed PulseAudio, it will be used by KDE4/Qt4 applications. For more information see the [http://www.pulseaudio.org/wiki/KDE KDE pages in the PulseAudio wiki].<br />
<br />
Additionally, a minimal KDE alternative to pavucontrol, the [https://aur.archlinux.org/packages.php?ID=43848 veromix plasmoid] is available in the AUR.<br />
<br />
===XFCE4===<br />
<br />
Applications running under XFCE4 can take advantage of Pulseaudio. To manage Pulseaudio settings you can use pavucontrol.<br />
<br />
==Applications==<br />
===Audacious===<br />
[[Audacious]] natively supports PulseAudio. In order to use it, in Audacious you should set Audacious Preferences -> Audio -> Current output plugin to 'PulseAudio Output Plugin'.<br />
<br />
===Flashplugin (x86_64 only)===<br />
If you are using [[Browser Plugins#Adobe Flash Player|Adobe Flash Player]] browser plugin from the [[Multilib_Project|multilib repository]] you need to install lib32-alsa-plugins and lib32-libcanberra-pulse, otherwise you will not be able to use other audio applications while using flashplugin.<br />
{{bc|<br />
# pacman -S lib32-alsa-plugins lib32-libcanberra-pulse<br />
}}<br />
<br />
===Java/OpenJDK===<br />
Create a wrapper for the java executable using padsp as seen on the [[Java#Java_sound_with_Pulseaudio|Java sound with Pulseaudio]] page.<br />
<br />
===Music Player Daemon (MPD)===<br />
You will need to [http://mpd.wikia.com/wiki/PulseAudio configure] [[MPD]] to use PulseAudio.<br />
<br />
On a headless box, run PulseAudio as the ''mpd'' user.<br />
On a desktop, running mpd as yourself and not using the ''mpd'' user is preferred.<br />
<br />
===MPlayer===<br />
[[MPlayer]] natively supports PulseAudio output with the "{{ic|-ao pulse}}" option. It can also be configured to default to PulseAudio output, in {{ic|~/.mplayer/config}} for per-user, or {{ic|/etc/mplayer/mplayer.conf}} for system-wide:<br />
{{hc|/etc/mplayer/mplayer.conf|2=ao=pulse}}<br />
<br />
===Skype (x86_64 only)===<br />
Install lib32-libpulse from [[Multilib_Project|multilib repository]], otherwise you will get the Error "Problem with Audio Playback" when trying to initiate a call.<br />
<br />
===VLC media player===<br />
[[VLC]] supports PulseAudio through native plugin. In order to use it, in VLC you should open '''Tools -> Preferences''' (or Ctrl-P) and on '''Audio''' tab change '''Output Type''' to '''Pulseaudio audio output'''.<br />
<br />
Also consider increasing '''Caching''' to 1000-1500 ms.: (This could solve some freezings/lags) change '''Show options''' to '''All''' and go to '''Input / Codecs -> Access Modules -> File'''<br />
<br />
===volume control===<br />
Adapt the variable 'device' to your sink-device listed in {{bc|pactl list}} and you can change the volume using this script.<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
device="alsa_output.pci-0000_00_14.2.analog-stereo"<br />
case "$1" in<br />
"up") # increase volume by 1000<br />
pacmd dump | awk --non-decimal-data '$1~/set-sink-volume/{if ($2~/'${device}'/) {if ($3+1000 > 65535) {system ("pactl "$1" '${device}' "65535)} else {system ("pactl "$1" '${device}' "$3+1000)}}}'<br />
;;<br />
"down") # decrease volume by 1000<br />
pacmd dump | awk --non-decimal-data '$1~/set-sink-volume/{if ($2~/'${device}'/) {if ($3-1000 < 0) {system ("pactl "$1" '${device}' "0)} else {system ("pactl "$1" '${device}' "$3-1000)}}}'<br />
;;<br />
"mute") # toggle mute<br />
pacmd dump|awk --non-decimal-data '$1~/set-sink-mute/{if ($2~/'${device}'/) {system ("pactl "$1" '${device}' "($3=="yes"?"no":"yes"))}}'<br />
;;<br />
esac<br />
</nowiki>}}<br />
<br />
*There is also a amixer like commandline mixer avaible {{AUR|pamixer-git}}.<br />
*For those wanting to map keyboard keys (such as volume up, volume down, mute, etc.), {{AUR|pulseaudio_ctl}} allows for this behavior.<br />
<br />
==Alternative configurations==<br />
===Surround sound systems===<br />
Many people have a surround card, but have speakers for just two channels, so PulseAudio cannot really default to a surround setup. To enable all the channels, edit {{ic|/etc/pulse/daemon.conf}}: uncomment the default-sample-channels line (i.e. remove the semicolon from the beginning of the line) and set the value to '''6''' if you have a ''5.1'' setup, or '''8''' if you have ''7.1'' setup etc.<br />
# Default<br />
default-sample-channels=2<br />
# For 5.1<br />
default-sample-channels=6<br />
# For 7.1<br />
default-sample-channels=8<br />
<br />
After doing the edit, you will need to restart Pulseaudio.<br />
<br />
====Splitting front/rear====<br />
<br />
You may want connect speakers to front analog output and headphones to rear output. It would be usefull to split front/rear to separate sinks. Add to default.pa:<br />
<br />
load-module module-remap-sink sink_name=speakers remix=no master=alsa_output.pci-0000_05_00.0.analog-surround-40 channels=2 master_channel_map=front-left,front-right channel_map=front-left,front-right<br />
load-module module-remap-sink sink_name=headphones remix=no master=alsa_output.pci-0000_05_00.0.analog-surround-40 channels=2 master_channel_map=rear-left,rear-right channel_map=front-left,front-right<br />
<br />
(replace alsa_output.pci-0000_05_00.0.analog-surround-40 to your sound card name that you got from 'pacmd list-sinks')<br />
<br />
After that you can switch player between speakers and headphones.<br />
<br />
===Advanced ALSA Configuration===<br />
In order for ALSA to use PulseAudio it needs a special {{ic|/etc/asound.conf}} (system wide settings) (recommended) or {{ic|~/.asoundrc}} (settings on a per user basis):<br />
{{hc|/etc/asound.conf|<nowiki><br />
pcm.pulse {<br />
type pulse<br />
}<br />
ctl.pulse {<br />
type pulse<br />
}<br />
pcm.!default {<br />
type pulse<br />
}<br />
ctl.!default {<br />
type pulse<br />
}<br />
</nowiki>}}<br />
<br />
If you omit the last two groups, Pulseaudio will not be used by default. You will then need to change the ALSA device to "pulse" in the applications that you use to make it work.<br />
<br />
{{Note|You can also simply install the package 'pulseaudio-alsa'}}<br />
<br />
====ALSA Monitor source====<br />
To be able to record from a monitor source (a.k.a. "What-U-Hear", "Stereo Mix"), use {{ic|pactl list}} to find out the name of the source in Pulseaudio (e.g. {{ic|alsa_output.pci-0000_00_1b.0.analog-stereo.monitor}}). Then add lines like the following to {{ic|/etc/asound.conf}} or {{ic|~/.asoundrc}}:<br />
pcm.pulse_monitor {<br />
type pulse<br />
device alsa_output.pci-0000_00_1b.0.analog-stereo.monitor<br />
}<br />
<br />
ctl.pulse_monitor {<br />
type pulse<br />
device alsa_output.pci-0000_00_1b.0.analog-stereo.monitor<br />
}<br />
<br />
Now you can select {{ic|pulse_monitor}} as a recording source.<br />
<br />
Alternatively, you can use pavucontrol to do this : make sure you've set up the display to "All input Devices", then select "Monitor of [your soundcard]" as the recording source.<br />
<br />
===HDMI output configuration===<br />
As outlined in ftp://download.nvidia.com/XFree86/gpu-hdmi-audio-document/gpu-hdmi-audio.html#_issues_in_pulseaudio unless your hdmi port is the first<br />
output you will not be able to have any audio when using certain graphics cards with hdmi audio support. This is because of a bug in pulseaudio where it will only select the first HDMI output on a device. A work around posted further down is to first find which hdmi output is working by using the aplay utility from alsa you will need to install the alsa-utils package<br />
# pacman -S alsa-utils<br />
<br />
The original title for this section indicated the problem is specific to nVidia cards. As seen in [https://bbs.archlinux.org/viewtopic.php?id=133222 this forum thread] other cards are affected as well. The rest of the section will use an nVidia card as a case-study but the solution should carry over for people using other affected cards.<br />
<br />
====Finding HDMI output====<br />
Then find the working output by listing the available cards<br />
# aplay -l<br />
<br />
sample output:<br />
**** List of PLAYBACK Hardware Devices ****<br />
card 0: NVidia [HDA NVidia], device 0: ALC1200 Analog [ALC1200 Analog]<br />
Subdevices: 1/1<br />
Subdevice #0: subdevice #0<br />
card 0: NVidia [HDA NVidia], device 3: ALC1200 Digital [ALC1200 Digital]<br />
Subdevices: 1/1<br />
Subdevice #0: subdevice #0<br />
card 1: NVidia_1 [HDA NVidia], device 3: HDMI 0 [HDMI 0]<br />
Subdevices: 1/1<br />
Subdevice #0: subdevice #0<br />
card 1: NVidia_1 [HDA NVidia], device 7: HDMI 0 [HDMI 0]<br />
Subdevices: 0/1<br />
Subdevice #0: subdevice #0<br />
card 1: NVidia_1 [HDA NVidia], device 8: HDMI 0 [HDMI 0]<br />
Subdevices: 1/1<br />
Subdevice #0: subdevice #0<br />
card 1: NVidia_1 [HDA NVidia], device 9: HDMI 0 [HDMI 0]<br />
Subdevices: 1/1<br />
Subdevice #0: subdevice #0<br />
<br />
====Testing for the correct card====<br />
Now that you have a list of the detected cards you need to test for which one is outputing to the tv/monitor<br />
# aplay -D plughw:1,3 /usr/share/sounds/alsa/Front_Right.wav<br />
<br />
where 1 is the card and 3 is the device substitute in the values listed from the previous section. If there is no audio then try substituting a different device (on my card I had to use card 1 device 7)<br />
<br />
====Manually configuring pulseaudio to detect the Nvidia HDMI====<br />
Now that you know which HDMI device is working you can force pulseaudio to use it<br />
<br />
Edit /etc/pulse/default.pa<br />
add the follwing line to the file<br />
# load-module module-alsa-sink device=hw:1,7<br />
<br />
where the 1 is the card and the 7 is the deivce that you found to work in the previous section<br />
<br />
restart pulse audio<br />
# killall pulseaudio<br />
<br />
open the sound settings manager, make sure that under the hardware tab the graphics cards HDMI audio is set to "Digital Stereo (HDMI) Output" ( My graphics card audio is called "GF100 High Definition Audio Controller"<br />
<br />
Then open the output tab there should now be two HDMI outputs for the graphics card test which one works by selecting one of them and then using a program to play audio i.e use vlc to play a movie if it doesn't work the select the other.<br />
<br />
===PulseAudio over network===<br />
One of PulseAudio's magnificent features is the possibility to stream audio from clients over TCP to the server running the PulseAudio daemon, allowing sound to be streamed through your LAN.<br />
<br />
To accomplish this, one needs to enable module-native-protocol-tcp, and copy the pulse-cookie to the clients. <br />
<br />
====TCP support (networked sound)====<br />
To enable the TCP module, add this to (or uncomment, if already there) {{ic|/etc/pulse/default.pa}}:<br />
load-module module-native-protocol-tcp<br />
<br />
Note: If you are having trouble connecting, use (on server)<br />
pacmd>> list-modules<br />
(you can even load modules from here!)<br />
<br />
====TCP support with anonymous clients====<br />
<br />
If you do not want to copy the pulse-cookies from clients, you can allow anonymous clients, by giving these parameters to module-native-protocol-tcp (again in {{ic|/etc/pulse/default.pa}}):<br />
<br />
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0/24 auth-anonymous=1<br />
<br />
Remember to change your LAN ip prefix should it be different from 192.168.0.0.<br />
<br />
====Zeroconf (Avahi) publishing====<br />
For the remote Pulseaudio server to appear in the PulseAudio Device Chooser ({{ic|padevchooser}}) you need to load the appropriate zeroconf modules as well as to enable Avahi. On both machines add {{ic|avahi-daemon}} to the DAEMONS in rc.conf.<br />
On the server, add {{ic|load-module module-zeroconf-publish}} to /etc/pulse/default.pa, on the client, add {{ic|load-module module-zeroconf-discover}} to /etc/pulse/default.pa. You can then redirect any stream or complete audio output to the remote pulseaudio server by selecting the appropriate sink.<br />
<br />
====Switching the PulseAudio server used by local X clients====<br />
To switch between servers on the client from within X, the {{ic|pax11publish}} command can be used. For example, to switch from the default server to the server at hostname foo:<br />
$ pax11publish -e -S foo<br />
<br />
Or to switch back to the default:<br />
$ pax11publish -e -r<br />
<br />
Note that for the switch to become apparent, the programs using Pulse must be restarted.<br />
<br />
====When everything else seems to fail====<br />
The following is a quickfix and NOT a permanent solution<br />
<br />
On the Server: <br />
$ paprefs <br />
Go to Network Access -> Enable access to local sound devices (Also check both 'Allow discover' and 'Don't require authentication').<br />
<br />
On the Client: <br />
$ export PULSE_SERVER=server.ip && mplayer test.mp3<br />
<br />
===PulseAudio through JACK the new new way===<br />
This configuration only works with jackdbus (JACK2 compiled with D-Bus support).<br />
load-module module-jackdbus-detect<br />
As described on the [http://trac.jackaudio.org/wiki/JackDbusPackaging Jack-DBUS Packaging] page:<br />
<br />
''Server auto-launching is implemented as D-Bus call that auto-activates JACK D-Bus service, in case it is not already started, and starts the JACK server. Correct interaction with PulseAudio is done using a D-Bus based audio card "acquire/release" mechanism. When JACK server starts, it asks this D-Bus service to acquire the audio card and PulseAudio will unconditionally release it. When JACK server stops, it releases the audio card that can be grabbed again by PulseAudio.''<br />
<br />
{{ic|module-jackdbus-detect.so}} dynamically loads and unloads module-jack-sink and module-jack-source when jackdbus is started and stopped.<br />
<br />
===PulseAudio through JACK the new way===<br />
The basic idea is that killing PulseAudio is bad idea, it may crash any apps using PulseAudio, and disrupt any audio playing<br />
<br />
the flow of how this setup works:<br />
<br />
# PulseAudio releases the sound card<br />
# JACK grabs sound card and starts up<br />
# script redirects PulseAudio to JACK<br />
# manually send PulseAudio apps to JACK output (pavucontrol may come in helpful for this)<br />
# use JACK programs etc<br />
# via script, stop redirecting PulseAudio to JACK<br />
# stop JACK and release soundcard<br />
# PulseAudio grabs sound card and reroutes audio to it directly<br />
<br />
with QJackCTL setup these scripts:<br />
<br />
{{ic|pulse-jack-pre-start.sh}} set it up as the execute script on startup script<br />
#!/bin/bash<br />
pacmd suspend true<br />
<br />
{{ic|pulse-jack-post-start.sh}} set this one up as execute script after startup<br />
#!/bin/bash<br />
pactl load-module module-jack-sink channels=2<br />
pactl load-module module-jack-source channels=2<br />
pacmd set-default-sink jack_out<br />
pacmd set-default-source jack_in<br />
<br />
{{ic|pulse-jack-pre-stop.sh}} "execute script on shutdown"<br />
#!/bin/bash<br />
SINKID=$(pactl list | grep -B 1 "Name: module-jack-sink" | grep Module | sed 's/[^0-9]//g')<br />
SOURCEID=$(pactl list | grep -B 1 "Name: module-jack-source" | grep Module | sed 's/[^0-9]//g')<br />
pactl unload-module $SINKID<br />
pactl unload-module $SOURCEID<br />
sleep 5<br />
<br />
{{ic|pulse-jack-post-stop.sh}} "execute script after shutdown"<br />
#!/bin/bash<br />
pacmd suspend false<br />
<br />
===Pulseaudio through JACK the old way===<br />
The JACK-Audio-Connection-Kit is popular for audio work, and is widely supported by Linux audio applications. It fills a similar niche as Pulseaudio, but with more of an emphasis on professional audio work. In particular, audio applications such as Ardour and Audacity (recently) work well with Jack.<br />
<br />
Pulseaudio provides module-jack-source and module-jack-sink which allow Pulseaudio to be run as a sound server above the JACK daemon. This allows the usage of per-volume adjustments and the like for the apps which need it, play-back apps for movies and audio, while allowing low-latency and inter-app connectivity for sound-processing apps which connect to JACK. However, this will prevent Pulseaudio from directly writing to the sound card buffers, which will increase overall CPU usage.<br />
<br />
To just try PA on top of jack you can have PA load the necessary modules on start:<br />
pulseaudio -L module-jack-sink -L module-jack-source<br />
<br />
To use pulseaudio with JACK, JACK must be started up before Pulseaudio, using whichever method you prefer. Pulseaudio then needs to be started loading the 2 relevant modules. Edit {{ic|/etc/pulse/default.pa}}, and change the following region:<br />
### Load audio drivers statically (it is probably better to not load<br />
### these drivers manually, but instead use module-hal-detect --<br />
### see below -- for doing this automatically)<br />
#load-module module-alsa-sink<br />
#load-module module-alsa-source device=hw:1,0<br />
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input<br />
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input<br />
#load-module module-null-sink<br />
#load-module module-pipe-sink<br />
<br />
### Automatically load driver modules depending on the hardware available<br />
.ifexists module-udev-detect.so<br />
load-module module-udev-detect<br />
.else<br />
### Alternatively use the static hardware detection module (for systems that<br />
### lack udev support)<br />
load-module module-detect<br />
.endif<br />
<br />
to the following:<br />
### Load audio drivers statically (it is probably better to not load<br />
### these drivers manually, but instead use module-hal-detect --<br />
### see below -- for doing this automatically)<br />
#load-module module-alsa-sink<br />
#load-module module-alsa-source device=hw:1,0<br />
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input<br />
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input<br />
#load-module module-null-sink<br />
#load-module module-pipe-sink<br />
load-module module-jack-source<br />
load-module module-jack-sink<br />
<br />
### Automatically load driver modules depending on the hardware available<br />
#.ifexists module-udev-detect.so<br />
#load-module module-udev-detect<br />
#.else<br />
### Alternatively use the static hardware detection module (for systems that<br />
### lack udev support)<br />
#load-module module-detect<br />
#.endif<br />
<br />
Basically, this prevents module-udev-detect from loading. module-udev-detect will always try to grab your sound-card (JACK has already done that, so this will cause an error). Also, the jack source and sink must be explicitly loaded.<br />
<br />
====QjackCtl with Startup/Shutdown Scripts====<br />
Using the settings listed above you can use QjackCtl to execute a script upon startup and shutdown to load/unload PulseAudio. Part of the reason you may wish to do this is that the above changes disable PulseAudio's automatic hardware detection modules. This particular setup is for using PulseAudio in an exclusive fashion with JACK, though the scripts could be modified to unload and load an alternate non-JACK setup, but killing and starting PulseAudio while programs might be using it would become problematic.<br />
<br />
The following example could be used and modified as necessary as a startup script that daemonizes PulseAudio and loads the ''padevchooser'' program (optional, needs to be built from AUR) called {{ic|jack_startup}}:<br />
#!/bin/bash<br />
#Load PulseAudio and PulseAudio Device Chooser<br />
<br />
pulseaudio -D<br />
padevchooser&<br />
<br />
as well as a shutdown script to kill PulseAudio and the Pulse Audio Device Chooser, as another example called {{ic|jack_shutdown}} also in the home directory:<br />
#!/bin/bash<br />
#Kill PulseAudio and PulseAudio Device Chooser<br />
<br />
pulseaudio --kill<br />
killall padevchooser<br />
<br />
Both scripts need to be made executable:<br />
chmod +x jack_startup jack_shutdown<br />
<br />
then with QjackCtl loaded, click on the ''Setup'' button and then the ''Options'' tab and tick both "Execute Script after Startup:" And "Execute Script on Shutdown:" and put either use the ... button or type the path to the scripts (assuming the scripts are in the home directory) {{ic|~/jack_startup}} and {{ic|~/jack_shutdown}} making sure to save the changes you have made.<br />
<br />
===Pulseaudio through OSS===<br />
Add the following to {{ic|/etc/pulse/default.pa}}:<br />
load-module module-oss<br />
<br />
Then start Pulseaudio as usual. You should have sinks and sources for your OSS devices.<br />
<br />
===Pulseaudio from within a chroot (ex. 32-bit chroot in 64-bit install)===<br />
Since a chroot sets up an alternative root for the running/jailing of applications, pulseaudio must be installed within the chroot itself ({{ic|pacman -S pulseaudio}} within the chroot environment).<br />
<br />
Pulseaudio, if not set up to connect to any specific server (this can be done in {{ic|/etc/pulse/client.conf}}, through the PULSE_SERVER environment variable, or through publishing to the local X11 properties using module-x11-publish), will attempt to connect to the local pulse server, failing which it will spawn a new pulse server. Each pulse server has a unique ID based on the machine-id value in {{ic|/var/lib/dbus}}. To allow for chrooted apps to access the pulse server, the following directories must be mounted within the chroot:-<br />
/var/run<br />
/var/lib/dbus<br />
/tmp<br />
~/.pulse<br />
<br />
{{ic|/dev/shm}} should also be mounted for efficiency and good performance. Note that mounting /home would normally also allow sharing of the {{ic|~/.pulse}} folder.<br />
<br />
For specific direction on accomplishing the appropriate mounts, please refer to the wiki on installing a bundled 32-bit system, especially the [http://wiki.archlinux.org/index.php?title=Arch64_Install_bundled_32bit_system#Additional_mount_option_to_allow_32-bit_apps_to_access_the_64-bit_Pulseaudio_server additional section] specific to Pulseaudio.<br />
<br />
===Simultaneous Digital and Analog Output===<br />
As an example situation: you want to listen to music at your desktop, using the regular 3.5mm analog outputs into your desktop PC speakers. You also want to feed the same music to your hi-fi system in another room via your sound card's digital output. You would think this would be a simple matter, but for many sound chipsets, it requires some editing to get it set up since the default Pulseaudio profiles allow you to use either analog or digital, but not both simultaneously.<br />
<br />
The solution is as follows (with thanks for some useful pointers from: http://superuser.com/questions/267442/how-to-get-simultaneous-sound-from-pulseadio-on-two-outputs-analog-and-digital). Amarok is used in this example.<br />
<br />
* Install "pavucontrol" (pacman -S pavucontrol). You ''won't'' be needing the other useful pulse configuration utility "paprefs" for this task.<br />
* In a terminal, launch "pacmd" - a command line utility for loading pulse modules<br />
* Enter the following commands in pacmd in this order (where your numbers for "hw:0,0" are determined by entering "aplay -l" in terminal. One number is the hardware ID for the analog device, the other for the digital):<br />
load-module module-alsa-sink device="hw:0,0" sink_name=analog_output<br />
load-module module-alsa-sink device="hw:0,1" sink_name=digital_output<br />
load-module module-combine sink_name=analog_digital slaves=digital_output,analog_output<br />
<br />
* Open "pavucontrol" from a terminal<br />
* Under pavucontrol's "Playback Tab", for the running app Amarok, select "Simultaneous output to Internal Audio, Internal Audio" (you will need to have Amarok playing something to test this)<br />
* Under the "Configuration Tab" Select "Digital Stereo Duplex (IEC958)" for "Internal Audio" (your exact names may vary here, according to how ALSA has named your hardware). You should now be able to hear Amarok playing on both your analog and digital outputs!<br />
<br />
The above solution only holds to long as you have pacmd running, and is specific for the running app (in the above example, Amarok).<br />
<br />
To set the the sinks up every reboot and for all audio apps, add the above load-module commands to your '''/etc/pulse/default.pa''' file. You may need to add them at the start of the file, just above line "### Automatically restore the volume of streams and devices", or it may not work as expected.<br />
<br />
Finally, use the Gnome 3 sound preferences to set your system's default "Output" to "Simultaneous output to Internal Audio, Internal Audio".<br />
<br />
===System-wide Equalizer===<br />
Pulseaudio can be configured to sound much better through the use of a system-wide equalizer. There are a few tools to do this. Extra information on the cons of each [http://ubuntuforums.org/showthread.php?t=1378087 here] . Individual apps can be excluded via {{Filename|pavucontrol}} .<br />
<br />
====pulseaudio-equalizer====<br />
A simple, user-friendly gtk tool which you can grab from the AUR [https://aur.archlinux.org/packages.php?ID=48316 here]. <br />
<br />
{{Note| If you remove pulseaudio-equalizer, you should comment out the respective generated section in {{Filename | $HOME/.pulse/default.pa}} or you may have strange issues.}}<br />
{{Note|If you have trouble with the volume resetting to the maximum level or making harsh noise upon switching sound sources, do [https://wiki.archlinux.org/index.php/Pulseaudio#Volume_gets_louder_every_time_a_new_application_is_started this] and then find the "Equalized audio configuration" section in {{Filename | $HOME/.pulse/default.pa}} and comment out only the "set-sink-volume" line there.}}<br />
<br />
====qpaeq====<br />
A simple qt tool that comes with pulseaudio and includes support for more bands than pulseaudio-equalizer (just resize the window horizontally), but presently lacks easily accessible presets and may need to be set as the default manually. Located at {{Filename | /usr/bin/qpaeq}} and requires {{Filename|python2-pyqt}} to run. <br />
<br />
{{Note| If qpaeq crashes at startup, be sure you have {{Filename|load-module module-equalizer-sink}} in {{Filename|/etc/pulse/default.pa}} or {{Filename|$HOME/.pulse/default.pa}} }}<br />
<br />
{{Note| If the equalizer has no effect (e.g., setting the ''qpaeq'' preamp bar to zero doesn't mute all sound), you may need to link your applications' audio sinks to the equalizer. Do this by adding the line {{Filename|set-default-sink equalized}} to {{Filename|/etc/pulse/default.pa}} or {{Filename|$HOME/.pulse/default.pa}}.}}<br />
<br />
==Troubleshooting==<br />
===No sound after install===<br />
<br />
====Flash Content====<br />
If after installing pulseaudio you get no sound from flash content, you can try installing [http://aur.archlinux.org/packages.php?ID=13384 libflashsupport-pulse] from the AUR. You can also try lib32-libpulse if on a 64-bit Arch and using [multilib]'s flashplugin:<br />
<br />
# pacman -S lib32-libcanberra-pulse lib32-alsa-plugins<br />
<br />
====No cards====<br />
If PulseAudio starts, run {{ic|pacmd list}}. If no cards are reported, make sure that your ALSA devices are not in use:<br />
$ fuser -v /dev/snd/*<br />
$ fuser -v /dev/dsp<br />
<br />
Make sure any applications using the pcm or dsp files are shut down before restarting PulseAudio.<br />
<br />
====The only device shown is "dummy output"====<br />
This may be caused by different reasons, one of them being the .asoundrc file in your home taking precedence over the systemwide /etc/asound.conf.<br />
<br />
The user file is modified also by the tool '''asoundconf''' or by its graphical variant '''asoundconf-gtk''' (the latter is named "Default sound card" in the menu) as soon as you run it.<br />
You can prevent the effects of .asoundrc altogether by commenting the last line like this:<br />
<br />
#</home/<yourusername>/.asoundrc.asoundconf><br />
<br />
====KDE4====<br />
It may be that you have another output device set as preferred in phonon. Make sure that every setting has your preferred output device at the top, and check the playback streams tab in kmix to make sure that applications are using the device for output.<br />
<br />
====Muted audio device====<br />
If you experience no audio output via any means while using ALSA as your default device, you may have to unmute your sound card. To do this, you will want to launch alsamixer and make sure each column has a green 00 under it (this can be toggled by pressing 'm')<br />
$ alsamixer -c 0<br />
<br />
===Bluetooth headset replay problems===<br />
Some user [https://bbs.archlinux.org/viewtopic.php?id=117420 report] huge delays or even no sound when the bluetooth connection does not send any data. This is due to an idle-suspend-module that puts the related sinks/sources automatically into suspend. As this can cause problems with headset, the responsible module can be deactivated. <br />
<br />
1. cp /etc/pulse/default.pa ~/.pulse/default.pa<br />
2. comment out the "load-module module-suspend-on-idle" line in ~/.pulse/default.pa<br />
3. pulseaudio -k && pulseaudio --start<br />
<br />
[http://robert.orzanna.de/2011/08/10/prevent-idle-suspend-with-a-bluetooth-headset-and-a2dp/ More information]<br />
<br />
===Pulse overwrites ALSA settings===<br />
Pulseaudio usually overwrites the ALSA settings- for example set with alsamixer- at start up, even when the alsa daemon is loaded. Since there seems to be no other way to restrict this behaviour, a workaround is to restore the alsa settings again after pulseaudio had started. Add the following command to {{ic|.xinitrc}} {{ic|.bash_login}} or any other autostart file and adjust the sleep, depending how long pulse needs to start on your system.<br />
<br />
(sleep 30 && alsactl -f /var/lib/alsa/asound.state restore) &<br />
<br />
===Daemon startup failed===<br />
Try resetting PulseAudio. To do that:<br />
$ pulseaudio --kill<br />
$ killall pulseaudio<br />
$ killall -9 pulseaudio<br />
$ rm -rf ~/.pulse*<br />
$ rm -rf /tmp/pulse*<br />
<br />
Afterwards, start PulseAudio again.<br />
<br />
===padevchooser===<br />
If you cannot launch the PulseAudio Device Chooser, first (re)start the Avahi daemon as follows:<br />
$ /etc/rc.d/avahi-daemon restart<br />
<br />
===Glitches, skips or crackling===<br />
The PulseAudio sound server uses a timer-based audio scheduling instead of the traditional interrupt-driven approach. Timer-based scheduling may expose issues in some ALSA drivers. To turn timer-based scheduling off, replace the line:<br />
load-module module-udev-detect <br />
in {{ic|/etc/pulse/default.pa}} by:<br />
load-module module-udev-detect tsched=0<br />
Then restart the PulseAudio server.<br />
<br />
===Choppy sound===<br />
Choppy sound in pulsaudio can result from wrong settings for the sample rate in /etc/pulse/daemon.conf. Try changing the line <br />
; default-sample-rate = 44100<br />
to <br />
default-sample-rate = 48000<br />
and restart the PulseAudio server.<br />
<br />
If you experience choppy sound in applications using openAL, you should also change the sample rate in /etc/openal/alsoft.conf:<br />
frequency = 48000<br />
<br />
===Volume adjustment doesn't work properly===<br />
You might want to check <br />
/usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common<br />
<br />
If the volume does not appear to increment/decrement properly using {{ic|alsamixer}} or {{ic|amixer}}, it may be due to pulseaudio having a larger number of increments (65537 to be exact). Try using larger values when changing volume (e.g. {{ic|amixer set Master 655+}}).<br />
<br />
===Volume gets louder every time a new application is started===<br />
Per default, it seems as if changing the volume in an application sets the global system volume to that level instead of only affecting the respective application. Applications setting their volume on startup will therefore cause the system volume to "jump".<br />
If you encounter this issue, you can fix it by uncommenting <br />
flat-volumes = no<br />
in<br />
/etc/pulse/daemon.conf<br />
and then restarting PulseAudio by executing<br />
pulseaudio -k<br />
<br />
When Pulse comes back after a few seconds, applications will not alter the global system volume anymore but have their own volume level again.<br />
<br />
{{Note| If you've previously installed and removed pulseaudio-equalizer, remnants of it in {{Filename|$HOME/.pulse/default.pa}} can also cause maximized volume trouble. Comment that out as needed.}}<br />
<br />
===No mic on ThinkPad T400/T500===<br />
Run<br />
alsamixer -c 0<br />
and maximize the volume of/unmute the "Internal Mic". Please improve this documentation if you know the cause of this issue.<br />
<br />
===No mic input on Acer Aspire One===<br />
Install pavucontrol, unlink the microphone channels and turn down the left one to 0. You should now be able to use your microphone.<br />
Reference: http://getsatisfaction.com/jolicloud/topics/deaf_internal_mic_on_acer_aspire_one#reply_2108048<br />
<br />
===Sound output is only mono on M-Audio Audiophile 2496 sound card===<br />
Add the following to /etc/pulseaudio/default.pa:<br />
load-module module-alsa-sink sink_name=delta_out device=hw:M2496 format=s24le channels=10 channel_map=left,right,aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7<br />
load-module module-alsa-source source_name=delta_in device=hw:M2496 format=s24le channels=12 channel_map=left,right,aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7,aux8,aux9<br />
set-default-sink delta_out<br />
set-default-source delta_in<br />
<br />
===Static Noise in Microphone Recording===<br />
If we are getting static noise in skype, gnome-sound-recorder, arecord, etc.'s recordings then the sound card samplerate is incorrect. That's why there is static noise in linux microphone recordings. To fix this We need to set sample-rate in /etc/pulse/daemon.conf for the sound hardware.<br />
<br />
====1. Determine soundcards in the system====<br />
This requires alsa-utils and related packages to be installed:<br />
$ arecord --list-devices<br />
<br />
output:<br />
**** List of CAPTURE Hardware Devices ****<br />
card 0: Intel [HDA Intel], device 0: ALC888 Analog [ALC888 Analog]<br />
Subdevices: 1/1<br />
Subdevice #0: subdevice #0<br />
card 0: Intel [HDA Intel], device 2: ALC888 Analog [ALC888 Analog]<br />
Subdevices: 1/1<br />
Subdevice #0: subdevice #0<br />
<br />
soundcard is hw:0,0<br />
<br />
====2. Determine sampling-rate of the sound card====<br />
arecord -f dat -r 60000 -D hw:0,0 -d 5 test.wav<br />
<br />
output:<br />
"Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 60000 Hz, Stereo<br />
Warning: rate is not accurate (requested = 60000Hz, '''got = 96000Hz''')<br />
please, try the plug plugin<br />
<br />
observe, the '''got = 96000Hz''', this is the max sample-rate of our card.<br />
<br />
====3. Setting the soundcard's sampling rate into pulse audio configuration====<br />
the default sample-rate in pulseaudio is<br />
grep "sample-rate" /etc/pulse/daemon.conf<br />
<br />
output:<br />
; default-sample-rate = 44100<br />
<br />
It is 44100 and is disabled. Let us set our sound card's settings into pulseaudio configuation file<br />
su -c "sed 's/; default-sample-rate = 44100/default-sample-rate = 96000/g' -i /etc/pulse/daemon.conf"<br />
<br />
Let's verify the changes to deamon.conf<br />
grep "sample-rate" /etc/pulse/daemon.conf <br />
output:<br />
default-sample-rate = 96000<br />
and it's done.<br />
<br />
====4. Restart pulseaudio to apply the new settings====<br />
pulseaudio --kill<br />
pulseaudio --start<br />
<br />
====5. Finally check by recording and playing it back====<br />
Let's record some voice using mic for say 10 seconds. Make sure the mic is not muted and all<br />
arecord -f cd -d 10 test-mic.wav<br />
<br />
After 10 seconds, let's play the recording...<br />
aplay test-mic.wav<br />
<br />
Now hopefully, there's no static noise in microphone recording anymore.<br />
<br />
=== My Bluetooth device is paired but doesn't play any sound ===<br />
[[Bluetooth#My_device_is_paired_but_no_sound_is_played_from_it|See the article in Bluetooth section]]<br />
<br />
==External links==<br />
*[http://www.pulseaudio.org/wiki/PerfectSetup http://www.pulseaudio.org/wiki/PerfectSetup] - A good guide to make your configuration perfect<br />
*[http://www.alsa-project.org/main/index.php/Asoundrc http://www.alsa-project.org/main/index.php/Asoundrc] - Alsa wiki on .asoundrc<br />
*[http://www.pulseaudio.org/ http://www.pulseaudio.org/] - PulseAudio official site<br />
*[http://www.pulseaudio.org/wiki/FAQ http://www.pulseaudio.org/wiki/FAQ] - PulseAudio FAQ</div>C.m.brandenburg