# Optimize lower-tier devices

> Reduce camera and effect workload on supported lower-tier devices while preserving one stable processing pipeline and measurable quality targets.

> For AI agents: the complete documentation index is at https://nosmai.com/llms/effects.txt

Product: Nosmai Effects
Group: guide
Source: https://nosmai.com/docs/effects/guides/performance/optimize-lower-tier-devices/

## Prerequisites

- A failing or marginal row in the physical-device qualification matrix
- A reproducible package, camera configuration, and session duration
- Release-build measurements for frame rate, memory, and thermal state

## Reduce the input workload

Start at 720p and 30 FPS. Increase resolution only when the target device
matrix proves the higher setting remains stable. Avoid a second camera
controller, per-frame image conversion, synchronous readback, and unnecessary
preview duplication.

## Reduce active processing

1. Keep one authored package active in each intended slot.
2. Disable background segmentation when no background feature is visible.
3. Remove beauty or makeup controls that are set to their neutral value.
4. Avoid starting processed-frame sampling unless the app consumes it.
5. Prefer one optimized package over chaining several packages with equivalent
   output.

The native runtime can selectively skip inference work and adjust recording
workload on measured lower-tier Android devices. Host code should still avoid
adding its own unbounded queues.

## Use latest-frame backpressure

When a consumer cannot keep up, replace pending work with the newest frame.
Never accumulate camera frames to preserve every callback; that increases
latency and memory until the user sees an old preview.

## Verify the optimized experience

Repeat preview, recording, streaming, background/foreground, camera switching,
and navigation loops. An optimization is acceptable only when it preserves the
required effect output and does not create lifecycle or media regressions.

## Common errors

| Symptom | Cause | Fix |
| --- | --- | --- |
| FPS improves but touch or controls lag | Work moved to the UI thread | Keep camera and package mutations serialized without blocking UI work |
| Latency grows during streaming | The host queues every processed frame | Use latest-frame backpressure and release native texture slots promptly |
| Memory rises after every screen visit | Preview, listener, or provider cleanup is incomplete | Stop media work, remove listeners, release the camera owner, then clean up |

## Next steps

- [Qualify devices and effects](/docs/effects/guides/performance/qualify-devices/)
- [Reduce application size](/docs/effects/guides/performance/reduce-app-size/)
- [Troubleshoot runtime problems](/docs/effects/troubleshooting/)

## References

- [Limits and performance](/docs/effects/limits-and-performance/)
- [Rendering pipeline](/docs/effects/concepts/how-the-pipeline-works/)
