CameraFrames sample throws unhandled exception when new camera is plugged in
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- operating-systems
Research direction
Start with the CameraFrames sample's scenario 2 and reproduce the failure when a USB camera is plugged in after the DeviceWatcher Added event. Inspect the call to MediaFrameSourceGroup.FromIdAsync() and determine whether the sample can avoid the unhandled exception; done means the sample handles this repro without crashing or the issue is confirmed as an OS defect.
Written by the indexing model from the issue text.
Description
The CameraFrames sample throws an unhandled exception when a new camera is plugged in.
Repro steps:
- Compile CameraFrames sample for Debug/x64 with Visual Studio 2017 (I used 15.9.15) targeting Windows 10 1903/18382.
- Run the sample and select scenario 2 (Find and display all media frame sources).
- Plug in a USB camera.
The exception is thrown in the call to MediaFrameSourceGroup.FromIdAsync(). The exception is The system cannot find the file specified. (Exception from HRESULT: 0x80070002).
I suspect there's a race condition here. If I set a breakpoint on the FromIdAsync() call and step over it in the debugger then the call succeeds. In fact, if I do something gross like let the first call fail but catch the exception and then try the call again it succeeds on the second call.
It seems like you can't call MediaFrameSourceGroup.FromIdAsync() too soon after the DeviceWatcher raises the Added event (after the initial enumeration is complete) or you'll hit this apparent race condition.
I'm running Windows 10 Pro 1903 build 18362.295.
I originally filed this as a doc bug here but I suspect it's really an OS bug.
- Dominant language
- JavaScript
- Stars
- 9.7k
- Forks
- 7.8k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/Windows-universal-samples
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 52/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
microsoft/Windows-universal-samples#1442 · 6 comments ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
microsoft/Windows-universal-samples#1440 · 3 comments · 1 reaction ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
microsoft/Windows-universal-samples#1437 · 3 comments ·
All issues in microsoft/Windows-universal-samples
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100