StreamPack icon indicating copy to clipboard operation
StreamPack copied to clipboard

[Feat]: Support 16KB memory alignment for Android

Open GreenVegetables opened this issue 7 months ago • 10 comments

Version

2.6.1

Environment that reproduces the issue

Hi, could you please add support for 16KB memory alignment on Android?

Use case description

Proposed solution

No response

Alternative solutions

No response

GreenVegetables avatar Jul 05 '25 09:07 GreenVegetables

Hi there, I guess the reason behind your request is: https://developer.android.com/guide/practices/page-sizes Ok, it is for native code, so it concerns the dependencies: srtdroid and rtmpdroid.

BTW, it won't be fixed in 2.6.1, probably in 3.1 because I don't have the access to rtmpdroid anymore.

Do you know where are the issues in the code?

ThibaultBee avatar Jul 05 '25 14:07 ThibaultBee

Do you use RTMP or SRT?

ThibaultBee avatar Jul 06 '25 12:07 ThibaultBee

I’m using SRT, and Google Play now requires all apps to support 16KB memory alignment. Otherwise, the app may be removed in the future. I tried to recompile the srtdroid source code myself, but I failed because I couldn’t find srt.h and other related C++ files. I’m currently using StreamPack and srtdroid, but neither of them supports 16KB alignment at the moment.

I know this is a bold request, but if possible, I sincerely hope you can update these libraries to support 16KB alignment.

GreenVegetables avatar Jul 06 '25 12:07 GreenVegetables

This app can check whether other apps’ native libraries support 16KB alignment. I hope it’s helpful to you.

https://github.com/LibChecker/LibChecker

GreenVegetables avatar Jul 06 '25 12:07 GreenVegetables

You can refer to this documentation to learn how to recompile native libraries with 16KB alignment support. I hope it’s useful to you.

https://developer.android.com/guide/practices/page-sizes#update-packaging

GreenVegetables avatar Jul 06 '25 13:07 GreenVegetables

I am working on srtdroid to fix this. But it is not that easy. I got to update the packaging to the new Maven Central portal + deal with OpenSSL. See https://github.com/openssl/openssl/issues/26913

I will be pushed in StreamPack 3.0.0-RC3.

Concerning RTMP, as I not longer have access to rtmpdroid, it will take more time. Also, I am working on another RTMP libraries for a while that will be integrate in 3.1.0.

ThibaultBee avatar Jul 07 '25 10:07 ThibaultBee

Done on main branch for srt.

ThibaultBee avatar Jul 07 '25 19:07 ThibaultBee

This is exciting news—thank you! You’re truly amazing.

GreenVegetables avatar Jul 08 '25 01:07 GreenVegetables

This is exciting news—thank you! You’re truly amazing.

If you like this project, there is a lot you can do to help:

  • stars
  • develops
  • tests
  • sponsors
  • etc

ThibaultBee avatar Jul 08 '25 09:07 ThibaultBee

The work on RTMP is almost done. I am just waiting for this issue: https://youtrack.jetbrains.com/issue/KTOR-8642#focus=Comments-27-12303807.0-0

If you want to test the new RTMP provider (aka krtmp).

git clone [email protected]:ThibaultBee/krtmp.git
cd krtmp
./gradlew publishToMavenLocal

Then in a StreamPack clone, checkout feature/rtmp_provider branch.

I have tested on YouTube, Node Media Server and ffplay. I would appreciate some feedbacks on which RTMP server you have tested.

ThibaultBee avatar Sep 29 '25 19:09 ThibaultBee