1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.

    Dismiss Notice

HOWTO find which codec is used between iOS device and bluetooth headphones

  1. rshev
    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.
     
    ShenaRingo326, chubbie and rade363 like this.
  2. philosophydan
    Thanks! This was super helpful!
     
  3. Jeepz
    Excellent post. I can't believe my old Sony's (XB950BT) support both AAC and aptX.
     
  4. Rocko1
    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: Mar 21, 2018
    rshev likes this.
  5. chubbie
    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:
     
  6. gorinp
    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?
     
  7. rshev
    @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).
     
  8. Pier Paolo
    Yes, pls, me too can't find codec in the consolle's messages
     
  9. alexwhittemore
    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.
     
  10. hereforonecomment
    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).
     
  11. alexwhittemore
    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 Page