Skip to content

Avoid windows ASIO4ALL hang by using QueuedConnection - #3867

Merged
pljones merged 1 commit into
jamulussoftware:mainfrom
ann0see:windows/moveQueuedConn
Aug 9, 2026
Merged

pljones merged 1 commit into
jamulussoftware:mainfrom
ann0see:windows/moveQueuedConn

Conversation

@ann0see

@ann0see ann0see commented Aug 8, 2026 •

Copy link
Copy Markdown
Member

Short description of changes

I believe this fixes the hang on ASIO4ALL device switches - I cannot reproduce the hang anymore.

The AI proposed guard and the narrowed lock (#3862) doesn't seem to be needed - but might be worth implementing as lower prio fix.

CHANGELOG: Bug: Fix hang on Windows while changing devices in ASIO4ALL

Context: Fixes an issue?

Found by AI debugging:
#3779 (comment)

Does this change need documentation? What needs to be documented and how?

No

Status of this Pull Request

Ready for testing and review by someone else.

What is missing until this pull request can be merged?

Review and 2nd testing

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

@ann0see ann0see added this to the Release 4.0.0 milestone Aug 8, 2026
@ann0see ann0see added this to Tracking Aug 8, 2026
@ann0see ann0see added bug Something isn't working backport_required A change to main that needs fix on an existing release. labels Aug 8, 2026
@github-project-automation github-project-automation Bot moved this to Triage in Tracking Aug 8, 2026
@ann0see
ann0see requested a review from softins August 8, 2026 08:07
@ann0see ann0see moved this from Triage to Waiting on Team in Tracking Aug 8, 2026
@ann0see
ann0see marked this pull request as ready for review August 8, 2026 08:30
@ann0see

ann0see commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

I remember that we had the same kind of bug on iOS with the language switch a few years ago.

@ann0see
ann0see requested a review from pljones August 8, 2026 08:32
@ann0see

This comment was marked as low quality.

@softins

softins commented Aug 8, 2026 •

Copy link
Copy Markdown
Member

I believe this fixes the hang on ASIO4ALL device switches - I cannot reproduce the hang anymore.

I'd like to verify this on my PC with ASIO4ALL. What are the steps I should use to demonstrate the hang on existing versions?

EDIT: ok, now seen the minimised AI comment above. I'll try changing devices within ASIO4ALL itself.

@ann0see

ann0see commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

You need to randomly enable/disable inputs/outputs in the ASIO4ALL gui and then sometimes click on the main window which will lead to a hang. It's not really reproducible but will come up quite quickly.

Comment thread src/client.cpp Resolved
@pljones

pljones commented Aug 8, 2026 •

Copy link
Copy Markdown
Collaborator

My gut feel is this is because of Qt insisting on the GUI being the "main" thread.

I guess the "proper" fix, from that perspective, is to start up CClient (and thus everything CClient looks after - CSound, CChannel, network bits, etc) on the real-time thread, leaving the "main" thread at normal priority.

That should mean the only cross-thread calls are then between GUI and CClient...

However, I guess that without substantial work, this might be the only way to fix it. Maybe it should have a guard so it's only Windows ASIO that gets it - unless there's reason to say it's needed for all platforms.

@pljones

pljones commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Also note, could you check if the cherry pick on any commit is clean before merging and, if not, see why and say whether you'll deal with it.

@ann0see

ann0see commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

I would expect it to be a clean cherry pick. Yes, we could probably fix it by refactoring correctly but definitely not part of this Pr.

Comment thread src/client.cpp Resolved
@ann0see
ann0see force-pushed the windows/moveQueuedConn branch from 174a11e to 3d3c271 Compare August 8, 2026 19:33
@ann0see
ann0see requested a review from pljones August 8, 2026 19:34
@pljones
pljones merged commit 393f3ad into jamulussoftware:main Aug 9, 2026
11 checks passed
@github-project-automation github-project-automation Bot moved this from Waiting on Team to Done in Tracking Aug 9, 2026
@pljones

pljones commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Merging. As there's nothing else tagged up pending backport, I'll cut the branch release.

@pljones pljones modified the milestones: Release 4.0.0, Release 3.12.4 Aug 9, 2026
@pljones pljones removed the backport_required A change to main that needs fix on an existing release. label Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants