|
|
Contents |
This document details the installation of PulseAudio as a replacement of EsoundD for improved audio quality and support of the Skype VoIP client. PulseAudio used to be called Polypaudio and was a Ubuntu package for Breezy however it was removed due to stalled development, today it is seeing new development though and is heading for integration into Gnome 2.18, it appears in Feisty Fawn (Ubuntu 7.04) for LTSP (Edubuntu) support only.
A typical scenario would look like this:
We also configure ALSA to use a PulseAudio plugin to redirect over the network as the GStreamer PulseAudio plugin package is not built yet.
Check the Ubuntu Desktop team for further updates.
From the main Ubuntu repositories PulseAudio can be installed in two parts, on the LTSP server:
$ sudo apt-get install pulseaudio pulseaudio-esound-compat pulseaudio-utils \
paprefs pavumeter pavucontrol padevchooser paman \
libao-pulse pulseaudio-module-hal pulseaudio-module-x11
Together with the LTSP client:
$ sudo chroot /opt/ltsp/i386/ apt-get install pulseaudio pulseaudio-esound-compat \
pulseaudio-module-x11
Re-configure Gnome to use ALSA for audio.
Configure ALSA to forward audio to PulseAudio by creating a file /etc/asound.conf or ~/.asoundrc with the following.
pcm.!default {
type pulse
}
ctl.!default {
type pulse
}
Configure the PulseAudio daemon, create /opt/ltsp/i386/etc/pulse/daemon.conf as follows:
daemonize = 1 high-priority = 1 log-target = stderr resample-method = trivial no-cpu-limit = 1 system-instance = 1 disable-shm = 1
There are no native local audio players and so those features are disabled, thin clients are generally low powered so the configuration has been tuned for the lowest quality and highest priority. The CPU limiter kills the daemon so not useful for conferencing.
PulseAudio modules are configured in /opt/ltsp/i386/etc/pulse/default.pa, we setup to communicate with local audio via ALSA and listen for EsoundD and native PulseAudio connections over the network from the LTSP server.
### Load audio drivers automatically on access # mobo sound on hw:0 (default) add-autoload-sink default_output module-alsa-sink device=hw:0 sink_name=default_output add-autoload-source default_input module-alsa-source device=hw:0 source_name=default_input # USB phone on hw:1 add-autoload-sink phone_output module-alsa-sink device=hw:1 rate=8000 channels=1 sink_name=phone_output add-autoload-source phone_input module-alsa-source device=hw:1 rate=8000 channels=1 source_name=phone_input ### Network access load-module module-esound-protocol-tcp auth-anonymous=1 load-module module-native-protocol-tcp auth-anonymous=1 ### Automatically restore the volume of playback streams load-module module-volume-restore ### Automatically move streams to the default sink if the sink they are ### connected to dies, similar for sources load-module module-rescue-streams ### Make some devices default set-default-sink default_output set-default-source default_input .nofail
Its probably recommended to implement IP ACL's on the TCP connections in a production environment.
For systems with more than one sound card or for devices not well detected you might have to manually specify the configuration. In future releases you might be able to leave PulseAudio to automagically configure itself, however the version used here has a fault with static hardware detection. There is no DBUS on a thin client so we cannot use PulseAudio's default detection mechanism. First take the above config files and make some changes, to daemon.conf disable the daemon:
; daemonize = 1 high-priority = 1 log-target = stderr resample-method = trivial no-cpu-limit = 1 system-instance = 1 disable-shm = 1
To default.pa enable static hardware detection, disable the autoload lines, default devices and enable the CLI interface:
### Alternatively use the static hardware detection module (for systems that ### lack HAL support load-module module-detect ### Load audio drivers automatically on access # mobo sound on hw:0 (default) #add-autoload-sink default_output module-alsa-sink device=hw:0 sink_name=default_output #add-autoload-source default_input module-alsa-source device=hw:0 source_name=default_input # USB phone on hw:1 #add-autoload-sink phone_output module-alsa-sink device=hw:1 rate=8000 channels=1 sink_name=phone_output #add-autoload-source phone_input module-alsa-source device=hw:1 rate=8000 channels=1 source_name=phone_input ### Network access load-module module-esound-protocol-tcp auth-anonymous=1 load-module module-native-protocol-tcp auth-anonymous=1 ### Automatically restore the volume of playback streams load-module module-volume-restore ### Automatically move streams to the default sink if the sink they are ### connected to dies, similar for sources load-module module-rescue-streams ### Make some devices default #set-default-sink default_output #set-default-source default_input .nofail load-module module-cli
Ensure you can login locally to a LTSP client, e.g. set an empty root password in /opt/ltsp/i386/etc/passwd, and Ctrl+Alt+F1. Restart PulseAudio and list the interfaces it can find with the info command.
# pkill pulseaudio
# pulseaudio
Welcome to PulseAudio! Use "help" for usage information.
>>> info
…
2 sink(s) available.
* index: 0
name: <alsa_output.hw_0>
driver: <modules/module-alsa-sink.c>
volume: <0: 80% 1: 80%>
latency: <0 usec>
monitor_source: <0>
sample spec: <s16le 2ch 44100Hz>
channel map: <front-left,front-right>
owner module: <0>
description: <ALSA PCM on hw:0 (VIA 82C686A/B rev50)>
index: 1
name: <alsa_output.hw_1>
driver: <modules/module-alsa-sink.c>
volume: <0: 100%>
latency: <0 usec>
monitor_source: <2>
sample spec: <s16le 1ch 8000Hz>
channel map: <mono>
owner module: <2>
description: <ALSA PCM on hw:1 (USB Audio)>
4 source(s) available.
index: 0
name: <alsa_output.hw_0.monitor>
driver: <modules/module-alsa-sink.c>
latency: <0 usec>
sample spec: <s16le 2ch 44100Hz>
channel map: <front-left,front-right>
monitor_of: <0>
owner module: <0>
description: <Monitor Source of ALSA PCM on hw:0 (VIA 82C686A/B rev50)>
* index: 1
name: <alsa_input.hw_0>
driver: <modules/module-alsa-source.c>
latency: <0 usec>
sample spec: <s16le 2ch 44100Hz>
channel map: <front-left,front-right>
owner module: <1>
description: <ALSA PCM on hw:0 (VIA 82C686A/B rev50)>
index: 2
name: <alsa_output.hw_1.monitor>
driver: <modules/module-alsa-sink.c>
latency: <0 usec>
sample spec: <s16le 1ch 8000Hz>
channel map: <mono>
monitor_of: <1>
owner module: <2>
description: <Monitor Source of ALSA PCM on hw:1 (USB Audio)>
index: 3
name: <alsa_input.hw_1>
driver: <modules/module-alsa-source.c>
latency: <78000 usec>
sample spec: <s16le 1ch 8000Hz>
channel map: <mono>
owner module: <3>
description: <ALSA PCM on hw:1 (USB Audio)>
…
The name and sample spec details can then be used in the manual configuration.
Update your lts.conf for PulseAudio:
## Sound configuration SOUND = True SOUND_DAEMON = pulse
Now reboot the client and sound should work through PulseAudio.
Skype 1.3 for Linux implements ALSA support but apparently not sufficiently to configure an ALSA plugin, therefore the PulseAudio system for OSS needs to be used. To run Skype with PulseAudio/OSS type the following:
$ padsp skype
Then Skype should detect an OSS audio device which is PulseAudio routed to the client. If you wish to specify a different PulseAudio set of devices, typically a USB phone use the PULSE_SINK and PULSE_SOURCE environment variables:
$ PULSE_SINK=phone_output PULSE_SOURCE=phone_input padsp skype
Firefox uses OSS audio by default and can be configured to use a wrapper that redirects audio to ALSA (aoss), NASD (audiooss), ESD (esddsp), aRts (artsdsp), or PulseAudio (padsp). Simply edit /etc/firefox/firefoxrc or ~/.mozilla/firefox/rc and set the following variable.
FIREFOX_DSP="padsp"
The latest beta from Adobe allows an customization of the audio sink and the Revolution Linux team have made a Pulse/ESD/ALSA/OSS compatible library available:
© 2009 Novell, Inc. All Rights Reserved.