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

Question: WinUI interfering with MIDI APIs #6663

Closed
tristanlabelle opened this issue Feb 1, 2022 · 4 comments
Closed

Question: WinUI interfering with MIDI APIs #6663

tristanlabelle opened this issue Feb 1, 2022 · 4 comments

Comments

@tristanlabelle
Copy link

tristanlabelle commented Feb 1, 2022

I am using the midiIn APIs to get a callback when I press notes on my connected (piano) keyboard. This works fine with a console application, but I never get any callbacks in my WinUI application. The midi objects are created in the Application.OnLaunched method, so they should have main thread affinity.

Does WinUI does not run a standard Win32 PeekMessage/DispatchMessage loop on the main thread? Is there a way to make it do so?

It would be possible to create a separate thread for my midi objects and run my own message loop there, but this is a good amount of extra complexity that I would rather avoid, and I'm not sure that would fix the issue.

Thanks for any suggestions

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Feb 1, 2022
@tristanlabelle
Copy link
Author

tristanlabelle commented Feb 1, 2022

I added an artificial message loop after my call to midiInStart and I'm still not receiving callbacks. Moreover, with the same message loop in a console app, the message loop is not pumping anything but I'm receiving callbacks. It looks like this doesn't have to do with message pumping. What could be different in a WinUI app to prevent the callbacks? :/

        while (GetMessage(out var msg, default, 0, 0))
        {
            TranslateMessage(in msg);
            DispatchMessage(in msg);
        }

@tristanlabelle tristanlabelle changed the title Question: Win32 message pump in WinUI? Question: WinUI interfering with MIDI APIs (message pumping issue?) Feb 1, 2022
@tristanlabelle tristanlabelle changed the title Question: WinUI interfering with MIDI APIs (message pumping issue?) Question: WinUI interfering with MIDI APIs Feb 1, 2022
@tristanlabelle
Copy link
Author

It appears to be a bug with the .NET debugger. I filed an issue below but I'll leave the WinUI team close this question in case they have insights.

dotnet/runtime#64668

@gabbybilka gabbybilka added the product-winui3 WinUI 3 issues label Feb 8, 2022
@StephenLPeters
Copy link
Contributor

@MikeHillberg thoughts?

@StephenLPeters StephenLPeters removed the needs-triage Issue needs to be triaged by the area owners label Mar 4, 2022
@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants