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

Audio ducking for media? #880

Open
sthibaul opened this issue Mar 17, 2024 · 5 comments
Open

Audio ducking for media? #880

sthibaul opened this issue Mar 17, 2024 · 5 comments

Comments

@sthibaul
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

Inferred from @eeejay feedback:
When e.g. listening to music, and suddenly a notification comes, we'd want the music to get lower so we can hear the notification, but not pause the music, since the notification could be a minor thing.

Describe the solution you'd like

SD could use the mixer to duck the audio of other applications.

I'm wondering if SD should just silent everything else, or we'd want some filtering?

@eeejay
Copy link

eeejay commented Mar 18, 2024

I have been thinking about this, and I think it should be implemented in Pipewire as an option. Pipewire should use the media roles to know which streams to duck when another one is playing. Specifically, if a stream with a role of Accessibility starts, other streams should duck. There are implementation questions I can't answer yet, like what is the lifetime of a stream, do they live the entire app lifetime or to they come and go with each sprite or utterance? If the former, is there some kind of notification when they are playing? But I think this should be a feature request in Pipewire.

@eeejay
Copy link

eeejay commented Mar 18, 2024

I asked around and it looks like wireplumber, the policy manager for pipewire does indeed support this. Shipping this on desktop and allowing users to enable this is another story:
https://pipewire.pages.freedesktop.org/wireplumber/daemon/configuration/features.html#policies

@sthibaul
Copy link
Collaborator Author

I asked around and it looks like wireplumber, the policy manager for pipewire does indeed support this. Shipping this on desktop and allowing users to enable this is another story: https://pipewire.pages.freedesktop.org/wireplumber/daemon/configuration/features.html#policies

Debian for instance pulls wireplumber when pipewire is installed.

@sthibaul
Copy link
Collaborator Author

I have been thinking about this, and I think it should be implemented in Pipewire as an option. Pipewire should use the media roles to know which streams to duck when another one is playing. Specifically, if a stream with a role of Accessibility starts, other streams should duck. There are implementation questions I can't answer yet, like what is the lifetime of a stream, do they live the entire app lifetime or to they come and go with each sprite or utterance? If the former, is there some kind of notification when they are playing? But I think this should be a feature request in Pipewire.

spd streams typically live all along the module liveness

@sthibaul
Copy link
Collaborator Author

spd streams typically live all along the module liveness

We can however pause them as appropriate

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

No branches or pull requests

2 participants