Skip to content

Multi-view: respect decoder limits — instance limit per codec, overload detection, pause cells beyond capacity #83

Closed

Description

@compot-dev

Hardware decoders have hard limits. On the AG-216, /vendor/etc/media_codecs.xml declares H.264: 16 instances, H.265: 4 instances, both 489 600 macroblocks/s. With 8+1 cells this can be exceeded, and today the result is silent: a black cell, or every cell dropping frames.

Substreams help, but they are not always available. The app should report the problem and manage the cells itself:

  1. Instance limit: read MediaCodecInfo.CodecCapabilities.getMaxSupportedInstances() (Android 6+) for the hardware decoder of each codec. A cell that would exceed it does not start a decoder and shows e.g. Decoder limit: 4 × H.265. It starts automatically when another cell frees an instance.
  2. Overload detection, by measurement: the declared macroblock budget is far too conservative on some boxes (Device testing: UDP, plain RTP and RTSP multicast (#70, #72, #73) #74: about 2.7× worked), so it is not used to refuse streams. Instead, the measured decoded/received fps (see the stats issue) is used: if cells keep falling behind (below about 85 % for several seconds), the decoder is overloaded.
  3. Dynamic cell count: on overload, the highest-numbered active cell is paused, showing Paused: decoder overloaded, until the load fits. Paused cells come back when the grid is reopened. The declared budget is logged for reference.

Related: #80 (status in the cell), #76.

Activity

  1. compot-dev commented on Oct 12, 2026

    @compot-dev
    CollaboratorAuthor

    Correction to the description: the AG-216's declared budget is not too conservative. Measured in #84, the box decodes about what it declares (1080p60 in total); the earlier "2.7× worked" in #74 came from frames being dropped silently. The relief now uses decoder losses (queue overflow, no input buffer) and settles at a load close to the declared budget.

  2. added a commit that references this issue on Oct 12, 2026
  3. compot-dev commented on Oct 12, 2026

    @compot-dev
    CollaboratorAuthor

    Done in #84: the per-codec instance limit, and overload relief judged by decoder losses with a cooldown. Keeping every camera on screen with key-frame mode and a learnt capacity continues in #85.

  4. added 5 commits that reference this issue on Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions