How do I determine which A2DP codecs my phone supports/is currently using? Bluetooth's Audio Profile A2DP supports multiple codecs.  All devices have to support SBC (subband codec), then they can support additional "optional codecs" like MP3 and AAC, or "non-A2DP" codecs like apt-X.

Of course these codecs can't actually be used if the receiver doesn't also support them, in which case both devices fall back to SBC.


How do I find out which codecs my hardware/ROM support?
How do I find out which codec is currently in use?  (Maybe this depends on the track, too, if it passes MP3/AAC files directly without re-encoding, for instance)
On my Cyanogen 10.1 phone (AOSP 4.2.2), it is possible to enable a capture of bluetooth traffic. You can then load this capture into Wireshark and look at the negotiation phase to determine which codecs the paired audio output device supports. Not sure what OSes support this: when I first ran across this method it claimed support only from 4.4 onward, but clearly not the case with CM on a Doubleshot. :-)

Assuming you have the requisite setup (rooted ~ 4.2.2 or later), these are the steps:


pair your phone with the A2DP device of interest
disable bluetooth on your phone
edit this file:  /etc/bluetooth/bt_stack.conf, changing the BtSnoopLogOutput setting from its default value of false to true.  For this I use ES Note Editor, launched from ES File Explorer after enabling its "Root Browser" setting.
start CatLog, with all logging types enabled
enable bluetooth on your phone
after it pairs with the output device, play a snippet of audio
with your player of choice (I use Apollo). Ten seconds or so should
be plenty.
disable bluetooth again
stop CatLog's logging and save off its log file to your SD card
[IMPORTANT!] edit bt_stack.conf, changing BtSnoopLogOutput back to false.
copy the BT capture from your SD card (/sdcard/btsnoop_hci.log),
 along with the saved CatLog file, to a computer with a current copy
 of Wireshark installed.
load the capture file into Wireshark and set a Wireshark
 display filter of "btavdtp" (no quotes).  You'll now see a few
 packets only, look for the output device's reply to the AVDTP
 GetCapabilities query and you'll have your answer.


You can also line up the capture timestamps with the CatLog log's timestamps to look for suggestive log entries. I found a couple and cleverly forgot to include them in the notes upon which this post is based.

Once I have some more time am hoping to reduce this rather lengthy set of steps down to an app, but not sure if it's possible and won't have the time yet for a while anyway. Meanwhile, suggestions to improve on the above process are welcome.