[Q] How do I get the system to return the currently used Bluetooth audio codec?
Dear XDA code pros,
I have a problem. I am currently programming a simple Android app which is supposed to confirm that an established Bluetooth connection from my phone (Galaxy Note II) to any Bluetooth audio device (e.g. a mobile BT speaker) uses aptX as the A2DP codec. To my knowledge, aptX is chosen automatically when the source as well as the sink are capable of aptX, so there has to be some form of negotiation between these devices when a connection is being established. If one of the devices is not aptX-capable, a lower level codec (such as the mandatory SBC) is used.
With the Android SDK and my basic programming skills I was able to shape an app that would display the desired information. However, I am now stuck at the code where I ask the system for the A2DP codec that is in use. I looked at the A2DP developing reference
, but it seems that the information I can get there is very basic. I also found no hint on how to ask the system for this information in any other Bluetooth developer reference.
With the help of this forum, I learned that the information about possible codecs is embedded in the bluez stack, and that the use of aptX can in fact be intercepted by logcat
. However, can this information also be extracted by code on a non-rooted stock phone with a simple app?
Any kind of help and hints will be greatly appreciated!!!