[GH-ISSUE #229] L2CAP Connection Fails on Pixel 7a with Both Xposed and Magisk Methods #105

Open
opened 2026-03-02 12:03:30 +03:00 by kerem · 16 comments
Owner

Originally created by @MaizeShark on GitHub (Oct 14, 2025).
Original GitHub issue: https://github.com/kavishdevar/librepods/issues/229

Device Information:

  • Device: Google Pixel 7a
  • Android Version: 16 (BP3A.250905.014)
  • Root: Magisk
  • Magisk Version 29
  • Xposed Framework: ReLSPosed (v1.0.1)
  • LibrePods started with v0.1.0-rc.4 and them moved to v0.2.0-alpha

Describe the bug:
The LibrePods app is unable to establish an L2CAP connection to my AirPods Pro 2 on my Pixel 7a, despite trying both the recommended Xposed and Magisk module methods. The symptoms are slightly different depending on the method used.

I do have to say that own AirReps but that shouldn't be the issue here, it works fine on my Ubuntu 24.04 Maschine. And the "Pro 2 V5.2 TB" are also compatible with IOS so...

Steps to Reproduce & Troubleshooting Journey:

  1. Initial State (No Fix):

    • I had in ReLSPosed enabled Bluetooth (com.google.android.bluetooth) and Settings (com.google.android.settings) and used Magisks Zygisk
    • The logcat shows java.lang.SecurityException: ... has no android.permission.BLUETOOTH_PRIVILEGED and android.bluetooth.BluetoothSocketException.
  2. Method 1: Xposed Hook (Recommended):

    • I just enabled Bluetooth and used ReZygisk dont know which fixed it
    • the BLUETOOTH_PRIVILEGED security exception is gone.
    • The system logs confirm the hook is active with the message: I AirPodsHook: l2c_fcr_chk_chan_modes hooked, returning true.
    • Result: The connection now silently times out. The app shows the error "Your AirPods are connected via Bluetooth, but LibrePods couldn't connect to AirPods using L2CAP. Error: Socket created, but not connected." There is no longer a No PSM available or BLUETOOTH_PRIVILEGED error in the logs. This indicates the initial check is bypassed, but a deeper part of the stack is dropping the connection.
  3. Method 2: btl2capfix Magisk Module:

    • I disabled the Xposed module and installed the btl2capfix (from you comment) Magisk module instead.
    • Result: The BLUETOOTH_PRIVILEGED error is also resolved with this method. However, the connection now fails immediately with the error android.bluetooth.BluetoothSocketException: No PSM available.
  4. SELinux:

    • I have also tested with SELinux set to Permissive (setenforce 0), and it did not solve the issue in either case.

latest_log.txt

Thank you for your work on this project! Please let me know if there is any further information I can provide.

Originally created by @MaizeShark on GitHub (Oct 14, 2025). Original GitHub issue: https://github.com/kavishdevar/librepods/issues/229 **Device Information:** * **Device:** Google Pixel 7a * **Android Version:** 16 (BP3A.250905.014) * **Root:** Magisk * **Magisk Version** 29 * **Xposed Framework:** ReLSPosed (v1.0.1) * **LibrePods** started with v0.1.0-rc.4 and them moved to v0.2.0-alpha **Describe the bug:** The LibrePods app is unable to establish an L2CAP connection to my AirPods Pro 2 on my Pixel 7a, despite trying both the recommended Xposed and Magisk module methods. The symptoms are slightly different depending on the method used. I do have to say that own AirReps but that shouldn't be the issue here, it works fine on my Ubuntu 24.04 Maschine. And the "Pro 2 V5.2 TB" are also compatible with IOS so... **Steps to Reproduce & Troubleshooting Journey:** 1. **Initial State (No Fix):** * I had in ReLSPosed enabled Bluetooth (com.google.android.bluetooth) and Settings (com.google.android.settings) and used Magisks Zygisk * The logcat shows `java.lang.SecurityException: ... has no android.permission.BLUETOOTH_PRIVILEGED` and `android.bluetooth.BluetoothSocketException`. 2. **Method 1: Xposed Hook (Recommended):** * I just enabled Bluetooth and used ReZygisk dont know which fixed it * the `BLUETOOTH_PRIVILEGED` security exception is gone. * The system logs confirm the hook is active with the message: `I AirPodsHook: l2c_fcr_chk_chan_modes hooked, returning true.` * **Result:** The connection now silently times out. The app shows the error "Your AirPods are connected via Bluetooth, but LibrePods couldn't connect to AirPods using L2CAP. Error: Socket created, but not connected." There is no longer a `No PSM available` or `BLUETOOTH_PRIVILEGED` error in the logs. This indicates the initial check is bypassed, but a deeper part of the stack is dropping the connection. 3. **Method 2: `btl2capfix` Magisk Module:** * I disabled the Xposed module and installed the `btl2capfix` (from you [comment](https://github.com/kavishdevar/librepods/issues/67#issuecomment-2842353549)) Magisk module instead. * **Result:** The `BLUETOOTH_PRIVILEGED` error is also resolved with this method. However, the connection now fails immediately with the error `android.bluetooth.BluetoothSocketException: No PSM available`. 4. **SELinux:** * I have also tested with SELinux set to `Permissive` (`setenforce 0`), and it did not solve the issue in either case. [latest_log.txt](https://github.com/user-attachments/files/22911052/latest_log.txt) Thank you for your work on this project! Please let me know if there is any further information I can provide.
Author
Owner

@kavishdevar commented on GitHub (Oct 15, 2025):

what is your setup when you collected the logs?

<!-- gh-comment-id:3404529532 --> @kavishdevar commented on GitHub (Oct 15, 2025): what is your setup when you collected the logs?
Author
Owner

@MaizeShark commented on GitHub (Oct 15, 2025):

what is your setup when you collected the logs?

the log is with the btl2capfix Magisk module (https://github.com/kavishdevar/librepods/issues/67#issuecomment-2842353549) if that is what you ment

<!-- gh-comment-id:3408229441 --> @MaizeShark commented on GitHub (Oct 15, 2025): > what is your setup when you collected the logs? the log is with the btl2capfix Magisk module (https://github.com/kavishdevar/librepods/issues/67#issuecomment-2842353549) if that is what you ment
Author
Owner

@kavishdevar commented on GitHub (Oct 19, 2025):

I am not really sure what's going on, but I can see neither of the two:

  • App's logs (I can only see Bluetooth) logs,
  • Something along the lines of L2CAP Registered service classic PSM: 0x1001 (0x1001 is the PSM that is used for controlling AirPods).

So, I doubt if my app is active and trying to connect. I doubt that your AirPods being fake matters, because I can't even see logs like Received Bluetooth connection broadcast. Could you try a clean install of the app, without the A16 module, and skip the onboarding (setting up hooks part). And, run the log collection?

<!-- gh-comment-id:3419715599 --> @kavishdevar commented on GitHub (Oct 19, 2025): I am not really sure what's going on, but I can see neither of the two: - App's logs (I can only see Bluetooth) logs, - Something along the lines of `L2CAP Registered service classic PSM: 0x1001` (0x1001 is the PSM that is used for controlling AirPods). So, I doubt if my app is active and trying to connect. I doubt that your AirPods being fake matters, because I can't even see logs like `Received Bluetooth connection broadcast`. Could you try a clean install of the app, without the A16 module, and skip the onboarding (setting up hooks part). And, run the log collection?
Author
Owner

@shailantani commented on GitHub (Oct 19, 2025):

I had a similar crash as well, this is the log I collected from your app:

_data_user_0_me.kavishdevar.librepods_files_logs_airpods_log_20251019_202438.txt

Could you check it out once? Im using airpods 4 on pixel 7a (A16)
Also, I do get an error that the app isnt 16KB compatible. this is the screenshot:

Image

Also I did get a notification with error that said, failed to establish connection: read failed, socket might closed or timeout, read ret: -1
Please let me know if you need any other logs! Thanks a lot for the hardwork!
@kavishdevar

<!-- gh-comment-id:3419730108 --> @shailantani commented on GitHub (Oct 19, 2025): I had a similar crash as well, this is the log I collected from your app: [_data_user_0_me.kavishdevar.librepods_files_logs_airpods_log_20251019_202438.txt](https://github.com/user-attachments/files/22990815/_data_user_0_me.kavishdevar.librepods_files_logs_airpods_log_20251019_202438.txt) Could you check it out once? Im using airpods 4 on pixel 7a (A16) Also, I do get an error that the app isnt 16KB compatible. this is the screenshot: <img width="1080" height="2400" alt="Image" src="https://github.com/user-attachments/assets/2f6d8620-7966-42b7-96e2-5515c82a0829" /> Also I did get a notification with error that said, failed to establish connection: read failed, socket might closed or timeout, read ret: -1 Please let me know if you need any other logs! Thanks a lot for the hardwork! @kavishdevar
Author
Owner

@kavishdevar commented on GitHub (Oct 19, 2025):

@shailantani you don't have the xposed hook active? There are no logs from the xposed module.

<!-- gh-comment-id:3419732915 --> @kavishdevar commented on GitHub (Oct 19, 2025): @shailantani you don't have the xposed hook active? There are no logs from the xposed module.
Author
Owner

@kavishdevar commented on GitHub (Oct 19, 2025):

And, that 16KB alignment: i'll fix it. thanks for pointing it out! I don't run A16, and had dismissed the warning on Android Studio a long time ago.

<!-- gh-comment-id:3419733772 --> @kavishdevar commented on GitHub (Oct 19, 2025): And, that 16KB alignment: i'll fix it. thanks for pointing it out! I don't run A16, and had dismissed the warning on Android Studio a long time ago.
Author
Owner

@shailantani commented on GitHub (Oct 19, 2025):

@shailantani you don't have the xposed hook active? There are no logs from the xposed module.

I do have it enabled:

Image Image

I can send logs from lsposed if that helps?

<!-- gh-comment-id:3419735237 --> @shailantani commented on GitHub (Oct 19, 2025): > [@shailantani](https://github.com/shailantani) you don't have the xposed hook active? There are no logs from the xposed module. I do have it enabled: <img width="1080" height="2400" alt="Image" src="https://github.com/user-attachments/assets/da4154d5-829e-4475-bead-a49edd299022" /> <img width="1080" height="2400" alt="Image" src="https://github.com/user-attachments/assets/36a5b212-1fa8-4d84-b539-52cb5a091e50" /> I can send logs from lsposed if that helps?
Author
Owner

@shailantani commented on GitHub (Oct 19, 2025):

And, that 16KB alignment: i'll fix it. thanks for pointing it out! I don't run A16, and had dismissed the warning on Android Studio a long time ago.

haha no worries atall! :)

<!-- gh-comment-id:3419735405 --> @shailantani commented on GitHub (Oct 19, 2025): > And, that 16KB alignment: i'll fix it. thanks for pointing it out! I don't run A16, and had dismissed the warning on Android Studio a long time ago. haha no worries atall! :)
Author
Owner

@shailantani commented on GitHub (Oct 19, 2025):

sorry, for the spam, i just opened the app and it randomly connected haha! I'll try to work out what I did. And let you know if I face a similar bug again :))

<!-- gh-comment-id:3419736896 --> @shailantani commented on GitHub (Oct 19, 2025): sorry, for the spam, i just opened the app and it randomly connected haha! I'll try to work out what I did. And let you know if I face a similar bug again :))
Author
Owner

@kavishdevar commented on GitHub (Oct 19, 2025):

sorry, for the spam, i just opened the app and it randomly connected haha! I'll try to work out what I did. And let you know if I face a similar bug again :))

It's alright! You probably restarted your Bluetooth :) Anyway, enjoy!

<!-- gh-comment-id:3419737453 --> @kavishdevar commented on GitHub (Oct 19, 2025): > sorry, for the spam, i just opened the app and it randomly connected haha! I'll try to work out what I did. And let you know if I face a similar bug again :)) It's alright! You probably restarted your Bluetooth :) Anyway, enjoy!
Author
Owner

@mint1246 commented on GitHub (Nov 18, 2025):

I have this issue too, no PSM available, also 5.2 TB reps.

_data_user_0_me.kavishdevar.librepods_files_logs_airpods_log_20251118_182702.txt

<!-- gh-comment-id:3548512963 --> @mint1246 commented on GitHub (Nov 18, 2025): I have this issue too, no PSM available, also 5.2 TB reps. [_data_user_0_me.kavishdevar.librepods_files_logs_airpods_log_20251118_182702.txt](https://github.com/user-attachments/files/23609965/_data_user_0_me.kavishdevar.librepods_files_logs_airpods_log_20251118_182702.txt)
Author
Owner

@Xpl0itU commented on GitHub (Nov 18, 2025):

_data_user_0_me.kavishdevar.librepods_files_logs_airpods_log_20251118_182702.txt

Same here, 5.4 Huilian reps, on LSPosed, it consistently complains about "MAC address must be 6 bytes"

Image
<!-- gh-comment-id:3549098850 --> @Xpl0itU commented on GitHub (Nov 18, 2025): [_data_user_0_me.kavishdevar.librepods_files_logs_airpods_log_20251118_182702.txt](https://github.com/user-attachments/files/23612026/_data_user_0_me.kavishdevar.librepods_files_logs_airpods_log_20251118_182702.txt) Same here, 5.4 Huilian reps, on LSPosed, it consistently complains about "MAC address must be 6 bytes" <img width="1080" height="2400" alt="Image" src="https://github.com/user-attachments/assets/d48305d2-1bcb-48ca-9078-b87a52179a4a" />
Author
Owner

@kavishdevar commented on GitHub (Nov 18, 2025):

@Xpl0itU please try https://github.com/kavishdevar/librepods/actions/runs/19412004970

<!-- gh-comment-id:3549128401 --> @kavishdevar commented on GitHub (Nov 18, 2025): @Xpl0itU please try https://github.com/kavishdevar/librepods/actions/runs/19412004970
Author
Owner

@Xpl0itU commented on GitHub (Nov 18, 2025):

@Xpl0itU please try https://github.com/kavishdevar/librepods/actions/runs/19412004970

Same notification, but app sometimes crashes when connecting to the airpods

LSPosed_2025-11-18T20_14_08.059414.zip

(Same error, just scrolling horizontally)

Image Image Image
<!-- gh-comment-id:3549200104 --> @Xpl0itU commented on GitHub (Nov 18, 2025): > [@Xpl0itU](https://github.com/Xpl0itU) please try https://github.com/kavishdevar/librepods/actions/runs/19412004970 Same notification, but app sometimes crashes when connecting to the airpods [LSPosed_2025-11-18T20_14_08.059414.zip](https://github.com/user-attachments/files/23612391/LSPosed_2025-11-18T20_14_08.059414.zip) (Same error, just scrolling horizontally) <img width="1080" height="2400" alt="Image" src="https://github.com/user-attachments/assets/03b13593-eac6-47fb-937a-908eb5fccf61" /> <img width="1080" height="2400" alt="Image" src="https://github.com/user-attachments/assets/ddd6fa14-4b23-4135-b66f-b9ca0c45a2b9" /> <img width="1080" height="2400" alt="Image" src="https://github.com/user-attachments/assets/913529c3-88a5-4bfd-9139-fd2eddb4442a" />
Author
Owner

@Xpl0itU commented on GitHub (Nov 19, 2025):

@Xpl0itU please try https://github.com/kavishdevar/librepods/actions/runs/19412004970

Same notification, but app sometimes crashes when connecting to the airpods

LSPosed_2025-11-18T20_14_08.059414.zip

(Same error, just scrolling horizontally)

Image Image Image

Using LineageOS 23.0-20251114-NIGHTLY-lynx on a Pixel 7a btw, not stock OS

<!-- gh-comment-id:3553775698 --> @Xpl0itU commented on GitHub (Nov 19, 2025): > > [@Xpl0itU](https://github.com/Xpl0itU) please try https://github.com/kavishdevar/librepods/actions/runs/19412004970 > > Same notification, but app sometimes crashes when connecting to the airpods > > [LSPosed_2025-11-18T20_14_08.059414.zip](https://github.com/user-attachments/files/23612391/LSPosed_2025-11-18T20_14_08.059414.zip) > > (Same error, just scrolling horizontally) > > <img alt="Image" width="1080" height="2000" src="https://private-user-images.githubusercontent.com/24777100/515905718-03b13593-eac6-47fb-937a-908eb5fccf61.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjM1NzE2OTUsIm5iZiI6MTc2MzU3MTM5NSwicGF0aCI6Ii8yNDc3NzEwMC81MTU5MDU3MTgtMDNiMTM1OTMtZWFjNi00N2ZiLTkzN2EtOTA4ZWI1ZmNjZjYxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTExMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMTE5VDE2NTYzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU0MjI0NzVjYTVhZWIyOWNjMzFkMzM2OTk0NWFjMDQ1ZWM5ZmFlMzM0YjliNzhiMTEwOGI2Y2UwMTY0MzA3NmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.nT7flyTKdw86-zvB4R-WmiVErMPQyKIpGpj4v0mLByk"> <img alt="Image" width="1080" height="2000" src="https://private-user-images.githubusercontent.com/24777100/515905719-ddd6fa14-4b23-4135-b66f-b9ca0c45a2b9.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjM1NzE2OTUsIm5iZiI6MTc2MzU3MTM5NSwicGF0aCI6Ii8yNDc3NzEwMC81MTU5MDU3MTktZGRkNmZhMTQtNGIyMy00MTM1LWI2NmYtYjljYTBjNDVhMmI5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTExMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMTE5VDE2NTYzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM1NmVlMzVkZDFjNjk1NGM2OWRkMDg0YjkxNzcxNTg3ZjM1NDFhODk2ODlhZmNjYzc5MzhmYTcyMDU2YWEzYmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Nt7NXTABQhkj4LjY5n9eF5KKjgo10J3zfhVZdzTz1Qk"> <img alt="Image" width="1080" height="2000" src="https://private-user-images.githubusercontent.com/24777100/515905717-913529c3-88a5-4bfd-9139-fd2eddb4442a.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjM1NzE2OTUsIm5iZiI6MTc2MzU3MTM5NSwicGF0aCI6Ii8yNDc3NzEwMC81MTU5MDU3MTctOTEzNTI5YzMtODhhNS00YmZkLTkxMzktZmQyZWRkYjQ0NDJhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTExMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMTE5VDE2NTYzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNlYzEwMmUyYTZiNmZkNjIwYTc5MGI4YjgwOWI0MmEwNzdkYjkxN2YyMTBjZjZkMmY1YWJhMGQ4Yzg2MDM1NzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.hMc_sYQzojJSaMKIy-4goq_516q3PART9eCHr7KyiSc"> Using LineageOS 23.0-20251114-NIGHTLY-lynx on a Pixel 7a btw, not stock OS
Author
Owner

@ImAleeexx commented on GitHub (Dec 19, 2025):

Are there any news on this issue, im facing the same using my airreps. Error when connecting and showing L2CAP connection errors

<!-- gh-comment-id:3677035313 --> @ImAleeexx commented on GitHub (Dec 19, 2025): Are there any news on this issue, im facing the same using my airreps. Error when connecting and showing L2CAP connection errors
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librepods#105
No description provided.