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

speech-dispatcher-dummy stream can not be monitored, stuck in PA_STREAM_CREATING state #871

Open
ratijas opened this issue Jan 10, 2024 · 2 comments
Labels

Comments

@ratijas
Copy link

ratijas commented Jan 10, 2024

Steps to reproduce

Using Plasma Volume applet which has stream monitoring feature. The applet's VolumeMonitor object creates a pa_stream for monitoring peak volume levels of inputs and outputs. In case of "speech-dispatcher-dummy", the stream is stuck in PA_STREAM_CREATING state, and won't ever change states. We can not close a "CREATING" stream right away, and deferred closing via pa_stream_set_state_callback is useless because the state won't ever change. This causes a leak of one stream per switching to Applications tab in the applet.

Obtained behavior

Dummy stream is stuck, it can not be closed, and eventually causes a leak in Plasma.

Expected behavior

Definitely not this.

Behavior information

Configuration files are basically untouched/default Arch Linux configs. espeak-ng module actually plays some audio via its own stream (tested with spd-say command), and it also suffers the same issue, but stuck/leaked streams are removed once the module starts synthesizing some speech.

Distribution

Arch Linux

Version of Speech-dispatcher

speech-dispatcher: 0.11.5-1
espeak-ng: 1.51.1-2

pipewire: 1:1.0.0-2
pipewire-pulse: 1:1.0.0-2
pulseaudio-qt: 1.3-1

Additional information

Downstream bug report in Plasma (sort of, there seem to be multiple bugs behind it): https://bugs.kde.org/show_bug.cgi?id=477522

Closely related issue in pipewire: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2168

@sthibaul
Copy link
Collaborator

I'm not sure to understand. Do you mean that whenever an application leaves a stream open but unused, VolumeMonitor ends up piling stream objects, until the application does make some use of its stream?

That really looks like a bug that should be fixed in pipewire itself, because:

espeak-ng [...] also suffers the same issue, but stuck/leaked streams are removed once the module starts synthesizing some speech

doesn't really look reasonable either. Within a session speech dispatcher can very well get started (because of some webspeech-triggered invocation for instance), and stay there unused until the user logs out.

@ratijas
Copy link
Author

ratijas commented Jan 11, 2024

It does look like a pipewire specific bug indeed. Check out the last link I posted to their GitLab issue.

I'm not sure to understand. Do you mean that whenever an application leaves a stream open but unused, VolumeMonitor ends up piling stream objects, until the application does make some use of its stream?

Yes, monitoring streams are left opened with a pending state change callback to close them. But state change never happens. And every time user switched to Applications tab, a new monitor stream is created, and when user switches tabs or closes the applet — a stuck stream isn't closed.

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

No branches or pull requests

2 participants