mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-04-25 08:05:56 +03:00
[GH-ISSUE #18] BluetoothDevice.uuids returning null crashes the app #12
Labels
No labels
android
bug
documentation
enhancement
good first issue
help wanted
linux
pull-request
reverse-engineering
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librepods#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @devnoname120 on GitHub (Jan 5, 2025).
Original GitHub issue: https://github.com/kavishdevar/librepods/issues/18
Originally assigned to: @kavishdevar on GitHub.
Describe the bug
aln crashes on start
To Reproduce
Steps to reproduce the behavior:
System information
I used this SO for the workaround: https://github.com/kavishdevar/aln/releases/download/v0.0.1/libbluetooth_jni-a15.so
Additional context
Crash dump:
sudo logcat | grep me.kavishdevar.aln:@kavishdevar commented on GitHub (Jan 6, 2025):
This is weird. What devices do you have connected via bluetooth with your phone. Usually, the UUIDs of services for a device should not be null.
I will anyway fix the bug so that it doesn't crash at this stage.
@devnoname120 commented on GitHub (Jan 6, 2025):
I tried with none and with my AirPorts connected.
Interestingly the app didn't crash before installing the workaround. Note that otherwise the Bluetooth still works properly with the workaround installed: I can connect to Bluetooth, list devices, play music, etc.
@kavishdevar commented on GitHub (Jan 6, 2025):
@devnoname120 please try the latest nightly release.
@devnoname120 commented on GitHub (Jan 6, 2025):
@kavishdevar The app now starts properly and displays my connected AirPods Pro 2 (version with the lightning connector). I was able to change the noise control mode from Noise Cancellation to Off (it worked), then from Off to Noise Cancellation (it worked), then from Noise Cancellation to Adaptive (it worked, but now clicking on other noise control options seems to work in the app but my AirPods Pro 2 (version with the lightning connector) are actually unaffected).
Edit: force closing ALN and then reopening it fixed switching to other modes (let's see how long it works).
Unrelated note: the app screen randomly switches to “AirPods not connected”. When this happens clicking on the refresh 🔄 button at the top right sometimes works, sometimes does nothing. I have to close the app from the app switcher and then reopen it. Sometimes it shows “AirPods not connected” suddenly then the normal screen again, sometimes it stays stuck on “AirPods not connected” until I kill the app from the recents.
@devnoname120 commented on GitHub (Jan 6, 2025):
Another issue: if I switch to another noise control mode using the touch control stem of my AirPods Pro 2 (version with the lightning connector) it doesn't show the change of mode in ALN. Pressing the refresh button doesn't fix it, and closing the app from the recents doesn't fix it either. I have to force close the app and reopen it in order ALN to show the correct noise control mode that is currently set on my AirPods Pro 2 (version with the lightning connector).
@devnoname120 commented on GitHub (Jan 6, 2025):
Another issue: the battery percentage of my AirPods Pro 2 (version with the lightning connector) is shown in ALN but the battery percentage of the case is never shown, no matter if it's closed or not.
@kavishdevar commented on GitHub (Jan 6, 2025):
Ah, that - I don’t know what happens with the service. If this happens often, the notification with the battery status would disappear and instead a “service is running” notification would be shown. Could you confirm if that happens. If this does happen, it means that the app is crashing after the some UI action. In that case, you might be able to grab logs and I can exactly know what is going wrong.
Please check if any logs show up when you change the noise control mode in the Debug screen. If they don’t it’s probably AirPods that don’t send the packets. I am using the same model, and this doesn’t seem to happen on my device.
Please keep your airpods in the case for a few seconds, the battery should show up. They only send the battery data for the case only when they’re in the case.
@kavishdevar commented on GitHub (Jan 6, 2025):
Also, for the Noise Control mode not updating - could you check if the QuickSetting Tile is updated? If it is updated it would mean that the service is working properly, and the app is not updating the UI.
Thanks!
@devnoname120 commented on GitHub (Jan 6, 2025):
Yes I confirm that the notification changes to “service is running”. It seems to be random and doesn't actually require me to press any buttons, I just need to wait a few seconds.
Which logs should I grab? Logcat or something else?
I kept them in the case open, waited for a few seconds, pressed refresh and it didn't show the battery. Tried closing the case, didn't show either and after a few seconds the app showed them disconnected (which makes sense because they also disconnected from Bluetooth).
Edit: if I start ALN and then connect the following screen shows null and then this:
Do you have the AirPods Pro 2 lightning or USB-C? They have some subtle differences for example the former doesn't support head-tracking / 3D spatial audio (at least on iPhones). I made a mistake while writing my comments I confirm that I have the lightning version, not the USB-C version.
Well for some reason it works now in the UI 🤷♂️ I didn't try the widget yet, will do next time this happens.
@devnoname120 commented on GitHub (Jan 6, 2025):
Update: so it looks like my other speaker secretly connected to my phone in addition to my AirPods Pro 2. I manually disconnected it and now it looks stable! Is this a bug from ALN where it picks up the top device in the Bluetooth list or something and that list is returned in random order by Android?
Case battery works too (only when AirPods are inside with case open). It would be nice if ALN could remember the last known case battery level, maybe greying it out when it's not a “live” value?
@kavishdevar commented on GitHub (Jan 6, 2025):
adb logcat | grep me.kavishdevar.alnThe restart button is to restart the service, and when that happens, even the previously received battery data will be reset. And the app would be waiting until AirPods send it the next time. If you close the case, the AirPods will obviously disconnect. (working on how to connect to the case even when they're not connnected - findmy stuff, but gives us battery data even when not connected)
Known bug. Please rename the AirPods to whatever you'd like from the app once. I keep on forgetting about this. I'll fix this first now. If you'd like Android to see the new name, please re-pair the AirPods from the Android settings app. User apps can not rename a Bluetooth Device. The rename function of the app just sends the new name to the AirPods.
Huh, nop. The app only tries to connect to the device which advertize that specific UUID for AAP (Apple Accessory Protocol). It might be that the speaker is advertizing that UUID which is very unrealistic.
I already have that, but I disabled it for debugging. :p I'll add a toggle for that, if users want to see the last saved battery status. Along with that, I'll also become not-apple and give users freedom - like to what percentage to reduce the volume when conversational awareness is activated, or maybe just pause it instead of reducing volume, etc.!
@kavishdevar commented on GitHub (Jan 6, 2025):
Also, do you mind creating a new issue/discussion for the other bugs? Thanks.
@kavishdevar commented on GitHub (Jan 6, 2025):
Forgot to reply to this one — I have the USBC ones, but that should not really matter.
@kavishdevar commented on GitHub (Jan 6, 2025):
Fixed all bugs - found the root cause. The all was thinking the airpods were disconnected when only the audio was disconnected, which is something that the app did itself. Now there should be no random disconnections.
Only one bug left, the ‘null’ in the connection popup.
As usual, the binary is in the latest mightly release.
@kavishdevar commented on GitHub (Jan 6, 2025):
@devnoname120, do test it and confirm. Thanks!
@devnoname120 commented on GitHub (Jan 6, 2025):
@kavishdevar I confirm that it's really stable now! Even if I connect to an additional Bluetooth speaker :)
Not sure if you fixed it already but the app still doesn't remember the last case charge value (neither in the app nor in the notification).
IMO grayed out in the app with a tiny circled i next to it would be good since it's only visual rather than an AirPods setting. Pressing on the little i would show a message saying that this is the last known value and will update once the AirPods are put back in the case. This way you won't need to have an extra toggle :) (this is the approach taken by the official Sony app for the WH-1000XM5)
Will do! Thanks a lot
@kavishdevar commented on GitHub (Jan 6, 2025):
yay!!
Nope, I was waiting on some free time so that I can add other customizations along with this.
Thanks for the suggestion! Here’s what I will do - for now, show the battery status regardless of if it is connected, although with some gray tint to it in the app, and nothing in the notification. And then, later on when I eventually end up making the
app settingsscreen, I will keep an option for having disabling it, just in case someone wants that. I would love to give as many customizations as possible unlike apple. :)@kavishdevar commented on GitHub (Jan 6, 2025):
@devnoname120 try out the latest nightly release - I have made changes for showing the last saved batter level. Thanks!
@kavishdevar commented on GitHub (Jan 6, 2025):
All other bugs kinda fixed. Closing.