Windows Embedded CE and Windows Mobile (March 31, 2009)
Chat Topic: Windows Embedded CE and Windows Mobile
Date: Tuesday, March 31, 2009
Please note: portions of this chat have been edited for clarity.
Sue Loh [MS] (Moderator):
Welcome to today's public chat. Our chat today covers the topic of Windows Embedded CE and Windows Mobile! We are pleased to welcome our Experts for today's chat. I will have them introduce themselves now.
Introductions:
MikeCal [msft] (Expert):
I'm Mike Calligaro and I'm a developer on the Windows CE kernel debugger
Ryan Ward [MSFT] (Expert):
Hello, I'm Ryan ward and I am a SDET on the Platform Builder IDE team.
Sing Wee [MS] (Expert):
Hi, I'm Sing Wee, part of the General Embedded BSP Test Team.
Justin Bouffard [MS] (Expert):
Justin Bouffard, image update dev
rajeevdu[MS] (Expert):
I am Rajeev Dubey, Bluetooth Program Manager
Sue Loh [MS] (Moderator):
Hi, I'm Sue Loh, a developer in the Windows Devices Core team at Microsoft. I work on the remote tools team, and have previous experience with the kernel and file system. I'm also moderating today's chat. I hope we can answer some questions for you today!
rajran [MS] (Expert):
hi, I'm Rajeev Rangappa, BSP PM in WCE team.
devinro [MS] (Expert):
I'm Devin Roberts and I'm a SDET on the Platform Builder IDE team.
Santosh Hegde [MS] (Expert):
Hi, I am Santosh Hegde, Multimedia Program Manager for General Embedded.
WayVad [MS] (Expert):
Hi, I'm Way Vadhanasin. I work in Windows Mobile Connectivity team handling Wininet.
Mikethom [MS] (Expert):
Hi, I'm Mike Thomson, Group Program Manager in Windows CE Embedded
Sue Loh [MS] (Moderator):
Let's begin the chat!
Start of chat:
Sue Loh [MS] (Moderator):
Q: I am using Microsoft pimg.exe camera application for capturing photos on my WM 6.1 device.Our DShow camera driver supports upto 5MP still resolution.After taking 3-4 stills 5MP pimg.exe starts showing "cannot complete operation.out of memory".
But i have 70MB program memory free on my device during this condition.For other resolution like 3MP it is not occuring.
A: I'm not an expert in DShow camera drivers, but I'll try to help here. My first suspicion is that you're actually running out of *Virtual* memory space (address space) inside your process instead of actual physical memory. I don't know if it's your DShow code that would be allocating memory buffers, or if it'd be pimg.exe itself, but I'd look for something that is using VirtualAlloc for each photo, and convert it to reuse the address (if possible) or at least free it. You are probably using Platform Builder, I suspect, so you should also be able to use a KITL image to hook up the kernel debugger and set breakpoints on things like VirtualAlloc or the memory error. You may also be able to use the "DevHealth.exe" tool to do a dump of the virtual and physical memory usage on your device.
Justin Bouffard [MS] (Expert):
Q: But i have 70MB program memory free on my device during this condition.For other resolution like 3MP it is not occuring.
A: I'd like to add that I believe WM 6.1 still uses the CE 5 kernel, which has a 32MB memory limit per process. So if you try to allocate more than 32MB, you should get an OOM error. This is probably what's going on, and could be explained by the difference in resolution since a bigger res picture takes more memory.
Sing Wee [MS] (Expert):
Q: I used appverifier but it didn't showed any memory leak.How can i debug this error?
A: Can you describe the steps you used to try to detect the leak? Is this on WM6.1 or WinCE 6.0?
Sue Loh [MS] (Moderator):
Q: I used appverifier but it didn't showed any memory leak.How can i debug this error?
A: Adding on - I do not think your problem actually sounds like a heap leak problem. I think it's more likely that you are running out of address space inside your 32MB process virtual memory. Maybe the VM is getting fragmented or just completely reserved.
Sue Loh [MS] (Moderator):
Q: I have the kernel debugger enabled image,then i used wince app verifier to connect to the device and added the pimg.exe to the appverifier and i ran the pimg.exe on the device.
A: You can try running "mi full" in the target control window, or DevHealth.exe, to get a dump of the virtual memory space of your process. You can also try setting a breakpoint in {,,coredll.dll}xxx_VirtualAlloc to catch the allocations happening.
Chienher_MS (Expert):
Q: Sue,i agree with your answer.But how i can resolve this or how i can prove it is because of this?
A: Use the rough math to calculate the memory consumed by 5M pixel image. if it is 32bit per pixel, then it will be 5 * 32 / 8 = 20M bytes.
Chienher_MS (Expert):
The PIMG is using the imaging interface to create the image from jpeg you can try the same way by using imaging interface and see if it repro https://msdn.microsoft.com/en-us/library/aa918428.aspx
Justin Bouffard [MS] (Expert):
Q: Thank you all.Let me try your suggestions.
A: Good luck :-)
Sue Loh [MS] (Moderator):
Q: Hi, we are developing an app on a WM6.1 professional device and are having problems with the large/shared memory area and window procedures. When overloading new() using VirtualAlloc the window proc for embedded WMP ocx can not be called in AtlAxGetControl
The SendMessage function fails and only diff seems to be the WNDPROC ptr points to large mem area address when it fails. How is this handled by the window message handler?
A: We're having a hard time understanding exactly what situation you are describing. I can understand why you'd overload new to allocate out of the shared memory area. But can you tell me what objects are being allocated by your overloaded new() operator?
Sue Loh [MS] (Moderator):
Q: One object which will be created this way is the CAxHostWindow which is then queried for the embedded control in AtlAxGetControl
A: After consulting on this we think the problem is that these pointers are expected to be part of your process slot, not part of the large memory area, and that there really isn't a way to make this work. :-( You'll have to allocate them inside your process space. Maybe you can still minimize what you allocate inside by making new() more selective... I don't have any good guidelines to know what should and should not be allocated each way though.
Sue Loh [MS] (Moderator):
Q: Another question; We are unable to run DevHealth/memdump when our app is running and also it does not appear when using Remote Heap Walker. Any ideas why this would happen?
A: Hmm, interesting. I am guessing the problem is the implementation of the heap capture in ToolHelp. ToolHelp's capture temporarily allocates a memory buffer inside the *target* app (the one being dumped) to hold all of the heap data. If the target app is too low on virtual memory space, the ToolHelp heap dump will fail. Certainly this would block Remote Heap Walker. It should have been possible to write DevHealth to work without heap dumps, but I'm guessing it's not done that way - the lack of heap dump must be breaking DevHealth.
Justin Bouffard [MS] (Expert):
Q: For autofocus indication of the camera,how i can show or draw a rectangle on the pimg.exe application?.
A: I'm almost certain this has been asked in the last chat or two, and I think the consensus was you couldn't modify pimg in this sense, you'd have to write your own camera app or something so you have control over the window you're trying to draw on, others please chime in if I'm mistaken
Sue Loh [MS] (Moderator):
Q: For autofocus indication of the camera,how i can show or draw a rectangle on the pimg.exe application?.
A: Justin, you are correct - it was even Prabu who asked the same question last chat. Prabu, here is the answer from the last chat:
Tom Getzinger [MSFT] (Expert):
Q: In WM 6.0 microsoft camera application,Can i draw rectangle inside the viewfinder window?.If yes means How to do?
A: I assume you are talking about PIMG.EXE. Since we do not provide this in source form, you can't change the behavior of this application. You could potentially have an application running in the background which displays an overlay on top of the camera application (assuming your display driver supports overlays). Or, you could have a window appearing on top of this application, but then you will likely have focus issues.
WayVad [MS] (Expert):
Q: A question showed up in a newsgroup today. The OP was asking about the TOS header in Winsock and this page: https://support.microsoft.com/kb/248611. Does CE have the ability to switch from automatic QOS control to manual TOS control via Winsock and how?
A: The socket option IP_TOS is definitely not documented, but I see the winsock has the plumbing into TDI. I'd lean toward it not being supported since we didn't document it, but I'll follow up with the core networking team to confirm this one way or the other and post the definite confirmation in microsoft.public.windowsce.app.development and the thread subject is "ISSUE IN WINCE".
Mikethom [MS] (Expert):
Q: is it possible to run 2 instances of directshow to handle 2 web cameras.
A: This should work as long as your camera driver is not single instance. Nothing in the DShow pipeline should prevent this.
Mikethom [MS] (Expert):
Q: How can I capture the hardware volume buttons in an application so that I can control the volume of our media player using those buttons?
A: This is going to depend on the device. By default the active/focused window should receive all key strokes and if you know the code to look for then you can grab it on the way by. But a shell can also have those redirected to itself so that it can be the one controlling that aspect. You are going to have to look at the device to see what it is taking control off.
Sue Loh [MS] (Moderator):
Hello everyone, we are just about out of time.
Sue Loh [MS] (Moderator):
Thank you for joining us for our Windows Embedded CE 6.0 and Windows Mobile chat today!
Sue Loh [MS] (Moderator):
The transcript of today's chat will be posted online as soon as possible, to https://msdn.microsoft.com/en-us/chats/bb250671.aspx. We'll see you again for another chat next month. Please check https://msdn.microsoft.com/chats for the list of upcoming chats.
Sue Loh [MS] (Moderator):
If you still have unanswered questions, let me suggest that you post them on one of our newsgroups, such as Microsoft.public.windowsce.platbuilder