2013년 7월 25일 목요일

OpenGL Error Codes

OpenGL Error Codes  ( http://www.opengl.org/wiki/OpenGL_Error_Codes)


In OpenGL, the function glGetError() tells you if an error has occurred in a program; 
for example, if you pass an invalid value to a function. 
When an error occurs, an error code is saved by the implementation. 
This error code will be the return value of glGetError() next time it is called.

Error Codes returned by glGetError:
  • GL_INVALID_ENUM​, 0x0500: 
      Given when an enumeration parameter is not a legal enumeration for that function. 
      This is given only for local problems; if the spec allows the enumeration in certain circumstances, 
      and other parameters or state dictate those circumstances, then GL_INVALID_OPERATION​ is the result instead.

  • GL_INVALID_VALUE​, 0x0501: 
      Given when a value parameter is not a legal value for that function. 
      This is only given for local problems; if the spec allows the value in certain circumstances, 
      and other parameters or state dictate those circumstances, then GL_INVALID_OPERATION is the result instead.

  • GL_INVALID_OPERATION​, 0x0502: 
      Given when the set of state for a command is not legal for the parameters given to that command. 
      It is also given for commands where combinations of parameters define what the legal parameters are.

  • GL_STACK_OVERFLOW​, 0x0503: 
      Given when a stack pushing operation cannot be done because it would overflow the limit of that stack's size.

  • GL_STACK_UNDERFLOW​, 0x0504: 
      Given when a stack popping operation cannot be done because the stack is already at its lowest point.

  • GL_OUT_OF_MEMORY​, 0x0505: 
      Given when performing an operation that can allocate memory, but the memory cannot be allocated. 
      The results of OpenGL functions that return this error are undefined; it is allowable for partial operations to happen.

  • GL_INVALID_FRAMEBUFFER_OPERATION​, 0x0506: 
      Given when doing anything that would attempt to read from or write/render to a framebuffer that is not complete, as defined here.

  • GL_TABLE_TOO_LARGE​1, 0x8031: 
      Part of the ARB_imaging extension.

1: These error codes are deprecated in 3.0 and removed in 3.1 core and above.

2013년 7월 24일 수요일

Installing Sun JDK 6 Update on Ubuntu 12.04


64bit Ubuntu에서는 apt-get install을 통한 sun-java6-jdk의 설치시 아래와 같은 에러가 발생한다.
The following packages have unmet dependencies:
 sun-java6-jdk:i386 : Depends: sun-java6-bin:i386 (>= 6.30-2~precise1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

apt-get install을 통해 설치가능한 oracle-java7-installer은 Android Platform Build 에서 Java Version error 가 발생한다.

Sun Java Download Centre. 에서 jdk 바이너리 다운로드 후 설치하는 방법에 대해 정리한다.

Installing Sun JDK 6 Update on Ubuntu 12.04

  1. Download the jdk-6u32-linux-i586.bin from the Sun Java Download Centre. If you are on 64-bit Ubuntu, you should grab jdk-6u32-linux-x64.bin.
  2. Make the bin file executable:
    1chmod +x jdk-6u32-linux-x64.bin
  3. Extract the bin file:
    1./jdk-6u32-linux-x64.bin
  4. Move extracted folder to this location:
    1sudo mv jdk1.6.0_32 /usr/lib/jvm/
  5. Install the new Java source in system:
    1sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_32/bin/javac 1
    2sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_32/bin/java 1
    3sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_32/bin/javaws 1
  6. Choose default Java:
    1sudo update-alternatives --config javac
    2sudo update-alternatives --config java
    3sudo update-alternatives --config javaws
  7. Check the Java version:
    1java -version
  8. Verify the symlinks all point to the new Java location:
    1ls -la /etc/alternatives/java*

2013년 7월 20일 토요일

Install Google Gapps - Nexus.S JB.4.2

AOSP plain source를 이용해서 생성한 이미지에는 google 관련 Application이 포함되어 있지 않습니다. Google Play, Google Talk, Google Sync, YouTube,....
Google Play만 있으면 Android Market에서 다운로드 받을 수 있는 항목이지만, 정작 필요한 Google Play 조차 없다는 것이지요.

구글링을 통해 Vending.apk, 등 몇 가지 package를 받아서 실행시켜보면 제대로 동작하지도 않고,  "com.google.process.gapps" 에 문제가 있어 종료한다는 팝업창을 만나게 됩니다.

이번 업그레이드 작업을 통해 gapps를 업데이트 하는 방법을 찾았습니다.
세상에는 이미 이런 문제점들을 경험해 보고 정리해 놓은 사람들이 참 많더군요.

우선 gapps가 무엇인지 궁금했습니다.
#TeamAndroid 라는 곳에서는 Android Device에 포함되어 있는 Google 이 소유권을 가진 Application이라고 정의합니다.

Google Gapps

Google Gapps (or Google Apps as they are meant) are the proprietary applications by Google included in many Android devices. These are the core Google apps that arefound in almost all phones and tablets. Most of the Gapps Google applications can now be found and updated via the Google Play Store. These apps are always running in Android under the process of com.google.process.gapps!


How to install gapps


Device의 Android 버전에 맞는 gapps package를 다운 받아서 설치만 하면 됩니다. 
( google에서 gapps download로 검색해보면 많이 나옵니다. )

1. Copy gapps(gapps-XXX.zip) to SDCard


2. Overwrite and execute shell script 

// remount
shell@android:/sdcard # mount -o remount rw /
shell@android:/sdcard # unzip -o gapps-jb-20121212-signed-4.2.x.zip -x "META-INF*" -d /


signed-4.2.x.zip -x "META-INF*" -d /                                          <
Archive:  gapps-jb-20121212-signed-4.2.x.zip
  inflating: install-optional.sh
  inflating: optional/face/addon.d/71-gapps-faceunlock.sh
  inflating: optional/face/app/FaceLock.apk
  inflating: optional/face/lib/libfacelock_jni.so
  inflating: optional/face/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.7/left_eye-y0-yi45-p0-pi45-r0-ri20.lg_32/full_model.bin
  inflating: optional/face/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.7/nose_base-y0-yi45-p0-pi45-r0-ri20.lg_32/full_model.bin
  inflating: optional/face/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.7/right_eye-y0-yi45-p0-pi45-r0-ri20.lg_32-2/full_model.bin
  inflating: optional/face/vendor/pittpatt/models/detection/yaw_roll_face_detectors.6/head-y0-yi45-p0-pi45-r0-ri30.4a-v24/full_model.bin
  inflating: optional/face/vendor/pittpatt/models/detection/yaw_roll_face_detectors.6/head-y0-yi45-p0-pi45-rn30-ri30.5-v24/full_model.bin
  inflating: optional/face/vendor/pittpatt/models/detection/yaw_roll_face_detectors.6/head-y0-yi45-p0-pi45-rp30-ri30.5-v24/full_model.bin
  inflating: optional/face/vendor/pittpatt/models/recognition/face.face.y0-y0-22-b-N/full_model.bin
  inflating: optional/photosphere/lib/liblightcycle.so
  inflating: optional/photosphere/mako/addon.d/73-gapps-mako.sh
  inflating: optional/photosphere/mako/app/GalleryGoogle.apk
  inflating: optional/photosphere/manta/addon.d/75-gapps-manta.sh
  inflating: optional/photosphere/manta/app/GalleryGoogle.apk
  inflating: optional/photosphere/tuna/addon.d/74-gapps-tuna.sh
  inflating: optional/photosphere/tuna/app/GalleryGoogle.apk
  inflating: system/addon.d/70-gapps.sh
  inflating: system/app/ChromeBookmarksSyncAdapter.apk
  inflating: system/app/GenieWidget.apk
  inflating: system/app/Gmail2.apk
  inflating: system/app/GmsCore.apk
  inflating: system/app/GoogleBackupTransport.apk
  inflating: system/app/GoogleCalendarSyncAdapter.apk
  inflating: system/app/GoogleContactsSyncAdapter.apk
  inflating: system/app/GoogleEars.apk
  inflating: system/app/GoogleFeedback.apk
  inflating: system/app/GoogleLoginService.apk
  inflating: system/app/GooglePartnerSetup.apk
  inflating: system/app/GoogleServicesFramework.apk
  inflating: system/app/GoogleTTS.apk
  inflating: system/app/LatinImeDictionaryPack.apk
  inflating: system/app/MediaUploader.apk
  inflating: system/app/NetworkLocation.apk
  inflating: system/app/OneTimeInitializer.apk
  inflating: system/app/Phonesky.apk
  inflating: system/app/QuickSearchBox.apk
  inflating: system/app/SetupWizard.apk
  inflating: system/app/Talk.apk
  inflating: system/app/Talkback.apk
  inflating: system/app/VoiceSearchStub.apk
  inflating: system/etc/g.prop
  inflating: system/etc/permissions/com.google.android.maps.xml
  inflating: system/etc/permissions/com.google.android.media.effects.xml
  inflating: system/etc/permissions/com.google.widevine.software.drm.xml
  inflating: system/etc/permissions/features.xml
  inflating: system/etc/preferred-apps/google.xml
  inflating: system/framework/com.google.android.maps.jar
  inflating: system/framework/com.google.android.media.effects.jar
  inflating: system/framework/com.google.widevine.software.drm.jar
  inflating: system/lib/libfilterpack_facedetect.so
  inflating: system/lib/libfrsdk.so
  inflating: system/lib/libgcomm_jni.so
  inflating: system/lib/libgoogle_recognizer_jni.so
  inflating: system/lib/libgtalk_jni.so
  inflating: system/lib/libgtalk_stabilize.so
  inflating: system/lib/libjni_latinime.so
  inflating: system/lib/libpatts_engine_jni_api.so
  inflating: system/lib/libspeexwrapper.so
  inflating: system/lib/libvorbisencoder.so
  inflating: system/tts/lang_pico/de-DE_gl0_sg.bin
  inflating: system/tts/lang_pico/de-DE_ta.bin
  inflating: system/tts/lang_pico/es-ES_ta.bin
  inflating: system/tts/lang_pico/es-ES_zl0_sg.bin
  inflating: system/tts/lang_pico/fr-FR_nk0_sg.bin
  inflating: system/tts/lang_pico/fr-FR_ta.bin
  inflating: system/tts/lang_pico/it-IT_cm0_sg.bin
  inflating: system/tts/lang_pico/it-IT_ta.bin
  inflating: system/usr/srec/en-US/acoustic_model
  inflating: system/usr/srec/en-US/c_fst
  inflating: system/usr/srec/en-US/clg
  inflating: system/usr/srec/en-US/compile_grammar.config
  inflating: system/usr/srec/en-US/contacts.abnf
  inflating: system/usr/srec/en-US/dict
  inflating: system/usr/srec/en-US/dictation.config
  inflating: system/usr/srec/en-US/embed_phone_nn_model
  inflating: system/usr/srec/en-US/embed_phone_nn_state_sym
  inflating: system/usr/srec/en-US/endpointer_dictation.config
  inflating: system/usr/srec/en-US/endpointer_voicesearch.config
  inflating: system/usr/srec/en-US/ep_acoustic_model
  inflating: system/usr/srec/en-US/g2p_fst
  inflating: system/usr/srec/en-US/google_hotword.config
  inflating: system/usr/srec/en-US/google_hotword_clg
  inflating: system/usr/srec/en-US/google_hotword_logistic
  inflating: system/usr/srec/en-US/grammar.config
  inflating: system/usr/srec/en-US/hmmsyms
  inflating: system/usr/srec/en-US/hotword_symbols
  inflating: system/usr/srec/en-US/lintrans_model
  inflating: system/usr/srec/en-US/metadata
  inflating: system/usr/srec/en-US/norm_fst
  inflating: system/usr/srec/en-US/normalizer
  inflating: system/usr/srec/en-US/offensive_word_normalizer
  inflating: system/usr/srec/en-US/phonelist
  inflating: system/usr/srec/en-US/rescoring_lm
  inflating: system/usr/srec/en-US/symbols

3. Reboot Device


shell@android:/sdcard # reboot
reboot