Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth keeps stopping issue #5

Open
ildar opened this issue Jan 26, 2023 · 19 comments
Open

Bluetooth keeps stopping issue #5

ildar opened this issue Jan 26, 2023 · 19 comments

Comments

@ildar
Copy link

ildar commented Jan 26, 2023

Following up the phhusson#376

Current Behavior:

BT stack is crashing regularly.

To Reproduce

  1. Connect BT headphones
  2. Connect BLE gadget (e.g. smartwatch)
  3. Start some music through A2DP
  4. CRASH of the Bluetooth stack, then OS restarts it automatically

Smartphone (please complete the following information):

  • Device: AGM H3
  • Build Flavor: lineage-20.0-20230115-UNOFFICIAL-arm64_bvS-vndklite
  • Version: latest

Additional context

To solve the problem there was the phhusson/platform_system_bt#1
But it changes nothing for my device.

@Iceows
Copy link

Iceows commented Jun 2, 2023

pra-lx1 don't support android 13, pra is a-only. Can you confirm your phone model?

@ildar ildar changed the title Bluetooth keeps stopping issue (Huawei P8 Lite 2017 - PRA-LX1) Bluetooth keeps stopping issue Jun 2, 2023
@ildar
Copy link
Author

ildar commented Jun 2, 2023 via email

@ildar
Copy link
Author

ildar commented Jun 2, 2023 via email

@phhusson
Copy link

phhusson commented Jun 2, 2023

@ildar latest fix for bluetooth crash literally has a if so it won't apply to you.
Please send a log of your crash. Just what's in adb logcat -b crashshould be enough

@ildar
Copy link
Author

ildar commented Jun 3, 2023 via email

@ildar
Copy link
Author

ildar commented Jun 13, 2023 via email

@ildar
Copy link
Author

ildar commented Jun 23, 2023 via email

@pineapple-academic
Copy link

I may have similar issues with Bluetooth and wireless earphones.
The Android GSI image is ArrowOS 13.1 v2023.07.05 (latest) and the device is tablet Alldocube kPad (Unisoc T610 UMS512; system-arm64-ab). "Use System Wide BT HAL" is enabled.
Earphones connect to the device but sometimes when hitting play in Spotify there is no audio (more often stops after Play -> Pause -> Play combo). And sometimes after few minutes the audio resumes. It's very sporadic behavior.

adb logcat -b crash ->
logcat_tablet_kpad_bt_audio_crash.txt

ildar referenced this issue in TrebleDroid/platform_packages_modules_Bluetooth Aug 17, 2023
@phhusson
Copy link

@ildar
Okay so your log has "06-02 23:25:11.675 17290 17290 F DEBUG : Abort message: 'assertion 'waiting_command_ == op_code' failed - Waiting for 0x2012 (LE_REMOVE_DEVICE_FROM_FILTER_ACCEPT_LIST), got 0x200e (LE_CREATE_CONNECTION_CANCEL)'"

So, let's assume that sending "LE_REMOVE_DEVICE_FROM_FILTER_ACCEPT_LIST" is the issue (I'm honestly not sure in this case), and let's tell Android that the chip doesn't actually support it.

Looking for LE_REMOVE_DEVICE_FROM_FILTER_ACCEPT_LIST in packages/modules/bluetooth, we end up with:

packages/modules/Bluetooth/system/gd/hci/controller.cc
811:      OP_CODE_MAPPING(LE_REMOVE_DEVICE_FROM_FILTER_ACCEPT_LIST)

Looking at OP_CODE_MAPPING, we see it is referring to local_supported_commands_
which we can see refers to persist.sys.bt.unsupported.commands
Then we see 552: LE_REMOVE_DEVICE_FROM_FILTER_ACCEPT_LIST = 271,

So to tell Android this command is not supported, you should be able to do this:
setprop persist.sys.bt.unsupported.commands 271

@ildar
Copy link
Author

ildar commented Aug 21, 2023 via email

@ildar
Copy link
Author

ildar commented Aug 26, 2023 via email

@AndyCGYan
Copy link

@AndyCGYan , would you consider adding this patch (0007-Add-properties-to-disable-some-features-commands-sta.patch) to your LOS-light build? It seems effective and lightweight. I couldn't quickly find its source, just see it in Releases ( https://github.com/TrebleDroid/treble_experimentations/releases/download/ci-20230718/patches-for-developers.zip ) (I'm on LOS-TD now but having fp issues so want to get back to LOS-light).

LOS upstream merged a similar commit (albeit with less coverage), gated by a different property bluetooth.hci.disabled_commands. On Light you might wanna try this?

@ildar
Copy link
Author

ildar commented Aug 27, 2023 via email

@ildar
Copy link
Author

ildar commented Aug 31, 2023 via email

@ildar
Copy link
Author

ildar commented Sep 10, 2023 via email

@AndyCGYan
Copy link

Though it's not 100% success story: I just got the SIGABRT again with
Abort message: 'assertion 'false' failed - Done waiting for debug
information after HCI timeout (READ_RSSI)'. That's strange because I had disabled_commands 271,155

Could be because LOS's has less coverage - I'll note this and perhaps switch to PHH's commit in the next update.

@ildar
Copy link
Author

ildar commented Sep 11, 2023 via email

@PowerPlop
Copy link

@ildar was this problem fixed in the end?

@ildar
Copy link
Author

ildar commented Jan 9, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants