Imagination PowerVR SDK Blog

PVRSRVCreateDCSwapChain Error On Android


#1

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


#2

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 be suitable for the work you are doing?



Thanks,

Joe


#3

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


#4

Hi Joel,



Glad to hear you’ve found a way to work around the problem :slight_smile:



Our Android expert is out of the office this week. I’ll ask him to look at this once he’s back.



Thanks,

Joe