Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

Error: Couldn't connect to pulseaudio: Access denied

Open BaituLime opened this issue 2 years ago • 6 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Is your issue described in the documentation?

  • [X] I have read the documentation

Describe the Bug

[2022:11:19:15:13:43]: Error: Couldn't connect to pulseaudio: Access denied [2022:11:19:15:13:43]: Warning: There will be no audio

image

Expected Behavior

No response

Additional Context

I tried in linux/nvidia/pipewire, and get the same result.

Host Operating System

Linux

Operating System Version

Archlinux(linux-zen)

Architecture

64 bit

Sunshine commit or version

0.15.0

Package

Linux - AUR

GPU Type

Nvidia

GPU Model

GTX 750ti

GPU Driver/Mesa Version

Nvidia-dkms 520.56.06

Capture Method (Linux Only)

X11/pulseaudio

Relevant log output

No response

BaituLime avatar Nov 19 '22 07:11 BaituLime

You should be using our AUR package instead of RPM...

https://docs.lizardbyte.dev/projects/sunshine/en/latest/about/installation.html#aur-package

ReenigneArcher avatar Nov 19 '22 17:11 ReenigneArcher

@ReenigneArcher nonono, there's no "aur" selection. Actually what I used is AUR.

BaituLime avatar Nov 20 '22 04:11 BaituLime

Okay... image

ReenigneArcher avatar Nov 20 '22 13:11 ReenigneArcher

I had the same problem, trying to delete ~/.config/pulse/ seems to solve it.

Tim-Paik avatar Nov 25 '22 01:11 Tim-Paik

same problem. Couldn't connect to pulseaudio on Fedora37 and manjaro...Where problem can be? i read problem can be in pipeware newest version.

nLLIeHu4ka avatar Dec 07 '22 07:12 nLLIeHu4ka

I have the same exact problem (tried on Pop_OS both 20.04 LTS and 22.04 LTS [only 22.04 LTS uses PipeWire as far as I can tell so I doubt that this is the root of the problem]).

[2023:01:02:08:42:45]: Error: Couldn't connect to pulseaudio: Access denied [2023:01:02:08:42:45]: Warning: There will be no audio

arastellia avatar Jan 02 '23 07:01 arastellia

Having the same issue on EndeavourOS. Here is my log.

[2023:01:03:20:58:16]: Debug: Start capturing Audio [2023:01:03:20:58:16]: Debug: Connecting to pulseaudio [2023:01:03:20:58:16]: Debug: Pulseadio context failed [2023:01:03:20:58:16]: Error: Couldn't connect to pulseaudio: Access denied [2023:01:03:20:58:16]: Warning: There will be no audio

ShredderCody avatar Jan 04 '23 04:01 ShredderCody

Hello, I have the same problem on Ubuntu 22.04. How to add permission to pulseaudio or any other solution?

Error: Couldn't connect to pulseaudio: Access denied

denys-karakuta avatar Jan 11 '23 09:01 denys-karakuta

Had the same problem, turns out I've been running sunshine daemon as root, not desktop user. When i changed it, everything started working.

m3nowak avatar Feb 11 '23 22:02 m3nowak

I have the same issue.

Downloaded the AUR package, however I always get Couldn't connect to pulseaudio: Access denied error.

I start sunshine from terminal via sudo sunshine. Is there something I'm doing wrong?

Smoukus avatar Feb 19 '23 11:02 Smoukus

Does no one care about this issue? A lot of people on Linux are having this problem.

Smoukus avatar Mar 05 '23 14:03 Smoukus

Do not start with sudo and all be good

nLLIeHu4ka avatar Mar 05 '23 14:03 nLLIeHu4ka

Do not start with sudo and all be good

Thanks for answering, however I tried that already. When I start it only with sunshine, I get following error: image

I am on KDE Wayland, and have 2 monitors (2560x1440 and 1920x1080) if it matters.

Smoukus avatar Mar 05 '23 15:03 Smoukus

Do not use wayland.. i think)

nLLIeHu4ka avatar Mar 05 '23 15:03 nLLIeHu4ka

That's unfortunate. That should definitely be noted somewhere that it only fully works on X11 and only partially on Wayland.

Smoukus avatar Mar 05 '23 15:03 Smoukus

The original problem was with X11/pulse. This latest problem seems to be something different and relates to screen capture. Does it work with KMS capture? I.e. first running the setcap command indicated in the log.

KuleRucket avatar Mar 05 '23 20:03 KuleRucket

The original problem was with X11/pulse. This latest problem seems to be something different and relates to screen capture. Does it work with KMS capture? I.e. first running the setcap command indicated in the log.

Hasn't worked unfortunately: image

Smoukus avatar Mar 05 '23 21:03 Smoukus

"sunshine" is a link. You need to dereference it: sudo setcap cap_sys_admin+p $(readlink -f $(which sunshine))

KuleRucket avatar Mar 05 '23 21:03 KuleRucket

"sunshine" is a link. You need to dereference it: sudo setcap cap_sys_admin+p $(readlink -f $(which sunshine))

Damn, that actually worked! Thanks a bunch!! Two things:

  1. What did that command actually do right now?
  2. I noticed that I had to configure web ui from scratch after running sunshine via sunshine after using that command from above. Does sudo sunshine and sunshine store config files in different places?

Smoukus avatar Mar 05 '23 21:03 Smoukus

Sunshine tries 4 different capture methods in this order: nvfbc, Wayland DMABUF, KMS, X11. It you have an nvidia card nvfbc would give the best performance but you have to patch the nvidia drivers. It looked like none of those methods worked for you before so the capture image was 0x0. Now you have a capture method working.

Rather than running sunshine as a command you should run it as a systemd service to start automatically (sudo systemctl --user enable --now sunshine). If you have to run it manually, don't use sudo.

Anyway, ask on discord for more info as this bug report is hijacked enough.

KuleRucket avatar Mar 05 '23 21:03 KuleRucket

Sunshine tries 4 different capture methods in this order: nvfbc, Wayland DMABUF, KMS, X11. It you have an nvidia card nvfbc would give the best performance but you have to patch the nvidia drivers. It looked like none of those methods worked for you before so the capture image was 0x0. Now you have a capture method working.

Rather than running sunshine as a command you should run it as a systemd service to start automatically (sudo systemctl enable --now sunshine). If you have to run it manually, don't use sudo.

Anyway, ask on discord for more info as this bug report is hijacked enough.

Thanks for the explanation!

I did ask on Discord first (created a dedicated thread), however no one responded there.

Smoukus avatar Mar 05 '23 22:03 Smoukus

@Smokus we're very busy with all the issues, discussions, and discord posts so sometimes it takes a while to answer everyone. The solution to your problem is on docs: https://docs.lizardbyte.dev/projects/sunshine/en/latest/about/usage.html#linux

Anyway, glad it's working for you now. I'm hiding all these off topic posts.

ReenigneArcher avatar Mar 05 '23 22:03 ReenigneArcher

I'm getting this same issue, latest release ubuntu package on Linux Mint. Looked through the docs and couldn't find any solution to the issue.

TheWanderingCrow avatar Mar 16 '23 21:03 TheWanderingCrow

faced the same issue on fedora 37 - after tinkering with pipewire, decided to switch back to pulse -- now the sound is coming from the PC Speaker, not streamed

tried to configure the sinks in the webUI - no luck ... always sound from PC Speaker

is sunshine supposed to create it's own sink, which i have to point to (if yes - none existing).

installation was via official package

kajdo avatar Mar 26 '23 17:03 kajdo

This issue is stale because it has been open for 90 days with no activity. Comment or remove the stale label, otherwise this will be closed in 10 days.

LizardByte-bot avatar Jun 25 '23 10:06 LizardByte-bot

This issue was closed because it has been stalled for 10 days with no activity.

LizardByte-bot avatar Jul 06 '23 10:07 LizardByte-bot

Same problem with the Flatpak version on KaOS.

jobukkit avatar Sep 06 '23 15:09 jobukkit

I'm having this issue too and I think it has to do with the fact that I'm running sunshine as root, but pulseaudio is under the user. It seems like the correct thing is to not run sunshine as root, but that doesn't work for me for other reasons. Has anyone solved this since?

yousefamar avatar Apr 07 '24 11:04 yousefamar

I managed to fix this by not running sunshine as root, but rather my user. I fixed the non-root issues by following the Linux install instructions more closely (specifically, I hadn't done "Enable permissions for KMS capture" properly).

yousefamar avatar Apr 07 '24 13:04 yousefamar