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

Android benchmarking app #326

Merged
merged 5 commits into from
Nov 22, 2023
Merged

Android benchmarking app #326

merged 5 commits into from
Nov 22, 2023

Conversation

barbibulle
Copy link
Collaborator

Android counterpart to bench.py. Only RFComm Server, RFComm Client, L2CAP Server and L2CAP Client are supported in this version.
Also, BT addresses must be entered manually, scanning isn't built-in.

@barbibulle barbibulle requested a review from mogenson November 7, 2023 03:18
@mogenson
Copy link
Collaborator

mogenson commented Nov 7, 2023

I've noticed that the app can be suspended when throughput data transmission takes a few seconds:

11-07 16:14:04.508  5080  5242 I btbench.socket-server: got connection
11-07 16:14:14.252  1310  1750 D ActivityManager: freezing 5080 com.github.google.bumble.btbench

Is it possible to keep this app from being frozen by the Activity Manager? https://source.android.com/docs/core/perf/cached-apps-freezer Maybe keep the display on to keep the app in the foreground?

@barbibulle
Copy link
Collaborator Author

I've noticed that the app can be suspended when throughput data transmission takes a few seconds:

11-07 16:14:04.508  5080  5242 I btbench.socket-server: got connection
11-07 16:14:14.252  1310  1750 D ActivityManager: freezing 5080 com.github.google.bumble.btbench

Is it possible to keep this app from being frozen by the Activity Manager? https://source.android.com/docs/core/perf/cached-apps-freezer Maybe keep the display on to keep the app in the foreground?

I usually have a developer setting that keeps the screen on while on USB adb. That does help prevent freezing the app. The other method is to do to the Developer settings and changing "Suspend execution for cached apps" to "disabled".

A cleaner long term solution would be to create a background service in this app, so that it can continue working without beeing frozen, even if you switch to a different app, but that's a task for another PR :-)

@mogenson
Copy link
Collaborator

@barbibulle when going from phone (RFCOMM client) to USB dongle (RFCOMM server) I've noticed that even though we're calling create insecure RFCOMM socket, I get a pairing request popup on Android. This makes a test hard to automate using the ADB shell launcher commands.

Do you know what maybe causing the bonding attempt?

@barbibulle
Copy link
Collaborator Author

@barbibulle when going from phone (RFCOMM client) to USB dongle (RFCOMM server) I've noticed that even though we're calling create insecure RFCOMM socket, I get a pairing request popup on Android. This makes a test hard to automate using the ADB shell launcher commands.

Do you know what maybe causing the bonding attempt?

The "insecure" part of setting up an RFComm socket is a bit misleading. It's just about whether you want MITM protection or not, but not whether you want any form of security or not. Android will always require the devices to have a pairing and to encrypt the channel. If you don't bond, it will re-pair every time you setup the socket. To avoid the dialog coming up everytime, what you need to do is to bond the devices. You can do that from either side. From the Bumble side, you can use the pair app to initiate pairing and bonding. Or you can use the nrfConnect app on the phone to do that as well.

@mogenson mogenson self-assigned this Nov 20, 2023
Copy link
Collaborator

@mogenson mogenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the info and context. Looking forward to having the BtBench app as part of the Bumble project.

@mogenson mogenson removed their assignment Nov 20, 2023
@barbibulle barbibulle force-pushed the gbg/android-benchmark-app branch from 58e119c to 3dc2e40 Compare November 22, 2023 23:33
@barbibulle barbibulle merged commit 284cc8a into main Nov 22, 2023
51 checks passed
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

Successfully merging this pull request may close these issues.

2 participants