Improve Bluetooth audio quality on headphones without aptX or LDAC

dandreye

Member
Jun 4, 2015
39
2
28
Hi All,

Could anyone (besides ValdikSS himself) familiar well enough with Bluedroid stack implementation in Android 8 AOSP please refer me to a particular function in a2dp_sbc.cc , a2dp_sbc_encoder.cc or perhaps in some other neighbour cc file called whenever audio playback is started? After patching /system/lib/hw/bluetooth.default.so as per ValdikSS's instructions I now have SBC DC selected by Samsung SM-A320FL running stock Android 8 ROM every time upon connecting to A2DP sink, however as soon as I start the very first audio playback it falls back to JS: first it tries changing it on the fly with Reconfigure on the channel opened earlier, the sink rejects that command as unsupported and it then closes down the channel and reopens it with JS instead. Knowing the answer will let me avoid studying Bluedroid source code myself :)

Many thanks in anticipation!

Update: just circumvented it by means of binary patching A2DP_ParseSinkCaps in a2dp_sbc.cc stripping off the support of any other SBC channel modes but DC in the sink caps advertised towards the phone. That'll do for my own needs although getting the answer one day would help hack it less brutally than that.
Code:
Connection:
  48:27:ea:d2:cc:7d (Galaxy A3 (2017)) → localhost ()

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

Used for audio:
  Audio SBC (44100 | DualChannel | block: 16 | subbands: 8 | allocation: Loudness | bitpool: 2..53)


Latest SBC Bitpool value: 53
 
Last edited: