Ubuntu based pulseaudio network audio server

    One of the interesting features of the pulseaudio audio server is the transfer of audio over the network to remote audio devices. In my case, such a device turned out to be a sound card in a torrent download with connected speakers and with ubuntu server 10.04 on board. Under the cat lies miniHOWTO for installing and configuring the pulseaudio network server.

    Client setup


    Client setup is trivial. We install a utility that sits in the tray and helps to quickly switch between pulseaudio servers.
    sudo apt-get install pulseaudio padevchooser

    Next, launch it:
    Menu - Sound & Video - PulseAudio Device Chooser
    Add to autorun. To do this, click on the tray icon and select Preferences ... 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 sound can play sound through the audio card of a remote computer.

    Server Tuning


    1. We put Avahi, if it’s not worth it:
    sudo apt-get install avahi-daemon

    2. We need pulseaudio and a module that automatically posts data about the presence of an audio server in the local network through the Avahi service.
    sudo apt-get install pulseaudio pulseaudio-module-zeroconf

    3. Create an audio group, whose members have the right to access audio devices:
    sudo groupadd audio

    4. Add yourself to this group:
    sudo gpasswd -a user audio

    5. Add yourself to this group too, to access pulseaudio:
    sudo gpasswd -a user pulse-access

    6. Install alsa.
    sudo apt-get install alsa libasound2-plugins

    7. Make sure audio devices are available to you. This command will show a list of available devices in the system.
    aplay -l

    8. Adjust the pulseaudio config:
    sudo nano /etc/pulse/default.pa

    I lost the signal on the alsa device while module-native-protocol-tcp and module-udev-detect were turned on (presumably this is a bug or my crooked hands), so I removed the sound cards auto-detection through udev, deleting this part of the configuration file and uncommenting it To access the audio server from the network, uncomment this and add the module-native-protocol-tcp module boot parameters: where 127.0.0.1; 192.168.0.0/16 are the networks on which our server will be available. Also do not forget to open access to pulseaudio in iptables. With a config everything. 9. Now you need to restart the server. If everything went well, then our server should appear in the PulseAudio Device Chooser at the client
    ### 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


    ### 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



    ### 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







    You can start the audio server by running the following command on behalf of the user:
    pulseaudio -D
    Stop like this:
    pulseaudio -k

    Also popular now: