Apparently the "xcb_connection_has_error()" message is caused by my having SSHed to the device. If I run the same command on the device directly, I don't get that message. My environment already had that variable set as you suggested: $ echo $XDG_RUNTIME_DIR /run/user/1000 In any case, I still get the "pa_context_connect() failed" message. Is pulseaudio running? Yes: $ ps -ef | grep pulse pi 1050 809 0 11:14 ? 00:00:54 /usr/bin/pulseaudio --daemonize=no $ PULSE_LOG=99 pactl info xcb_connection_has_error() returned true Using shared memory pool with 1024 slots of size 64.0 KiB each, total size is 64.0 MiB, maximum usable slot size is 65496 Trying to connect to /run/user/1000/pulse/native... connect(): Resource temporarily unavailable (11) Trying to connect to /var/run/pulse/native... connect(): No such file or directory (2) Connection failure: Connection refused pa_context_connect() failed: Connection refused $ netstat -lx | grep pulse unix 3 [ ACC ] STREAM LISTENING 12344 /run/user/1000/pulse/native Any other thoughts? Does it matter that I have "--daemonize=no" in my service file? By the way, if I do not use a systemd service at all, I've been able to get Pulseaudio to run successfully by manually typing "pulseaudio --start" at the command line. That doesn't really help me though, because I need Pulseaudio to be available on bootup, without manual intervention. > On May 22, 2017, at 12:08 PM, Tanu Kaskinen <tanuk at iki.fi> wrote: > > On Mon, 2017-05-22 at 11:21 -0700, Karl Stahl wrote: >> Thanks for the reply! I'm running Raspbian and have pulseaudio >> version 5.0. >> I tried changing it to type=simple, and that fixed the notify issue, >> but it's still not working. This is what I get: >> >> $ paplay test.wav >> connect localhost port 6020: Connection refused >> xcb_connection_has_error() returned true > > These are unfamiliar errors to me... Is your X11 setup unusual? The > first error could be about libpulse trying to connect to X11 using port > 6020, which would be strange, because normally X11 uses unix sockets. > >> Connection failure: Connection refused >> pa_context_connect() failed: Connection refused > > Is pulseaudio running? If it is, paplay doesn't find the socket. That > might be because systemd sets the XDG_RUNTIME_DIR environment variable > for the services it starts, and that affects the socket location, but > your login environment might not have that variable set. Try setting > XDG_RUNTIME_DIR=/run/user/1000 in your login session setup. > > If that doesn't help, run "PULSE_LOG=99 pactl info". That will show > what socket pactl tries to use. You can compare that to the output of > "netstat -lx | grep pulse", that will show what socket the server uses. > > -- > Tanu > > https://www.patreon.com/tanuk > _______________________________________________ > pulseaudio-discuss mailing list > pulseaudio-discuss at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss