Invalid LHDC-Codec


Kai-ZD2018

Members
Jun 15, 2018
36
20
With the new build 9.11.7 the LHDC codec is also available for devices based on Android 10. Previously it was only active for Android 9 respectively was displayed in developer settings.

Now I wanted to try the codec with two compatible headphones. Neither with the Sennheiser IE80 S BT nor with Xiaomi Mi Air 2 can a connection with LHDC be established. The IE80S BT can only be used with aptx HD and the Mi Air 2 only with AAC. The attempt to activate the LHDC codec in the developer settings also failed.

I tested the headphones with a Mi MIX 2S (MIUI 11.0.3 Stable) and a Mi 9 (MIUI 11.1 9.11.7) as well as a MI MIX 3 (MIUI 11.1 9.11.7).

The logcat says something about an unknown codec. Now I don't know if the LHDC codec is meant in the smartphone or if it is not supported by the headphones.

I would be very happy if the developers could have a look at it.

Code:
MIX 2S
11-10 11:51:55.298  4450 24764 D A2dpStateMachine: A2DP Codec Local Capability: {codecName:aptX HD,mCodecType:3,mCodecPriority:4001,mSampleRate:0x1(44100),mBitsPerSample:0x2(24),mChannelMode:0x2(STEREO),mCodecSpecific1:0,mCodecSpecific2:0,mCodecSpecific3:0,mCodecSpecific4:0}
11-10 11:51:55.299  4450 24764 D A2dpStateMachine: A2DP Codec Local Capability: {codecName:UNKNOWN CODEC(6),mCodecType:6,mCodecPriority:7001,mSampleRate:0x2(48000),mBitsPerSample:0x1(16),mChannelMode:0x1(MONO),mCodecSpecific1:0,mCodecSpecific2:0,mCodecSpecific3:0,mCodecSpecific4:0}
11-10 11:51:55.299  4450 24764 D A2dpStateMachine: A2DP Codec Local Capability: {codecName:LDAC,mCodecType:5,mCodecPriority:5001,mSampleRate:0xf(44100|48000|88200|96000),mBitsPerSample:0x7(16|24|32),mChannelMode:0x3(MONO|STEREO),mCodecSpecific1:0,mCodecSpecific2:0,mCodecSpecific3:0,mCodecSpecific4:0}
11-10 11:51:55.299  4450 24764 D A2dpStateMachine: A2DP Codec Local Capability: {codecName:aptX,mCodecType:2,mCodecPriority:3001,mSampleRate:0x1(44100),mBitsPerSample:0x1(16),mChannelMode:0x2(STEREO),mCodecSpecific1:0,mCodecSpecific2:0,mCodecSpecific3:0,mCodecSpecific4:0}
11-10 11:51:55.299  4450 24764 D A2dpStateMachine: A2DP Codec Local Capability: {codecName:AAC,mCodecType:1,mCodecPriority:2001,mSampleRate:0x1(44100),mBitsPerSample:0x1(16),mChannelMode:0x2(STEREO),mCodecSpecific1:0,mCodecSpecific2:0,mCodecSpecific3:0,mCodecSpecific4:0}
11-10 11:51:55.299  4450 24764 D A2dpStateMachine: A2DP Codec Local Capability: {codecName:SBC,mCodecType:0,mCodecPriority:1001,mSampleRate:0x1(44100),mBitsPerSample:0x1(16),mChannelMode:0x3(MONO|STEREO),mCodecSpecific1:0,mCodecSpecific2:0,mCodecSpecific3:0,mCodecSpecific4:0}
11-10 11:51:55.299  4450 24764 D A2dpStateMachine: A2DP Codec Selectable Capability: {codecName:aptX HD,mCodecType:3,mCodecPriority:4001,mSampleRate:0x1(44100),mBitsPerSample:0x2(24),mChannelMode:0x2(STEREO),mCodecSpecific1:0,mCodecSpecific2:0,mCodecSpecific3:0,mCodecSpecific4:0}
11-10 11:51:55.300  4450 24764 D A2dpStateMachine: A2DP Codec Selectable Capability: {codecName:aptX,mCodecType:2,mCodecPriority:3001,mSampleRate:0x1(44100),mBitsPerSample:0x1(16),mChannelMode:0x2(STEREO),mCodecSpecific1:0,mCodecSpecific2:0,mCodecSpecific3:0,mCodecSpecific4:0}
11-10 11:51:55.300  4450 24764 D A2dpStateMachine: A2DP Codec Selectable Capability: {codecName:AAC,mCodecType:1,mCodecPriority:2001,mSampleRate:0x1(44100),mBitsPerSample:0x1(16),mChannelMode:0x2(STEREO),mCodecSpecific1:0,mCodecSpecific2:0,mCodecSpecific3:0,mCodecSpecific4:0}
11-10 11:51:55.300  4450 24764 D A2dpStateMachine: A2DP Codec Selectable Capability: {codecName:SBC,mCodecType:0,mCodecPriority:1001,mSampleRate:0x1(44100),mBitsPerSample:0x1(16),mChannelMode:0x3(MONO|STEREO),mCodecSpecific1:0,mCodecSpecific2:0,mCodecSpecific3:0,mCodecSpecific4:0}

Code:
Mi 9
11-10 12:41:23.368 16602 16629 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:41:23.368 16602 16629 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:41:23.368 16602 16629 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:41:23.368 16602 16629 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:41:23.368 16602 16629 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:41:23.369 16602 16629 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:41:23.369 16602 16629 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:41:23.369 16602 16629 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:41:23.369 16602 16629 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:41:23.370 16602 16651 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:41:23.370 16602 16651 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:42:03.728 18203 18230 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:42:03.729 18203 18230 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:42:03.729 18203 18230 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:42:03.729 18203 18230 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:42:03.729 18203 18230 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:42:03.729 18203 18230 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:42:03.729 18203 18230 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:42:03.729 18203 18230 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:42:03.729 18203 18230 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:42:03.729 18203 18230 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:42:03.730 18203 18253 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:42:03.730 18203 18253 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:42:13.965 18428 18428 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:42:13.965 18428 18428 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:42:13.965 18428 18428 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:42:13.965 18428 18428 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:42:13.965 18428 18428 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:42:13.965 18428 18428 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:43:38.502 18428 18490 D A2dpService: setCodecConfigPreference(null): {codecName:UNKNOWN CODEC(9),mCodecType:9,mCodecPriority:1000000,mSampleRate:0x1(44100),mBitsPerSample:0x2(24),mChannelMode:0x2(STEREO),mCodecSpecific1:32771,mCodecSpecific2:49154,mCodecSpecific3:0,mCodecSpecific4:0}
11-10 12:43:38.503 18428 18490 W A2dpCodecConfig: Codec is not selectable: {codecName:UNKNOWN CODEC(9),mCodecType:9,mCodecPriority:1000000,mSampleRate:0x1(44100),mBitsPerSample:0x2(24),mChannelMode:0x2(STEREO),mCodecSpecific1:32771,mCodecSpecific2:49154,mCodecSpecific3:0,mCodecSpecific4:0}

Code:
MIX3
11-10 12:59:39.186  2291  2401 E bt_btif : bta_av_get_peer_a2dp_codecs() i = 5
11-10 12:59:44.354  2291  2401 I a2dp_codec: A2dp_SetOffloadStatus:status = 1
11-10 12:59:44.354  2291  2401 D a2dp_codec: init
11-10 12:59:44.355  2291  2401 D a2dp_codec: createCodec: codec SBC
11-10 12:59:44.355  2291  2401 I a2dp_codec: init: updated SBC codec priority to 1001
11-10 12:59:44.355  2291  2401 D a2dp_codec: createCodec: codec AAC
11-10 12:59:44.355  2291  2401 I a2dp_codec: init: updated AAC codec priority to 2001
11-10 12:59:44.355  2291  2401 D a2dp_codec: createCodec: codec aptX
11-10 12:59:44.355  2291  2401 I a2dp_codec: init: updated aptX codec priority to 3001
11-10 12:59:44.355  2291  2401 D a2dp_codec: createCodec: codec aptX-HD
11-10 12:59:44.355  2291  2401 I a2dp_codec: init: updated aptX-HD codec priority to 4001
11-10 12:59:44.355  2291  2401 D a2dp_codec: createCodec: codec aptX-adaptive
11-10 12:59:44.355  2291  2401 I a2dp_codec: init: updated aptX-adaptive codec priority to -1
11-10 12:59:44.355  2291  2401 D a2dp_codec: createCodec: codec LDAC
11-10 12:59:44.355  2291  2401 I a2dp_codec: init: updated LDAC codec priority to 6001
11-10 12:59:44.356  2291  2401 D a2dp_codec: createCodec: codec aptX-TWS
11-10 12:59:44.356  2291  2401 I a2dp_codec: init: updated aptX-TWS codec priority to 7001
11-10 12:59:44.356  2291  2401 D a2dp_codec: createCodec: codec SBC SINK
11-10 12:59:44.356  2291  2401 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:59:44.356  2291  2401 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:59:44.356  2291  2401 I a2dp_codec: init: initialized Source codec aptX-TWS
11-10 12:59:44.356  2291  2401 I a2dp_codec: init: initialized Source codec LDAC
11-10 12:59:44.356  2291  2401 I a2dp_codec: init: initialized Source codec aptX-HD
11-10 12:59:44.356  2291  2401 I a2dp_codec: init: initialized Source codec aptX
11-10 12:59:44.356  2291  2401 I a2dp_codec: init: initialized Source codec AAC
11-10 12:59:44.356  2291  2401 I a2dp_codec: init: initialized Source codec SBC
11-10 12:59:44.356  2291  2401 I a2dp_codec: init: initialized Sink codec SBC(Sink)
11-10 12:59:44.356  2291  2401 D a2dp_codec: init
11-10 12:59:44.356  2291  2401 D a2dp_codec: createCodec: codec SBC
11-10 12:59:44.356  2291  2401 I a2dp_codec: init: updated SBC codec priority to 1001
11-10 12:59:44.356  2291  2401 D a2dp_codec: createCodec: codec AAC
11-10 12:59:44.356  2291  2401 I a2dp_codec: init: updated AAC codec priority to 2001
11-10 12:59:44.356  2291  2401 D a2dp_codec: createCodec: codec aptX
11-10 12:59:44.356  2291  2401 I a2dp_codec: init: updated aptX codec priority to 3001
11-10 12:59:44.356  2291  2401 D a2dp_codec: createCodec: codec aptX-HD
11-10 12:59:44.357  2291  2401 I a2dp_codec: init: updated aptX-HD codec priority to 4001
11-10 12:59:44.357  2291  2401 D a2dp_codec: createCodec: codec aptX-adaptive
11-10 12:59:44.357  2291  2401 I a2dp_codec: init: updated aptX-adaptive codec priority to -1
11-10 12:59:44.357  2291  2401 D a2dp_codec: createCodec: codec LDAC
11-10 12:59:44.357  2291  2401 I a2dp_codec: init: updated LDAC codec priority to 6001
11-10 12:59:44.357  2291  2401 D a2dp_codec: createCodec: codec aptX-TWS
11-10 12:59:44.357  2291  2401 I a2dp_codec: init: updated aptX-TWS codec priority to 7001
11-10 12:59:44.357  2291  2401 D a2dp_codec: createCodec: codec SBC SINK
11-10 12:59:44.357  2291  2401 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:59:44.357  2291  2401 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:59:44.357  2291  2401 I a2dp_codec: init: initialized Source codec aptX-TWS
11-10 12:59:44.357  2291  2401 I a2dp_codec: init: initialized Source codec LDAC
11-10 12:59:44.357  2291  2401 I a2dp_codec: init: initialized Source codec aptX-HD
11-10 12:59:44.357  2291  2401 I a2dp_codec: init: initialized Source codec aptX
11-10 12:59:44.357  2291  2401 I a2dp_codec: init: initialized Source codec AAC
11-10 12:59:44.357  2291  2401 I a2dp_codec: init: initialized Source codec SBC
11-10 12:59:44.357  2291  2401 I a2dp_codec: init: initialized Sink codec SBC(Sink)
11-10 12:59:44.357  2291  2401 D a2dp_codec: init
11-10 12:59:44.357  2291  2401 D a2dp_codec: createCodec: codec SBC
11-10 12:59:44.357  2291  2401 I a2dp_codec: init: updated SBC codec priority to 1001
11-10 12:59:44.358  2291  2401 D a2dp_codec: createCodec: codec AAC
11-10 12:59:44.358  2291  2401 I a2dp_codec: init: updated AAC codec priority to 2001
11-10 12:59:44.358  2291  2401 D a2dp_codec: createCodec: codec aptX
11-10 12:59:44.358  2291  2401 I a2dp_codec: init: updated aptX codec priority to 3001
11-10 12:59:44.358  2291  2401 D a2dp_codec: createCodec: codec aptX-HD
11-10 12:59:44.358  2291  2401 I a2dp_codec: init: updated aptX-HD codec priority to 4001
11-10 12:59:44.358  2291  2401 D a2dp_codec: createCodec: codec aptX-adaptive
11-10 12:59:44.358  2291  2401 I a2dp_codec: init: updated aptX-adaptive codec priority to -1
11-10 12:59:44.358  2291  2401 D a2dp_codec: createCodec: codec LDAC
11-10 12:59:44.358  2291  2401 I a2dp_codec: init: updated LDAC codec priority to 6001
11-10 12:59:44.358  2291  2401 D a2dp_codec: createCodec: codec aptX-TWS
11-10 12:59:44.358  2291  2401 I a2dp_codec: init: updated aptX-TWS codec priority to 7001
11-10 12:59:44.358  2291  2401 D a2dp_codec: createCodec: codec SBC SINK
11-10 12:59:44.358  2291  2401 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:59:44.358  2291  2401 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:59:44.358  2291  2401 I a2dp_codec: init: initialized Source codec aptX-TWS
11-10 12:59:44.359  2291  2401 I a2dp_codec: init: initialized Source codec LDAC
11-10 12:59:44.359  2291  2401 I a2dp_codec: init: initialized Source codec aptX-HD
11-10 12:59:44.359  2291  2401 I a2dp_codec: init: initialized Source codec aptX
11-10 12:59:44.359  2291  2401 I a2dp_codec: init: initialized Source codec AAC
11-10 12:59:44.361  2291  2401 I a2dp_codec: init: initialized Source codec SBC
11-10 12:59:44.361  2291  2401 I a2dp_codec: init: initialized Sink codec SBC(Sink)
11-10 12:59:44.361  2291  2401 D a2dp_codec: init
11-10 12:59:44.361  2291  2401 D a2dp_codec: createCodec: codec SBC
11-10 12:59:44.361  2291  2401 I a2dp_codec: init: updated SBC codec priority to 1001
11-10 12:59:44.361  2291  2401 D a2dp_codec: createCodec: codec AAC
11-10 12:59:44.361  2291  2401 I a2dp_codec: init: updated AAC codec priority to 2001
11-10 12:59:44.361  2291  2401 D a2dp_codec: createCodec: codec aptX
11-10 12:59:44.361  2291  2401 I a2dp_codec: init: updated aptX codec priority to 3001
11-10 12:59:44.361  2291  2401 D a2dp_codec: createCodec: codec aptX-HD
11-10 12:59:44.362  2291  2401 I a2dp_codec: init: updated aptX-HD codec priority to 4001
11-10 12:59:44.362  2291  2401 D a2dp_codec: createCodec: codec aptX-adaptive
11-10 12:59:44.362  2291  2401 I a2dp_codec: init: updated aptX-adaptive codec priority to -1
11-10 12:59:44.362  2291  2401 D a2dp_codec: createCodec: codec LDAC
11-10 12:59:44.362  2291  2401 I a2dp_codec: init: updated LDAC codec priority to 6001
11-10 12:59:44.362  2291  2401 D a2dp_codec: createCodec: codec aptX-TWS
11-10 12:59:44.362  2291  2401 I a2dp_codec: init: updated aptX-TWS codec priority to 7001
11-10 12:59:44.362  2291  2401 D a2dp_codec: createCodec: codec SBC SINK
11-10 12:59:44.362  2291  2401 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:59:44.362  2291  2401 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:59:44.362  2291  2401 I a2dp_codec: init: initialized Source codec aptX-TWS
11-10 12:59:44.362  2291  2401 I a2dp_codec: init: initialized Source codec LDAC
11-10 12:59:44.362  2291  2401 I a2dp_codec: init: initialized Source codec aptX-HD
11-10 12:59:44.362  2291  2401 I a2dp_codec: init: initialized Source codec aptX
11-10 12:59:44.362  2291  2401 I a2dp_codec: init: initialized Source codec AAC
11-10 12:59:44.362  2291  2401 I a2dp_codec: init: initialized Source codec SBC
11-10 12:59:44.362  2291  2401 I a2dp_codec: init: initialized Sink codec SBC(Sink)
11-10 12:59:44.362  2291  2401 D a2dp_codec: init
11-10 12:59:44.362  2291  2401 D a2dp_codec: createCodec: codec SBC
11-10 12:59:44.362  2291  2401 I a2dp_codec: init: updated SBC codec priority to 1001
11-10 12:59:44.362  2291  2401 D a2dp_codec: createCodec: codec AAC
11-10 12:59:44.362  2291  2401 I a2dp_codec: init: updated AAC codec priority to 2001
11-10 12:59:44.362  2291  2401 D a2dp_codec: createCodec: codec aptX
11-10 12:59:44.362  2291  2401 I a2dp_codec: init: updated aptX codec priority to 3001
11-10 12:59:44.362  2291  2401 D a2dp_codec: createCodec: codec aptX-HD
11-10 12:59:44.362  2291  2401 I a2dp_codec: init: updated aptX-HD codec priority to 4001
11-10 12:59:44.362  2291  2401 D a2dp_codec: createCodec: codec aptX-adaptive
11-10 12:59:44.362  2291  2401 I a2dp_codec: init: updated aptX-adaptive codec priority to -1
11-10 12:59:44.363  2291  2401 D a2dp_codec: createCodec: codec LDAC
11-10 12:59:44.363  2291  2401 I a2dp_codec: init: updated LDAC codec priority to 6001
11-10 12:59:44.363  2291  2401 D a2dp_codec: createCodec: codec aptX-TWS
11-10 12:59:44.363  2291  2401 I a2dp_codec: init: updated aptX-TWS codec priority to 7001
11-10 12:59:44.363  2291  2401 D a2dp_codec: createCodec: codec SBC SINK
11-10 12:59:44.363  2291  2401 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:59:44.363  2291  2401 D a2dp_codec: createCodec: codec UNKNOWN CODEC INDEX
11-10 12:59:44.363  2291  2401 I a2dp_codec: init: initialized Source codec aptX-TWS
11-10 12:59:44.363  2291  2401 I a2dp_codec: init: initialized Source codec LDAC
11-10 12:59:44.363  2291  2401 I a2dp_codec: init: initialized Source codec aptX-HD
11-10 12:59:44.363  2291  2401 I a2dp_codec: init: initialized Source codec aptX
11-10 12:59:44.363  2291  2401 I a2dp_codec: init: initialized Source codec AAC
11-10 12:59:44.363  2291  2401 I a2dp_codec: init: initialized Source codec SBC
11-10 12:59:44.363  2291  2401 I a2dp_codec: init: initialized Sink codec SBC(Sink)


Log from MIX 2S, Mi 9 & MIX 3 with Sennheiser : https://1drv.ms/u/s!AmxDv1kJ8iAah4RqW_x4yxL8VZ6YEQ?e=TFzdaM
 
Last edited:
I did also a Bluetooth HCI Snoop Log, which was analyzed by this service: https://btcodecs.valdikss.org.ru/

The result ist:
Code:
Connection:

  a4:50:46:36:a8:f2 (Mi MIX 3) → 00:1b:66:a9:62:fa (IE 80S BT)


Supported codecs:

  Audio non-A2DP

  Audio non-A2DP (aptX Low Latency - 44100 48000, Stereo)

  Audio non-A2DP (unknown codec)

  Audio non-A2DP (aptX HD - 44100 48000, Stereo)

  Audio non-A2DP (aptX - 44100 48000, Stereo)

  Audio MPEG-2,4 AAC

  Audio SBC (16000 32000 44100 48000 | Mono DualChannel Stereo JointStereo | block: 4 8 12 16 | subbands: 4 8 | allocation: SNR Loudness | bitpool: 2..53)


Used for audio:

  Audio non-A2DP (aptX HD - 44100, Stereo)
 
27454
27455
27458
27459
Screenshot_2019-12-04-18-13-43-916_com.android.settings.jpgScreenshot_2019-12-04-18-10-49-039_com.android.settings.jpgScreenshot_2019-12-04-18-10-36-492_com.android.settings.jpgScreenshot_2019-12-04-18-10-29-374_com.android.settings.jpg
 
Do you people know what "Developer options" is meant for? Not everything on that menu is supported on a specific device. You're not even supposed to be on that menu, and no, it's not a "normal" way to switch to LHDC. If LHDC gets supported on your ROM, you'll see it in the Bluetooth devices list.

P.S. The only device that has LHDC codec libraries is Mi 9 Pro 5G (crux), from what I could find.
 
that was the main point of the questions.
Exactly. I just wanted to know if the developers of Xiaomi.eu could solve the problem, or if Xiaomi has to do it itself. After all, Xiaomi sells the Mi Air 2 with LHDC support. But unfortunately this doesn't seem to work with their own smartphones.
 
According to a thread in the Xiaomi forum, only the Mi 9 Pro currently supports LHDC. I guess we have to wait until the Xiaomi developers have implemented support for LHDC for other devices as well. Apparently, the Xiaomi.eu developers can't do that.