Preparing for 16KB alignment

1,248 views
Skip to first unread message

John Dallman

unread,
May 10, 2024, 6:44:54 AMMay 10
to andro...@googlegroups.com
Preface: I am not producing an Android app. I work for a software component business, creating shared libraries, compiled from C and C++ code, for use in third-party customers' apps. I test my libraries in a command-line test harness, which I run in the ADB shell. I am only producing software for 64-bit ARM, because none of the customers want 32-bit code. 

I recently happened on the page about supporting 16KB page sizes. Since the libraries I produce sometimes get used for years after their release, I'd like to support the larger page size ASAP. Since I use a custom build system, I'll use the "-Wl,-z,max-page-size=16384" link option. I already use several -Wl,-z options when linking my shared libraries, so this is nothing strange. I understand I'll need to use the NDK 27 C++ run-time shared library. 

I have further questions: 
  • Presumably common-page-size should be left at the default, which is presumably 4KB for now?
  • I'm going to have to buy a Pixel 6 Pro to get appropriate test hardware. That presents a problem:
    • I gave up buying consumer 'phones because Cortex-X series cores drain batteries faster than USB-C from a computer will charge them. 
    • How can I find out if a Pixel 6 Pro can charge wirelessly while talking to a computer over USB? And if this can keep up with running a fast core continuously?  
    • Cuttlefish is unattractive, because I have a lot of testing, plus I'm completely unfamiliar with it. I've never used an Android emulator for testing: we've always needed hardware performance.
Thanks in advance,

John

Dan Albert

unread,
May 10, 2024, 3:09:25 PMMay 10
to andro...@googlegroups.com, Steven Moreland

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAH1xqgmcdRrDdmyeB494kj65KFts7hAMi7QeRVhn%2BSNgKNg%3Dnw%40mail.gmail.com.

Steven Moreland

unread,
May 14, 2024, 7:40:39 PMMay 14
to android-ndk
> Presumably common-page-size should be left at the default, which is presumably 4KB for now?
>> Set the page size most commonly used to value.

Yeah, the most common page size would still be 4kb, though I'd still recommend testing your library on a 16kb device.


> I gave up buying consumer 'phones because Cortex-X series cores drain batteries faster than USB-C from a computer will charge them.

Interesting, I never noticed. I can't seem to get more than 6 watts out of my macbook. You could try USB splitters as well.


> How can I find out if a Pixel 6 Pro can charge wirelessly while talking to a computer over USB?

From looking this up online, it sounds like the wire takes priority.


> And if this can keep up with running a fast core continuously?

You're going to hit thermal throttling if you're running it continuously. External heat sinks can help, but it isn't always enough.


> Cuttlefish is unattractive, because I have a lot of testing, plus I'm completely unfamiliar with it. I've never used an Android emulator for testing: we've always needed hardware performance.

Needed hardware performance or needed good performance?

John Dallman

unread,
May 21, 2024, 5:53:01 AMMay 21
to andro...@googlegroups.com
On Wed, May 15, 2024 at 12:40 AM 'Steven Moreland' via android-ndk <andro...@googlegroups.com> wrote:
Yeah, the most common page size would still be 4kb, though I'd still recommend testing your library on a 16kb device.

Makes sense. 
 
> I gave up buying consumer 'phones because Cortex-X series cores drain batteries faster than USB-C from a computer will charge them.

Interesting, I never noticed. I can't seem to get more than 6 watts out of my macbook. You could try USB splitters as well.

Can you go into more detail about splitters? There's a lot of strange USB kit available, and we aren't experts on that. 
 
> How can I find out if a Pixel 6 Pro can charge wirelessly while talking to a computer over USB?

From looking this up online, it sounds like the wire takes priority.

Meaning that the wire is used if it's connected? 

 > And if this can keep up with running a fast core continuously?
You're going to hit thermal throttling if you're running it continuously. External heat sinks can help, but it isn't always enough.

I'll take the thermal throttling if the device will stay up for long enough. 
 
> Cuttlefish is unattractive, because I have a lot of testing, plus I'm completely unfamiliar with it. I've never used an Android emulator for testing: we've always needed hardware performance.
Needed hardware performance or needed good performance?

Good performance, which we've always presumed had to come from hardware. Running the routine testing we do on each build takes about 15 hours on a Snapdragon 8 Gen 1's ARM Cortex-X2. We need it to take less than 20 hours, so we don't have a lot of spare time. The fullest set of testing - all the auto-testable bug reports we've ever had - takes about 7 days on the same hardware, but we don't run that routinely on Android, only on x86-64 Windows and Linux, where we have lots of machines and can spread the testing over them to fit it into 20 hours. The software we produce is normally run on powerful Linux, Windows or macOS machines, but some customers want it on Android (and on iOS). They use this for AR on building sites and other places with poor connectivity.  

We run our Android testing on these. Batteries are optional, and we don't use them. Since the devices aren't cased up like mobile devices, they stay cool quite readily. The devices live in a server room, connected via USB to the Linux development host. Manually operating them, or plugging and unplugging them is very undesirable. 

Thanks,

John
 
On Friday, May 10, 2024 at 12:09:25 PM UTC-7 Dan Albert wrote:

On Fri, May 10, 2024 at 3:44 AM John Dallman <jgdats...@gmail.com> wrote:
Preface: I am not producing an Android app. I work for a software component business, creating shared libraries, compiled from C and C++ code, for use in third-party customers' apps. I test my libraries in a command-line test harness, which I run in the ADB shell. I am only producing software for 64-bit ARM, because none of the customers want 32-bit code. 

I recently happened on the page about supporting 16KB page sizes. Since the libraries I produce sometimes get used for years after their release, I'd like to support the larger page size ASAP. Since I use a custom build system, I'll use the "-Wl,-z,max-page-size=16384" link option. I already use several -Wl,-z options when linking my shared libraries, so this is nothing strange. I understand I'll need to use the NDK 27 C++ run-time shared library. 

I have further questions: 
  • Presumably common-page-size should be left at the default, which is presumably 4KB for now?
  • I'm going to have to buy a Pixel 6 Pro to get appropriate test hardware. That presents a problem:
    • I gave up buying consumer 'phones because Cortex-X series cores drain batteries faster than USB-C from a computer will charge them. 
    • How can I find out if a Pixel 6 Pro can charge wirelessly while talking to a computer over USB? And if this can keep up with running a fast core continuously?  
    • Cuttlefish is unattractive, because I have a lot of testing, plus I'm completely unfamiliar with it. I've never used an Android emulator for testing: we've always needed hardware performance.
Thanks in advance,

John

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAH1xqgmcdRrDdmyeB494kj65KFts7hAMi7QeRVhn%2BSNgKNg%3Dnw%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.

Pete Bentley

unread,
May 21, 2024, 9:31:36 AMMay 21
to andro...@googlegroups.com
On Tue, 21 May 2024 at 10:52, John Dallman <jgdats...@gmail.com> wrote:
On Wed, May 15, 2024 at 12:40 AM 'Steven Moreland' via android-ndk <andro...@googlegroups.com> wrote:
Yeah, the most common page size would still be 4kb, though I'd still recommend testing your library on a 16kb device.

Makes sense. 
 
> I gave up buying consumer 'phones because Cortex-X series cores drain batteries faster than USB-C from a computer will charge them.

Interesting, I never noticed. I can't seem to get more than 6 watts out of my macbook. You could try USB splitters as well.

Can you go into more detail about splitters? There's a lot of strange USB kit available, and we aren't experts on that. 


Unsure how that would work, but what about adb over wifi for command and control and plug the device into a chunky PSU for power?
 
 
> How can I find out if a Pixel 6 Pro can charge wirelessly while talking to a computer over USB?

From looking this up online, it sounds like the wire takes priority.

Meaning that the wire is used if it's connected? 

Also I think the most you can do over wireless charging is about 15W.
 

John Dallman

unread,
May 21, 2024, 11:41:15 AMMay 21
to andro...@googlegroups.com
On Tue, May 21, 2024 at 2:31 PM 'Pete Bentley' via android-ndk <andro...@googlegroups.com> wrote:
On Tue, 21 May 2024 at 10:52, John Dallman <jgdats...@gmail.com> wrote:
Can you go into more detail about splitters? There's a lot of strange USB kit available, and we aren't experts on that. 
Unsure how that would work, but what about adb over wifi for command and control and plug the device into a chunky PSU for power?

This isn't very practical:
  1. We have to copy quite a lot of confidential test data onto devices to run tests.
  2. That means we need to make it hard to steal the devices. 
  3. We do that by locking them in cages made from steel bars, about 1mm in diameter and 20mm spacing. 
  4. USB cables can be run through that easily, but Wi-Fi isn't reliable. 
From looking this up online, it sounds like the wire takes priority.
Meaning that the wire is used if it's connected? 
Also I think the most you can do over wireless charging is about 15W.

I'll believe it. 

Thanks,

John 
 

John Dallman

unread,
May 29, 2024, 7:08:51 AMMay 29
to andro...@googlegroups.com
> I gave up buying consumer 'phones because Cortex-X series cores drain batteries faster than
> USB-C from a computer will charge them.
Interesting, I never noticed. I can't seem to get more than 6 watts out of my macbook. You could try USB splitters as well.
> Can you go into more detail about splitters? There's a lot of strange USB kit available, and we aren't experts on that. 

Anyone got any suggestions on USB splitters?

Thanks,

John Dallman
Reply all
Reply to author
Forward
0 new messages