Installing PulseAudio

From MEPIS Documentation Wiki

(Redirected from Installing Pulseaudio)
Jump to: navigation, search

Pulseaudio is a rather new audio backend that is generally considered to be a really promising technology. One of the main advantages at this moment is that it supports multiple audio streams to soundcards that otherwise do not (fully) support it. The infamous Intel HDA chips on laptops often cause problems in situations where e.g. you are playing music via Amarok, and you get an incoming Skype call. Skype sound will be unavailable, or your microphone is not activated.

In order to get Pulseaudio working on MEPIS 7, I used two important pieces of information. The links are given at the end.

Here's how to proceed:

Contents

Install the required packages.

 apt-get install libasound2-plugins libao-pulse libpulse-browse0 libpulse-mainloop-glib0 libpulse0 pulseaudio pulseaudio-esound-compat 
 apt-get install pulseaudio-module-hal pulseaudio-module-x11 pulseaudio-module-zeroconf pulseaudio-utils

Set the correct permissions

Add your username to the groups pulse, pulse-rt and pulse-access

Create file to configure ALSA

ALSA can run on top of Pulseaudio. So your applications can use ALSA (most of them), whereas sound will be handled via the underlying Pulseaudio layer.

 Open a console
 su to become root
 cd /etc
 mcedit asound.conf
 copy and paste the text below and save the file
  pcm.pulse {
      type pulse
  }

  ctl.pulse {
    type pulse
}

pcm.!default {
    type pulse
}

ctl.!default {
    type pulse
} 

# Part I directly from ALSA Dmix Wiki

pcm.mycard {
    type dmix
    ipc_key 1024
    slave {
        pcm "hw:0,0"     
        period_time 0
        period_size 1024
        buffer_size 8192
       #format "S32_LE"
       #periods 128
        rate 44100
    }
}

pcm.dsp0 {
    type plug
    slave.pcm "mycard"
}

# This following device can fool some applications into using pulseaudio
pcm.dsp1 {
    type plug
    slave.pcm "pulse"
}

ctl.mixer0 {
    type hw
    card 0
}

# Part II directly from Pulseaudio Wiki

pcm.pulse {
    type pulse
}

ctl.pulse {
    type pulse
}

# Optional, set defaults

pcm.!default {
    type pulse
}

ctl.!default {
    type pulse
}

Almost done. In order to make sure that Pulseaudio starts when needed:

 As root in console: 
 cd /etc/pulse
 mcedit client.conf
 find the line with the word Autospawn, uncomment it and make sure it reads:
 Autospawn = yes

We can now start Pulseaudio like this:

 As root in console:
 pulseaudio --system=1 -high-priority=1 -D

You should now be able to normally play sounds in applications that support ALSA.

Special settings

  • For Skype, go into Options, and change all sound devices to pulse (sound in, sound out and sound ringing). You can now use the microphone in Skype regardless of other sounds playing.
  • If you run VirtualBox, Pulseaudio is natively supported. Just set VirtualBox to use PulseAudio for sound. This allows to use the microphone from within VirtualBox.
  • A number of applications still have problems with PulseAudio, notably Audacity. Work is being done, so who knows it'll work soon. For now, you need to kill PulseAudio whenever you wish to use Audacity. It means you cannot record audio using Audacity either.

External links

Personal tools
In other languages