❔ System.AccessViolationException from Windows.Media.Audio.AudioPlaybackConnection (UWP)
For familiarity, AudioPlaybackConnection on UWP enables an A2DP sink Bluetooth profile connection between Windows and another device (for receiving audio playback). Following https://learn.microsoft.com/en-us/windows/uwp/audio-video-camera/enable-remote-audio-playback, the app crashes on
TryCreateFromId()
:
As seen in the screenshot attached, this exception is a ghost. Does anyone have any idea how to debug this?13 Replies
this happens every time?
Yeah... I'm gonna try changing architectures
I swear .NET UWP is just broken at this point
a good place to start is by trying with mixed-mode debugger
you would need visual studio for this
Mixed-mode as in enabling native-code debugging?
yeah
Alr
Got to the bottom of the call stack
Windows.Media.Devices.dll
is the file. At this point in native debugging, you're supposed to compile a modified version of that file yourself?
If anyone knows how to find the source file for bluetootha2dpplaybackconnection.cpp
I'd appreciate it
It'd provide a lot more insight on what's going onsorry, didn't see this
at this point you have debugged into windows source code and there isn't much you can do
unless you are pretty good at reverse-engineering you'll need to black box debug this (maybe see if other devices have this problem? maybe try making your code more similar to the example in the documentation?), or find some contact at microsoft who can help you, or accept that this WinRT API is bugged like many others
i am not sure how much luck you'll have, but you may want to post somewhere in $uwp that you're getting an access violation when calling this API
it should not happen, no matter how you slice it, so there's definitely a bug to be fixed, and it's almost certainly in AudioPlaybackConnection itself
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.