# PVRSRVCreateDCSwapChain Error On Android

**URL:** <https://forums.imgtec.com/t/pvrsrvcreatedcswapchain-error-on-android/1756>\
**Category:** PowerVR Insider\
**Created:** [April 19, 2013, 7:01am UTC](https://forums.imgtec.com/t/pvrsrvcreatedcswapchain-error-on-android/1756 "2013-04-19T07:01:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![joelc](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@joelc](https://forums.imgtec.com/u/joelc)\
**Post date:** [April 19, 2013, 7:01am UTC](https://forums.imgtec.com/t/pvrsrvcreatedcswapchain-error-on-android/1756/1 "2013-04-19T07:01:43Z")

</div>

Hi all,  
  
  
  
I’m working with GLES on Android 4.0.4 (AOSP), using a Galaxy Nexus maguro phone. However when I run the command line OpenGL tests, built from sources in frameworks/base/opengl/tests, they fail with the following output from logcat:  
  
D/libEGL (12589): loaded /system/lib/egl/libGLES\_android.so  
  
D/libEGL (12589): loaded /vendor/lib/egl/libEGL\_POWERVR\_SGX540\_120.so  
  
D/libEGL (12589): loaded /vendor/lib/egl/libGLESv1\_CM\_POWERVR\_SGX540\_120.so  
  
D/libEGL (12589): loaded /vendor/lib/egl/libGLESv2\_POWERVR\_SGX540\_120.so  
  
E/IMGSRV (12589): :0: PVRSRVCreateDCSwapChain: Error - 10 returned  
  
E/IMGSRV (12589): :0: framebuffer\_device\_open: Failed to create flip chain  
  
E/FramebufferNativeWindow(12589): couldn’t open framebuffer HAL (Bad address)  
  
  
  
The errors come from a call to android\_createDisplaySurface. Here are some relevant code snippets:  
  
frameworks/base/libs/ui/FramebufferNativeWindow.cpp:  
  
342EGLNativeWindowType android\_createDisplaySurface(void)  
  
343{  
  
344 FramebufferNativeWindow\* w;  
  
345 w = new FramebufferNativeWindow();  
  
346 if (w-\>getDevice() == NULL) {  
  
347 // get a ref so it can be destroyed when we exit this block  
  
348 sp ref(w);  
  
349 return NULL;  
  
350 }  
  
351 return (EGLNativeWindowType)w;  
  
352}  
  
  
  
frameworks/base/libs/ui/FramebufferNativeWindow.cpp:  
  
83 if (hw\_get\_module(GRALLOC\_HARDWARE\_MODULE\_ID, &module) == 0) {  
  
85 int err;  
  
87 err = framebuffer\_open(module, &fbDev);  
  
88 LOGE\_IF(err, “couldn’t open framebuffer HAL (%s)”, strerror(-err));  
  
  
  
hardware/libhardware/include/hardware/fb.h:  
  
151static inline int framebuffer\_open(const struct hw\_module\_t\* module,  
  
152 struct framebuffer\_device\_t\*\* device) {  
  
153 return module-\>methods-\>open(module,  
  
154 GRALLOC\_HARDWARE\_FB0, (struct hw\_device\_t\*\*)device);  
  
155}  
  
  
  
Any ideas about what’s happening here? Any other information I could provide to help diagnose the problem?  
  
  
  
Ultimately, my aim is to do some offscreen rendering using GLES from native code.  
  
  
  
Many thanks,  
  
  
  
Joel

---

<div class="post-metadata">

**Author:** ![JoeDavis](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/joedavis/32/71_2.png) [@JoeDavis](https://forums.imgtec.com/u/JoeDavis)\
**Post date:** [April 19, 2013, 8:21am UTC](https://forums.imgtec.com/t/pvrsrvcreatedcswapchain-error-on-android/1756/2 "2013-04-19T08:21:47Z")

</div>

Hi Joel,  
  
  
  
Are you building with the vanilla Android 4.0.4 (AOSP) code, or have you modified it at all? Would a [factory image](https://developers.google.com/android/nexus/images) be suitable for the work you are doing?  
  
  
  
Thanks,  
  
Joe

---

<div class="post-metadata">

**Author:** ![joelc](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@joelc](https://forums.imgtec.com/u/joelc)\
**Post date:** [April 19, 2013, 8:58am UTC](https://forums.imgtec.com/t/pvrsrvcreatedcswapchain-error-on-android/1756/3 "2013-04-19T08:58:00Z")

</div>

Thanks for your response Joe.  
  
  
  
I have got some modifications from TI that enable the writeback pipeline, but I don’t think I can share them. I haven’t tried the same tests on vanilla 4.0.4 yet. It is certainly possible that those modifications have had an effect.  
  
  
  
At the moment I seem to have worked around the issue by using SurfaceTextureClient, like in  
  
frameworks/base/libs/gui/tests/SurfaceTexture\_test.cpp  
  
  
  
Joel

---

<div class="post-metadata">

**Author:** ![JoeDavis](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/joedavis/32/71_2.png) [@JoeDavis](https://forums.imgtec.com/u/JoeDavis)\
**Post date:** [April 19, 2013, 9:02am UTC](https://forums.imgtec.com/t/pvrsrvcreatedcswapchain-error-on-android/1756/4 "2013-04-19T09:02:46Z")

</div>

Hi Joel,  
  
  
  
Glad to hear you’ve found a way to work around the problem 🙂  
  
  
  
Our Android expert is out of the office this week. I’ll ask him to look at this once he’s back.  
  
  
  
Thanks,  
  
Joe
