-
Notifications
You must be signed in to change notification settings - Fork 90
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
Windows 11 22H2 OS build 10.0.22621.2428: CreateCaptureSession(item) does not return and hangs #64
Comments
Hmmm, I'm unable to reproduce this on my 22621 machines. |
Thanks, Rob for your quick response. What is your Windows 11 Build #? You can find this by opening Settings->System->About. My win11 previous build is OS build: 22621.457 and it works fine. But my customers reported this issue and told me their build is build 10.0.22621.2428. Then I updated my Win 11 22621.457 to 22621.2428. After that, I can see this issue. |
Ah sorry, I misread your comment. I thought you were saying all 22621 builds were effected. But all the same, I'm running 22621.2428. |
Thanks, Rob for trying. When you run this Win32CaptureSample app, after selecting one application such as Notepad from Windows Dropdown(ComboBox), Win32CaptrureSample is able to capture an image of Notepad? Does Win32CaptrureSamep hang after capturing? After updating my OS from 22621.2428 to the latest OS build 23565.1000 (Windows 11 Pro Insider Preview), this Win32CaptureSample app works. What could be wrong on this specific Win 11 OS build 22621.2428? Why CreateCaptureSession(item) hangs and never return from this API? Thanks for your help, |
No, Win32CaptureSample does not hang for me. I'm able to capture windows and displays, and I'm able to continue interacting with the application. What's interesting is that it hangs on CreateCaptureSession and not something earlier like creating the GraphicsCaptureItem. Is the capture service running (Task Manager -> Services tab -> CaptureService_*)? If you do a visual-based capture instead of a window or display based capture, does it exhibit the same behavior? I don't have a simpler test on hand, but this repo exercises visual-based capture: https://github.com/robmikh/CaptureAdHocTest I would try running the "alpha" test using the exe built out of that repo. (e.g. If you're comfortable, could you collect a memory dump of the following processes while in the repro state:
And attach them to a piece of feedback in the FeedbackHub? Make sure to put it in the category of Desktop Environment -> DWM. Please let me know the title of the feedback so I can fish it out when it shows up in a few days. It also wouldn't hurt to include a link to this issue in the feedback. The easiest way to collect the memory dumps would be to use the Task Manager, go to the details tab, and right click the process and select "Create dump file". To find the CaptureService's process, find the CaptureService_* entry in the services tab, right click, and select "Go to details". That'll take you to the process in the details tab where you can collect the memory dump. |
Please refer to my previous message on collecting a memory dump. In short, you can do it through Task Manager. |
Thanks, Rob for your support. BTW, I only can duplicate this issue by clicking on "Take Snapshot" button a few times like below: I also tried CaptureAdHocTest exe on my computer. Running the "alpha" test Passed without any issues. I also attached a screenshot when Win32CaptureSample app was freezing, you can see that CaptureService had yellow frame all the time. It tells that capturing has been stuck on somewhere and was not able to finish. Please let me know if you need additional info to debug this issue. |
Hi Rob @robmikh |
Unfortunately, I'm having trouble accessing your feedback. I'll comment here when there's something to report. |
you meant that you can see my feedback: |
No I meant that I couldn't see your feedback. But another colleague was able to help me access it now. I'll let you know if I find something. Unfortunately, I don't see other reports of this issue and it might be tricky to diagnose without a repro. |
How many instances of the Win32CaptureSample are you running? Are you running other applications that call the capture API at the same time? |
This is what I did --- Tried a few times to click on "Take Snapshot" button, whole Win32CapureSampe was freezing. |
How many instances of the Win32CaptureSample are you running? |
I think I've found the issue. For now the mitigation is to refrain from using the same GraphicsCaptureItem, and to instead create a new one. The snapshot feature of the sample runs into this because it reuses the GraphicsCaptureItem. This is a bug in the capture service that will need to be fixed. Thank you for collecting the dumps, they were very useful! |
Great news! Thanks. Here are some parts of my codes: winrt::GraphicsCaptureItem App::StartCaptureFromWindowHandle(HWND hwnd) Does util::CreateCaptureItemForWindow(hwnd) create new item? Try to find a workaround? |
Yes, |
|
correct? |
Correct |
cool and I will give a try to see if this workaround on my future release build. |
Tried the mitigation and now my app works on 22621.2428. Thanks for a quick turn around! |
At a minimum the fix has already been checked in for a future release of Windows. I don't have anything I can share at this time about servicing the fix to already released versions, I will be speaking to those folks next week. |
Thanks and really appreciate your help! |
Hi Rob @robmikh, could you share the timetable about servicing the fix to already released versions like OS build 10.0.22621.2428? A lot of my customers have that build. |
I have nothing to at that this time. I will post an update when available. |
Hi Team,
In last two/three years, my desktop application has been using CreateCaptureSession(item) for capturing other application window's image. It has been working until Windows 11 OS build 22621.2428 has released recently. My desktop application does Not work on Windows 11 22H2 OS build 10.0.22621.2428, it will hang when try to capture an image of other application window.
My QA team has tested following Win11 OS older builds and my desktop application works on all these older builds:
Windows 11 Pro - OS Build: 22621.2283
Windows 11 Pro - OS build : 22621.1928
Windows 11 -- OS build: 22621.457
Also, two/three years ago, I have downloaded Win32CaptureSample zip source codes. Now using that source codes, I created a release build of Win32CapureSampe. When running it on Win 11 OS build 22621.2428, after selecting one application such as Notepad from Windows Dropdown(ComboBox), whole Win32CaptrureSamep hangs.
Is this capturing issue on Win11 OS build 10.0.22621.2428? How to resolve this hanging issue when calling CreateCaptureSession(item)?
Thanks for your help and looking forward to advices/suggestions,
The text was updated successfully, but these errors were encountered: