wasabeef/android-gpuimage · critical · IllegalArgumentException

No config chosen

Error message

No config chosen

What it means

All returned EGLConfigs were inspected by chooseConfig(egl, display, configs) and none matched the ComponentSizeChooser's criteria (RGB bit sizes / alpha / depth), so it returned null. Unlike errors 1-2, EGL worked; the device's configs simply don't pass the chooser's filter.

Solutions

  1. Relax ComponentSizeChooser matching (use >= comparisons or EGL_DONT_CARE for non-essential sizes)
  2. Fall back to the first returned EGLConfig instead of throwing
  3. Accept RGB565 as fallback: set requested bits to 5/6/5 on constrained devices
  4. Verify with eglGetConfigs what bit depths the device actually exposes

Example fix

// before
if (config == null) throw new IllegalArgumentException("No config chosen");
// after
if (config == null && configs.length > 0) {
    config = configs[0]; // best-effort fallback
} else if (config == null) { throw ...; }
Defensive patterns

Strategy: fallback

Validate before calling

// Pre-check chooser criteria against real configs
EGLConfig[] configs = new EGLConfig[numConfigs];
// after fill: if (chooseConfig(...) == null) accept configs[0];

Try / catch

// catch (IllegalArgumentException e) { switch chooser to 'first available config' mode and retry }

Prevention

When it happens

Trigger: Device reports configs whose red/green/blue/alpha sizes differ from the requested values (e.g. 5-6-5 RGB instead of 8-8-8) while the spec only set minimum desired sizes loosely.

Common situations: Low-end devices with RGB565-only surfaces, emulators in software GL mode, headerless devices where alpha isn't supported.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of wasabeef/android-gpuimage@ceea576ec9 (2026-09-11). Data as JSON: /api/errors/39cf389455d3c182. Report an issue: GitHub.

Appendix: source

Thrown at library/src/main/java/jp/co/cyberagent/android/gpuimage/GLTextureView.java:792

        public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
            int[] num_config = new int[1];
            if (!egl.eglChooseConfig(display, mConfigSpec, null, 0, num_config)) {
                throw new IllegalArgumentException("eglChooseConfig failed");
            }

            int numConfigs = num_config[0];

            if (numConfigs <= 0) {
                throw new IllegalArgumentException("No configs match configSpec");
            }

            EGLConfig[] configs = new EGLConfig[numConfigs];
            if (!egl.eglChooseConfig(display, mConfigSpec, configs, numConfigs, num_config)) {
                throw new IllegalArgumentException("eglChooseConfig#2 failed");
            }
            EGLConfig config = chooseConfig(egl, display, configs);
            if (config == null) {
                throw new IllegalArgumentException("No config chosen");
            }
            return config;
        }

        abstract EGLConfig chooseConfig(EGL10 egl, EGLDisplay display, EGLConfig[] configs);

        protected int[] mConfigSpec;

        private int[] filterConfigSpec(int[] configSpec) {
            if (eglContextClientVersion != 2) {
                return configSpec;
            }
            /* We know none of the subclasses define EGL_RENDERABLE_TYPE.
             * And we know the configSpec is well formed.
             */
            int len = configSpec.length;
            int[] newConfigSpec = new int[len + 2];
            System.arraycopy(configSpec, 0, newConfigSpec, 0, len - 1);

View on GitHub (pinned to ceea576ec9)