TracNav menu
-
Home
- What is it?
- News
-
About PulseAudio
- Details
- Current Status
- Features
- Supported Operating Systems
- Related Software
- Screenshots
- Distributions
- In The Press
-
PulseAudio Community
- Mailing Lists
- IRC
- Tracking
- Patches & Bugs
- People
-
Download PulseAudio
- Requirements
- Source code
- Binaries
- Development Sources
-
Documentation
- First Steps
- The Perfect Setup
- FAQ
- Modules
- Command Line Interface
- Daemon Parameters
- Server Strings
- System-Wide Daemon
-
Developer Documentation
- Developing Clients
- Developing Modules
Frequently Asked Questions
Some of the answers need updating! Also, some questions are too long for the outline, and they get truncated.
- Uncategorized questions
- How does PulseAudio compare with ESOUND/aRts/NAS?
- Is PulseAudio a GNOME program?
- I want to write a new driver for PulseAudio, are there any docs?
- The pulseaudio executable is installed SUID root by default. Why this? …
- Is PulseAudio capable of providing synchronized audio playback over the …
- What environment variables does PulseAudio care about?
- How do the PulseAudio libraries decide where to connect to?
- Why the heck does libpulse link against libX11?
- What is this RTP/SDP/SAP thing all about?
- Why did you rename Polypaudio to PulseAudio?
- Compatibility with other software
- What about ESOUND compatibility?
- Can I integrate PulseAudio in my GLIB/GTK/GNOME application?
- Can I integrate PulseAudio in my Qt/KDE application?
- What about compatibility with NAS?
- What about compatibility with aRts?
- Can I get OSS and ALSA applications to work with PulseAudio?
- Is there a Win32/Windows driver that act like a PulseAudio client?
- Troubleshooting
- I want to do this specific thing…
- I want to run PulseAudio only when it is needed, how do I do this?
- How do I list all PulseAudio modules installed?
- How do I use PulseAudio over the network?
- I saw that SIGUSR2 provokes loading of the module …
- How can I use PulseAudio as an RTP based N:N multicast conferencing …
- How can I use PulseAudio to stream music from my main PC to my LAN with …
- How can I use PulseAudio to share a single LINE-IN/MIC jack on the entire …
- Can I have more than one multicast RTP group?
- Can I use PulseAudio to playback music on two sound cards simultaneously?
- Can I use PulseAudio to combine two stereo soundcards into a virtual …
- How can use my Windows box to play the sound from my Linux box?
- How can I reverse my left and right speaker channels?
Uncategorized questions
How does PulseAudio compare with ESOUND/aRts/NAS?
PulseAudio is sound daemon similar to ESOUND and NAS, but much more powerful. aRts is a realtime-synthesizer-cum-sound-server, i.e. it does much more than PulseAudio. However, I believe that PulseAudio does what it does much better than any other free sound server.
Is PulseAudio a GNOME program?
No, PulseAudio has no dependency on GNOME/GTK/GLIB. All it requires is a UNIX-like operating system and very few dependency libraries. However, the accompanying GUI tools are written with gtkmm, i.e. require both GLIB and GTK.
I want to write a new driver for PulseAudio, are there any docs?
Currently, only the client API is documented with doxygen. Read the source and base your work on a simple module like module-pipe-sink.
The pulseaudio executable is installed SUID root by default. Why this? Isn't this a potential security hole?
PulseAudio activates SCHED_FIFO scheduling if the user passes --high-priority=1. This will only succeed when executed as root, therefore the binary is marked SUID root by default. Yes, this is a potential security hole. However, PulseAudio tries its best to minimize the security threat: immediately after startup PulseAudio drops all capabilities except CAP_SYS_NICE (At least on systems that support it, like Linux; see man 7 capabilities for more information). If the calling user is not a member of the group pulse-rt (which is required to have a GID < 1000), root rights are dropped immediately. This means, you can install pulseaudio SUID root, but only a subset of your users (the members of the group pulse-rt) may make use of realtime scheduling. Keep in mind that these users might load their own binary modules into the PulseAudio daemon which may freeze the machine. The daemon has a minimal protection against CPU hogging (the daemon is killed after hogging more than 70% CPU for 5 seconds), but this may be circumvented easily by evildoers.
Is PulseAudio capable of providing synchronized audio playback over the network for movie players like MPlayer?
Yes! Unless your network is congested in some way (i.e. transfer latencies vary strongly ('jitter')) it works perfectly. Drop me an email for experimental patches for MPlayer.
What environment variables does PulseAudio care about?
- The client honors:
- $PULSE_SINK (default sink to connect to)
- $PULSE_SOURCE (default source to connect to)
- $PULSE_SERVER (default server to connect to, like ESPEAKER, see ServerStrings for an explanation of the format)
- $PULSE_BINARY (the binary to start when autospawning a daemon)
- $PULSE_CLIENTCONFIG (path to the client configuration file).
- The daemon honors:
- $PULSE_SCRIPT (default CLI script file run after startup)
- $PULSE_CONFIG (default daemon configuration file)
- $PULSE_DLPATH (colon separated list of paths where to look for modules)
How do the PulseAudio libraries decide where to connect to?
The following rule applies: (see ServerStrings for an explanation of the format of server specifications)
- If the the application using the library specifies a server to connect to it is used. If the connection fails, the library fails too.
- If the environment variable $PULSE_SERVER is defined the library connects to that server. If the connection fails, the library fails too.
- If $DISPLAY is set, the library tries to connect to that server and looks for the root window property PULSE_SERVER for the host to connect to. If PULSE_COOKIE is set it is used as authentication cookie.
- If the client configuration file (~/.pulse/client.conf or /etc/pulse/client.conf) sets the server address, the library connects to that server. If the connection fails, the library fails too.
- The library tries to connect to the default local UNIX socket for PulseAudio servers. If the connection fails, it proceeds with the next item.
- The library tries to connect to the default local TCP socket for PulseAudio servers. If the connection fails, it proceeds with the next item.
- If $DISPLAY is set, the library tries to connect to the default TCP port of that host. If the connection fails, it proceeds with the next item.
- The connection fails.
Why the heck does libpulse link against libX11?
The PulseAudio client libraries look for some X11 root window properties for the credentials of the PulseAudio server to access. You may compile PulseAudio without X11 for disabling this feature.
What is this RTP/SDP/SAP thing all about?
RTP is the Realtime Transfer Protocol. It is a well-known protocol for transferring audio and video data over IP. SDP is the Session Description Protocol and can be used to describe RTP sessions. SAP is the Session Announcement Protocol and can be used to announce RTP sessions that are described with SDP. (Modern SIP based VoIP phones use RTP/SDP for their sessions, too)
All three protocols are defined in IETF RFCs (RFC3550, RFC3551, RFC2327, RFC2327). They can be used in both multicast and unicast fashions. PulseAudio exclusively uses multicast RTP/SDP/SAP containing audio data.
For more information about using these technologies with PulseAudio have a look on the respective module's documentation.
Why did you rename Polypaudio to PulseAudio?
Please read this blog story for an explanation.
Compatibility with other software
What about ESOUND compatibility?
PulseAudio is a drop in replacement for ESOUND. That means: you can load a esound compatibility module which implements an ESOUND compatible protocol which allows you to use most of the classic ESOUND compatible programs (including the command line programs like esdcat).
Can I integrate PulseAudio in my GLIB/GTK/GNOME application?
Yes! PulseAudio comes with a GLIB main loop adapter. You can embed both the client library and the daemon (!) into your GLIB based application.
Can I integrate PulseAudio in my Qt/KDE application?
Yes! PulseAudio uses a main loop abstraction layer that allows you to integrate PulseAudio in any program that supports main loops. Unfortunately there is no adapter for Qt publicly available yet.
What about compatibility with NAS?
Is not available (yet?). It is doable, but noone has implemented it yet.
What about compatibility with aRts?
Is not available. Since aRts is as synthesizer application you'd have to reimplement very much code for PulseAudio. It should be easy to implement limited support for libartsc based applications. Noone has done this yet. It is probably a better idea to run arts on top of PulseAudio (through a PulseAudio driver for aRts, which nobody has written yet). Another solution would be to embed PulseAudio in the aRts process.
Can I get OSS and ALSA applications to work with PulseAudio?
Yes, you can! OSS applications are handled using the padsp utility shipped with PulseAudio:
padsp myapp <arguments to myapp>ALSA applications are handled using the PulseAudio backend for alsa-lib. Documentation and the backend itself are shipped in the alsa-plugins package as part of the ALSA project.
Is there a Win32/Windows driver that act like a PulseAudio client?
Not exactly, but there use to be a ESoundD driver like that, and PulseAudio can connect to a ESoundD client.
This project is WinESD at WinESD. This software was developped for NT4 and Windows 2000. It has been reported to work under Windows XP connected to a PulseAudio server (One computer under Microsoft Windows XP using WinESD, connected to another computer under Microsoft Windows XP using PulseAudio). This project looks unmaintained and last version was "pre-alpha". It still works, but with restrictions :
- Sometimes, the sound is "broken". It look like it's when two processes try to emit sounds in the same time. Perhaps it's different from one computer to another.
- There is no easy installers as for July 2007, neither for WinESD nor PulseAudio for Win32/Windows. It's a "Let's play with configuration by hands" installation.
- You need to unactivate your sound card if you already have one on the computer running WinESD. This will need a reboot. This is undocumented on the WinESD site.
- Switching from one driver to another will need to play with Activate/Unactivate drivers, which will cause reboot.
Troubleshooting
I often hear noises when playing back with PulseAudio, what can I do?
There are to possible solutions: run PulseAudio with argument --high-priority=1 and make yourself member of the group realtime, or increase the fragment sizes of the audio drivers. The former will allow PulseAudio to activate SCHED_FIFO high priority scheduling (root rights are dropped immediately after this). Keep in mind that this is a potential security hole!
I have a surround sound card, but PulseAudio uses just the front speakers!
Many people have a surround card, but have speakers for just two channels, so PulseAudio can't really default to a surround setup. To enable all the channels, edit /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.
When sending multicast RTP traffic it is recieved on the entire LAN but not by the sender machine itself!
Pass loop=1 to the sender module!
Hmm, tcpwrap (aka /etc/hosts.allow, /etc/hosts.deny) support doesn't work properly for me!
Have you compile PulseAudio with tcpwrap support? Are you using the right tcpwrap service name? PA uses five different names for its five protocols:
pulseaudio-native pulseaudio-simple pulseaudio-cli pulseaudio-http esound
I want to do this specific thing…
I want to run PulseAudio only when it is needed, how do I do this?
Set autospawn = yes in client.conf. That configuration file may be found either in /etc/pulse/ or in ~/.pulse/.
How do I list all PulseAudio modules installed?
pulseaudio --dump-modules
Add -v for terse usage instructions.
How do I use PulseAudio over the network?
Just set the environment variable $PULSE_SERVER to the host name of the PulseAudio server. Alternatively you can modify ~/.pulse/client.conf or /etc/pulse/client.conf and set default-server= (See ServerStrings for an explanation of the format, see FAQ# 18 for all locations you can specify the server to use) For authentication you need the same auth cookies on all sides. For that copy ~/.pulse-cookie to all clients that shall be allowed to connect. Alternatively the authorization cookies can be stored in the X11 server. The server must have module-native-protocol-tcp loaded, with the argument loopback=0 set. Note that this can use pretty much network bandwidth (around 1.3Mbps for 44100Hz sound). If you get choppy sound, try downsampling it.
I saw that SIGUSR2 provokes loading of the module module-cli-protocol-unix. But how do I make use of that?
A brilliant guy named Lennart Poettering once wrote a nifty tool for that purpose: bidilink. To connect to a running PulseAudio daemon try using the following commands:
killall -USR2 pulseaudio bidilink unix-client:/tmp/pulse-$USER/cliBTW: Someone should package this great tool for Debian!
New: There's now a tool pacmd that automates sending SIGUSR2 to the daemon and running a bidilink like tool for you.
How can I use PulseAudio as an RTP based N:N multicast conferencing solution for the LAN?
After loading all the necessary audio drivers for recording and playback, just load the RTP reciever and sender modules with default parameters:
load-module module-rtp-send load-module module-rtp-recvAs long as the PulseAudio daemon runs, the microphone data will be streamed to the network and the data from other hosts is played back locally. Please note that this may cause quite a lot of traffic. Hence consider passing rate=8000 format=ulaw channels=1 to the sender module to save bandwith while still maintaining good quality for speech transmission.
How can I use PulseAudio to stream music from my main PC to my LAN with multiple PCs with speakers?
On the sender side create an RTP sink:
load-module module-null-sink sink_name=rtp load-module module-rtp-send source=rtp.monitor set-default-sink rtpThis will make rtp the default sink, i.e. all applications will write to this virtual RTP device by default.
On the client sides just load the reciever module:load-module module-rtp-recvNow you can play your favourite music on the sender side and all clients will output it simultaneously.
BTW: You can have more than one sender machine set up like this. The audio data will be mixed on the client side.
How can I use PulseAudio to share a single LINE-IN/MIC jack on the entire LAN?
On the sender side simply load the RTP sender module:
load-module module-rtp-sendOn the reciever sides, create an RTP source:
load-module module-null-sink sink_name=rtp load-module module-rtp-recv sink=rtp set-default-source rtp_monitorNow the audio data will be available from the default source rtp_monitor.
Can I have more than one multicast RTP group?
Yes! Simply use a new multicast group address. Use the destination/sap_address arguments of the RTP modules to select them. Choose your group addresses from the range 225.0.0.x to make sure the audio data never leaves the LAN.
Can I use PulseAudio to playback music on two sound cards simultaneously?
Yes! Use module-combine for that.
load-module module-oss-mmap device="/dev/dsp" sink_name=output0 load-module module-oss-mmap device="/dev/dsp1" sink_name=output1 load-module module-combine sink_name=combined master=output0 slaves=output1 set-sink-default combinedThis will combine the two sinks output0 and output1 into a new sink combined. Every sample written to the latter will be forwarded to the former two. PulseAudio will make sure to adjust the sample rate of the slave device in case it deviates from the master device. You can have more than one slave sink attached to the combined sink, and hence combine even three and more sound cards.
Can I use PulseAudio to combine two stereo soundcards into a virtual surround sound card?
Yes! You can use use module-combine for that.
load-module module-oss-mmap device="/dev/dsp" sink_name=output0 channel_map=left,right channels=2 load-module module-oss-mmap device="/dev/dsp1" sink_name=output1 channel_map=rear-left,rear-right channels=2 load-module module-combine sink_name=combined master=output0 slaves=output1 channel_map=left,right,rear-left,rear-right channels=4This is mostly identical to the previous example. However, this time we manually specify the channel mappings for the sinks to make sure everything is routed correctly.
Please keep in mind that PulseAudio will constantly adjust the sample rate to compensate for the deviating quartzes of the sound devices. This is not perfect, however. Deviations in a range of 1/44100s (or 1/48000s depending on the sampling frequency) can not be compensated. The human ear will decode these deviations as minor movements (less than 1cm) of the positions of the sound sources you hear.
How can use my Windows box to play the sound from my Linux box?
- Download the windows binary of pulseaudio from the download page.
- In the pulseaudio directory, create a file default.pa whith a content similar to this one (you may have to adjust the auth-ip-acl to reflect your network's settings):
load-module module-waveout load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0/16
- In pulseaudio applet: PA applet -> Default Server -> Other -> Enter the hostname or ip of your windows box.
How can I reverse my left and right speaker channels?
This is the same as "reverse stereo", where the left and right channels are to be swapped.
- cat /proc/asound/cards and use the name string for the device you wish to use (the one in square brackets)
- Edit /etc/pulse/default.pa and comment out module-hal-detect and module-detect lines.
- Search for the commented-out line that starts "#load-module module-alsa-sink", uncomment it and change it to
load-module module-alsa-sink device=hw:[answer from step 0] channel_map=right,left
- Restart the pulseaudio deamon by running pulseaudio -k; pulseaudio -D
