WhyNotHugo / caffeine-ng

⚠ This project has migrated to codeberg.org
https://codeberg.org/WhyNotHugo/caffeine-ng
GNU General Public License v3.0
180 stars 21 forks source link

no support for PipeWire? #75

Closed carlocastoldi closed 3 years ago

carlocastoldi commented 3 years ago

I am afraid caffeine-ng does not support PipeWire for checking on audio sources & sinks, causing its crash. Is that possible or is it a problem of mine?

This the output i get with --verbose:

❯ caffeine --verbose
DEBUG:caffeine.cli:Running with --verbose.
INFO:caffeine.core:Running with triggers: [<caffeine.triggers.ManualTrigger object at 0x7fbd2810ac10>, WhiteListTrigger(process_manager=<caffeine.procmanager.ProcManager object at 0x7fbd2810aee0>), <caffeine.triggers.FullscreenTrigger object at 0x7fbd2810a910>, <caffeine.triggers.PulseAudioTrigger object at 0x7fbd280966d0>].
INFO:caffeine.core:Caffeine is starting up...
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/caffeine/core.py", line 123, in run_all_triggers
    inhibit = max(inhibit, trigger.run())
  File "/usr/lib/python3.9/site-packages/caffeine/triggers.py", line 135, in run
    and not pulseaudio.source_info(
  File "/usr/lib/python3.9/site-packages/pulsectl/pulsectl.py", line 559, in _wrapper_method
    if not data: raise PulseIndexError(index)
pulsectl.pulsectl.PulseIndexError: 65579

"/usr/lib/python3.9/site-packages/caffeine/core.py", line 123 "/usr/lib/python3.9/site-packages/caffeine/triggers.py", line 135 "/usr/lib/python3.9/site-packages/pulsectl/pulsectl.py", line 559

If it was confirmed, I am afraid the source of the problem is that caffene-ng depends on a seemingly dead lib: pulsectl. The other option that came to my mind is that PipeWire does no longer allow to "spuff" other application's volume, so we can't know if anything is being played. Unfortunately I am not an expert and I cannot really confirm that. All i can say is that, searching online, I can't really find a library to substitute pulsectl.

I stumbled upon pipewire_python, but it's a pretty recent (and active) project and i don't think it supports the functionality we need.