librepods icon indicating copy to clipboard operation
librepods copied to clipboard

Your AirPods are connected via Bluetooth, but LibrePods couldn't connect to AirPods using L2CAP

Open Tsavoritel opened this issue 5 months ago • 18 comments

Seems my Airpods 4 w/ANC wont connect. I'm guessing its because something weird is happening with the Xposed module on my Sony Xperia but definitely not my expertise.

Full error message: Your AirPods are connected via Bluetooth, but LibrePods couldn't connect to AirPods using L2CAP. Error: Failed to establish connection: read failed, socket might closed or timeout, read ret: -1

Phone: Sony Xperia 1 IV Airpods: 4 ANC Logs: airpods_log_1754442367279.txt

Tried setting back up, reinstalling, re-pairing, and restarting my phone. Any ideas? :)

Tsavoritel avatar Aug 06 '25 01:08 Tsavoritel

It might be because your phone uses a proprietary bluetooth library or the hook not working properly (either onboarding didn't work, or the bluetooth process wasnt restarted), try installing the root module. If this shows an error, or doesn't work, unfortunately there's no workaround that I know of.

kavishdevar avatar Aug 06 '25 05:08 kavishdevar

Yeah, it tells me QTI bluetooth libraries aren't supported. Darn. Install_2025-08-06T03_05_54.323464.log

Although with quick research so correct me if i'm wrong it looks open source? so is it possible to make compatible?

Tsavoritel avatar Aug 06 '25 07:08 Tsavoritel

Even if it's open source, it uses some older version of the AOSP stack. And, for older versions, the simple "bypass" that I use for a check doesn't seem to work. Well, that's my guess at least based on the reports on older android versions and qti libraries. I have looked through the older versions and haven't been able to point the exact cause.

kavishdevar avatar Aug 06 '25 07:08 kavishdevar

wait this happens to me too on pixel 8 pro, the first and second method do not work

NL-TCH avatar Aug 06 '25 20:08 NL-TCH

edit: this comment (with the custom magisk module) worked for me! https://github.com/kavishdevar/librepods/issues/67#issuecomment-2827073784

NL-TCH avatar Aug 06 '25 21:08 NL-TCH

hrmm still doesn't work for me, same error(s)

Tsavoritel avatar Aug 07 '25 00:08 Tsavoritel

wait this happens to me too on pixel 8 pro, the first and second method do not work

Do you have any root hiding modules installed, or "Unmount all modules" enabled? If so, disable unmount modules for com,(. google).android.bluetooth and/or give root permissions to it as well, this would probably make xposed work.

edit: this comment (with the custom magisk module) worked for me! #67 (comment)

I believe you're on Android 16?

kavishdevar avatar Aug 07 '25 08:08 kavishdevar

No i am on A15

NL-TCH avatar Aug 15 '25 12:08 NL-TCH

It might be because your phone uses a proprietary bluetooth library or the hook not working properly (either onboarding didn't work, or the bluetooth process wasnt restarted), try installing the root module. If this shows an error, or doesn't work, unfortunately there's no workaround that I know of.

I’m experiencing the same issue.

Tested on:

Pixel 4a

Android 13 (Stock)

Android 15 (LineageOS 22)

Error:

Failed to establish connection: A Bluetooth Socket failure occurred

Tried solutions:

Used the Xposed/LSPosed method → same error.

Flashed the root module btl2capfix.zip via Magisk (Method 2) → rebooted and re-paired the AirPods → issue still persists.

So far, neither method fixes the L2CAP connection problem on my setup.

ltstereo avatar Aug 21 '25 14:08 ltstereo

@ltstereo do you have any root hiding modules installed?

kavishdevar avatar Aug 21 '25 15:08 kavishdevar

@ltstereo do you have any root hiding modules installed?

Yes, I have ReZygisk, Play Integrity Fix, TrickyStore, and also NoHello installed.

Edit: I tested again after disabling all root hiding and extra Zygisk modules (ReZygisk, Play Integrity Fix, NoHello, Tricky Store,). Only the btl2capfix.zip root module was left enabled.

The issue still persists.

Edit2: Device: Pixel 4a (sunfish)
OS: Android 15 (LineageOS 22)

Output of su -c lsof | grep libbluetooth: /system/lib64/libbluetooth_jni.so

When I go to Troubleshooting in the LibrePods app, I only see a loading spinner that never ends. No logs are displayed.

ltstereo avatar Aug 21 '25 15:08 ltstereo

Here are some logs for the error

Sometimes on my pixel 8pro Bluetooth crashes constantly and refuses to connect. Hopefully these logs are usefull

airpods_log_1756148373542.txt

seems not to be the same, but maybe related...

NL-TCH avatar Aug 25 '25 19:08 NL-TCH

where can i find this btl2capfix.zip file?

hcne0 avatar Sep 17 '25 14:09 hcne0

Image

MahfuzReh avatar Sep 21 '25 21:09 MahfuzReh

[

btl2capfix.zip

](url)

MahfuzReh avatar Sep 21 '25 21:09 MahfuzReh

where can i find this btl2capfix.zip file?

https://github.com/user-attachments/files/18931021/btl2capfix.zip

@MahfuzReh, where did you get this? It's not the module.

kavishdevar avatar Sep 22 '25 04:09 kavishdevar

I get the same error message with the module in https://github.com/kavishdevar/librepods/issues/67#issuecomment-2842353549 (installed with Magisk). Bluetooth works and the airpods can connect. I have tried both the stable and nightly releases.

I have no other modules loaded (hosts aka Systemless Hosts is disabled):

➜ adb shell su -c 'ls /data/adb/modules'
btl2capfix
hosts

Phone: Pixel 6 OS: GrapheneOS (Android 16) Device: Airpods 2 Pro Troubleshooting log: airpods_log_1758722998187.txt

➜ adb shell su -c 'lsof | grep libbluetooth'
binder:890_2   890 audioserve  mem       REG              254,8    106040       2334 /vendor/lib64/libbluetooth_audio_session.so
binder:890_2   890 audioserve  mem       REG              254,8    413184       2335 /vendor/lib64/libbluetooth_audio_session_aidl.so
droid.bluetooth 15582  bluetooth  mem       REG              7,320  14194696         43 /apex/com.android.bt/lib64/libbluetooth_jni.so

MihkelMK avatar Sep 24 '25 14:09 MihkelMK

where can i find this btl2capfix.zip file?

https://github.com/user-attachments/files/18931021/btl2capfix.zip

@MahfuzReh, where did you get this? It's not the module.

the original zip link was not working, so searched on google

MahfuzReh avatar Sep 24 '25 22:09 MahfuzReh