How to change the audio codec Bluetooth on Xiaomi: optimization of sound in headphones

Most Xiaomi users are unaware that the sound quality of wireless headphones depends not only on the device model, but also on the chosen Bluetooth audio codec. By default, smartphones often use a standard SBC, which provides minimal transmission quality. Meanwhile, modern devices support advanced codecs like aptX, LDAC or AAC, which can dramatically improve the sound.

The problem is, MIUI It hides these settings in the back of the menu, and in some models they are blocked altogether. In this article, we will look at all the ways to change the codec, from standard settings to engineering menus and the following: ADB-You will learn which codec is best for your headphones, how to check the current one and what to do if the desired option is missing.

โš ๏ธ Important: Not all codecs are compatible with every device. For example, aptX requires support from both your smartphone and headphones. Before changing your settings, make sure your headset supports the format you choose.

Why you should change the audio codec for Xiaomi

The standard SBC codec, which is the default smartphone, was developed back in the 1990s, and it provides basic compatibility, but it compresses sound greatly, losing detail.

  • ๐ŸŽต High bitrate quality: LDAC transmits sound with a bitrate of up to 990 kbit / s (versus 328 kbit / s y) SBC), This is almost indistinguishable from wired connection.
  • ๐Ÿ”Š Low latency: aptX Low Latency reduces lag to 40ms โ€“ critical for gaming and video.
  • ๐ŸŽง Broad range: AAC It is better at transmitting high and low frequencies that are important to music.
  • ๐Ÿ”‹ Energy efficiency: Some codecs (e.g. aptX Adaptive) dynamically adjust bitrates, saving battery life.

In practice, the difference is particularly noticeable when listening to music in FLAC or WAV. Compare for yourself: when using SBC, high frequencies can cut your ears, and the bass sounds blurry. With LDAC or aptX HD, tracks become volume and clarity.

โš ๏ธ Note: Cheap headphones (up to 3000)โ‚ฝ) The difference between the codecs may be invisible due to weak speakers. Before setting up, check the characteristics of your headset on the manufacturer's website.

๐Ÿ“Š What headphones do you use with Xiaomi?
AirDots
Sony WH-1000XM
JBL
Other TWS
Wired

How to check the current audio codec on Xiaomi

Before you change your settings, you need to know what codec is currently in use. There are two ways MIUI can do this:

Method 1. Through the notification panel (works on MIUI 12-14):

  1. Put your headphones on Bluetooth.
  2. Open the notification bar (swipe down).
  3. Find the Device or Bluetooth tab.
  4. Click on your headphonesโ€™ name and the current codec (such as AAC) will show up.

Method 2. Through the engineering menu (for all versions):

  1. Enter the code in the phone app: ##4636##
  2. Select Phone Information.
  3. Scroll to the Bluetooth block, there will be a string of Audio Codec.

If the codec is not in the engineering menu, then your Xiaomi model does not support software change, in which case only the firmware with a modified Bluetooth stack will help (more about this below).

What to do if the codec is not displayed?
If the engineering menu doesn't have the "Audio Codec" line, it means your smartphone is using a proprietary Bluetooth stack from Qualcomm or MediaTek that doesn't disclose that information, and 90% of the time, that means that the device is tied to an SBC or AAC without the ability to change.

Change the audio codec through standard MIUI settings

On most Xiaomi smartphones (Redmi Note 10/11/12 series, POCO X3/X4, Mi 11/12), the codec changes as follows:

  1. Put your headphones on Bluetooth.
  2. Go to Settings โ†’ Connected devices โ†’ Bluetooth.
  3. Click on the gear next to your headphones.
  4. Select Sound Quality or Audio Codec (the names may vary).
  5. In the list of available codecs, select the desired one (for example, aptX Adaptive or LDAC).

โš ๏ธ Note: Some firmware (especially global ones) may not have this item, so try changing the system region to India or Europe, sometimes unlocking hidden settings.

โ˜‘๏ธ Preparation for codec change

Done: 0 / 4

Available codecs and their features:

CodecMax. bitrate.Delay.Xiaomi supportBetter for you.
SBC328 kbps~100 ms.All models.Basic compatibility
AAC250โ€“320 kbit/s~80 ms.All models.Music (Apple AirPods)
aptX352 kbps~40 ms.Models with SnapdragonGames, videos
LDAC990 kbps~50 ms.Flagships (Mi 10/11/12)Hi-Res audio
LHDC900 kbps~30 ms.New models (2023+)Quality/delay balance

Unlocking hidden codecs through ADB

If the settings do not have the desired codec, it can be activated via ADB-This method works for teams. 80% Xiaomi devices with Qualcomm processors (Snapdragon) 6xx/7xx/8xx). You'll need it:

  • ๐Ÿ–ฅ๏ธ Computer with installed ADB Tools.
  • ๐Ÿ“ฑ Included debugging by USB on a smartphone (Settings) โ†’ The phone. โ†’ Version. MIUI โ€” Press 7 times, then return to Additional โ†’ For developers โ†’ Debugging by USB).
  • ๐Ÿ”Œ USB-cable (preferably original).

Step-by-step:

  1. Connect the phone to the PC and confirm the debugging permission.
  2. Open the command prompt (Windows) or terminal (Mac/Linux) in the folder with ADB.
  3. Enter the command to check the connection: Adb devices must display the serial number of your device.
  4. Execute the command to unlock all codecs: adb shell settings put global bluetooth_a2dp_offload_capability 15
  5. Reboot your smartphone.

After the reboot, the full list of supported codecs will appear in the Bluetooth settings. If the command does not work, try an alternative option:

adb shell settings put global bluetooth_a2dp_offload_disabled 0

โš ๏ธ Note: Some firmware (e.g. HyperOS) may reset these commands after the update. To record changes, use the Bluetooth Audio Codec module in Magisk.

๐Ÿ’ก

If the codec changes, try lowering the bitrate. For LDAC, type the command:

adb shell settings put global bluetooth_ldac_bitrate 2

Change the codec through the Engineering Menu (MTK)

MediaTek processor devices (e.g. Redmi 9/10A, POCO M3/M4) require a different approach, where the codec changes through a hidden engineering menu:

  1. Enter the code in the phone application: ##36446337##
  2. Go to Hardware Testing โ†’ Audio โ†’ Bluetooth Audio.
  3. Find the Codec Selection option and select the option you want.
  4. Save the settings and restart the phone.

On some models (for example, Redmi Note 8 Pro) after changing the codec through the engineering menu, the sound may disappear in the headphones, in which case, return the settings to the factory or stitch the Bluetooth module through TWRP.

If the engineering menu is not available, try the alternative code:

##83781##

It opens the Version Info menu, where additional options are sometimes available in the Bluetooth section.

Firmware custom Bluetooth stack

For owners of older models (e.g. Redmi 4X, Mi A1) or devices with cropped firmware (e.g. for the Russian market), standard methods may not work.

  • ๐Ÿ“ฑ Requirements: Unlocked loader and installed TWRP.
  • ๐Ÿ”ง Tools: Bluetooth Library Patcher for Magisk.
  • โš™๏ธ Risks: Incorrect firmware can lead to loss of Bluetooth connectivity.

Instructions:

  1. Download the right module for your model from the XDA Developers forum.
  2. Install it through Magisk Manager.
  3. Reboot the phone.
  4. Check the available codecs in Bluetooth settings.

๐Ÿ”น Popular modules:

  • ๐ŸŽง LDAC Enabler adds support LDAC on unoptimized devices.
  • ๐Ÿ”Š aptX & AAC Patch โ€“ Corrects coding errors on MediaTek.
  • ๐Ÿ“ก Bluetooth Stack Switcher โ€“ allows you to switch between Qualcomm and Google stacks.

โš ๏ธ Note: After firmware custom stack may lose support for some functions (for example, Dual Audio or Bluetooth). LE). Before installing, make a backup section /vendor into TWRP.

๐Ÿ’ก

Firmware custom Bluetooth stack is an extreme method, before you make sure to check whether the problem is solved by standard methods (ADB or engineering menu).

Solving problems after changing the codec

Sometimes when you change the audio codec, you get a problem, and here are the most common ways to fix it:

1.The sound is interrupted or distorted

  • ๐Ÿ”น Reduce bitrate (for the LDAC: adb shell settings put global bluetooth_ldac_bitrate 1 โ€” it 330 quid).
  • ๐Ÿ”น Turn off high-resolution audio in Bluetooth settings.
  • ๐Ÿ”น Switch to the switch. AAC โ€” It is more stable on weak processors.

2. Headphones don't connect

  • ๐Ÿ”น Reset Bluetooth Settings: Settings โ†’ Annexes โ†’ Application management โ†’ Three points. โ†’ Reset the settings.
  • ๐Ÿ”น Remove a couple of headphones and reconnect.
  • ๐Ÿ”น Check if the codec is in conflict with Dual Audio (disable it).

3. High battery consumption

  • ๐Ÿ”น Codecs. LDAC aptX HD They increase energy. Switch to power. AAC or SBC.
  • ๐Ÿ”น Turn off the absolute volume in the headphone settings.

If the problem doesnโ€™t go away, return the standard codec (SBC) and check the headphones on another device โ€” the headset may be faulty.

FAQ: Frequent questions about changing the audio codec to Xiaomi

๐Ÿ”น Which codec is best to choose for music?
For high-quality music (FLAC, WAV) listening, LDAC (990 kbps) or LHDC (900 kbps) are optimal. If your headphones don't support them, choose AAC, which is better than SBC for medium and high frequencies. AAC is enough for streaming (Spotify, YouTube).
๐Ÿ”น Why my Xiaomi doesnโ€™t have the option to change the codec?
It could be related to: ๐Ÿ“ฑ Refreshing the old slate (refresh) MIUI last-minute). ๐ŸŒ Regional restrictions (try to change region to India or Europe). ๐Ÿ”ง Hardware restrictions (budget models on MediaTek Helio) G35/G80 If nothing helps, all that remains is the firmware of the custom Bluetooth stack.
๐Ÿ”น Can I change the codec to Redmi? 9A?
On the Redmi. 9A (Other budget models on MediaTek Helio G25/G35) You can't change the codec through the settings. The only working ways are: Use ADB-Adb shell settings put global bluetooth_a2dp_offload_capability 3 (unlock AAC). Swipe the Bluetooth Library Patcher module through Magisk (requires an unlocked bootloader). LDAC This device is not worth it - iron will not pull.
๐Ÿ”น Does the codec affect the delay of sound in games?
Yes, critical. For games, choose low latency codecs: ๐ŸŽฎ aptX Low Latency (~40 ms is the best option. ๐ŸŽง LHDC LL (~30 ms โ€“ if the headphones support. ๐Ÿšซ LDAC (~50-100 ms) โ€” not suitable for shooters. Also turn off Absolute Volume in Bluetooth settings โ€” this will reduce lag by 10-15 ms.
๐Ÿ”น How to return the standard settings if the sound is gone?
If after experimenting with codecs, the sound in the headphones disappeared: Reset Bluetooth settings: Settings โ†’ Annexes โ†’ Application management โ†’ Three points. โ†’ Reset the settings โ†’ Bluetooth. Return the codec to SBC through ADB: adb shell settings put global bluetooth_a2dp_offload_capability 0 If it doesnโ€™t work, run a standard Bluetooth module through the TWRP (download the stock vendor.img for your model).