Wednesday 28 April 2010

Windows CE Live Chat Transcript April 2010

Hi guys,

Just in case you missed the Live chat yesterday with very interesting questions (e.g. how to improve the performance of bitblt), you can find the transcript of yesterday's chat here.

Unfortunately not all questions were answered, maybe in the next chat.

davbo_msft (Moderator): Our chat today covers the topic of Windows Embedded CE!

davbo_msft (Moderator)[18:00]: We are pleased to welcome our Experts for today’s chat. I will have them introduce themselves now.

Sing Wee[MS] (Expert)[18:08]: Hi everyone, I'm Sing Wee, part of the CoreOS/BSP Test Team.

GLanger_MS (Expert)[18:09]: Hi, good morning. I'm Glen Langer, program manager for Core OS on the Windows Embedded team.

rajran[MS] (Expert)[18:10]: Hi , I am Rajeev Rangappa, PM in Core OS group.

Sing Wee[MS] (Expert)[18:10]:

Q: [1] Larger memory sizes are getting cheaper. Soon 1GB of RAM will be cheaper and more available than 512MB. CE 6 is limited to 512 MB. What are your plans to increase memory size usage?

A: Although we can't discuss future releases here, I can say that we're aware of our customer's desire to use larger memory sizes.

Travis Hobrla [MS] (Expert)[18:13]:

Q: [2] What could be the reason of a very bad perfomance performing a GDI bitblit operation of a bitmap with color conversion from 16bpp to 24bpp and viceversa?

A: How are you doing the color conversion? Is the 24bpp memory aligned by 24-bits or by 32-bits?

Travis Hobrla [MS] (Expert)[18:15]:

Q: [3] When running a huge application on our CE6 based board we notice that free program memmory will decrease all the time. We already have tried to use the application verifier to detect any heap leaks, but could not find any (at least in our application). Do you know another way to verify heap leaks?

A: It is possible you are not leaking memory but have a driver or application that is consistently requesting more memory and actually using it. If you are wary of your huge application I would track the amount of allocations it has made. Also, if you want to get really in-depth you can construct your own custom heap and use that to track allocations.

Travis Hobrla [MS] (Expert)[18:16]:

Q: [5] If I use XIP can I see some improvements from the memory consumption point of view?

A: Yes, because the code that is executed in place doesn't need to be copied to RAM.

Sing Wee[MS] (Expert)[18:16]:

Q: [3] When running a huge application on our CE6 based board we notice that free program memmory will decrease all the time. We already have tried to use the application verifier to detect any heap leaks, but could not find any (at least in our application). Do you know another way to verify heap leaks?

A: As a follow-up to Travis' answer, if you know you're using a particular driver, you can apply AppVerifier to that driver as well to see if it turns up any leaks.

Sing Wee[MS] (Expert)[18:19]:

Q: [6] There is a known issue with Windows CE 6 that the active sync remote tools do not always work. One workaround is to start the tools from the Start Menu rather than from VS Menu. Unfortunately not all Tools are availble from the start menu. Does anybody know if this has been addressed, yet? Will it work better with CE 7?

A: While we can't speak specifically about future releases, I can say that we've been actively triaging/fixing all bugs that we know about. clip_image001

Travis Hobrla [MS] (Expert)[18:20]:

Q: [7] sorry, I didn't flag the check box. it is a 24bpp packed. Performing the bitblit with the same color resolution (i.e. 16bpp to 16bpp) the performance are quite good whereas bitblitting from 16 to 24 and viceversa it seems a disaster (around 20 times slower)
I'm using native MS code. I don't have any HW accelerator.

A: I am thinking the alignment issues there are likely causing some of the issue. Also, having to do any kind of per-pixel conversion is going to be a lot more expensive than doing no conversion. Can you try bltting to 32bpp (24bpp unpacked) and see what the perf difference is like?

Travis Hobrla [MS] (Expert)[18:21]:

Q: [9] Yes. I have noticed that using the 24bpp unpacket (32 bit aligned) the performance are much better but still very low.

A: I think the conversion in general is going to be expensive, it is a lot of extra math compared to a simple memcpy.

Travis Hobrla [MS] (Expert)[18:22]:

Q: [11] Is there any feature on windows CE 6.0 like "image update" (for windows mobile)?

A: Sorry, we don't support any such feature. You would have to use XIP and implement your own update mechanism in the bootloader.

davbo_msft (Moderator)[18:27]:

Q: [4] The new IE6 in R3 seems to run out of memory a lot quicker than IE6 in R2. Are you guys aware of this and planning to fix or should we send in a bug report?

A: Hello Norm - a bug report would be helpful for us to narrow down the memory issue you are seeing. Some helpful information would be details on how to reproduce the issue and state of the memory before & after you perform the repro steps. If you have any info about memory related to browsing a specific site or actions you take within the browser would help us narrow down the issue in the lab.

Travis Hobrla [MS] (Expert)[18:30]:

Q: [12] how to avoid this error VMProcessPageFault Error: Page fault occurred while in power handler! Address = 0xd0636078? making some debug I have identified that is coming from the filesystem during the powerup phase..

A: This is not a fatal error, I believe you should be safe to ignore it. We're aware of the issue but don't have a fix for it right now.

Travis Hobrla [MS] (Expert)[18:31]:

Q: [16] Is there any way to replace the floating point library in MIPS like using SYSGEM_OEM_FPCRT in ARM ?

A: Unfortunately, no. Sorry.

davbo_msft (Moderator)[18:34]:

Q: [10] I´m facing also exceptions in COMMCTRL.DLL, caused by explorer.exe, at random times, mostly when I use the GUI. Is there any bug open on that? (I´m on MIPS/CE6R3, using the standard shell)

A: Hello Marcelovk - Can you provide some additional details about the issue you are seeing? Specifically if you have consistent repro steps we can use to see the issue in the lab. Any specific actions you are doing in explorer.exe to reproduce the issues would be helpful.

Travis Hobrla [MS] (Expert)[18:37]:

Q: [13] Do you have any suggestion to improve the performance of bitblit?

A: Here are a few approaches: 1. You can try using the optimized Blt routines in public\common\oak\drivers\display\emulrotate\fastb lt.cpp by setting g_fUseFastBlt = TRUE in your display driver; I don't see any there that handle 16to24 or 16to32 so this won't help in your current situation but it may help in others.2. You can try to manage the source/destination surfaces so that you don't end up needing to do this converstion. 3. In your driver's BltPrepare you can detect when this conversion needs to happen and implement your own optimized software blt function in the driver for this case.

Travis Hobrla [MS] (Expert)[18:40]:

Q: [18] Another question regarding memory consuption: Is it correct that caused by heap fragmentation the remaining space will decrease generally. On CE3.0 I have read that buffers with a size of 384Bytes where used for all allocations. Is this really the case on CE6.0. Or what about fragmentation effect during runntime when allocating and freeing a lot of memory?

A: When you get low on memory, a function called CompactAllHeaps will automatically be run; this will attempt to eliminate/reduce fragmentation. There will be a DEBUGMSG in debug builds that indicates heap compaction is occurring. You can also call out to CompactAllHeaps manually if you like.

Travis Hobrla [MS] (Expert)[18:42]:

Q: [22] Hi Travis, you mentioned a method to track allocations. Are there any white papers on how to write your own custom heap to track memory allocations? Could you replace the OS heap allocator so that you can track all applications?

A: I don't know of any whitepapers that explain this in detail, but the msdn documentation should be sufficient to get you started: http://msdn.microsoft.com/en-us/library/ee488377.aspx

davbo_msft (Moderator)[18:44]:

Q: [20] In outlook 2003 and 2007 can I set an email notice to autosend on a certain day of each month

A: Hello jojodbear - this is a chat on Windows CE Embedded. For Outlook questions please refer to the Outlook website. http://office.microsoft.com/en-us/outlook/default.aspx.

Sing Wee[MS] (Expert)[18:45]:

Q: [8] I´m facing some troubles in USB stack, sometimes when I boot and when I powerdown with an usb device attached (mouse, usb stick) the driver enters on an endless loop. It looks like that they are not notified correctly to stop processing. How can I do notify them that the system is resetting, powering down?

A: Have you looked tried looking at the Device Notifications function that you register during USBDeviceAttach? Looking at some of our public drivers, this is where the USB_CLOSE_DEVICE mesage is handled. You Another place to look might be USBUninstallDriver. Be sure you've set the right debug zones/add some additional debug messages to see where you're getting into a loop. A related link would be this: http://msdn.microsoft.com/en-us/library/ee485900.aspx

Travis Hobrla [MS] (Expert)[18:47]:

Q: [23] Does WindowsCE support BGR555 format completely? We are running this framebuffer format currently. So far we did not get any problems. The driver reports 16Bpp, but the unused bit is masked in the palette correctly. Unfortunatly we now have noticed that the function GradientFill() function does not respect this limitation which leads into display errors.

A: I don't think this is a known issue, we should support it entirely. We do test BGR555 although I am not sure we tested with GradientFill(). If this is an important bug for your product, you can raise a support request and we can get this fixed via a QFE.

Sing Wee[MS] (Expert)[18:49]:

Q: [6] There is a known issue with Windows CE 6 that the active sync remote tools do not always work. One workaround is to start the tools from the Start Menu rather than from VS Menu. Unfortunately not all Tools are availble from the start menu. Does anybody know if this has been addressed, yet? Will it work better with CE 7?

A: Just to be clear, this issue you're referring to is running Remote Tools over ActiveSync, correct? I want to be sure the product team is aware of what you're seeing.

Travis Hobrla [MS] (Expert)[18:51]:

Q: [21] Unfortunately, I don´t have much steps to reproduce, only vague pointings. It looks like that it occurs more when the SHIPBUILD is disabled, in retail, and when I run applications made in Compact Framework 2.0 (but not only). We started to have this after porting a MIPS based bsp (au1200) from CE5 to CE6. They don´t seem to cause any side effect besides dumping the exception in the output (in our case, the serial port)

A: The 512MB limitation is because the CE 6.0 kernel reserves 0x80000000-0x9FFFFFFF for cached memory and 0xA0000000-0xBFFFFFFF for uncached memory; each of those regions are hardcoded and can't grow beyond 512MB. For MIPS and SH4 architectures this is an architectural limitation, for ARM and x86 CE 6.0 has a software limit. You can write a custom driver to expose this memory but the kernel won't know about it, so you will have to do all of the memory management on your own.

Travis Hobrla [MS] (Expert)[18:51]: Sorry, answered the wrong question, reactive your question Marcelovk.

Travis Hobrla [MS] (Expert)[18:51]:

Q: [26] If I have a system with 1GB of RAM and am using R3, CE 6 won't use half the memory, 512 MB. Where is the 512MB limitation in CE? Could I write a custom driver to provide a RAM disk using the extra 512 MB?

A: Answering the right question this time: The 512MB limitation is because the CE 6.0 kernel reserves 0x80000000-0x9FFFFFFF for cached memory and 0xA0000000-0xBFFFFFFF for uncached memory; each of those regions are hardcoded and can't grow beyond 512MB. For MIPS and SH4 architectures this is an architectural limitation, for ARM and x86 CE 6.0 has a software limit. You can write a custom driver to expose this memory but the kernel won't know about it, so you will have to do all of the memory management on your own.

Travis Hobrla [MS] (Expert)[18:52]:

Q: [25] Are most graphic routines designed to work best with RGB565? If so, will using another mode (e.g BGR555) be much slower?

A: I believe we have done more testing and optimization of RGB565 because it is more common. I would not expect BGR555 to be much slower unless you are doing a lot of conversions or other special operations, though.

masatos_MSFT (Expert)[18:53]:

Q: [15] In the case of Activesync connection over USB, how does the RASDial get notified of a USB disconnection? Who does the USB driver notify? Is it through the registry? system event?

A: Hi, can you specify which version of CE you are using?

Travis Hobrla [MS] (Expert)[18:56]:

Q: [24] In MSDN, it states that "TFAT requires the underlying block structure to support atomic sector writes". How can I know that my device (NOR flash) fulfill that?

A: I would query the vendor through which you got the NOR flash controller if the controller supports atomic writes or not - it may also be in the documentation for that controller.

Travis Hobrla [MS] (Expert)[18:57]:

Q: [28] 1GB question: Cool. The extra 512MB in a 1BG system would have to be handled by a driver as a special device. Do you guys have any cool ideas what could be done with it?

A: What is the system going to be used for? That should be the driving factor for your entire embedded design, from included modules to thread priorities all the way up to and including memory usage.

masatos_MSFT (Expert)[18:57]:

Q: [19] I get the error message "Cannot connect to PC. Stop any programs that may be using a connection, and try again. If the problem persists, reset your device according to the owner's manual. - Port Not Available" when plugging in USB to connect to Activesync. How can I start to debug this problem? How can I tell which "component" was not shut down properly? (using CE6R2, on ARMV4I platform)

A: I will consult with some team members here and get back to you.

Have fun!

No comments: