Mobile app developers and photography enthusiasts often face the limitations of the standard Camera. API on Xiaomi smartphones. Camera2 API Opens access to advanced camera features: manual shutter speed setting, ISO, RAW-shooting and supporting third-party applications like Google Camera (GCam), but by default this interface is disabled in the firmware MIUI HyperOS β the manufacturer blocks it for βstability".
In this article you will find the most relevant ways to activate Camera2 API on Xiaomi, Redmi and other devices POCO (including the 2023-2026 models on Snapdragon and Mediatek. ADB, Important: the procedure requires technical preparation - incorrect actions can lead to loss of warranty or "brick" of the device.
What is it? Camera2 API Why do you want to include it on Xiaomi?
Camera2 API β It is a modern software interface from Google, which replaces the outdated Camera1 API (The de facto standard on most Xiaomi smartphones is out of the box:
- πΈ Manual control of shooting parameters: exposure up to 30 seconds, ISO 50 to 25600, white balance in Kelvin.
- π Support RAW (DNG): saving raw data from the matrix for post-processing in Lightroom or Darktable.
- π€ GCam Compatibility: The ability to use ported versions of Google Camera with algorithms HDR+ Night Sight.
- π₯ Advanced video features: logarithmic profile, 10-bit color, external microphones.
Xiaomi. Camera2 API Default is disabled even on flagships like Xiaomi 14 Ultra or Redmi K70 The manufacturer is motivated by βoptimizing performanceβ, but the real reason is the desire to promote their own software (Mi Camera) and limit users to the ecosystem. MIUI.
β οΈ Attention: Activation Camera2 API This can cause a standard camera application to work in an unstable manner, POCO X5 Pro) after the interface is turned on, support is lost 4K@60fps stock-chamber.
Before you start, check if your device supports Camera2 API It's at the hardware level:
- Install the app AIDA64 or Camera2 Probe from Google Play.
- Open the Camera section and find the Hardware Support Level bar.
- If so, LEGACY β No hardware support (the methods from the article will not help). LIMITED or FULL β continue.
Preparation of the device: unlocking the loader and ADB
Most activation methods Camera2 API Requires an unlocked bootloader and access to the ADB (Without it, you can only check the current status of the interface, but not change it.
Step 1: Unlock the bootloader
On Xiaomi devices, the bootloader is locked by default.
- Link your Mi Account to your device in Settings β Xiaomi Account.
- Go to Settings β About Phone β MIUI version and tap 7 times on the line to activate Developer Mode.
- Return to Settings β Additional β For developers and enable OEM Unlock and USB Debugging.
- Download the official utility Mi Unlock (requires a Windows PC).
- Connect your phone in Fastboot mode (press Power + Volume down when the device is off) and follow the program instructions.
β οΈ Attention: Unlocking the bootloader resets the device to factory settings. Data backup is mandatory! on some models (e.g. Xiaomi) 13T) When the Widevine is unblocked, it stops working. L1 (descend L3), What is blocking viewing of Full HD Netflix and Disney+.
Step 2: Setup ADB
To work with ADB on PC:
- Download Googleβs Platform Tools and unpack it to the root of the disk C:\ (The path should not contain gaps).
- Connect your phone to your PC, select File Transfer (MTP) mode.
- Open the command line (Win + R β enter cmd) and do:
cd C:\platform-tools
adb devicesIf the device is displayed in the list β ADB If not, install Xiaomi drivers manually through Device Manager.
Unlocked bootloader (bootloader)
USB debugging enabled
Installed Platform Tools on PC
The device is defined in ADB (team `adb devices`)
Data backup created-->
Method 1: Activation Camera2 API through ADB (rootless)
The safest way to turn on Camera2 API β use ADB-It works with most Xiaomi devices. MIUI 12-15 and HyperOS, but may reset after a firmware update.
Instructions:
- Connect your phone to your PC and make sure that ADB recognizes the device (the adb device command).
- Run a command to check the current status:
adb shell getprop persist.camera.HAL3.enabledIf answer 0, the interface is disabled. Type:
adb shell setprop persist.camera.HAL3.enabled 1
adb shell setprop persist.vendor.camera.HAL3.enabled 1- Reset the device:
adb rebootAfter the reboot, check the status again. If the command returns 1 β Camera2 API activated.
Challenges and solutions:
- π Reset after update: Setprop commands are temporary. To fix changes, you need to edit the build.prop file).
- π« Read-only file system error: Some firmware (HyperOS 1.0) mounts the file system in read-only mode. The solution is to use Magisk to mount the system in read-only mode. RW.
- π± Not working on Mediatek: On Mediatek chipsets (e.g. Redmi Note 12 Pro)+) You may need an additional patch through TWRP.
π‘
If, after activation, Camera2 API The standard camera app stopped running, clear its cache in Settings β Annexes β Camera. β Warehouse β Clear the cache.
Method 2: Edit build.prop (root required)
For continuous activation Camera2 API You need to edit the system file build.prop. This method requires root rights, which can be obtained through Magisk after unlocking the bootloader.
Step-by-step:
- Install Magisk and get root access (see XDA Developers for instructions for your model).
- Download any file manager with root support (such as Root Explorer or Mixplorer).
- Move to the /system/build.prop and find the lines:
persist.camera.HAL3.enabled=0
persist.vendor.camera.HAL3.enabled=0- Replace 0 by 1 and save the file.
- Change the file access permissions to 644 (long press). β Permissions).
- Reset the device.
If you donβt have strings, add them to the end of the build.prop file. For HyperOS devices, you may need to edit an additional file. /vendor/build.prop.
Risks and cautions:
- π Device Brick: Incorrect editing build.prop can lead to a download cycle.Always back up the file!
- π Loss of loss OTA-Updates: Changing system files will block the installation of updates "over the air." You will have to install firmware manually through Fastboot.
- π Performance issues: On weak devices (e.g. Redmi) 9A) Camera2 API It can cause lags when shooting in RAW.
How to restore build.prop after an error?
Method 3: Installation of a custom core or firmware
If the previous methods did not work, there remains a radical solution - installing a custom core or firmware with pre-activated Camera2 API. This method is suitable for experienced users and requires:
- π Unlocked loader.
- π Installed TWRP ornamental.
- β οΈ Understanding the risks (possible loss of warranty, unstable operation of the camera module).
Popular Firmware with Support Camera2 API:
| Firmware | Support Camera2 API | Root is required. | Compatibility |
|---|---|---|---|
| Pixel Experience | FULL | No. | Most Xiaomi devices (official and unofficial builds) |
| LineageOS | LIMITED/FULL | No. | Limited list of models (check on the XDA) |
| crDroid | FULL | No. | Flagships and the Middle Segment (Xiaomi) 12T, POCO F5) |
| MIUI EU (unofficial) | LIMITED | No. | All devices. Xiaomi/Redmi/POCO, but with the risk of account bans |
| KernelSU + patches | FULL | Yes. | Any device with KernelSU support |
Installation instructions:
- Download the right firmware for your model with XDA Developers or Telegram channels (e.g. Pixel Experience for Xiaomi 13).
- Reboot to TWRP (Put Power + Volume up when the phone is off).
- Make a backup of the current firmware (Backup) β Select sections β Swipe to Backup).
- Flip the firmware through Install β Choose. ZIP β Swipe to Confirm Flash.
- After installation, run the Wipe β Format Data (required, otherwise the system will not boot!).
β οΈ Note: Unofficial firmware may contain vulnerabilities or spyware. download only from verified sources (official groups in Telegram, topics on the Internet). XDA On some models (Redmi Note 11 Pro)+) Custom firmware breaks the main camera β check reviews before installing.
Verification of work Camera2 API and GCam tuning
After activation Camera2 API You need to check its performance and configure third-party applications (for example, Google Camera).
Step 1: Checking through Camera2 Probe
Install the app Camera2 API Probe from Google Play and pay attention to the following options:
- Hardware Support Level: Must be LIMITED or FULL.
- RAW Support: YES (if you're planning to shoot in DNG).
- Manual Sensor: YES (manually ISO/extraction).
- Manual Lens: YES (manually focused).
If any parameters are marked as NO, Your device does not support them at the hardware level (even after activation). Camera2 API).
Step 2: Install and configure Google Camera
For maximum quality of photos:
- Download the compatible version of GCam for your model (recommended builds:
- π± Xiaomi 13/14 series: BSG GCam or Shamim GCam.
- π± Redmi K60/K70: Wichaya GCam.
- π± POCO F4/F5: Nikita GCam.
- Install. APK-file (permission to install from unknown sources may be required).
- Import. XML-Config for your model (download on Celso Azevedo or XDA).
- In the GCam settings, enable:
Activate Camera2 API (under "Developer Settings")
Insert HDR+ Enhanced
Select a processing model (e.g., "Pixel 7 Pro" for flagships)
Activate Night Sight for the front cameraOn some devices (Redmi Note 12 Pro) GCam may not start due to conflict with the GCam. MIUI Camera.The solution is to disable the camera's stock app through ADB:
adb shell pm disable-user --user 0 com.miui.cameraπ‘
Even after successful activation Camera2 API some functions of GCam (for example, 8K-Video or Astrophotography may not work due to chipset hardware limitations or drivers.
Frequent problems and their solutions
Activation Camera2 API Xiaomi is often accompanied by errors. Let's look at typical scenarios and ways to fix them.
Problem 1: The camera stopped working after turning on Camera2 API
Symptoms:
- The camera's stock app gives an error "Can't connect to the camera."
- When GCam is launched, a message appears: "Camera" API2 not supported".
Decisions:
- Clear the cache and data of the camera app in Settings β Annexes.
- Reverse changes to build.prop (if you edited it).
- Install an alternative camera app (such as Open Camera or Footage).
Problem 2: RAW-shooting's down
Reasons:
- Chipset does not support preservation RAW (For example, Snapdragon 6xx series).
- No line in build.prop persist.camera.raw.enabled=1.
- The camera app is not optimized for your model.
Decisions:
adb shell setprop persist.camera.raw.enabled 1
adb shell setprop persist.vendor.camera.raw.enabled 1Restart the device and check for the option. RAW Open Camera or GCam.
Problem 3: After the update MIUI Camera2 API throw off
Firmware MIUI And HyperOS often resets custom build.prop settings after the upgrade:
- Turn off automatic updates in Settings β The phone. β Updating the system.
- Use Magisk to create a module that will apply patches after each reboot.
- Install a custom Recovery (TWRP) and flash updates manually, pre-save build.prop.