Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRITICAL Could not connect to pulseaudio! Application terminates! #41

Closed
cocoonkid opened this issue Mar 10, 2022 · 13 comments
Closed

CRITICAL Could not connect to pulseaudio! Application terminates! #41

cocoonkid opened this issue Mar 10, 2022 · 13 comments

Comments

@cocoonkid
Copy link

I run Arch Linux and i have pipewire installed. How can I make this work?

INFO Found the following pulseaudio server addresses:
CRITICAL Could not connect to pulseaudio! Application terminates!
INFO SSDPDiscover.search()

Thanks in advance

@cocoonkid
Copy link
Author

It seems this is my issue:

● pipewire-pulse.service - PipeWire PulseAudio
     Loaded: loaded (/usr/lib/systemd/user/pipewire-pulse.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2022-03-09 16:06:23 CET; 22h ago
TriggeredBy: ● pipewire-pulse.socket
   Main PID: 3169 (pipewire-pulse)
      Tasks: 2 (limit: 76715)
     Memory: 53.2M
        CPU: 5min 55.157s
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire-pulse.service
             └─3169 /usr/bin/pipewire-pulse

Mar 09 16:06:23 sonos systemd[2762]: Started PipeWire PulseAudio.
Mar 09 16:06:23 sonos pipewire-pulse[3171]: Failed to load cookie file from cookie: Permission denied

How can I fix this?

@Cygn
Copy link
Owner

Cygn commented Mar 10, 2022

You cannot. Does not work with pipewire. In Fedora the workaround is to fall back to pulse.

@Cygn Cygn closed this as completed Mar 10, 2022
@cocoonkid
Copy link
Author

Thanks. I was about to report that I did exactly that 😄

@EvTheFuture
Copy link

Is there any work going on to get this to work with pipewire already?

If not, I'll take a look at it...

@Cygn
Copy link
Owner

Cygn commented May 29, 2022

Well you need to check if pipewire guys finished implementing full compatibility - unfortunately I don't think that's the case because nothing else seems to require what we need.

Also, I think that there is probably a better way to implement this in pure pipewire - even with audio and video. If you are looking for a challenge, I'd pick this.

@EvTheFuture
Copy link

Also, I think that there is probably a better way to implement this in pure pipewire - even with audio and video.

Yeah, I was first thinking of start from scratch but then again this project have lots of experience on potential pitfalls etc.

What functions do you need in pipewire that you mentioned?

@Cygn
Copy link
Owner

Cygn commented May 29, 2022

https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1127

@EvTheFuture
Copy link

@Cygn I've not had the time to dig in deep yet, but I've started to glance at the implementation. Correct me if I'm wrong, but the dbus interface is basically only used to communicate with pulseaudio to setup new sinks and get callbacks of when something happens with the audio routing.

Then streamserver is used to handle connections from the casting devices to forward the actual audio packets to the chromecast device. Is this first analysis correct?

If so, I'm thinking the dbus interface is not really needed for pipewire, it should be possible to write the same functionality that is in pulseaudio.py but specific for pipewire instead and communicate over the pipewire-protocol-native or pipewire-protocol-simple maybe.

Then one could specify which implementation to use, pulseaudio or pipewire.

How does this sound? Or have I completely missed some critical part here?

@Cygn
Copy link
Owner

Cygn commented May 29, 2022

This overlaps my understanding of the code. Note that I've taken over just for packaging; @masmu is the original architect. I've touched the code very little and mostly handle PRs.
Anyway, yes, there isn't much pa specific in there. I haven't looked much at pw internals, but I guess a routing layer should be there. Maybe also consulting pw guys on this can be a good idea, I won't be surprised that's a usecase they had in mind in the design.

@EvTheFuture
Copy link

Ok, I just wanted to check so I don't spend time implementing something that someone else know is the wrong path to go.

Thanks for your input. I'll dig into this, but it will take some time. I'll implement it more pipewire specific and add an option to select if using pipewire or PulseAudio when starting the Daemon.

@Cygn
Copy link
Owner

Cygn commented May 29, 2022

Cool :-) point me to your repo when you start this.

@EvTheFuture
Copy link

Cool :-) point me to your repo when you start this.

I'll fork this project to my laptop and then push it here: https://github.com/EvTheFuture

@EvTheFuture
Copy link

EvTheFuture commented Jun 11, 2022

I've created a pipewire wrapper in C that works with ctypes in Python. However when thinking of it and looking at the code, wouldn't it be sufficient (and easier, i e no need to compile C code) to simply wrap the commands pw-link -mio to monitor sinks and links and pactl load-module module-pipe-sink file=/tmp/pulseaudio-dlna_<UUID> sink_name=<NAME OF THE CHROMECAST> format=s16le rate=48000 to get a fifo with the raw audio that is routed to the sink?

Ideas and suggestions are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants