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

Data Callback executed after stream stop on alsa backend with pipewire-alsa #762

Open
git-bruh opened this issue Oct 24, 2023 · 1 comment

Comments

@git-bruh
Copy link

Hello, I've discovered a bug where the stream's data callback gets called even after alsa_stream_stop has been called. This in-turn causes a crash in Firefox when it tries to capture the microphone from it's WebRTC component (happens very rarely). I've traced it down to cubeb. This does not seem to be reproducible with the example program from the docs

Still debugging it, will keep updating here with more details

More details: https://bugzilla.mozilla.org/show_bug.cgi?id=1859796

@git-bruh
Copy link
Author

I haven't verified this, but do you think there's a possibility that the calls to alsa_set_stream_state in alsa_stream_stop and alsa_run could be "racing" due to interleaved calls to mutex locks and unlocks?

So even tho the calls are wrapped in mutexes, it might happen that alsa_stream_stop sets the state to INACTIVE, and it subsequently gets set to PROCESSING by the other thread after that thread locks the mutex

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

1 participant