raspberry-vanilla / android_local_manifest

106 stars 48 forks source link

Bluetooth issues on AOSP14 Android Automotive #33

Closed SuperPou1 closed 3 months ago

SuperPou1 commented 8 months ago

When I pair my phone, it starts rapidly connecting and disconnecting. On the pi bluetooth actually turns off and on. Sometimes when I re-pair my phone, it doesn't do that, but aosp doesn't say my phone is connected, and on my phone when I try to play music for example, it instantly stops. I also tried other phones with same results.

My phone: Samsung galaxy a52s 5g, android 13 oneui 5.1 Rpi4: 2gb

Did anyone also encounter this issue?

SuperPou1 commented 8 months ago

okay, so i think i found the cause of the issue. disabling text messaging access in bluetooth device settings fixes the problem, and i can play music as normal.

KonstaT commented 8 months ago

This issue report is missing all kinds of important information. Please edit the issue to include appropriate logs (logcat) and information about the build target.

Bluetooth has several issues on Android Automotive builds, which I have to assume this issue report is about. I'm actually very surprised if A2DP sink works and you can play music from another device (which you naturally can't between e.g. two Android phones).

Nols1000 commented 6 months ago

Hi I can confirm, that after denying text-message access, audio-playback via bluetooth works on my build of the aosp_rpi4_car-userdebug target. Currently its only working with the 3.5mm audio jack. I'll look into getting the HiFiBerry Amp2 working.

I'll look for the logs of the disconnecting and reconnecting issue later.

PXL_20240106_133031934 PXL_20240106_132958036

adufftpc commented 3 months ago

I can propose to disable BT MAP client to avoid cyclic reconnections. https://github.com/raspberry-vanilla/android_device_brcm_rpi4/pull/2

KonstaT commented 3 months ago

I can propose to disable BT MAP client to avoid cyclic reconnections. raspberry-vanilla/android_device_brcm_rpi4#2

Thank you for your contribution. This seems reasonable but it's been a while since I've bothered to make any Android Automotive builds so I'm not able to test at the moment.

Does this resolve some specific issue with bluetooth on Android Automotive since IIRC there are quite a few?

adufftpc commented 3 months ago

Does this resolve some specific issue with bluetooth on Android Automotive since IIRC there are quite a few?

It removes rapid connections and disconnections from @SuperPou1 initial issue description. Also there was an issue he described as "on my phone when I try to play music for example, it instantly stops". It is resolved by adding the AVRCP profile. I can add a commit with the fix to the same pr if needed.

KonstaT commented 3 months ago

I can add a commit with the fix to the same pr if needed.

Please do if that fixes something. I'm not exactly sure how this should be configured for Automotive target. By Google's plan these profiles (https://android.googlesource.com/platform/packages/services/Car/+/refs/tags/android-14.0.0_r22/car_product/properties/bluetooth.prop) should be enabled by default on car configuration but I guess that doesn't work on this hardware.

Also please prepend the commit messages with car: tag as this only affect Android Automotive build target.

KonstaT commented 3 months ago

Closing as the issues reported in the original post should be be fixed with https://github.com/raspberry-vanilla/android_device_brcm_rpi4/pull/2.