# Pulseaudio "Connection refused!"

**URL:** <https://discourse.libretime.org/t/pulseaudio-connection-refused/1843>\
**Category:** Get Help\
**Created:** [February 20, 2025, 11:23pm UTC](https://discourse.libretime.org/t/pulseaudio-connection-refused/1843 "2025-02-20T23:23:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Galen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.libretime.org/galen/32/816_2.png) [@Galen](https://discourse.libretime.org/u/Galen)\
**Post date:** [February 20, 2025, 11:23pm UTC](https://discourse.libretime.org/t/pulseaudio-connection-refused/1843/1 "2025-02-20T23:23:30Z")

</div>

I am trying to get Libretime 4 running on a new server (not in a container). Everything is working, except for system audio output, which I need.  
I’ve tried the following so far:

- Enabled system audio in the config file, with “pulseaudio” as the kind.
- Verified that pulseaudio is working with my sound card by playing a file from the command line with aplay.
- Added the libretime and liquidsoap users to the pulse and pulse-access groups.
- Found the name of the audio device using pacmd list-sinks and added it to the device field in the config file.  
No matter what I do though, liquidsoap just keeps reporting this error:

```auto
[clock.wallclock_pulse:2] Error when starting output pulseaudio:1: Pulseaudio error: Connection refused!
[clock.wallclock_pulse:3] Raised by primitive operation at file "pulseaudio.ml" (inlined), line 47, characters 6-67
[clock.wallclock_pulse:3] Called from file "io/pulseaudio_io.ml", line 82, characters 10-120
[clock.wallclock_pulse:3] Called from file "tools/start_stop.ml", line 108, characters 8-18
[clock.wallclock_pulse:3] Called from file "clock.ml", line 245, characters 20-38

```

---

<div class="post-metadata">

**Author:** ![Galen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.libretime.org/galen/32/816_2.png) [@Galen](https://discourse.libretime.org/u/Galen)\
**Post date:** [June 19, 2025, 7:00pm UTC](https://discourse.libretime.org/t/pulseaudio-connection-refused/1843/2 "2025-06-19T19:00:09Z")

</div>

Just updating this as I was eventually able to get pulseaudio working.  
First I had to modify /etc/pulse/daemon.conf to enable ‘daemonize’ and ‘system-instance’

```auto
daemonize = yes
system-instance = yes

```

After rebooting I found that I could get audio working from libretime by manually starting pulseaudio with:

```auto
# sudo pulseaudio

```

So then I created an init script to automatically start pulseaudio on launch:  
**/etc/init.d/startpulse**

```auto
#!/bin/sh
pulseaudio

```

Then

```auto
# sudo chmod +x /etc/init.d/startpulse
# sudo ln -s /etc/init.d/startpulse /etc/rc3.d/S01startpulse

```

I don’t know if this solution was optimal, or why it was necessary, but it worked. I think maybe it has something to do with Libretime not having a ‘real’ user, but I’m not sure.
