wekaco / WKC-5P

ヒューマノイド「WKC-5P」
0 stars 0 forks source link

core/pulseaudio Pulseaudio node setup #15

Open dmtrs opened 6 years ago

dmtrs commented 6 years ago

from PulseAudio

PulseAudio is a sound system for POSIX OSes, meaning that it is a proxy for your sound applications. >It allows you to do advanced operations on your sound data as it passes between your application and your hardware. Things like transferring the audio to a different machine, changing the sample format or channel count and mixing several sounds into one are easily achieved using a sound server.

Consideration for setup between host/cluster/container communication of audio. To avoid issues such as https://github.com/wekaco/WKC-5P/issues/12#issuecomment-431314505

dmtrs commented 6 years ago

Install

On mac with brew install pulseaudio on Mac. Command line tool accessible through pulseaudio -nC & documentation on man pulse-cli-syntax

ALSA

To activate the driver edit /etc/asound.conf or ~/.asoundrc and add:

pcm.pulse {
    type pulse
}

ctl.pulse {
    type pulse
}

Now you you can access the PulseAudio server under the virtual ALSA device pulse:

$ aplay -Dpulse foo.wav
$ amixer -Dpulse

PulseAudio/Documentation/User/PerfectSetup

Network Setup

There are several different ways to connect to another PulseAudio server

Note all methods described here stream raw PCM audio over the network. This can use pretty much network bandwidth (around 1.4 Mb/s for CD-quality sound). If you get choppy sound, try setting a lower sample rate for the network stream. Furthermore, even while many WiFi connections can sustain such bitrates, often the jitter in packet latency makes transmitting low-latency audio over a wireless link infeasible in practice.

Direct connection

Just set the environment variable $PULSE_SERVER to the host name of the PulseAudio server. Alternatively you can modify ~/.pulse/client.conf or /etc/pulse/client.conf and set default-server. See Server Strings for an explanation of the format. In this FAQ entry all locations you can specify the server to use are listed. All the methods that connect to the daemon over the network using the native protocol need module-native-protocol-tcp loaded. This includes tunnels and Zeroconf setups. With this module loaded, the server listens on port 4713 for incoming client connections.

PulseAudio/Documentation/User/Network