
(source pulseaudio)
This is a short introduction to PulseAusio
PulseAudio is sound server!! This confuses the reader (why a sound server). okie what is a sound server ?
Let us see this with a practical example. You have Internet connection and this Internet connection has to be shared among several PC’s what you will do ?
What we do is make the PC as a network server and share the network connection with other PCs. In the same way sound resource (a speaker output) within a PC, is shared and controlled by different applications.
It is similar to a proxy network for sound systems.
Before getting into more detail we need to know about ALSA
ALSA Advance Linux Sound Architecture is the expansion for ALSA. what ALSA does when requested to play a audio. ALSA simply passes buffer (sound samples) through the sound card (considering the sound card is registered for playback with ALSA), where digital samples are converted to analog (simply DAC) by the sound card.
When there is ALSA, why we need PulseAudio is a good question in your mind, read further.
When a application requests ALSA to play a audio (consider a song you like is played by xmms), the application needs to know the sampling rate, channels use, sample size (16 bit or 24 bit) etc.,of the song to register with ALSA to play a song.
PulseAusio framework does all this for you. PulseAudio also has features to change the sample format, channel counts, mixing several sounds into one etc.,
Let us take two real time scenario for example:
Sample Format conversion:
Lets say a application wanted to play a audio file of 32K sampling rate at a rate of 44K through the sound card. The application needs to convert the source 32K bit samples file through sampling rate converter to convert the audio to 44K. In this case the application would require a additional component called sampling rate converter, this is provided by PulseAudio framework.
Mixing audio (Audio1 + Audio2):
Lets view this from a mobile phone perspective. Consider you are playing a song from your mobile, a short message interrupts the play. The operating system pauses the song play, plays the tone to intimate you a message has arrived and then continues playing the song.
If PulseAudio is available in the mobile, the song would be continuing uninterruptedly. With the message notification mixed with the song play.
Don’t worry, the OS will be designed to pause the sound play when you receive a call
One thing can strike your mind now, PulseAudio for Mobile? PulseAudio is POSIX based so the sound server can be brought in a mobile also.
In Linux based systems, configuration for PulseAudio is available in. (/etc/pulse). Some intro to config files before we wind up.
/etc/pulse/daemon.conf: Configuration settings for the PulseAudio daemon.
/etc/pulse/default.pa: The default configuration script to execute when the PulseAudio daemon is started.
/etc/pulse/client.conf: Configuration settings for PulseAudio client applications.
All the config files can be placed in your home directory, to load your personal settings, if personal config files are absent. The config files in /etc/pulse is used.
I hope you should be interested with PulseAudio get started now from here
Related posts:
