[pulseaudio-discuss] libpulse clients with no datagram sockets?

Arun Raghavan arun at arunraghavan.net
Mon Jul 25 04:24:01 UTC 2016



On Sat, 23 Jul 2016, at 12:40 PM, Adam Seering wrote:
> Hi all,
>     I have a bit of an odd question:  Is there any pulse client
> configuration that does not use datagram sockets at all, internally or
> externally?
> 
> 
>     As background:  I'm playing with the new Windows Subsystem for
> Linux, which lets you run Linux userspace binaries directly on top of
> the NT kernel.  (It ships with an Ubuntu 14.04 chroot.)  I want my
> Linux binaries to be able to play sound.  WSL doesn't expose hardware
> to the Linux userspace, but it does expose TCP.  And there exists a
> Windows build of pulseaudio.  So I'm thinking, run a Windows
> pulseaudio daemon, configure it to listen over TCP, and modify WSL's
> /etc/pulse/client.conf to instruct all libpulse-based applications to
> connect over TCP.
> 
>     Nice plan; not-so-simple execution:  WSL implements many aspects
> of Linux, but its initial release still lacks SOCK_DGRAM sockets.
> When I make the required modifications to client.conf, I see the
> following in 'strace', followed immediately by an error message and a
> failure to play audio:
> 
> socketpair(PF_LOCAL, SOCK_DGRAM, 0, 0x21daae0) = -1 ESOCKTNOSUPPORT
> (Socket type not supported)
> 
>     The only reference to socketpair() I can find in the libpulse
> source code is in src/pulse/def/h , on "struct pa_spawn_api".  Looking
> briefly through the source, it looks like the libpulse-based
> application might be spinning up a side process of some sort and using
> the datagram socket to communicate with that process?

Yes, the default setup is for the client API to spawn the PulseAudio
server if it's not running already.

For your case, though, you can start up the server manually, disable
module-protocol-native-unix in configuration (this module provides the
protocol that clients use as a UNIX datagram socket). Instead, you'd
load up module-protocol-native-tcp, and then set PULSE_SERVER=localhost
or change default-server in client.conf in the environment for your
clients to know that you've got PA running as a TCP server.

To start with, maybe just set listen=localhost auth-anonymous=1 in the
module arguments so you're only listening for local clients.

Cheers,
Arun


More information about the pulseaudio-discuss mailing list