Multiple Screens and DirectDraw on Windows Embedded Compact 7 RRS feed

  • Question

  • Hello embedders,

    so far I've been able to set up dual monitor support in a WEC7 OS design (fyi, the platform is a Freescale i.MX), mostly by peeking at the ATI Rage XL driver sample delivered within public sources. With this configuration things work fine for GDI applications, but DirectDraw doesn't work at all - even if it is supposed to work on the primary display device (only).

    A call to DirectDrawCreate() returns DDERR_UNSUPPORTED and after digging a bit into the assembly (DirectDraw source code is not available) I found that the function HALInit() is searched for in multimon.dll - not in the display driver's DLL, as it were expected. Note that DirectDraw works fine with the same driver in a single screen setup - HALInit and buildDDHALInfo are of course available in the driver, but they never get called in multiple screen setup for the reason above.

    I've verified that the driver is enumerated under HKLM\System\DDraw\DeviceEnum and I also tried to invoke DirectDrawCreate() passing in the GUID, with no luck. The GUID is all zeroes, as in the registry key and as returned by DirectDrawEnumerateEx. Passing a different GUID (for testing purpose) causes the message "Unable to match given device GUID to a system device. DirectDrawCreate fails." to be shown.

    As a side note, EnumDisplayMonitors() works correctly - i.e., monitor handles in the callback are valid and monitor information can be successfully retrieved by invoking GetMonitorInfo(). Also EnumDisplayDevices() works fine and the structure DISPLAY_DEVICE is filled with consistent data - i.e., DeviceName and DISPLAY_DEVICE_ATTACHED_TO_DESKTOP and DISPLAY_DEVICE_PRIMARY_DEVICE flags set.

    Has someone run into a similar problem or is anyone able to give a clue on the issue? The documentation on this topic is not so generous...

    Kindest regards,
    Stefano Voulaz

    UPDATE: further investigation seems to show that an inside call to GetDispDriverFromName() returns a pointer to "multimon" driver. It looks like GetDispDriverFromName() - made up of just a few assembly instructions - actually returns a default pointer (to the top-level driver?) stored somewhere, rather than searching for the named display driver. If that is true, it would make DirectDraw unusable in multiple screens setup...  Does it make any sense? 

    Stefano Voulaz Embedded Design @ projecKt studio

    Wednesday, March 7, 2012 8:32 AM

All replies


    I faked multimon.dll through a forwarder that redirects HALInit() to the actual driver: DirectDrawCreate() now succeeds, but I'm still stuck with being unable to use DirectDraw other than full screen on both displays. Here are some notes about what I've been able to track so far:

    1) If cooperative level is not set to DDSCL_FULLSCREEN, then CreateSurface() fails.

    2) As soon as cooperative level is set to DDSCL_FULLSCREEN, both monitors are blanked. According to the documentation, DirectDraw is supposed to work only on the primary display.

    3) CreateSurface() fails if height and width information are set in the surface descriptor (DDSURFACEDESC) - this is somewhat documented.

    4) When CreateSurface() succeeds, inside HalCreateSurface() - the driver's implementer function - I notice that requested surface dimensions account for the sum of the two monitors' size. That is, having two 800x480 monitors, DDHAL_CREATESURFACEDATA.DDSURFACEDESC.dwWidth and dwHeight are set to 1600 and 480 respectively.

    As you may imagine, I'm a little frustrated: it looks like there's no way to have DirectDraw working decently on a single monitor (as it is supposed to) in a multiple screen setup... Any suggestions?

    Best regards,
    Stefano Voulaz

    Stefano Voulaz Embedded Design @ projecKt studio

    Sunday, March 11, 2012 12:41 PM

    FYI, cooperative level DDSCL_NORMAL does work fine, provided CreateSurface() is invoked *before* setting cooperative level. This way, after recompiling and adjusting some parameters, the mosquito sample produces consistent results - need some D.D.T. to shut it off, but that's ok.

    Still, full screen DirectDraw obscures both displays and I've been unable - so far - to successfully play any video using MediaPlayer (that is, Quartz - that is, DirectDraw).

    I'll keep the topic updated... :)

    Stefano Voulaz

    Stefano Voulaz Embedded Design @ projecKt studio

    Wednesday, March 21, 2012 1:31 PM
  • Hi Stefano,

    have you tried to use the Freescale implemented dual video support? I know that it is not the same but it will allow touse DirectDraw on the auxiliary
    display and you can use media player the primary display. We also tried to use multi- monitor support and we had the same problems you are seeing. I haven’t
    ask Freescale but for me it seems the implemented their dual video support because of problems in the Windows CE multi monitor support.

    Best regards,


    Digi International Inc

    Thursday, March 22, 2012 8:18 AM
  • Hi mike,

    thank you for your comment. Unfortunately Freescale support for dual video is not viable in our current implementation, since end users of the system do need an actual desktop extension. To me it looks like Freescale (reasonably) released a driver for demonstration purpose, rather than trying to provide full fledged dual monitor support - also because dual monitor support on Windows CE, as you stated, is somewhat undocumented and problematic. But this doesn't mean it's not possible... :-)

    I am trying to go a little deeper. After scratching the surface(s) I got dual monitor + touch with desktop extension (with different resolutions) and DirectDraw mosquitos (OGM) flying around. Looks like I'm just a few steps from having video playback - and possibly some feedback from Microsoft on the validity of the tricks above.

    Of course, most of the DirectDraw magic relies on the driver implementation, but making it a little more flexible and integrated in the CE DirectDraw model (although limited) could accomodate for different end user requirements.

    Best regards,

    Stefano Voulaz Embedded Design @ projecKt studio

    Thursday, March 22, 2012 8:54 AM
  • Hi Stefano Voulaz,

    Iam working on multiple screen in WEC7 OS.

    I am also using the IMX default IPU driver for my Multiple Screen Support.Have you modified the IPU driver or any modification wrt to ATI Rage XL driver?

    Could you help me out regarding this implementation?

    Now can you able to play video in multiple screen support ?


    Rizwan Syed

    Saturday, June 27, 2015 6:52 AM
  • Hi Rizwan,

    we finally were able to support multiple monitors under WEC7 on i.MX53, but that required digging deep into the IPU driver and DirectDraw implementation. It took a while, some months from experienced programmers and still some limitation exist. For example, it is not possible to play movies full screen on two displays simultaneously.

    At the moment I can just suggest you to go once againg through this thread and to analyze the IPU driver in the details. Adding to the BSP the support for GDI on dual monitor is (as far as I can remember) quite straightforward - some documentation is available here and there. The hard part is modifying the Freescale IPU driver...

    Good luck!


    Monday, June 29, 2015 1:11 PM
  • Hi Stefano,

    I am working on Multiple monitor support,One half of the screen should appear on one screen while other half on another screen.

    Other Display Driver will be similar to our Display Driver as we have settings for it and just we have to apply it.

    One is LVDS and other is RGB Lcd.

    Could you suggest me How to Link RGB Lcd display to GWES and suggestion to deal with this?


    Rizwan Syed

    • Edited by RizwanSyed Tuesday, June 30, 2015 9:25 AM
    Tuesday, June 30, 2015 8:29 AM
  • Hello Mike/Stefano,

    Did you guys mean Freescale implementation of dual video support as shifting of the displays using DisplaySet.exe application? Here one screen would be blank and other one would be running.  Or both the displays with different content are running?

    Are there any documents that can be referred for the dual monitor/multi monitor support?

    Did you use the display devices connected to PCI or directly to the IPU?

    It would be great if you could help me out in this.



    • Edited by Seeth Wednesday, July 1, 2015 10:01 AM
    Wednesday, July 1, 2015 6:46 AM
  • Hi Voulaz,

    I'm trying to implement dual display and use DirectShow for video playback.

    Why did you use DirectDraw? Is it not possible to use DirectShow?

    Tuesday, August 4, 2015 5:36 AM
  • Hi,

    DS is supposed to work for windowed playback - but I never used it. The problem with full screen playback is that Qartz (whose sources are not available) tries to use the whole [extended] desktop as a rendering surface, which is not possible with multiple monitors. Based on my experience, it looks like DS on CE does not support the concept of "display device", it just asks GWES for the size of the desktop - which includes all attached monitors. Unfortunately, multiple monitors support in CE lacks a lot of functionality of the desktop OS implementation - at least, AFAIK.


    Tuesday, August 4, 2015 12:43 PM
  • Thank you for the reply, Stefano..

    Whether you were able to achieve HD video playback on both the screens simultaneously? Or did you face any issues?

    One more quick question. Did you use display devices connected to PCI? Or directly to the IPU?


    With regards,


    Wednesday, August 5, 2015 5:06 AM
  • Hi Keshava,
    in our implementation dual video playback in full-screen is not supported - and both displays are attached directly to the IPU.

    I think that running two videos full-screen on different monitors would be quite hard (if not impossible) due to the limitations of the DD/DS implementation on CE - you could use two windowed player.

    Best regards,

    Wednesday, August 5, 2015 9:12 AM
  • Thanks Stephano...

    We are just starting implementing the dual screen support on Freescale BSP.

    Do you suggest modifying the Freescale driver by referring RageXL driver sample?

    Can you share your ideas on this?


    With regards,


    Wednesday, August 5, 2015 9:36 AM
  • Hello Keshava,

    the RageXL driver was just a source of inspiration for implementing the interface to GDI. As I wrote on this thread some time ago, adding to the BSP the support for GDI on dual monitor is quite straightforward. The hard part is modifying the Freescale IPU driver. Beside taking almost all the IPU components out of the common tree to modify them, you'll have to deal with the existing management of IPUs and surfaces, which in Freescale's implementation is hard-coded for non-standard use of a secondary primary surface, used just for full screen playback of movies.

    The work took quite a long time and effort, since the management of two different DDIPU objects required a deep analysis and understanding of the existing driver. Moreover, the resulting architecture is very specific to the customer's platform, so it's beyond my possibilities to share it.

    Best regards,

    • Edited by S. Voulaz Thursday, August 6, 2015 10:51 PM
    Thursday, August 6, 2015 10:49 PM
  • Thanks a lot Stefano...

    Friday, August 7, 2015 5:11 AM
  • Hello Stefano.

    I had created two different IPU objects and changed almost all the "hardcoded" things in driver to support this architecture.

    I think the flow is proper now. But not getting anything on both the screens.

    One thing I observed is SetMode is being called two times and both with mode = 0.

    Is this a normal thing? If yes, whether I should handle display mode = 0 in this or mode = 1?

    Thank you :)




    If I disable "Total Monitors = 2" registry, I'm getting one screen properly, and the flow-wise only difference is upper layer is calling "GetGPEPerCard" and "SetMode" functions only one time in this case.


    • Edited by Keshava GN Thursday, August 27, 2015 7:45 AM
    Thursday, August 27, 2015 7:40 AM
  • We were able to implement multi-monitor setup on Freescale i.MX6Q custom board.

    Resulting setup looks as in below snap:

    Multi monitor

    We are now trying to implement DS video playback on second screen.

    Monday, August 31, 2015 1:41 PM