falkTX / Carla

Audio plugin host
https://kx.studio/carla
1.6k stars 147 forks source link

Fixes empty connections bug on pipewire #1748

Open ecruz1986 opened 1 year ago

ecruz1986 commented 1 year ago

Fixes #1625 regarding empty connections that appears while using Carla patchbay with pipewire, among other related issues.

The ignore lists logic on this piece of code was not consistent. There were corner cases that caused inconsistencies with the mechanism of ignoring ports and connection registers. So we revert back to processing every single event in the order they are queued and this fixes the bug.

See my comments on the issue #1625 for more information about why the logic was inconsistent.

This effectively reverts what was done in commit e5f4d02e8f5ef83ee169b6be77e02b6c31588697.

I'm not sure why this ignore mechanism was needed in the first place, I lack project history and context. My guess is it was necessary 20 months ago to work around some pipewire bug that existed back then, but it doesn't seem necessary anymore today. I don't see any abnormalities or crashes while using it with today's pipewire 0.3.66

SnipeXandrej commented 1 year ago

Sadly this does not seem to fix Carla crashing for me.

ecruz1986 commented 1 year ago

Sadly this does not seem to fix Carla crashing for me.

Sorry... Then unfortunately your issue has a different cause and it's unrelated to this. I'll remove mention to your issue from the description.

falkTX commented 1 year ago

Thanks for the research and finding the culprit! Looking around the code I am not particularly happy with how it was being done.. then got worse with pipewire in the mix and me trying to workaround a few things..

I have simplified the whole thing in f8b35fde654bd874d5e407fb51e636f06c866f14, which includes your idea to not bother keeping 2 list of events, one to ignore etc..

Please give it a try. If it still works fine under pipewire I will backport the fix into a new 2.5.x release. It should work, but feedback confirming it would be very welcome! (dont have a aystem with PW right now to test myself)

ecruz1986 commented 1 year ago

I have simplified the whole thing in [f8b35fd] (...) Please give it a try.

I have been using the latest git master for two days now, it surely does fix the empty connections bug under pipewire, and I haven't noticed any regressions. I haven't reviewed the code, but from a users perspective, it looks good to me! You may close this pull request, and a backport would surely be of use to many users who are suffering with this.

Thank you!