wasapi: make render thread exist for the lifetime of the stream object#542
Conversation
kinetiknz
left a comment
There was a problem hiding this comment.
Thanks for doing this! The approach generally looks good to me. Do you want me to go ahead and review this as-is?
I suspect we'll need to retain part of the emergency bailout logic. Specifically, we need be sure we never execute callbacks after a stream_stop/stream_destroy.
|
After After |
Just WASAPI, so this case is fine and I'm just wrong about it. stream_destroy is the important case, since we expect the caller to free resources after the stream is destroyed.
I think this is fine for now, since it's no different from the behaviour before your changes. Eventually we'll want to tighten this up for all backends, I think. |
c71b53a to
9f7318f
Compare
|
@kinetiknz Apologies for the delay on this. Rebased to current master (taking extra care around the changes to the thread/bailout logic), and based on the comments above this is ready for review as-is. |
kinetiknz
left a comment
There was a problem hiding this comment.
Thanks! This looks good. I'll merge this soon.
|
@kinetiknz Are you still interested in this? Happy to rebase and fix conflicts if so. |
|
@kinetiknz any reason this wasn't merged? |
|
Sorry about that, I think we forgot. I've rebased your initial patch, because the underlying code has changed a lot. https://github.com/mozilla/cubeb/tree/wasapi_render_loop_lifecycle_rebase is my rebase. I'll change this branch so that it's cleaner, there are various things in a single commit at the moment and CI changes unrelated to your fix. We now have CI for Windows (as of last week): https://github.com/mozilla/cubeb/actions/runs/4862284679/jobs/8668439986, and I'm trying the patch on Firefox's CI, running most of our media tests, we'll see. |
https://treeherder.mozilla.org/jobs?repo=try&revision=254552db12c035f9a53c5985e4c837b35d4e6cf7. Our CI is having an outage at the moment, but I'm told ops will restart jobs once it's fixed, so we'll have results there. |
|
@danilaml are you up to review my rebase, since you wrote the code in the first place, and it was already reviewed by @Kinetik (and I had to re-read it for the rebase)? It's at 3e12930. If I haven't screwed up, I'll separate what was your patch orignally from my other fixes, put the right author on the commit and merge. I've started more tests on Firefox's CI (same link), running the same test suite in opt / non-debug and ASAN enabled, since we're really dealing about lifetimes of resources and such here, can't be too careful. |
|
Ha yes that's what I get for only reading the end of the thread, apologies. |
|
@padenot for the record, I've been running with the rebased branch for a few days so far and haven't encountered any issues (and it did indeed fix the problem I was having). Granted, that's even less coverage than mozilla CI provides, but at least I can confirm that this solves something ;P |
Yes, but the workloads are less synthetic, so it's useful to know, thanks for giving it a try! I'm going to re-read the patch myself and probably merge it. |
- Converts cubeb_stream into a reference-counted object, and gets rid of emergency_bailout logic - When reconfiguring, only restart a stream if it was already started - Removes timeout inside the render thread, as we can't guarantee events while a stream is stopped Subsequently rebased by Paul Adenot <padenot@mozilla.com>
…the CI to version 15
765c2a0 to
d31af33
Compare
|
@kinetiknz I'm merging this, it's green all around on treeherder and here. I've added a couple commits to be able to have |
Took a crack at this to see what it might look like. See #534 for why I think this could be a good idea.
emergency_bailout logic
while a stream is stopped