[pulseaudio-discuss] "Connection refused" on API pa_context_connect()

Tanu Kaskinen tanuk at iki.fi
Fri Jul 14 19:47:10 UTC 2017


On Fri, 2017-07-14 at 19:29 +0930, Steven Wawryk wrote:
> Hello,
> 
> I can't connect a pa_context to the PulseAudio server.  Can anyone help?
> 
> I've been trying to use the async API to connect to a source which has 
> been setup by a PulseAudio CLI script.
> 
> When I use the script via the --file=<filename> argument to pulseaudio, 
> then run my programs that use the API to connect to the source then 
> everything works just fine.
> 
> When the CLI script is run on another machine as part of the start-up, 
> then the program that uses the API (also on the same machine) always 
> fails on the pa_context_connect() call, with "Connection refused" being 
> the result of pa_strerror(pa_context_errno(context)).  The context was 
> successfully created using a pa_mainloop_api * returned from a 
> successfully created pa_mainloop.

"Connection refused" means that the client didn't find the server's
socket. Either the server isn't running, or the client has a different
idea than the server about where the socket should be.

I assume that the server is running, so the problem isn't that. Check
with "netstat -l -x | grep pulse" where the server is listening, and
run your client with environment variable PULSE_LOG=99 set. The
environment variable will enable extra logging in libpulse (printed to
stderr), and the log output will show where the client is trying to
connect.

-- 
Tanu

https://www.patreon.com/tanuk


More information about the pulseaudio-discuss mailing list