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

Suspend PulseAudio sinks when they are not used #5314

Closed
savchenko opened this issue Nov 11, 2021 · 1 comment
Closed

Suspend PulseAudio sinks when they are not used #5314

savchenko opened this issue Nov 11, 2021 · 1 comment

Comments

@savchenko
Copy link

Describe the bug
Mumble keeps PA sink awake even when client has its microphone and speakers disabled ("deafened and muted").

Steps to Reproduce

  1. Launch pulseaudio -v and observe its output.

  2. Compare, for example, with mpv or your favourite music player. Start playing, then put it on pause:

    I: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.usb-Solid_State_Logic_SSL_2-00.analog-stereo idle for too long, suspending ...
    I: [alsa-sink-USB Audio] alsa-sink.c: Device suspended...
    I: [pulseaudio] core.c: All sinks and sources are suspended, vacuuming memory
    
  3. Close the audio player, try the same with Mumble.

  4. Sink stays open:

    I: [pulseaudio] protocol-native.c: Requested tlength=60.00 ms, minreq=10.00 ms
    I: [pulseaudio] protocol-native.c: Final latency 60.00 ms = 20.00 ms + 2*10.00 ms + 20.00 ms
    

    This results in an excessive CPU usage and unnecessary memory reservation. Former is (much) more of a problem as for some reason running Mumble makes PA eat ~10% CPU. For comparison, playing audio via mpv is about 0.5-1%.

Expected behavior

  1. Mumble tells PA to pause the processing when it's not needed.
  2. Ideally, PA/Mumble combination consumes (much) less CPU than 10% of 11th gen i5 :)

Screenshots
N/A

Desktop (please complete the following information):

Additional context
If #5300 is fixed, this might be irrelevant (or at least much less relevant). Modern ALSA does all the mixing and resampling by itself.

@Krzmbrzl
Copy link
Member

Related to the high CPU usage: #4177 and #1092

In terms of this request itself: I think this could be a (partial) duplicate of #1089 which was implemented for PulseAudio in #171 but reverted again in #4633, because this has caused quite a few issues due to the way the audio system is currently implemented.

The gist of it is: The audio system needs to be refactored and redesigned before something like this is possible.

Given that we already have #1089 (and the other linked issues), I think this issue here does not really describe a separate issue. Therefore, I'll close this in favor of the other issues.

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

2 participants