1

I know this question has been asked multiple times before, but I haven't found a solution that works for me yet.

I'm having trouble playing audio over an SSH session. The device in question is a Raspberry Pi 3B+ running Arch Linux ARM and with USB speakers plugged in. I have an HDMI cable and a keyboard hooked up to it now for an easier setup process, but it is going to be used headless when I'm done.

When I log in to the local terminal, playing sounds and recording the microphone are no problem. pactl list short sinks lists HDMI out, the 3.5 mm jack and my USB speakers, and with the latter set as the default sink, playing audio with commands like paplay is no problem at all.

However, when I access the pi over SSH, pactl list short sinks only shows a dummy audio sink which quietly discards all audio I try to play. If I happen to be logged in locally at the same time, I see all my sinks and can even play audio! But as soon as I log off locally, audio from the SSH session stops working again. This is very inconvenient because as mentioned earlier, the pi will be used headless later.

Some people on the internet have suggested that this is one of the few cases where pulseaudio's highly discouraged system mode makes sense. Following the advice online I did the following steps:

  1. sudo systemctl --global mask pulseaudio.socket to stop the userspace server from being started on login.
  2. Create user pulse without a home dir.
  3. Add myself to the pulse-access group.
  4. Reboot.
  5. After local login, pactl list short sinks reports Connection failure: Connection refused, verifying that the userspace server has indeed not been spawned.
  6. Start pulseaudio in system mode with sudo pulseaudio --system -D.

But this actually made things worse. Now, pactl list short sinks only lists the dummy sink both in SSH and local sessions, leaving me unable to play audio even from a local terminal even as root.

What can I do? Are there any log files that might contain useful information? Thanks!

1 Answer 1

2

The pulse user needs to be in the audio (and bluetooth) groups in order to be able to use ALSA and bluetooth devices.

usermod -aG audio pulse
1
  • Right on point. It works now. Thanks a ton!
    – Rapti
    Dec 21, 2021 at 16:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .