HOWTO find which codec is used between iOS device and bluetooth headphones
post-13256304
Thread Starter
Post #1 of 20

rshev

New Head-Fier
Joined
Jan 27, 2017
Messages
9
Reaction score
18
Joined
Jan 27, 2017
Posts
9
Likes
18
Was just curious this weekend (I'm an iOS engineer by day) how to find out which codec your iOS device uses to communicate to bluetooth headphones.
There are numerous tutorials on this matter for macOS (OSX) on the Internet, Alt+Click, Bluetooth Explorer and friends, but nothing on iOS.
That's why I decided to compose this tutorial for you, requires looking into console log and some keyboard munching.
(wanted to insert screenshots here but have no rights as I'm very fresh to head-fi. Version with screenshots here: https://stackoverflow.com/questions/22639691/how-to-determine-which-codecs-a-bluetooth-device-supports-over-a2dp/42190656)
 
Here we go:
 
1. Connect your iOS device to your Mac, answer Trust on the iOS device if you haven't done this before.
 
2. Open Console.app.

3. Select your iOS device on the left sidebar.

4. Type `bluetooth` in the top-right search bar, press Enter and select `Subsystem` instead of `All`.

5. Now, start playing to your bluetooth headphones on the iOS device (codec activates only when you output sound).

6. Press `Cmd+F` and search for `Starting a2dp send thread` in your console messages.

7. You'll see used codec in `codec: ` field. Values are the same as specified in Bluetooth specs. Basically `0 = SBC`, `2 = AAC`.
 
Was very surprised, though, that a pair of headphones I just bought from very adored and award-winning manufacturer (not Sennheiser) does not have AAC codec in them, despite having that in specifications (will not name them here, contacting their tech support for clarification).
 
Feel free to publish your experience and discoveries here.
 
post-13928605
Post #3 of 20

Jeepz

New Head-Fier
Joined
Dec 18, 2017
Messages
43
Reaction score
3
Location
Canada
Joined
Dec 18, 2017
Location
Canada
Posts
43
Likes
3
Excellent post. I can't believe my old Sony's (XB950BT) support both AAC and aptX.
 
     Share This Post       
post-14119363
Post #4 of 20

Rocko1

500+ Head-Fier
Joined
Jan 27, 2010
Messages
564
Reaction score
37
Joined
Jan 27, 2010
Posts
564
Likes
37
Was just curious this weekend (I'm an iOS engineer by day) how to find out which codec your iOS device uses to communicate to bluetooth headphones.
There are numerous tutorials on this matter for macOS (OSX) on the Internet, Alt+Click, Bluetooth Explorer and friends, but nothing on iOS.
That's why I decided to compose this tutorial for you, requires looking into console log and some keyboard munching.
(wanted to insert screenshots here but have no rights as I'm very fresh to head-fi. Version with screenshots here: https://stackoverflow.com/questions...-bluetooth-device-supports-over-a2dp/42190656)

Here we go:

1. Connect your iOS device to your Mac, answer Trust on the iOS device if you haven't done this before.

2. Open Console.app.

3. Select your iOS device on the left sidebar.

4. Type `bluetooth` in the top-right search bar, press Enter and select `Subsystem` instead of `All`.

5. Now, start playing to your bluetooth headphones on the iOS device (codec activates only when you output sound).

6. Press `Cmd+F` and search for `Starting a2dp send thread` in your console messages.

7. You'll see used codec in `codec: ` field. Values are the same as specified in Bluetooth specs. Basically `0 = SBC`, `2 = AAC`.

Was very surprised, though, that a pair of headphones I just bought from very adored and award-winning manufacturer (not Sennheiser) does not have AAC codec in them, despite having that in specifications (will not name them here, contacting their tech support for clarification).

Feel free to publish your experience and discoveries here.
This works great. I tried this with my MDR-1000X and in priority connection I can see codec-0 and in priority sound quality I can see codec-2.
 
Last edited:
     Share This Post       
  • Like
Reactions: rshev
post-14300678
Post #5 of 20

chubbie

New Head-Fier
Joined
Jun 10, 2018
Messages
3
Reaction score
0
Location
Hong Kong
Joined
Jun 10, 2018
Location
Hong Kong
Posts
3
Likes
0
I'm happy to report that the Sony WF-SP700N support AAC when choosing the quality over connectivity on the app. :ksc75smile:

Thanks rshev for the tips on how to find out the codec!:thumbsup:
 
     Share This Post       
post-14684426
Post #6 of 20

gorinp

New Head-Fier
Joined
Dec 28, 2018
Messages
1
Reaction score
0
Location
Toronto, Canada
Joined
Dec 28, 2018
Location
Toronto, Canada
Posts
1
Likes
0
Thanks for this awesome post rshev!

I'm having trouble finding the codec value.

When I search for "Starting a2dp send thread" I get no results, so I searched for "Starting a2dp" and I see this as paired playback stars:

"Starting A2DP audio streaming to device <private>"

I googled around and it seems that there's no way to view apple's <private> values...

I'm on iOS 12.1.2 pairing with my Jaybird X3's which advertise that they support AAC, but sometimes I'm skeptical.

Any other suggestions you might have?
 
     Share This Post       
post-14692994
Post #7 of 20

rshev

New Head-Fier
Joined
Jan 27, 2017
Messages
9
Reaction score
18
Joined
Jan 27, 2017
Posts
9
Likes
18
@gorinp happy new year! Thanks for the feedback. They might have changed logging in iOS 12, I'll check it and let you know (I have AirPods now only though to test with).
 
     Share This Post       
post-14693035
Post #8 of 20

Pier Paolo

100+ Head-Fier
Joined
May 29, 2012
Messages
102
Reaction score
16
Joined
May 29, 2012
Posts
102
Likes
16
@gorinp happy new year! Thanks for the feedback. They might have changed logging in iOS 12, I'll check it and let you know (I have AirPods now only though to test with).
Yes, pls, me too can't find codec in the consolle's messages
 
     Share This Post       
post-14736219
Post #9 of 20

alexwhittemore

New Head-Fier
Joined
Jan 23, 2019
Messages
2
Reaction score
0
Location
LA
Joined
Jan 23, 2019
Location
LA
Posts
2
Likes
0
Fiddling with bluetooth codecs today to figure out why some songs on some devices sound worse. I used all the relevant tricks on Mac to figure out my brand new WH-1000xm3’s were connecting via SBC - sounds way better forcing AptX

Next up is a new pair of earbuds that sound halfway decent on my iPhone, but way worse on my Mac with my SBC-killer test tracks (some poppy energetic St Lucia, and RAC’s Let Go - they sound artifact-y and aliased in the sharp synth highs).

Anyway, I got testing in Console. The trick seems to be to have console open not just during track start, but during initial connection of the target device. After the headphones were powered off for a minute, I searched “(subsystem: bluetooth) codec” and got:

default 15:48:00.538802 -0800 bluetoothd Bad48KHzCodecs: Disabling 48 KHz - Device is NOT in 48 KHz AAC whitelist
default 15:48:00.718042 -0800 mediaserverd Codecs available. NBS (CVSD): 1, WBS (mSBC): 1, UWBS (AAC-ELD): 0
debug 15:48:00.718391 -0800 mediaserverd Sending codec metric - codecType: 1, mediaType: 1, [sampleRate: 16000]
debug 15:48:02.784335 -0800 bluetoothd Parsing Audio Codec ID and information for seid 1
default 15:48:02.784492 -0800 bluetoothd Audio Codec ID <private> for remote SEID 1
debug 15:48:02.801615 -0800 bluetoothd Parsing Audio Codec ID and information for seid 2
default 15:48:02.801789 -0800 bluetoothd Audio Codec ID <private> for remote SEID 2
default 15:48:02.802527 -0800 bluetoothd Selected preferred codec AVDTP_CODEC_MPEG_AAC (0x2) out of 2 available endpoints
default 15:48:02.802677 -0800 bluetoothd Selected preferred codec AVDTP_CODEC_MPEG_AAC (0x2) out of 2 available endpoints
debug 15:48:02.872643 -0800 bluetoothd Found AVDTP_CODEC_MPEG_AAC codec type 0x2
default 15:48:02.873476 -0800 bluetoothd A2DP configured at 44.1 KHz. Codec: AAC-LC, VBR max: 221 kbps. 1 frames * (12+644) bytes = 656 per RTP (max=656) every 23.22 ms
debug 15:48:02.906085 -0800 mediaserverd Sending codec metric - codecType: 2, mediaType: 2, [sampleRate: 44100]

AAC-ELD is a 64kbps voice codec, so I think that’s actually a red herring. Down a bit lower, “Selected preferred codec AVDTP_CODEC_MPEG_AAC” seem to be the ticket. Then “A2DP configured at 44.1 KHz. Codec: AAC-LC, VBR max: 221 kbps…”

So it looks like these headphones are, in fact, using AAC on my iPhone, which would explain why they sound much better in my torture test there. Now I just need to go figure out why they AREN'T using AAC on my mac.
 
     Share This Post       
post-14737688
Post #10 of 20

hereforonecomment

New Head-Fier
Joined
Jan 24, 2019
Messages
1
Reaction score
0
Location
California
Joined
Jan 24, 2019
Location
California
Posts
1
Likes
0
Now I just need to go figure out why they AREN'T using AAC on my mac.
Thanks for figuring out the Console thing! To enable AAC (and aptX) on your Mac, you need to download one of the developer tools and then check a box. Instructions are here. I did this yesterday, and can now happily report that I'm getting AAC on both iPhone and Mac. Though it seems like the Mac uses a higher bitrate than the phone (XS Max).
 
     Share This Post       
post-14738106
Post #11 of 20

alexwhittemore

New Head-Fier
Joined
Jan 23, 2019
Messages
2
Reaction score
0
Location
LA
Joined
Jan 23, 2019
Location
LA
Posts
2
Likes
0
Thanks for figuring out the Console thing! To enable AAC (and aptX) on your Mac, you need to download one of the developer tools and then check a box. Instructions are here. I did this yesterday, and can now happily report that I'm getting AAC on both iPhone and Mac. Though it seems like the Mac uses a higher bitrate than the phone (XS Max).
I'd already done that for the Sony's (force aptX), but hadn't changed the AAC settings, hence had to go back in and do just what you say (thanks!).

Those settings confuse me terribly though, and what I was really getting at is "why are these not defaults?"

For instance, we've got a checkbox each for "Force aptX," "Disable aptX," "Disable AAC," and "Enable AAC"
What the eff does it even mean to leave both disable aac and enable aac unchecked (the default)?! At least "Force aptX" and "Disable aptX" leave room in the middle for the default to be "use aptX if appropriate"
But then, in practice, that isn't even what happens.

Defaults (everything unchecked): Headphones connect with SBC, regardless of better codec support. Sounds mostly fine for the cans with the good antenna/RSSI since they use a high bitpool, sounds crap for the earbuds.
Check "Enable AAC": sonys connect with AAC, sound good. Earbuds connect with SBC, sound like crap.
Check "Enable AAC" and also "Force aptX": sonys connect with AAC - sound good, but aptX would be better (equal quality, lower latency). Earbuds connect with AAC, sound great.
----At this point, why on earth would "Force aptX" be necessary for the AAC-only earbuds to use AAC? Makes no sense. And if "Force aptX", why do the Sonys then default to AAC?!
UNCHECK "Enable AAC" and KEEP "Force aptX": Sonys connect with aptX (optimal). Buds fall back to SBC and suck again.
Interestingly, when I check all 3 of "Force aptX," "Enable AAC," AND "Disable AAC" (yeah...), the buds connect via SBC (of course?), but despite the same bitpool, the connection is WAY more stable. And the Sonys in this case connect with aptX.

So basically, I've learned that
1) the defaults don't do the most logical thing (aptX falls back to AAC falls back to SBC)
2) there's no combination of settings that enables this "optimal" behavior
3) The closest you can get is either a) "Force aptX+Enable AAC+Disable AAC" (aptX device connects that way, AAC-only connects with SBC, but stably), or b) "Force aptX+Enable AAC" (aptX device falls back to AAC, but AAC-only devices also connect with AAC)

For now I'm sticking with "Force aptX+Enable AAC," but it's annoying that the Sonys won't use that aptX.

Bonus: if I go for broke and check all 4 boxes, which makes NO sense at ALL, the sonys use aptX and the headphones fall back to stable-but-crappy low bitpool SBC. Ok, the bitpool comes back up to "pretty good" after a module reset.

Unrelated (maybe?), the volume on my Sonys seems completely independent from the volume on the Mac. So that's super annoying.
 
     Share This Post       
post-15120114
Post #12 of 20

danisnowman

New Head-Fier
Joined
Sep 21, 2018
Messages
18
Reaction score
0
Location
Guatemala
Joined
Sep 21, 2018
Location
Guatemala
Posts
18
Likes
0
If anyone is interested I just found out that the bitrate of the PXC-550's connected to an iOS device is 317.9kbps (SBC) and 384kbps (aptX) connected to a Macbook Pro.

  • For iOS, I connected it to my computer, tapped "Trust" and then I opened console, started playing some music through my headphones and searched for "a2dp" and at first I was looking for the bit pool but apparently they log the actual bitrate.
  • For macOS, I connected my headphones, opened up the dev tool "Bluetooth Explorer" and then Tools>Audio Graphs and that's where they 'log' the bitrate.
 
     Share This Post       
post-15121383
Post #13 of 20

Tsukuyomi

1000+ Head-Fier
Joined
Mar 25, 2015
Messages
1,319
Reaction score
378
Location
Canada
Joined
Mar 25, 2015
Location
Canada
Posts
1,319
Likes
378
LDAC?
 
     Share This Post       
post-15121945
Post #14 of 20

mattiav

100+ Head-Fier
Joined
Feb 4, 2015
Messages
283
Reaction score
108
Joined
Feb 4, 2015
Posts
283
Likes
108
     Share This Post       
post-15122894
Post #15 of 20

Tsukuyomi

1000+ Head-Fier
Joined
Mar 25, 2015
Messages
1,319
Reaction score
378
Location
Canada
Joined
Mar 25, 2015
Location
Canada
Posts
1,319
Likes
378
Not on an iOS or OSX device - iPhones are AAC or SBC, Macs support AptX. To my knowledge neither do LDAC.
Hmm, you think apple will bring ldac support for their future ios firmware updates? Would be a shame not to include it. Its not like they're short on money for licensing fees lol.
 
     Share This Post       

Users Who Are Viewing This Thread (Users: 0, Guests: 2)

Top