One of the interesting features of the audio server pulseaudio is the transmission of an audio stream over a network to remote audio devices. In my case, such a device turned out to be a sound card in a torrent with connected speakers and with ubuntu server 10.04 on board. Under the cut is the miniHOWTO for installing and configuring the pulseaudio network server.
Client setup
Client configuration is trivial. We put a utility that sits in the tray and helps you quickly switch between the pulseaudio servers.
sudo apt-get install pulseaudio padevchooser
Next, run it:
Menu - Sound & Video - PulseAudio Device Chooser
Add to autostart. To do this, click on the tray icon and select the Preferences item ... Check the box “Start applet on session login”.
After setting up the server, you can select it in the menu.
Now, any program that uses pulseaudio to output audio can play sound through a remote computer's audio card.
')
Server Tuning
1. We put Avahi, if not:
sudo apt-get install avahi-daemon
2. We need a pulseaudio and a module that automatically places data on the presence of an audio server on the local network via the Avahi service.
sudo apt-get install pulseaudio pulseaudio-module-zeroconf
3. Create an audio group, whose members have access to audio devices:
sudo groupadd audio
4. Add yourself to this group:
sudo gpasswd -a user audio
5. Add yourself to this group, to access pulseaudio:
sudo gpasswd -a user pulse-access
6. Put alsa.
sudo apt-get install alsa libasound2-plugins
7. Make sure that you have audio devices available. This command will show the list of available devices in the system.
aplay -l
8. Let's correct the pulseaudio config:
sudo nano /etc/pulse/default.pa
I lost the signal on the alsa device with both the module-native-protocol-tcp and module-udev-detect simultaneously turned on (presumably this is a bug or my crooked hands), so I removed the autodetection of sound cards through udev by deleting this part of the configuration file
### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Alternatively use the static hardware detection module (for systems that
### lack udev support)
load-module module-detect
.endif
and uncommenting it
### Load audio drivers statically (it's probably better to not load
### these drivers manually, but instead use module-hal-detect --
### see below -- for doing this automatically)
load-module module-alsa-sink
To access the audio server from the network, uncomment it and add the module-native-protocol-tcp module boot parameters:
### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
load-module module-esound-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0/16
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0/16
load-module module-zeroconf-publish
where 127.0.0.1; 192.168.0.0/16 are networks in which our server will be available. Also do not forget to open access to pulseaudio in iptables.
With all config.
9. Now you need to restart the server. If everything went well, then our server should appear in the PulseAudio Device Chooser on the client.
You can start the audio server by running the following command on behalf of the user:
pulseaudio -D
Stop like this:
pulseaudio -k