diff --git a/aosptree/vendor/devices-community/gd_rpi4/BoardConfig.mk b/aosptree/vendor/devices-community/gd_rpi4/BoardConfig.mk index 0652014..d53caa7 100644 --- a/aosptree/vendor/devices-community/gd_rpi4/BoardConfig.mk +++ b/aosptree/vendor/devices-community/gd_rpi4/BoardConfig.mk @@ -22,3 +22,5 @@ BOARD_LIBCAMERA_EXTRA_TARGETS += \ BOARD_FFMPEG_ENABLE_REQUEST_API := true BOARD_FFMPEG_KERNEL_HEADERS_DIR := $(BC_PATH)/codecs/request_api_headers_v4 BOARD_FFMPEG_EXTRA_CONFIGURE_OPTIONS := --enable-sand + +UNSAFE_DISABLE_APEX_ALLOWED_DEPS_CHECK := true \ No newline at end of file diff --git a/aosptree/vendor/devices-community/gd_rpi4/device.mk b/aosptree/vendor/devices-community/gd_rpi4/device.mk index 6eb279a..755c443 100644 --- a/aosptree/vendor/devices-community/gd_rpi4/device.mk +++ b/aosptree/vendor/devices-community/gd_rpi4/device.mk @@ -67,7 +67,7 @@ PRODUCT_VENDOR_PROPERTIES += \ ro.hardware.vulkan=broadcom \ # Enable Vulkan backend for SKIA/HWUI -#TARGET_USES_VULKAN = true +TARGET_USES_VULKAN = true # Bluetooth PRODUCT_VENDOR_PROPERTIES += \ diff --git a/build.sh b/build.sh index 7d3e8d7..a33f4a7 100755 --- a/build.sh +++ b/build.sh @@ -6,6 +6,7 @@ echo Building the Android pushd aosptree . build/envsetup.sh lunch gd_rpi4-trunk_staging-userdebug -make images -k || make images -j1 +make -k || make -j1 +make images make sdcard popd diff --git a/manifests/glodroid.xml b/manifests/glodroid.xml index 6774dd6..15be9bb 100644 --- a/manifests/glodroid.xml +++ b/manifests/glodroid.xml @@ -5,12 +5,10 @@ - + - - - + @@ -19,35 +17,30 @@ - - + - - - + + + - - + - + - - - - + +Date: Sun, 24 May 2026 21:31:46 +0300 +Subject: [PATCH] Fix build issues + +Signed-off-by: Roman Stratiienko +--- + Android.bp | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/Android.bp b/Android.bp +index 3631635..be16062 100644 +--- a/Android.bp ++++ b/Android.bp +@@ -12,7 +12,6 @@ cc_defaults { + cflags: [ + "-g3", + "-Werror", +- "-D_FORTIFY_SOURCE=2", + "-DYAML_VERSION_MAJOR=" + YAML_MAJOR, + "-DYAML_VERSION_MINOR=" + YAML_MINOR, + "-DYAML_VERSION_PATCH=" + YAML_PATCH, +@@ -28,7 +27,7 @@ cc_library_headers { + ], + } + +-cc_library_shared { ++cc_library { + name: "libyaml", + vendor: true, + defaults: [ +-- +2.51.0 + diff --git a/patches-aosp/external/lzma/0001-Remove-Android.bp-march-hacks.patch b/patches-aosp/external/lzma/0001-Remove-Android.bp-march-hacks.patch deleted file mode 100644 index a1dacab..0000000 --- a/patches-aosp/external/lzma/0001-Remove-Android.bp-march-hacks.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 2cf2a6c076670aa5a6846109706fc309f2ffc91f Mon Sep 17 00:00:00 2001 -From: Elliott Hughes -Date: Thu, 5 Sep 2024 15:52:58 +0000 -Subject: [PATCH] Remove Android.bp -march hacks. - -It looks like clang changed so that the __attribute__((__target__())) -stuff is working again, and that's a lot safer than hard-coding -march. -In particular, it turns out that we're still shipping ART mainline -module updates to armv7 devices... - -Bug: http://b/364822746 -Test: objdump -Change-Id: If409deff5d08559a7466b6ebcd0aa95ea63a1665 ---- - Android.bp | 9 --------- - 1 file changed, 9 deletions(-) - -diff --git a/Android.bp b/Android.bp -index 752a8f9..828650c 100644 ---- a/Android.bp -+++ b/Android.bp -@@ -81,15 +81,6 @@ cc_library { - "C/XzIn.c", - ], - -- arch: { -- arm: { -- cflags: ["-march=armv8-a+crypto"], -- }, -- arm64: { -- cflags: ["-march=armv8-a+crypto"], -- }, -- }, -- - target: { - linux_bionic: { - enabled: true, --- -2.43.0 - diff --git a/patches-aosp/external/v4l2_codec2/0001-v4l2_codec2-Remove-multilib-support.patch b/patches-aosp/external/v4l2_codec2/0001-v4l2_codec2-Remove-multilib-support.patch index 8ba20b4..33d8d38 100644 --- a/patches-aosp/external/v4l2_codec2/0001-v4l2_codec2-Remove-multilib-support.patch +++ b/patches-aosp/external/v4l2_codec2/0001-v4l2_codec2-Remove-multilib-support.patch @@ -1,7 +1,7 @@ -From 92c8351dfb247422ba84e8cc9012094bbd12f11a Mon Sep 17 00:00:00 2001 +From 5f9f0acbe326f588ae2b51d377a16990bd425f49 Mon Sep 17 00:00:00 2001 From: Roman Stratiienko Date: Thu, 12 Oct 2023 03:19:20 +0300 -Subject: [PATCH 01/11] v4l2_codec2: Remove multilib support +Subject: [PATCH 01/10] v4l2_codec2: Remove multilib support For the bindarized HAL, multilib doesn't make any sense. Also, it confuses the init sometimes if both 64 and 32 @@ -11,61 +11,61 @@ Change-Id: I33854241f2976ac54cdb7731cdcc93e94021d30c Signed-off-by: Roman Stratiienko --- service/Android.bp | 13 ++----------- - ...android.hardware.media.c2@1.0-service-v4l2-64.rc | 7 ------- - ...> android.hardware.media.c2@1.0-service-v4l2.rc} | 2 +- + ...android.hardware.media.c2@1.2-service-v4l2-64.rc | 7 ------- + ...> android.hardware.media.c2@1.2-service-v4l2.rc} | 2 +- 3 files changed, 3 insertions(+), 19 deletions(-) - delete mode 100644 service/android.hardware.media.c2@1.0-service-v4l2-64.rc - rename service/{android.hardware.media.c2@1.0-service-v4l2-32.rc => android.hardware.media.c2@1.0-service-v4l2.rc} (82%) + delete mode 100644 service/android.hardware.media.c2@1.2-service-v4l2-64.rc + rename service/{android.hardware.media.c2@1.2-service-v4l2-32.rc => android.hardware.media.c2@1.2-service-v4l2.rc} (82%) diff --git a/service/Android.bp b/service/Android.bp -index eaf5d3f..1cc3808 100644 +index 7a0bc41..e1d14b6 100644 --- a/service/Android.bp +++ b/service/Android.bp -@@ -33,16 +33,7 @@ cc_binary { - - required: ["android.hardware.media.c2-default-seccomp_policy"], +@@ -50,16 +50,7 @@ cc_binary { + "-DV4L2_CODEC2_SERVICE_V4L2_STORE", + ], - compile_multilib: "both", - multilib: { - lib32: { - suffix: "-32", -- init_rc: ["android.hardware.media.c2@1.0-service-v4l2-32.rc"], +- init_rc: ["android.hardware.media.c2@1.2-service-v4l2-32.rc"], - }, - lib64: { - suffix: "-64", -- init_rc: ["android.hardware.media.c2@1.0-service-v4l2-64.rc"], +- init_rc: ["android.hardware.media.c2@1.2-service-v4l2-64.rc"], - }, - }, + compile_multilib: "first", -+ init_rc: ["android.hardware.media.c2@1.0-service-v4l2.rc"], ++ init_rc: ["android.hardware.media.c2@1.2-service-v4l2.rc"], vintf_fragments: ["android.hardware.media.c2@1.2-service-v4l2.xml"], } -diff --git a/service/android.hardware.media.c2@1.0-service-v4l2-64.rc b/service/android.hardware.media.c2@1.0-service-v4l2-64.rc +diff --git a/service/android.hardware.media.c2@1.2-service-v4l2-64.rc b/service/android.hardware.media.c2@1.2-service-v4l2-64.rc deleted file mode 100644 -index 454953b..0000000 ---- a/service/android.hardware.media.c2@1.0-service-v4l2-64.rc +index 9869c6b..0000000 +--- a/service/android.hardware.media.c2@1.2-service-v4l2-64.rc +++ /dev/null @@ -1,7 +0,0 @@ --service android-hardware-media-c2-v4l2-hal-1-0 /vendor/bin/hw/android.hardware.media.c2@1.0-service-v4l2-64 +-service android-hardware-media-c2-v4l2-hal-1-2 /vendor/bin/hw/android.hardware.media.c2@1.2-service-v4l2-64 - class hal - user media - group mediadrm drmrpc - ioprio rt 4 - task_profiles ProcessCapacityHigh - setenv MESA_GLSL_CACHE_DISABLE 1 -diff --git a/service/android.hardware.media.c2@1.0-service-v4l2-32.rc b/service/android.hardware.media.c2@1.0-service-v4l2.rc +diff --git a/service/android.hardware.media.c2@1.2-service-v4l2-32.rc b/service/android.hardware.media.c2@1.2-service-v4l2.rc similarity index 82% -rename from service/android.hardware.media.c2@1.0-service-v4l2-32.rc -rename to service/android.hardware.media.c2@1.0-service-v4l2.rc -index e4ddbc3..8d1a45b 100644 ---- a/service/android.hardware.media.c2@1.0-service-v4l2-32.rc -+++ b/service/android.hardware.media.c2@1.0-service-v4l2.rc +rename from service/android.hardware.media.c2@1.2-service-v4l2-32.rc +rename to service/android.hardware.media.c2@1.2-service-v4l2.rc +index 4fe0ccb..3420fe8 100644 +--- a/service/android.hardware.media.c2@1.2-service-v4l2-32.rc ++++ b/service/android.hardware.media.c2@1.2-service-v4l2.rc @@ -1,4 +1,4 @@ --service android-hardware-media-c2-v4l2-hal-1-0 /vendor/bin/hw/android.hardware.media.c2@1.0-service-v4l2-32 -+service android-hardware-media-c2-v4l2-hal-1-0 /vendor/bin/hw/android.hardware.media.c2@1.0-service-v4l2 +-service android-hardware-media-c2-v4l2-hal-1-2 /vendor/bin/hw/android.hardware.media.c2@1.2-service-v4l2-32 ++service android-hardware-media-c2-v4l2-hal-1-2 /vendor/bin/hw/android.hardware.media.c2@1.2-service-v4l2 class hal user media group mediadrm drmrpc -- -2.39.2 +2.43.0 diff --git a/patches-aosp/external/v4l2_codec2/0002-v4l2_codec2-Make-the-project-directory-independent.patch b/patches-aosp/external/v4l2_codec2/0002-v4l2_codec2-Make-the-project-directory-independent.patch index a10ab35..0dbcc26 100644 --- a/patches-aosp/external/v4l2_codec2/0002-v4l2_codec2-Make-the-project-directory-independent.patch +++ b/patches-aosp/external/v4l2_codec2/0002-v4l2_codec2-Make-the-project-directory-independent.patch @@ -1,7 +1,7 @@ -From f20359e78c894dd389337a74bcd4af36432823df Mon Sep 17 00:00:00 2001 +From 79e4bbac5cae481edc8c2090f558296290fa4df7 Mon Sep 17 00:00:00 2001 From: Roman Stratiienko Date: Wed, 11 Oct 2023 11:32:05 +0300 -Subject: [PATCH 02/11] v4l2_codec2: Make the project directory-independent +Subject: [PATCH 02/10] v4l2_codec2: Make the project directory-independent Some users want to group all vendor code in a separate directory. Replace hardcoded 'external/v4l2_codec2' paths with cc_library_headers. @@ -9,34 +9,32 @@ Replace hardcoded 'external/v4l2_codec2' paths with cc_library_headers. Change-Id: I29b3c15df199a225ce0acccbafe4f935de250a2c Signed-off-by: Roman Stratiienko --- - common/Android.bp | 6 ++++++ - components/Android.bp | 6 ++++++ + common/Android.bp | 5 +++++ + components/Android.bp | 5 +++++ tests/c2_comp_intf/Android.bp | 6 ++---- - 3 files changed, 14 insertions(+), 4 deletions(-) + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/common/Android.bp b/common/Android.bp -index e9c5fe3..a92bca5 100644 +index 6b571c9..58a1f5e 100644 --- a/common/Android.bp +++ b/common/Android.bp -@@ -50,3 +50,9 @@ cc_library { +@@ -50,3 +50,8 @@ cc_library { "-Wall", ], } -+ +cc_library_headers { + name: "v4l2_codec2_common_headers", + vendor: true, + export_include_dirs: ["include"], +} diff --git a/components/Android.bp b/components/Android.bp -index 5bee73b..742b9eb 100644 +index 73efcf2..98a64b2 100644 --- a/components/Android.bp +++ b/components/Android.bp -@@ -57,3 +57,9 @@ cc_library { +@@ -54,3 +54,8 @@ cc_library { "-Wthread-safety", ], } -+ +cc_library_headers { + name: "v4l2_codec2_components_headers", + vendor: true, @@ -61,5 +59,5 @@ index 5c91ef4..35380f3 100644 "libcodec2_headers", "libcodec2_vndk_headers", -- -2.39.2 +2.43.0 diff --git a/patches-aosp/external/v4l2_codec2/0004-GLODROID-Disable-seccomp.patch b/patches-aosp/external/v4l2_codec2/0003-GLODROID-Disable-seccomp.patch similarity index 75% rename from patches-aosp/external/v4l2_codec2/0004-GLODROID-Disable-seccomp.patch rename to patches-aosp/external/v4l2_codec2/0003-GLODROID-Disable-seccomp.patch index 88c5863..bb6558c 100644 --- a/patches-aosp/external/v4l2_codec2/0004-GLODROID-Disable-seccomp.patch +++ b/patches-aosp/external/v4l2_codec2/0003-GLODROID-Disable-seccomp.patch @@ -1,7 +1,7 @@ -From b8227baca2bb8df1a57e155cac7de3e6b4daecc9 Mon Sep 17 00:00:00 2001 +From 72d9be62f1773f3940e43f4045a3bf8d37bd6797 Mon Sep 17 00:00:00 2001 From: Roman Stratiienko Date: Sun, 17 Sep 2023 12:14:08 +0300 -Subject: [PATCH 04/11] GLODROID: Disable seccomp +Subject: [PATCH 03/10] GLODROID: Disable seccomp From my understanding, the seccomp only makes sense when using proprietary codec libraries to ensure they are not doing anything @@ -10,30 +10,29 @@ unexpected. Change-Id: I90caac273ea51666f2ec51eb4ecaa02f76743f52 Signed-off-by: Roman Stratiienko --- - service/Android.bp | 2 -- + service/Android.bp | 1 - service/service.cpp | 13 ------------- - 2 files changed, 15 deletions(-) + 2 files changed, 14 deletions(-) diff --git a/service/Android.bp b/service/Android.bp -index 1cc3808..180dff3 100644 +index e1d14b6..494032a 100644 --- a/service/Android.bp +++ b/service/Android.bp -@@ -31,8 +31,6 @@ cc_binary { +@@ -32,7 +32,6 @@ cc_defaults { "libutils", ], - required: ["android.hardware.media.c2-default-seccomp_policy"], -- - compile_multilib: "first", - init_rc: ["android.hardware.media.c2@1.0-service-v4l2.rc"], - vintf_fragments: ["android.hardware.media.c2@1.2-service-v4l2.xml"], + } + + cc_binary { diff --git a/service/service.cpp b/service/service.cpp -index 1fa9aae..25a612a 100644 +index 03865ef..97323fb 100644 --- a/service/service.cpp +++ b/service/service.cpp -@@ -14,23 +14,10 @@ - - #include +@@ -20,23 +20,10 @@ + #include + #endif -// This is the absolute on-device path of the prebuild_etc module -// "android.hardware.media.c2-default-seccomp_policy" in Android.bp. @@ -56,5 +55,5 @@ index 1fa9aae..25a612a 100644 // Extra threads may be needed to handle a stacked IPC sequence that // contains alternating binder and hwbinder calls. (See b/35283480.) -- -2.39.2 +2.43.0 diff --git a/patches-aosp/external/v4l2_codec2/0003-plugin_store-Mark-libc2plugin_store-library-as-vendo.patch b/patches-aosp/external/v4l2_codec2/0003-plugin_store-Mark-libc2plugin_store-library-as-vendo.patch deleted file mode 100644 index 1caf198..0000000 --- a/patches-aosp/external/v4l2_codec2/0003-plugin_store-Mark-libc2plugin_store-library-as-vendo.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 4d61b0f94def056351f18f0223e6863e4ff822bf Mon Sep 17 00:00:00 2001 -From: Andrew Gazizov -Date: Tue, 27 Sep 2022 09:53:59 +0200 -Subject: [PATCH 03/11] plugin_store: Mark libc2plugin_store library as - vendor_available. - -Set property vendor_available:true for libc2plugin_store library -to install it for platform (/system/lib directory). [1] -Otherwise libc2plugin_store will be not visible and accessible -for C2PlatformStorePluginLoader. - -REF: -[1] https://source.android.com/docs/core/architecture/vndk/enabling - -Bug: 249120082 -Test: Build and run - -Change-Id: I465266ef2a3b0d7ea9fa5cd904f345574ff7f275 ---- - plugin_store/Android.bp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/plugin_store/Android.bp b/plugin_store/Android.bp -index 621cbfc..ec44f13 100644 ---- a/plugin_store/Android.bp -+++ b/plugin_store/Android.bp -@@ -9,7 +9,7 @@ package { - - cc_library_shared { - name: "libc2plugin_store", -- vendor: true, -+ vendor_available: true, - - defaults: [ - "libcodec2-impl-defaults", --- -2.39.2 - diff --git a/patches-aosp/external/v4l2_codec2/0005-Rename-HAL-instance-from-default-to-v4l2.patch b/patches-aosp/external/v4l2_codec2/0004-Rename-HAL-instance-from-default-to-v4l2.patch similarity index 71% rename from patches-aosp/external/v4l2_codec2/0005-Rename-HAL-instance-from-default-to-v4l2.patch rename to patches-aosp/external/v4l2_codec2/0004-Rename-HAL-instance-from-default-to-v4l2.patch index 120d751..2742411 100644 --- a/patches-aosp/external/v4l2_codec2/0005-Rename-HAL-instance-from-default-to-v4l2.patch +++ b/patches-aosp/external/v4l2_codec2/0004-Rename-HAL-instance-from-default-to-v4l2.patch @@ -1,14 +1,14 @@ -From a8b9f1030b9f850c0ded14e00231f944e66cc4ee Mon Sep 17 00:00:00 2001 +From 8101bd51f6cdfa3b997228c4d46fa232505d0a20 Mon Sep 17 00:00:00 2001 From: Roman Stratiienko Date: Sun, 17 Sep 2023 12:21:07 +0300 -Subject: [PATCH 05/11] Rename HAL instance from default to v4l2 +Subject: [PATCH 04/10] Rename HAL instance from default to v4l2 Change-Id: I361fbfc536db21f99b4a72b30bdb1ea482f70528 Signed-off-by: Roman Stratiienko --- service/android.hardware.media.c2@1.2-service-v4l2.xml | 2 +- - service/service.cpp | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) + service/service.cpp | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/service/android.hardware.media.c2@1.2-service-v4l2.xml b/service/android.hardware.media.c2@1.2-service-v4l2.xml index 7976a59..df88113 100644 @@ -24,18 +24,20 @@ index 7976a59..df88113 100644 diff --git a/service/service.cpp b/service/service.cpp -index 25a612a..2909bb2 100644 +index 97323fb..e0548c6 100644 --- a/service/service.cpp +++ b/service/service.cpp -@@ -37,7 +37,7 @@ int main(int /* argc */, char** /* argv */) { - new utils::ComponentStore(android::V4L2ComponentStore::Create())); +@@ -45,8 +45,8 @@ int main(int /* argc */, char** /* argv */) { + #endif + if (store == nullptr) { - ALOGE("Cannot create Codec2's V4L2 IComponentStore service."); +- ALOGE("Cannot create Codec2's IComponentStore service."); - } else if (store->registerAsService("default") != android::OK) { ++ ALOGE("Cannot create Codec2's V4L2 IComponentStore service."); + } else if (store->registerAsService("v4l2") != android::OK) { ALOGE("Cannot register Codec2's IComponentStore service."); } else { ALOGI("Codec2's IComponentStore service created."); -- -2.39.2 +2.43.0 diff --git a/patches-aosp/external/v4l2_codec2/0005-EncoderInterface-Set-both-input-and-output-usage-to-.patch b/patches-aosp/external/v4l2_codec2/0005-EncoderInterface-Set-both-input-and-output-usage-to-.patch new file mode 100644 index 0000000..b65421f --- /dev/null +++ b/patches-aosp/external/v4l2_codec2/0005-EncoderInterface-Set-both-input-and-output-usage-to-.patch @@ -0,0 +1,32 @@ +From c78bf460244e808ef2f45cd8ecd5e8ba3939b4bb Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Mon, 2 Oct 2023 01:55:53 +0300 +Subject: [PATCH 05/10] EncoderInterface: Set both input and output usage to + VIDEO_ENCODER + +... so that gralloc can allocate the buffer with the appropriate memory type. + +Change-Id: Ifc7d507c9bb9c8193217b74d860760689f993d6c +Signed-off-by: Roman Stratiienko +--- + components/EncodeInterface.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/components/EncodeInterface.cpp b/components/EncodeInterface.cpp +index 12152e6..af4e14a 100644 +--- a/components/EncodeInterface.cpp ++++ b/components/EncodeInterface.cpp +@@ -319,6 +319,10 @@ void EncodeInterface::Initialize(const C2String& name, const SupportedCapabiliti + 0u, static_cast(BufferUsage::VIDEO_ENCODER))) + .build()); + ++ addParameter(DefineParam(mInputMemoryUsage, C2_PARAMKEY_OUTPUT_STREAM_USAGE) ++ .withConstValue(new C2StreamUsageTuning::input( ++ 0u, static_cast(BufferUsage::VIDEO_ENCODER))) ++ .build()); + addParameter( + DefineParam(mOutputFormat, C2_PARAMKEY_OUTPUT_STREAM_BUFFER_TYPE) + .withConstValue(new C2StreamBufferTypeSetting::output(0u, C2BufferData::LINEAR)) +-- +2.43.0 + diff --git a/patches-aosp/external/v4l2_codec2/0006-EncoderInterface-Set-both-input-and-output-usage-to-.patch b/patches-aosp/external/v4l2_codec2/0006-EncoderInterface-Set-both-input-and-output-usage-to-.patch deleted file mode 100644 index af42270..0000000 --- a/patches-aosp/external/v4l2_codec2/0006-EncoderInterface-Set-both-input-and-output-usage-to-.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 2379c1166cc0deeec129614bb8a0769450153a5e Mon Sep 17 00:00:00 2001 -From: Roman Stratiienko -Date: Mon, 2 Oct 2023 01:55:53 +0300 -Subject: [PATCH 06/11] EncoderInterface: Set both input and output usage to - VIDEO_ENCODER - -... so that gralloc can allocate the buffer with the appropriate memory type. - -Change-Id: Ifc7d507c9bb9c8193217b74d860760689f993d6c -Signed-off-by: Roman Stratiienko ---- - components/V4L2EncodeInterface.cpp | 20 +++++++++----------- - 1 file changed, 9 insertions(+), 11 deletions(-) - -diff --git a/components/V4L2EncodeInterface.cpp b/components/V4L2EncodeInterface.cpp -index 03d8c37..2e65cb8 100644 ---- a/components/V4L2EncodeInterface.cpp -+++ b/components/V4L2EncodeInterface.cpp -@@ -382,17 +382,15 @@ void V4L2EncodeInterface::Initialize(const C2String& name) { - .withConstValue(new C2StreamBufferTypeSetting::input(0u, C2BufferData::GRAPHIC)) - .build()); - -- // TODO(b/167640667) Add VIDEO_ENCODER flag once input convertor is not enabled by default. -- // When using the format convertor (which is currently always enabled) it's not useful to add -- // the VIDEO_ENCODER buffer flag for input buffers here. Currently zero-copy is not supported -- // yet, so when using this flag an additional buffer will be allocated on host side and a copy -- // will be performed between the guest and host buffer to keep them in sync. This is wasteful as -- // the buffer is only used on guest side by the format convertor which converts and copies the -- // buffer into another buffer. -- //addParameter(DefineParam(mInputMemoryUsage, C2_PARAMKEY_INPUT_STREAM_USAGE) -- // .withConstValue(new C2StreamUsageTuning::input( -- // 0u, static_cast(BufferUsage::VIDEO_ENCODER))) -- // .build()); -+ addParameter(DefineParam(mInputMemoryUsage, C2_PARAMKEY_INPUT_STREAM_USAGE) -+ .withConstValue(new C2StreamUsageTuning::input( -+ 0u, static_cast(BufferUsage::VIDEO_ENCODER))) -+ .build()); -+ -+ addParameter(DefineParam(mInputMemoryUsage, C2_PARAMKEY_OUTPUT_STREAM_USAGE) -+ .withConstValue(new C2StreamUsageTuning::input( -+ 0u, static_cast(BufferUsage::VIDEO_ENCODER))) -+ .build()); - - addParameter( - DefineParam(mOutputFormat, C2_PARAMKEY_OUTPUT_STREAM_BUFFER_TYPE) --- -2.39.2 - diff --git a/patches-aosp/external/v4l2_codec2/0006-v4l2_codec2-Increase-maximum-frame-rate-to-60FPS.patch b/patches-aosp/external/v4l2_codec2/0006-v4l2_codec2-Increase-maximum-frame-rate-to-60FPS.patch new file mode 100644 index 0000000..fe40e62 --- /dev/null +++ b/patches-aosp/external/v4l2_codec2/0006-v4l2_codec2-Increase-maximum-frame-rate-to-60FPS.patch @@ -0,0 +1,29 @@ +From b82a44f9f562c12e819ae9df1d6c79bbba964c18 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Mon, 2 Oct 2023 01:58:46 +0300 +Subject: [PATCH 06/10] v4l2_codec2: Increase maximum frame rate to 60FPS + +We want screen capture to have more than 30FPS. + +Change-Id: I169a40be12bd4fb69285df79dca8b55db0fb07f2 +Signed-off-by: Roman Stratiienko +--- + v4l2/V4L2Device.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/v4l2/V4L2Device.cpp b/v4l2/V4L2Device.cpp +index 0190deb..65fdc78 100644 +--- a/v4l2/V4L2Device.cpp ++++ b/v4l2/V4L2Device.cpp +@@ -2343,7 +2343,7 @@ SupportedProfiles V4L2Device::enumerateSupportedProfiles( + + SupportedProfile profile; + if (type == Type::kEncoder) { +- profile.max_framerate_numerator = 30; ++ profile.max_framerate_numerator = 60; + profile.max_framerate_denominator = 1; + } + +-- +2.43.0 + diff --git a/patches-aosp/external/v4l2_codec2/0007-HACK-v4l2_codec2-Allow-format-converter-initializati.patch b/patches-aosp/external/v4l2_codec2/0007-HACK-v4l2_codec2-Allow-format-converter-initializati.patch new file mode 100644 index 0000000..947a0e4 --- /dev/null +++ b/patches-aosp/external/v4l2_codec2/0007-HACK-v4l2_codec2-Allow-format-converter-initializati.patch @@ -0,0 +1,33 @@ +From abd58baf98824aac5321eaf005f5419203faf301 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Mon, 2 Oct 2023 02:15:11 +0300 +Subject: [PATCH 07/10] HACK: v4l2_codec2: Allow format converter + initialization to fail + +We do not need any format converters. +We want zero-copy - to display the buffer as is. + +Change-Id: Ibb4e6b9df370dcba53b15b24fb9f503f6e1608b4 +Signed-off-by: Roman Stratiienko +--- + components/EncodeComponent.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/components/EncodeComponent.cpp b/components/EncodeComponent.cpp +index 65de283..ca20edf 100644 +--- a/components/EncodeComponent.cpp ++++ b/components/EncodeComponent.cpp +@@ -478,8 +478,8 @@ void EncodeComponent::queueTask(std::unique_ptr work) { + VideoEncoder::kInputBufferCount, mEncoder->codedSize()); + if (!mInputFormatConverter) { + ALOGE("Failed to created input format convertor"); +- reportError(C2_CORRUPTED); +- return; ++ // reportError(C2_CORRUPTED); ++ // return; + } + } + } +-- +2.43.0 + diff --git a/patches-aosp/external/v4l2_codec2/0007-v4l2_codec2-Increase-maximum-frame-rate-to-60FPS.patch b/patches-aosp/external/v4l2_codec2/0007-v4l2_codec2-Increase-maximum-frame-rate-to-60FPS.patch deleted file mode 100644 index 25535cb..0000000 --- a/patches-aosp/external/v4l2_codec2/0007-v4l2_codec2-Increase-maximum-frame-rate-to-60FPS.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 16c04660aaee31877ca5e87eb706758e59b7fd8b Mon Sep 17 00:00:00 2001 -From: Roman Stratiienko -Date: Mon, 2 Oct 2023 01:58:46 +0300 -Subject: [PATCH 07/11] v4l2_codec2: Increase maximum frame rate to 60FPS - -We want screen capture to have more than 30FPS. - -Change-Id: I169a40be12bd4fb69285df79dca8b55db0fb07f2 -Signed-off-by: Roman Stratiienko ---- - common/V4L2Device.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/common/V4L2Device.cpp b/common/V4L2Device.cpp -index 68a9dca..b3d3679 100644 ---- a/common/V4L2Device.cpp -+++ b/common/V4L2Device.cpp -@@ -1850,7 +1850,7 @@ V4L2Device::SupportedEncodeProfiles V4L2Device::enumerateSupportedEncodeProfiles - - for (const auto& pixelformat : supportedPixelformats) { - SupportedEncodeProfile profile; -- profile.max_framerate_numerator = 30; -+ profile.max_framerate_numerator = 60; - profile.max_framerate_denominator = 1; - ui::Size minResolution; - getSupportedResolution(pixelformat, &minResolution, &profile.max_resolution); --- -2.39.2 - diff --git a/patches-aosp/external/v4l2_codec2/0008-HACK-v4l2_codec2-Allow-format-converter-initializati.patch b/patches-aosp/external/v4l2_codec2/0008-HACK-v4l2_codec2-Allow-format-converter-initializati.patch deleted file mode 100644 index 4746b5d..0000000 --- a/patches-aosp/external/v4l2_codec2/0008-HACK-v4l2_codec2-Allow-format-converter-initializati.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 3972306731a17a468a89afbc6829b0b92907b7b1 Mon Sep 17 00:00:00 2001 -From: Roman Stratiienko -Date: Mon, 2 Oct 2023 02:15:11 +0300 -Subject: [PATCH 08/11] HACK: v4l2_codec2: Allow format converter - initialization to fail - -We do not need any format converters. -We want zero-copy - to display the buffer as is. - -Change-Id: Ibb4e6b9df370dcba53b15b24fb9f503f6e1608b4 -Signed-off-by: Roman Stratiienko ---- - components/V4L2EncodeComponent.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/components/V4L2EncodeComponent.cpp b/components/V4L2EncodeComponent.cpp -index c2a2679..b17488b 100644 ---- a/components/V4L2EncodeComponent.cpp -+++ b/components/V4L2EncodeComponent.cpp -@@ -677,7 +677,7 @@ bool V4L2EncodeComponent::initializeEncoder() { - V4L2Encoder::kInputBufferCount, mEncoder->codedSize()); - if (!mInputFormatConverter) { - ALOGE("Failed to created input format convertor"); -- return false; -+ //return false; - } - - return true; --- -2.39.2 - diff --git a/patches-aosp/external/v4l2_codec2/0009-v4l2_codec2-encoder-Don-t-advertise-BITRATE_CONST.patch b/patches-aosp/external/v4l2_codec2/0008-v4l2_codec2-encoder-Don-t-advertise-BITRATE_CONST.patch similarity index 68% rename from patches-aosp/external/v4l2_codec2/0009-v4l2_codec2-encoder-Don-t-advertise-BITRATE_CONST.patch rename to patches-aosp/external/v4l2_codec2/0008-v4l2_codec2-encoder-Don-t-advertise-BITRATE_CONST.patch index 116fcb2..d9de3e0 100644 --- a/patches-aosp/external/v4l2_codec2/0009-v4l2_codec2-encoder-Don-t-advertise-BITRATE_CONST.patch +++ b/patches-aosp/external/v4l2_codec2/0008-v4l2_codec2-encoder-Don-t-advertise-BITRATE_CONST.patch @@ -1,21 +1,21 @@ -From fb3644c873f60638f614eba8e8dc7109c08032c9 Mon Sep 17 00:00:00 2001 +From 29e6418064cd19c24982ca2d653cbdac0fe60fb5 Mon Sep 17 00:00:00 2001 From: Roman Stratiienko Date: Mon, 2 Oct 2023 02:44:44 +0300 -Subject: [PATCH 09/11] v4l2_codec2/encoder: Don't advertise BITRATE_CONST +Subject: [PATCH 08/10] v4l2_codec2/encoder: Don't advertise BITRATE_CONST BITRATE_CONST doesn't work properly on RPI4. Change-Id: I2e90b2dd9604e8390d16abc336b73a5b8dfdcee4 Signed-off-by: Roman Stratiienko --- - components/V4L2EncodeInterface.cpp | 4 ++-- + components/EncodeInterface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/components/V4L2EncodeInterface.cpp b/components/V4L2EncodeInterface.cpp -index 2e65cb8..76bf868 100644 ---- a/components/V4L2EncodeInterface.cpp -+++ b/components/V4L2EncodeInterface.cpp -@@ -312,10 +312,10 @@ void V4L2EncodeInterface::Initialize(const C2String& name) { +diff --git a/components/EncodeInterface.cpp b/components/EncodeInterface.cpp +index af4e14a..90c0d79 100644 +--- a/components/EncodeInterface.cpp ++++ b/components/EncodeInterface.cpp +@@ -244,10 +244,10 @@ void EncodeInterface::Initialize(const C2String& name, const SupportedCapabiliti addParameter( DefineParam(mBitrateMode, C2_PARAMKEY_BITRATE_MODE) @@ -29,5 +29,5 @@ index 2e65cb8..76bf868 100644 .build()); -- -2.39.2 +2.43.0 diff --git a/patches-aosp/external/v4l2_codec2/0010-RPI4-v4l2_codec2-encoder-Set-input-format-after-1st-.patch b/patches-aosp/external/v4l2_codec2/0009-RPI4-v4l2_codec2-encoder-Set-input-format-after-1st-.patch similarity index 64% rename from patches-aosp/external/v4l2_codec2/0010-RPI4-v4l2_codec2-encoder-Set-input-format-after-1st-.patch rename to patches-aosp/external/v4l2_codec2/0009-RPI4-v4l2_codec2-encoder-Set-input-format-after-1st-.patch index a0ad578..027ae69 100644 --- a/patches-aosp/external/v4l2_codec2/0010-RPI4-v4l2_codec2-encoder-Set-input-format-after-1st-.patch +++ b/patches-aosp/external/v4l2_codec2/0009-RPI4-v4l2_codec2-encoder-Set-input-format-after-1st-.patch @@ -1,7 +1,7 @@ -From f44eb6275ec715e1a06b7c7a998515ccb38cea78 Mon Sep 17 00:00:00 2001 +From f8396f827c13dfb0424fd56fe5de2936114aa217 Mon Sep 17 00:00:00 2001 From: Roman Stratiienko Date: Mon, 2 Oct 2023 02:01:11 +0300 -Subject: [PATCH 10/11] RPI4: v4l2_codec2/encoder: Set input format after 1st +Subject: [PATCH 09/10] RPI4: v4l2_codec2/encoder: Set input format after 1st frame received To distinguish between scrcpy/recording case (RGBA) and the camera @@ -10,74 +10,23 @@ recording (NV12) case. Change-Id: I5caaac35649a59317321b8202985c6c496ccea1c Signed-off-by: Roman Stratiienko --- - components/V4L2EncodeComponent.cpp | 49 +--------------- - components/V4L2Encoder.cpp | 57 +++++++++++++------ - .../v4l2_codec2/components/V4L2Encoder.h | 7 ++- - 3 files changed, 45 insertions(+), 68 deletions(-) + v4l2/V4L2EncodeComponent.cpp | 12 +---- + v4l2/V4L2Encoder.cpp | 49 ++++++++++++++------- + v4l2/include/v4l2_codec2/v4l2/V4L2Encoder.h | 6 ++- + 3 files changed, 38 insertions(+), 29 deletions(-) -diff --git a/components/V4L2EncodeComponent.cpp b/components/V4L2EncodeComponent.cpp -index b17488b..8a5adb2 100644 ---- a/components/V4L2EncodeComponent.cpp -+++ b/components/V4L2EncodeComponent.cpp -@@ -38,8 +38,6 @@ namespace android { - - namespace { - --const VideoPixelFormat kInputPixelFormat = VideoPixelFormat::NV12; -- - // The peak bitrate in function of the target bitrate, used when the bitrate mode is VBR. - constexpr uint32_t kPeakBitrateMultiplier = 2u; - -@@ -134,41 +132,6 @@ std::optional> getVideoFrameLayout(const C2ConstGra - return planes; - } - --// Get the video frame stride for the specified |format| and |size|. --std::optional getVideoFrameStride(VideoPixelFormat format, ui::Size size) { -- // Fetch a graphic block from the pool to determine the stride. -- std::shared_ptr pool; -- c2_status_t status = GetCodec2BlockPool(C2BlockPool::BASIC_GRAPHIC, nullptr, &pool); -- if (status != C2_OK) { -- ALOGE("Failed to get basic graphic block pool (err=%d)", status); -- return std::nullopt; -- } -- -- // Android HAL format doesn't have I420, we use YV12 instead and swap the U and V planes when -- // converting to NV12. YCBCR_420_888 will allocate NV12 by minigbm. -- HalPixelFormat halFormat = (format == VideoPixelFormat::I420) ? HalPixelFormat::YV12 -- : HalPixelFormat::YCBCR_420_888; -- -- std::shared_ptr block; -- status = pool->fetchGraphicBlock(size.width, size.height, static_cast(halFormat), -- C2MemoryUsage(C2MemoryUsage::CPU_READ), &block); -- if (status != C2_OK) { -- ALOGE("Failed to fetch graphic block (err=%d)", status); -- return std::nullopt; -- } -- -- const C2ConstGraphicBlock constBlock = block->share(C2Rect(size.width, size.height), C2Fence()); -- VideoPixelFormat pixelFormat; -- std::optional> planes = -- getVideoFrameLayout(constBlock, &pixelFormat); -- if (!planes || planes.value().empty()) { -- ALOGE("Failed to get video frame layout from block"); -- return std::nullopt; -- } -- -- return planes.value()[0].mStride; --} -- - // Create an input frame from the specified graphic block. - std::unique_ptr CreateInputFrame(const C2ConstGraphicBlock& block, - uint64_t index, int64_t timestamp) { -@@ -639,23 +602,13 @@ bool V4L2EncodeComponent::initializeEncoder() { +diff --git a/v4l2/V4L2EncodeComponent.cpp b/v4l2/V4L2EncodeComponent.cpp +index e3b9b14..4299d9e 100644 +--- a/v4l2/V4L2EncodeComponent.cpp ++++ b/v4l2/V4L2EncodeComponent.cpp +@@ -73,16 +73,6 @@ bool V4L2EncodeComponent::initializeEncoder() { h264Level = c2LevelToV4L2Level(mInterface->getOutputLevel()); } - // Get the stride used by the C2 framework, as this might be different from the stride used by - // the V4L2 encoder. - std::optional stride = -- getVideoFrameStride(kInputPixelFormat, mInterface->getInputVisibleSize()); +- getVideoFrameStride(VideoEncoder::kInputPixelFormat, mInterface->getInputVisibleSize()); - if (!stride) { - ALOGE("Failed to get video frame stride"); - reportError(C2_CORRUPTED); @@ -87,28 +36,20 @@ index b17488b..8a5adb2 100644 // Get the requested bitrate mode and bitrate. The C2 framework doesn't offer a parameter to // configure the peak bitrate, so we use a multiple of the target bitrate. mBitrateMode = mInterface->getBitrateMode(); +@@ -95,7 +85,7 @@ bool V4L2EncodeComponent::initializeEncoder() { mBitrate = mInterface->getBitrate(); mEncoder = V4L2Encoder::create( - outputProfile, h264Level, mInterface->getInputVisibleSize(), *stride, + outputProfile, h264Level, mInterface->getInputVisibleSize(), mInterface->getKeyFramePeriod(), mBitrateMode, mBitrate, - mBitrate * kPeakBitrateMultiplier, + mBitrate * VideoEncoder::kPeakBitrateMultiplier, ::base::BindRepeating(&V4L2EncodeComponent::fetchOutputBlock, mWeakThis), -diff --git a/components/V4L2Encoder.cpp b/components/V4L2Encoder.cpp -index cd20cb5..a1c036e 100644 ---- a/components/V4L2Encoder.cpp -+++ b/components/V4L2Encoder.cpp -@@ -26,8 +26,6 @@ namespace android { - - namespace { - --const VideoPixelFormat kInputPixelFormat = VideoPixelFormat::NV12; -- - // The maximum size for output buffer, which is chosen empirically for a 1080p video. - constexpr size_t kMaxBitstreamBufferSizeInBytes = 2 * 1024 * 1024; // 2MB - // The frame size for 1080p (FHD) video in pixels. -@@ -54,7 +52,7 @@ size_t GetMaxOutputBufferSize(const ui::Size& size) { +diff --git a/v4l2/V4L2Encoder.cpp b/v4l2/V4L2Encoder.cpp +index 730827c..49f7dfa 100644 +--- a/v4l2/V4L2Encoder.cpp ++++ b/v4l2/V4L2Encoder.cpp +@@ -52,7 +52,7 @@ size_t GetMaxOutputBufferSize(const ui::Size& size) { // static std::unique_ptr V4L2Encoder::create( C2Config::profile_t outputProfile, std::optional level, @@ -117,7 +58,7 @@ index cd20cb5..a1c036e 100644 C2Config::bitrate_mode_t bitrateMode, uint32_t bitrate, std::optional peakBitrate, FetchOutputBufferCB fetchOutputBufferCb, InputBufferDoneCB inputBufferDoneCb, OutputBufferDoneCB outputBufferDoneCb, DrainDoneCB drainDoneCb, ErrorCB errorCb, -@@ -64,7 +62,7 @@ std::unique_ptr V4L2Encoder::create( +@@ -62,7 +62,7 @@ std::unique_ptr V4L2Encoder::create( std::unique_ptr encoder = ::base::WrapUnique(new V4L2Encoder( std::move(taskRunner), std::move(fetchOutputBufferCb), std::move(inputBufferDoneCb), std::move(outputBufferDoneCb), std::move(drainDoneCb), std::move(errorCb))); @@ -126,7 +67,7 @@ index cd20cb5..a1c036e 100644 bitrate, peakBitrate)) { return nullptr; } -@@ -205,7 +203,7 @@ VideoPixelFormat V4L2Encoder::inputFormat() const { +@@ -208,7 +208,7 @@ VideoPixelFormat V4L2Encoder::inputFormat() const { } bool V4L2Encoder::initialize(C2Config::profile_t outputProfile, std::optional level, @@ -135,7 +76,7 @@ index cd20cb5..a1c036e 100644 C2Config::bitrate_mode_t bitrateMode, uint32_t bitrate, std::optional peakBitrate) { ALOGV("%s()", __func__); -@@ -265,13 +263,6 @@ bool V4L2Encoder::initialize(C2Config::profile_t outputProfile, std::optionalpixelFormat(); + auto stride = encodeRequest.video_frame->planes()[0].mStride; -+ + if (!mFormatSet) { + if (format != VideoPixelFormat::NV12) + format = VideoPixelFormat::RGBA; -+ + ALOGI("Setting input format to %s", videoPixelFormatToString(format).c_str()); -+ + if (!configureInputFormat(format, stride)) { + ALOGE("Failed to set input format to %s", videoPixelFormatToString(format).c_str()); + onError(); + return; + } -+ + // Create input and output buffers. + if (!createInputBuffers() || !createOutputBuffers()) { + ALOGE("Failed to create input and output buffers"); + onError(); + return; + } -+ + mFormatSet = true; + } -+ // Check if the device has free input buffers available. If not we'll switch to the // WAITING_FOR_INPUT_BUFFERS state, and resume encoding once we've dequeued an input buffer. // Note: The input buffers are not copied into the device's input buffers, but rather a memory -@@ -455,15 +471,15 @@ void V4L2Encoder::onDrainDone(bool done) { +@@ -458,15 +470,15 @@ void V4L2Encoder::onDrainDone(bool done) { } bool V4L2Encoder::configureInputFormat(VideoPixelFormat inputFormat, uint32_t stride) { @@ -203,7 +138,7 @@ index cd20cb5..a1c036e 100644 if (fourcc) { format = mInputQueue->setFormat(fourcc->toV4L2PixFmt(), mVisibleSize, 0, stride); } -@@ -472,10 +488,15 @@ bool V4L2Encoder::configureInputFormat(VideoPixelFormat inputFormat, uint32_t st +@@ -475,10 +487,15 @@ bool V4L2Encoder::configureInputFormat(VideoPixelFormat inputFormat, uint32_t st // input pixel formats and use a format convertor. We need to try all formats as some formats // might not be supported for the configured output format. if (!format) { @@ -219,12 +154,12 @@ index cd20cb5..a1c036e 100644 } } -diff --git a/components/include/v4l2_codec2/components/V4L2Encoder.h b/components/include/v4l2_codec2/components/V4L2Encoder.h -index d7b55c0..b36fd1c 100644 ---- a/components/include/v4l2_codec2/components/V4L2Encoder.h -+++ b/components/include/v4l2_codec2/components/V4L2Encoder.h -@@ -33,7 +33,7 @@ public: - +diff --git a/v4l2/include/v4l2_codec2/v4l2/V4L2Encoder.h b/v4l2/include/v4l2_codec2/v4l2/V4L2Encoder.h +index d1eb656..1908d09 100644 +--- a/v4l2/include/v4l2_codec2/v4l2/V4L2Encoder.h ++++ b/v4l2/include/v4l2_codec2/v4l2/V4L2Encoder.h +@@ -29,7 +29,7 @@ class V4L2Encoder : public VideoEncoder { + public: static std::unique_ptr create( C2Config::profile_t profile, std::optional level, const ui::Size& visibleSize, - uint32_t stride, uint32_t keyFramePeriod, C2Config::bitrate_mode_t bitrateMode, @@ -232,7 +167,7 @@ index d7b55c0..b36fd1c 100644 uint32_t bitrate, std::optional peakBitrate, FetchOutputBufferCB fetchOutputBufferCb, InputBufferDoneCB inputBufferDoneCb, OutputBufferDoneCB outputBufferDoneCb, DrainDoneCB drainDoneCb, ErrorCB errorCb, -@@ -82,7 +82,7 @@ private: +@@ -78,7 +78,7 @@ private: // Initialize the V4L2 encoder for specified parameters. bool initialize(C2Config::profile_t outputProfile, std::optional level, @@ -241,16 +176,15 @@ index d7b55c0..b36fd1c 100644 C2Config::bitrate_mode_t bitrateMode, uint32_t bitrate, std::optional peakBitrate); -@@ -190,6 +190,9 @@ private: +@@ -186,6 +186,8 @@ private: // The current state of the encoder. State mState = State::UNINITIALIZED; + // We don't know the input format until the first input frame received + bool mFormatSet = false; -+ scoped_refptr<::base::SequencedTaskRunner> mTaskRunner; ::base::WeakPtr mWeakThis; -- -2.39.2 +2.43.0 diff --git a/patches-aosp/external/v4l2_codec2/0010-RPI4-v4l2_codec2-decoder-Enable-zero-copy-AVC-decodi.patch b/patches-aosp/external/v4l2_codec2/0010-RPI4-v4l2_codec2-decoder-Enable-zero-copy-AVC-decodi.patch new file mode 100644 index 0000000..93271b1 --- /dev/null +++ b/patches-aosp/external/v4l2_codec2/0010-RPI4-v4l2_codec2-decoder-Enable-zero-copy-AVC-decodi.patch @@ -0,0 +1,46 @@ +From 43135459db3cd993a7c34885fa11d07f5f2b4cd4 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Thu, 12 Oct 2023 01:33:39 +0300 +Subject: [PATCH 10/10] RPI4: v4l2_codec2/decoder: Enable zero-copy AVC + decoding + +1. Lower the rank, to override the ffmpeg_codec2. +2. Keep only NV12. We do not want other formats. + +Change-Id: I091b96dc1286409bb8077866f1d58afd98214721 +Signed-off-by: Roman Stratiienko +--- + components/ComponentStore.cpp | 2 +- + v4l2/include/v4l2_codec2/v4l2/V4L2Decoder.h | 3 +-- + 2 files changed, 2 insertions(+), 3 deletions(-) + +diff --git a/components/ComponentStore.cpp b/components/ComponentStore.cpp +index aa4eba8..3241acf 100644 +--- a/components/ComponentStore.cpp ++++ b/components/ComponentStore.cpp +@@ -21,7 +21,7 @@ + + namespace android { + namespace { +-const uint32_t kComponentRank = 0x80; ++const uint32_t kComponentRank = 0x20; + + } // namespace + +diff --git a/v4l2/include/v4l2_codec2/v4l2/V4L2Decoder.h b/v4l2/include/v4l2_codec2/v4l2/V4L2Decoder.h +index e537f0c..37867ab 100644 +--- a/v4l2/include/v4l2_codec2/v4l2/V4L2Decoder.h ++++ b/v4l2/include/v4l2_codec2/v4l2/V4L2Decoder.h +@@ -31,8 +31,7 @@ namespace android { + // Currently we only support flexible pixel 420 format YCBCR_420_888 in Android. + // Here is the list of flexible 420 format. + constexpr std::initializer_list kSupportedOutputFourccs = { +- Fourcc::YU12, Fourcc::YV12, Fourcc::YM12, Fourcc::YM21, +- Fourcc::NV12, Fourcc::NV21, Fourcc::NM12, Fourcc::NM21, ++ Fourcc::NV12, + }; + + class V4L2Decoder : public VideoDecoder { +-- +2.43.0 + diff --git a/patches-aosp/external/v4l2_codec2/0011-RPI4-v4l2_codec2-decoder-Enable-zero-copy-AVC-decodi.patch b/patches-aosp/external/v4l2_codec2/0011-RPI4-v4l2_codec2-decoder-Enable-zero-copy-AVC-decodi.patch deleted file mode 100644 index 0e58d85..0000000 --- a/patches-aosp/external/v4l2_codec2/0011-RPI4-v4l2_codec2-decoder-Enable-zero-copy-AVC-decodi.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 0bed1ed5c32a03654362d4c9510878cc3a6c9ede Mon Sep 17 00:00:00 2001 -From: Roman Stratiienko -Date: Thu, 12 Oct 2023 01:33:39 +0300 -Subject: [PATCH 11/11] RPI4: v4l2_codec2/decoder: Enable zero-copy AVC - decoding - -1. Lower the rank, to override the ffmpeg_codec2. -2. Keep only NV12. We do not want other formats. - -Change-Id: I091b96dc1286409bb8077866f1d58afd98214721 -Signed-off-by: Roman Stratiienko ---- - components/V4L2ComponentStore.cpp | 2 +- - components/V4L2Decoder.cpp | 3 +-- - 2 files changed, 2 insertions(+), 3 deletions(-) - -diff --git a/components/V4L2ComponentStore.cpp b/components/V4L2ComponentStore.cpp -index 4004ce5..7bffff2 100644 ---- a/components/V4L2ComponentStore.cpp -+++ b/components/V4L2ComponentStore.cpp -@@ -22,7 +22,7 @@ - - namespace android { - namespace { --const uint32_t kComponentRank = 0x80; -+const uint32_t kComponentRank = 0x20; - - std::string getMediaTypeFromComponentName(const std::string& name) { - if (name == V4L2ComponentName::kH264Decoder || name == V4L2ComponentName::kH264SecureDecoder || -diff --git a/components/V4L2Decoder.cpp b/components/V4L2Decoder.cpp -index aa59e91..88a6f55 100644 ---- a/components/V4L2Decoder.cpp -+++ b/components/V4L2Decoder.cpp -@@ -30,8 +30,7 @@ constexpr size_t kNumExtraOutputBuffers = 4; - // Currently we only support flexible pixel 420 format YCBCR_420_888 in Android. - // Here is the list of flexible 420 format. - constexpr std::initializer_list kSupportedOutputFourccs = { -- Fourcc::YU12, Fourcc::YV12, Fourcc::YM12, Fourcc::YM21, -- Fourcc::NV12, Fourcc::NV21, Fourcc::NM12, Fourcc::NM21, -+ Fourcc::NV12, - }; - - uint32_t VideoCodecToV4L2PixFmt(VideoCodec codec) { --- -2.39.2 - diff --git a/patches-aosp/external/v4l2_codec2/0011-Scan-for-more-devices-in-getDeviceInfosForType.patch b/patches-aosp/external/v4l2_codec2/0011-Scan-for-more-devices-in-getDeviceInfosForType.patch new file mode 100644 index 0000000..fb15b7b --- /dev/null +++ b/patches-aosp/external/v4l2_codec2/0011-Scan-for-more-devices-in-getDeviceInfosForType.patch @@ -0,0 +1,29 @@ +From bdc6999f70c3f8aafe25b4b7341f09846cce4c2b Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Fri, 22 May 2026 12:04:38 +0300 +Subject: [PATCH 11/11] Scan for more devices in getDeviceInfosForType + +RPI4's encoder is located at /dev/video11 + +Change-Id: I79181d045879b84c320bdf5a06f56bef3672c947 +Signed-off-by: Roman Stratiienko +--- + v4l2/V4L2Device.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/v4l2/V4L2Device.cpp b/v4l2/V4L2Device.cpp +index 65fdc78..f9cf053 100644 +--- a/v4l2/V4L2Device.cpp ++++ b/v4l2/V4L2Device.cpp +@@ -2483,7 +2483,7 @@ const V4L2Device::DeviceInfos& V4L2Device::getDeviceInfosForType(V4L2Device::Typ + } + + DeviceInfos deviceInfos; +- for (int i = 0; i < 10; ++i) { ++ for (int i = 0; i < 64; ++i) { + std::string path = base::StringPrintf("%s%d", kVideoDevicePattern, i); + + scoped_refptr device = V4L2Device::create(); +-- +2.51.0 + diff --git a/patches-aosp/external/v4l2_codec2/0012-Explicitly-specify-base.patch b/patches-aosp/external/v4l2_codec2/0012-Explicitly-specify-base.patch deleted file mode 100644 index fc75848..0000000 --- a/patches-aosp/external/v4l2_codec2/0012-Explicitly-specify-base.patch +++ /dev/null @@ -1,289 +0,0 @@ -From c53fbacdcfcf9f5329d98f1224395cc79c5494ec Mon Sep 17 00:00:00 2001 -From: Daichi Hirono -Date: Mon, 4 Dec 2023 17:24:16 +0900 -Subject: [PATCH 12/12] Explicitly specify ::base - -The upstream includes these headers after declaring android::base -namespace, which resulted in confusing the compiler libchrome's ::base -v.s. android::base - -Bug: 314693926 -Test: m -Change-Id: I25a226b8eb962138489f30cd0fa1a42c3e599bdf ---- - common/V4L2Device.cpp | 4 +- - .../include/v4l2_codec2/common/V4L2Device.h | 45 ++++++++++--------- - .../v4l2_codec2/common/V4L2DevicePoller.h | 12 ++--- - .../v4l2_codec2/components/VideoDecoder.h | 8 ++-- - .../v4l2_codec2/components/VideoEncoder.h | 10 ++--- - .../plugin_store/C2VdaBqBlockPool.h | 2 +- - 6 files changed, 41 insertions(+), 40 deletions(-) - -diff --git a/common/V4L2Device.cpp b/common/V4L2Device.cpp -index b3d3679..5cc837a 100644 ---- a/common/V4L2Device.cpp -+++ b/common/V4L2Device.cpp -@@ -696,7 +696,7 @@ public: - #define ALOGVQ(fmt, ...) ALOGD("(%s)" fmt, V4L2Device::v4L2BufferTypeToString(mType), ##__VA_ARGS__) - - V4L2Queue::V4L2Queue(scoped_refptr dev, enum v4l2_buf_type type, -- base::OnceClosure destroyCb) -+ ::base::OnceClosure destroyCb) - : mType(type), mDevice(dev), mDestroyCb(std::move(destroyCb)) { - DCHECK_CALLED_ON_VALID_SEQUENCE(mSequenceChecker); - } -@@ -1043,7 +1043,7 @@ class V4L2QueueFactory { - public: - static scoped_refptr createQueue(scoped_refptr dev, - enum v4l2_buf_type type, -- base::OnceClosure destroyCb) { -+ ::base::OnceClosure destroyCb) { - return new V4L2Queue(std::move(dev), type, std::move(destroyCb)); - } - }; -diff --git a/common/include/v4l2_codec2/common/V4L2Device.h b/common/include/v4l2_codec2/common/V4L2Device.h -index 77d7ddb..9824221 100644 ---- a/common/include/v4l2_codec2/common/V4L2Device.h -+++ b/common/include/v4l2_codec2/common/V4L2Device.h -@@ -105,7 +105,7 @@ private: - // Do the actual queue operation once the v4l2_buffer structure is properly filled. - bool doQueue() &&; - -- V4L2WritableBufferRef(const struct v4l2_buffer& v4l2Buffer, base::WeakPtr queue); -+ V4L2WritableBufferRef(const struct v4l2_buffer& v4l2Buffer, ::base::WeakPtr queue); - - V4L2WritableBufferRef(const V4L2WritableBufferRef&) = delete; - V4L2WritableBufferRef& operator=(const V4L2WritableBufferRef&) = delete; -@@ -124,7 +124,7 @@ private: - // buffers they originate from. This flexibility is required because V4L2ReadableBufferRefs can be - // embedded into VideoFrames, which are then passed to other threads and not necessarily destroyed - // before the V4L2Queue buffers are freed. --class V4L2ReadableBuffer : public base::RefCountedThreadSafe { -+class V4L2ReadableBuffer : public ::base::RefCountedThreadSafe { - public: - // Returns whether the V4L2_BUF_FLAG_LAST flag is set for this buffer. - bool isLast() const; -@@ -148,11 +148,11 @@ public: - - private: - friend class V4L2BufferRefFactory; -- friend class base::RefCountedThreadSafe; -+ friend class ::base::RefCountedThreadSafe; - - ~V4L2ReadableBuffer(); - -- V4L2ReadableBuffer(const struct v4l2_buffer& v4l2Buffer, base::WeakPtr queue); -+ V4L2ReadableBuffer(const struct v4l2_buffer& v4l2Buffer, ::base::WeakPtr queue); - - V4L2ReadableBuffer(const V4L2ReadableBuffer&) = delete; - V4L2ReadableBuffer& operator=(const V4L2ReadableBuffer&) = delete; -@@ -183,7 +183,7 @@ class V4L2Buffer; - // metadata, as well as making other references to it. The buffer will not be reused until all - // the references are dropped. Once this happens, the buffer goes back to the free list described - // in 1). --class V4L2Queue : public base::RefCountedThreadSafe { -+class V4L2Queue : public ::base::RefCountedThreadSafe { - public: - // Set |fourcc| as the current format on this queue. |size| corresponds to the desired buffer's - // dimensions (i.e. width and height members of v4l2_pix_format_mplane (if not applicable, pass -@@ -206,10 +206,10 @@ public: - size_t bufferSize) WARN_UNUSED_RESULT; - - // Returns the currently set format on the queue. The result is returned as a std::pair where -- // the first member is the format, or base::nullopt if the format could not be obtained due to -- // an ioctl error. The second member is only used in case of an error and contains the |errno| -- // set by the failing ioctl. If the first member is not base::nullopt, the second member will -- // always be zero. -+ // the first member is the format, or ::base::nullopt if the format could not be obtained due -+ // to an ioctl error. The second member is only used in case of an error and contains the -+ // |errno| set by the failing ioctl. If the first member is not ::base::nullopt, the second -+ // member will always be zero. - // - // If the second member is 0, then the first member is guaranteed to have a valid value. So - // clients that are not interested in the precise error message can just check that the first -@@ -304,19 +304,20 @@ private: - - scoped_refptr mDevice; - // Callback to call in this queue's destructor. -- base::OnceClosure mDestroyCb; -+ ::base::OnceClosure mDestroyCb; - -- V4L2Queue(scoped_refptr dev, enum v4l2_buf_type type, base::OnceClosure destroyCb); -+ V4L2Queue(scoped_refptr dev, enum v4l2_buf_type type, -+ ::base::OnceClosure destroyCb); - friend class V4L2QueueFactory; - friend class V4L2BufferRefBase; -- friend class base::RefCountedThreadSafe; -+ friend class ::base::RefCountedThreadSafe; - - SEQUENCE_CHECKER(mSequenceChecker); - -- base::WeakPtrFactory mWeakThisFactory{this}; -+ ::base::WeakPtrFactory mWeakThisFactory{this}; - }; - --class V4L2Device : public base::RefCountedThreadSafe { -+class V4L2Device : public ::base::RefCountedThreadSafe { - public: - // Specification of an encoding profile supported by an encoder. - struct SupportedEncodeProfile { -@@ -364,7 +365,7 @@ public: - // Composes human readable string of v4l2_buffer. - static std::string v4L2BufferToString(const struct v4l2_buffer& buffer); - -- // Composes VideoFrameLayout based on v4l2_format. If error occurs, it returns base::nullopt. -+ // Composes VideoFrameLayout based on v4l2_format. If error occurs, it returns ::base::nullopt. - static std::optional v4L2FormatToVideoFrameLayout( - const struct v4l2_format& format); - -@@ -411,8 +412,8 @@ public: - // Return a vector of dmabuf file descriptors, exported for V4L2 buffer with |index|, assuming - // the buffer contains |numPlanes| V4L2 planes and is of |bufType|. Return an empty vector on - // failure. The caller is responsible for closing the file descriptors after use. -- std::vector getDmabufsForV4L2Buffer(int index, size_t numPlanes, -- enum v4l2_buf_type bufType); -+ std::vector<::base::ScopedFD> getDmabufsForV4L2Buffer(int index, size_t numPlanes, -+ enum v4l2_buf_type bufType); - - // Returns the preferred V4L2 input formats for |type| or empty if none. - std::vector preferredInputFormat(Type type); -@@ -440,7 +441,7 @@ public: - // be posted to the client's - // sequence if a polling error has occurred. - bool startPolling(android::V4L2DevicePoller::EventCallback eventCallback, -- base::RepeatingClosure errorCallback); -+ ::base::RepeatingClosure errorCallback); - // Stop polling this V4L2Device if polling was active. No new events will be posted after this - // method has returned. - bool stopPolling(); -@@ -463,7 +464,7 @@ private: - // Vector of video device node paths and corresponding pixelformats supported by each device node. - using Devices = std::vector>>; - -- friend class base::RefCountedThreadSafe; -+ friend class ::base::RefCountedThreadSafe; - V4L2Device(); - ~V4L2Device(); - -@@ -500,13 +501,13 @@ private: - std::map mDevicesByType; - - // The actual device fd. -- base::ScopedFD mDeviceFd; -+ ::base::ScopedFD mDeviceFd; - - // eventfd fd to signal device poll thread when its poll() should be interrupted. -- base::ScopedFD mDevicePollInterruptFd; -+ ::base::ScopedFD mDevicePollInterruptFd; - - // Associates a v4l2_buf_type to its queue. -- base::flat_map mQueues; -+ ::base::flat_map mQueues; - - // Used if EnablePolling() is called to signal the user that an event happened or a buffer is - // ready to be dequeued. -diff --git a/common/include/v4l2_codec2/common/V4L2DevicePoller.h b/common/include/v4l2_codec2/common/V4L2DevicePoller.h -index ad256be..53b4b3f 100644 ---- a/common/include/v4l2_codec2/common/V4L2DevicePoller.h -+++ b/common/include/v4l2_codec2/common/V4L2DevicePoller.h -@@ -32,7 +32,7 @@ class V4L2DevicePoller { - public: - // Callback to be called when buffer ready/V4L2 event has potentially been polled. |event| is - // set if a V4L2 event has been detected. -- using EventCallback = base::RepeatingCallback; -+ using EventCallback = ::base::RepeatingCallback; - - // Create a poller for |device|, using a thread named |threadName|. Notification won't start - // until |startPolling()| is called. -@@ -45,7 +45,7 @@ public: - // again in order to be notified for them. - // - // If an error occurs during polling, |mErrorCallback| will be posted on the caller's sequence. -- bool startPolling(EventCallback eventCallback, base::RepeatingClosure errorCallback); -+ bool startPolling(EventCallback eventCallback, ::base::RepeatingClosure errorCallback); - // Stop polling and stop the thread. The poller won't post any new event to the caller's - // sequence after this method has returned. - bool stopPolling(); -@@ -66,19 +66,19 @@ private: - // V4L2 device we are polling. - V4L2Device* const mDevice; - // Thread on which polling is done. -- base::Thread mPollThread; -+ ::base::Thread mPollThread; - // Callback to post to the client's sequence when an event occurs. - EventCallback mEventCallback; - // Closure to post to the client's sequence when an error occurs. -- base::RepeatingClosure mErrorCallback; -+ ::base::RepeatingClosure mErrorCallback; - // Client sequence's task runner, where closures are posted. -- scoped_refptr mClientTaskTunner; -+ scoped_refptr<::base::SequencedTaskRunner> mClientTaskTunner; - - // Since poll() returns immediately if no buffers have been queued, we cannot rely on it to - // pause the polling thread until an event occurs. Instead, - // the polling thread will wait on this WaitableEvent (signaled by |schedulePoll| before calling - // poll(), so we only call it when we are actually waiting for an event. -- base::WaitableEvent mTriggerPoll; -+ ::base::WaitableEvent mTriggerPoll; - // Set to true when we wish to stop polling, instructing the poller thread to break its loop. - std::atomic_bool mStopPolling; - }; -diff --git a/components/include/v4l2_codec2/components/VideoDecoder.h b/components/include/v4l2_codec2/components/VideoDecoder.h -index 5b2da41..3e3fec4 100644 ---- a/components/include/v4l2_codec2/components/VideoDecoder.h -+++ b/components/include/v4l2_codec2/components/VideoDecoder.h -@@ -26,11 +26,11 @@ public: - }; - static const char* DecodeStatusToString(DecodeStatus status); - -- using GetPoolCB = base::RepeatingCallback( -+ using GetPoolCB = ::base::RepeatingCallback( - const ui::Size& size, HalPixelFormat pixelFormat, size_t numOutputBuffers)>; -- using DecodeCB = base::OnceCallback; -- using OutputCB = base::RepeatingCallback)>; -- using ErrorCB = base::RepeatingCallback; -+ using DecodeCB = ::base::OnceCallback; -+ using OutputCB = ::base::RepeatingCallback)>; -+ using ErrorCB = ::base::RepeatingCallback; - - virtual ~VideoDecoder(); - -diff --git a/components/include/v4l2_codec2/components/VideoEncoder.h b/components/include/v4l2_codec2/components/VideoEncoder.h -index 5f23541..7e5a3c2 100644 ---- a/components/include/v4l2_codec2/components/VideoEncoder.h -+++ b/components/include/v4l2_codec2/components/VideoEncoder.h -@@ -47,13 +47,13 @@ public: - }; - - using FetchOutputBufferCB = -- base::RepeatingCallback* buffer)>; -+ ::base::RepeatingCallback* buffer)>; - // TODO(dstaessens): Change callbacks to OnceCallback provided when requesting encode/drain. -- using InputBufferDoneCB = base::RepeatingCallback; -- using OutputBufferDoneCB = base::RepeatingCallback; -+ using OutputBufferDoneCB = ::base::RepeatingCallback buffer)>; -- using DrainDoneCB = base::RepeatingCallback; -- using ErrorCB = base::RepeatingCallback; -+ using DrainDoneCB = ::base::RepeatingCallback; -+ using ErrorCB = ::base::RepeatingCallback; - - virtual ~VideoEncoder() = default; - -diff --git a/plugin_store/include/v4l2_codec2/plugin_store/C2VdaBqBlockPool.h b/plugin_store/include/v4l2_codec2/plugin_store/C2VdaBqBlockPool.h -index fde6299..26655d3 100644 ---- a/plugin_store/include/v4l2_codec2/plugin_store/C2VdaBqBlockPool.h -+++ b/plugin_store/include/v4l2_codec2/plugin_store/C2VdaBqBlockPool.h -@@ -88,7 +88,7 @@ public: - * Return false if we don't support to notify the caller when a buffer is available. - * - */ -- bool setNotifyBlockAvailableCb(base::OnceClosure cb); -+ bool setNotifyBlockAvailableCb( ::base::OnceClosure cb); - - std::optional getBufferIdFromGraphicBlock(const C2Block2D& block); - --- -2.43.0 - diff --git a/patches-aosp/external/wpa_supplicant_8/0001-Add-netlink-public-header-library.patch b/patches-aosp/external/wpa_supplicant_8/0001-Add-netlink-public-header-library.patch deleted file mode 100644 index 41422f6..0000000 --- a/patches-aosp/external/wpa_supplicant_8/0001-Add-netlink-public-header-library.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 13fed80854c281cc7eaf78e5848b10f5becb947a Mon Sep 17 00:00:00 2001 -From: Jooyung Han -Date: Tue, 26 Jul 2022 12:56:00 +0900 -Subject: [PATCH 1/3] Add netlink public header library - -libwifi-hal-bcm has been using the header via LOCAL_C_INCLUDES. To -convert libwifi-hal-bcm into a Soong module, the header is exposed as a -header lib. - -Bug: 239984067 -Test: m libwifi-hal-bcm -Merged-In: I92e044565b291c003cff9ac580dd36299fab9851 -Change-Id: I92e044565b291c003cff9ac580dd36299fab9851 -(cherry picked from commit eb043d58c236676a019ff8579d46b06f83a6daa1) ---- - Android.bp | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/Android.bp b/Android.bp -index cbb1a90f..35cdb4f5 100644 ---- a/Android.bp -+++ b/Android.bp -@@ -26,3 +26,11 @@ license { - ], - license_text: ["LICENSE"], - } -+ -+cc_library_headers { -+ name: "libnetlink_iface_headers", -+ vendor_available: true, -+ export_include_dirs: [ -+ "src/drivers", -+ ], -+} --- -2.39.2 - diff --git a/patches-aosp/external/wpa_supplicant_8/0002-Decalre-a-soong-module-for-hostapd-manifest.patch b/patches-aosp/external/wpa_supplicant_8/0002-Decalre-a-soong-module-for-hostapd-manifest.patch deleted file mode 100644 index 159dc47..0000000 --- a/patches-aosp/external/wpa_supplicant_8/0002-Decalre-a-soong-module-for-hostapd-manifest.patch +++ /dev/null @@ -1,30 +0,0 @@ -From c5ccabd03d222c26b8a255f3e4c9b5ec3a002270 Mon Sep 17 00:00:00 2001 -From: Jeongik Cha -Date: Fri, 18 Nov 2022 15:09:34 +0900 -Subject: [PATCH 2/3] Decalre a soong module for hostapd manifest - -Bug: 202992812 -Bug: 259516259 -Test: build -Change-Id: Ibc2b7a0d66f6c07660dee96a6a3f7976687ce18e ---- - hostapd/Android.bp | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/hostapd/Android.bp b/hostapd/Android.bp -index 2a252080..3194d369 100644 ---- a/hostapd/Android.bp -+++ b/hostapd/Android.bp -@@ -318,3 +318,9 @@ filegroup { - ], - - } -+ -+// This manifest can used by a vendor apex module for hostapd as well. -+filegroup { -+ name: "android.hardware.wifi.hostapd.xml", -+ srcs: ["android.hardware.wifi.hostapd.xml"], -+} --- -2.39.2 - diff --git a/patches-aosp/external/wpa_supplicant_8/0003-Remove-a-host-of-incorrect-OPENSSL_IS_BORINGSSL-ifde.patch b/patches-aosp/external/wpa_supplicant_8/0003-Remove-a-host-of-incorrect-OPENSSL_IS_BORINGSSL-ifde.patch deleted file mode 100644 index e564aef..0000000 --- a/patches-aosp/external/wpa_supplicant_8/0003-Remove-a-host-of-incorrect-OPENSSL_IS_BORINGSSL-ifde.patch +++ /dev/null @@ -1,157 +0,0 @@ -From 61b76bf4a6ee2a1b47aea2d47baa22cfe8e43568 Mon Sep 17 00:00:00 2001 -From: David Benjamin -Date: Mon, 13 Jun 2022 12:22:05 -0400 -Subject: [PATCH 3/3] Remove a host of incorrect OPENSSL_IS_BORINGSSL ifdefs - -The include is neccessary in both OpenSSL and BoringSSL -because the file uses BUF_MEM (IWYU). It's just that OpenSSL spells it -, not matching the type, so use the compatible -spelling. - -Additionally all the CHECKED_CAST and manual STACK_OF(T) definitions are -calling into BoringSSL internals that we were only keeping around for -compatible with wpa_supplicant's incorrect use of the APIs. The correct -APIs are simply to just use the same code as OpenSSL and call the -DEFINE_STACK_OF macros. - -(tls_openssl_ocsp.c needs to be rewritten entirely later, as the use of - is also quite dangerous, but I've left that alone for -now.) - -Test: treehugger -Change-Id: Id923db6513f9e2833854322994aa3a113ee1579d ---- - hs20/client/est.c | 28 +++------------------------- - src/crypto/tls_openssl_ocsp.c | 8 +------- - src/utils/http_curl.c | 23 ----------------------- - 3 files changed, 4 insertions(+), 55 deletions(-) - -diff --git a/hs20/client/est.c b/hs20/client/est.c -index 97f91321..c3f27e1e 100644 ---- a/hs20/client/est.c -+++ b/hs20/client/est.c -@@ -17,9 +17,7 @@ - #include - #include - #include --#ifdef OPENSSL_IS_BORINGSSL --#include --#endif /* OPENSSL_IS_BORINGSSL */ -+#include - - #include "common.h" - #include "utils/base64.h" -@@ -220,9 +218,7 @@ typedef struct { - } d; - } AttrOrOID; - --#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(OPENSSL_IS_BORINGSSL) - DEFINE_STACK_OF(AttrOrOID) --#endif - - typedef struct { - int type; -@@ -340,30 +336,13 @@ static void add_csrattrs(struct hs20_osu_client *ctx, CsrAttrs *csrattrs, - if (!csrattrs || ! csrattrs->attrs) - return; - --#ifdef OPENSSL_IS_BORINGSSL -- num = sk_num(CHECKED_CAST(_STACK *, STACK_OF(AttrOrOID) *, -- csrattrs->attrs)); -- for (i = 0; i < num; i++) { -- AttrOrOID *ao = sk_value( -- CHECKED_CAST(_STACK *, const STACK_OF(AttrOrOID) *, -- csrattrs->attrs), i); -- switch (ao->type) { -- case 0: -- add_csrattrs_oid(ctx, ao->d.oid, exts); -- break; -- case 1: -- add_csrattrs_attr(ctx, ao->d.attribute, exts); -- break; -- } -- } --#else /* OPENSSL_IS_BORINGSSL */ --#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(OPENSSL_IS_BORINGSSL) -+#if OPENSSL_VERSION_NUMBER >= 0x10100000L - num = sk_AttrOrOID_num(csrattrs->attrs); - #else - num = SKM_sk_num(AttrOrOID, csrattrs->attrs); - #endif - for (i = 0; i < num; i++) { --#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(OPENSSL_IS_BORINGSSL) -+#if OPENSSL_VERSION_NUMBER >= 0x10100000L - AttrOrOID *ao = sk_AttrOrOID_value(csrattrs->attrs, i); - #else - AttrOrOID *ao = SKM_sk_value(AttrOrOID, csrattrs->attrs, i); -@@ -377,7 +356,6 @@ static void add_csrattrs(struct hs20_osu_client *ctx, CsrAttrs *csrattrs, - break; - } - } --#endif /* OPENSSL_IS_BORINGSSL */ - } - - -diff --git a/src/crypto/tls_openssl_ocsp.c b/src/crypto/tls_openssl_ocsp.c -index b570bea0..a74e6f3d 100644 ---- a/src/crypto/tls_openssl_ocsp.c -+++ b/src/crypto/tls_openssl_ocsp.c -@@ -216,13 +216,7 @@ ASN1_SEQUENCE(BasicOCSPResponse) = { - - IMPLEMENT_ASN1_FUNCTIONS(BasicOCSPResponse); - --#define sk_SingleResponse_num(sk) \ --sk_num(CHECKED_CAST(_STACK *, STACK_OF(SingleResponse) *, sk)) -- --#define sk_SingleResponse_value(sk, i) \ -- ((SingleResponse *) \ -- sk_value(CHECKED_CAST(_STACK *, STACK_OF(SingleResponse) *, sk), (i))) -- -+DEFINE_STACK_OF(SingleResponse) - - static char * mem_bio_to_str(BIO *out) - { -diff --git a/src/utils/http_curl.c b/src/utils/http_curl.c -index 30b07f23..77d5b357 100644 ---- a/src/utils/http_curl.c -+++ b/src/utils/http_curl.c -@@ -433,28 +433,6 @@ ASN1_SEQUENCE(LogotypeExtn) = { - - IMPLEMENT_ASN1_FUNCTIONS(LogotypeExtn); - --#ifdef OPENSSL_IS_BORINGSSL --#define sk_LogotypeInfo_num(st) \ --sk_num(CHECKED_CAST(_STACK *, STACK_OF(LogotypeInfo) *, (st))) --#define sk_LogotypeInfo_value(st, i) (LogotypeInfo *) \ --sk_value(CHECKED_CAST(_STACK *, const STACK_OF(LogotypeInfo) *, (st)), (i)) --#define sk_LogotypeImage_num(st) \ --sk_num(CHECKED_CAST(_STACK *, STACK_OF(LogotypeImage) *, (st))) --#define sk_LogotypeImage_value(st, i) (LogotypeImage *) \ --sk_value(CHECKED_CAST(_STACK *, const STACK_OF(LogotypeImage) *, (st)), (i)) --#define sk_LogotypeAudio_num(st) \ --sk_num(CHECKED_CAST(_STACK *, STACK_OF(LogotypeAudio) *, (st))) --#define sk_LogotypeAudio_value(st, i) (LogotypeAudio *) \ --sk_value(CHECK_CAST(_STACK *, const STACK_OF(LogotypeAudio) *, (st)), (i)) --#define sk_HashAlgAndValue_num(st) \ --sk_num(CHECKED_CAST(_STACK *, STACK_OF(HashAlgAndValue) *, (st))) --#define sk_HashAlgAndValue_value(st, i) (HashAlgAndValue *) \ --sk_value(CHECKED_CAST(_STACK *, const STACK_OF(HashAlgAndValue) *, (st)), (i)) --#define sk_ASN1_IA5STRING_num(st) \ --sk_num(CHECKED_CAST(_STACK *, STACK_OF(ASN1_IA5STRING) *, (st))) --#define sk_ASN1_IA5STRING_value(st, i) (ASN1_IA5STRING *) \ --sk_value(CHECKED_CAST(_STACK *, const STACK_OF(ASN1_IA5STRING) *, (st)), (i)) --#else /* OPENSSL_IS_BORINGSSL */ - #if OPENSSL_VERSION_NUMBER < 0x10100000L - #define sk_LogotypeInfo_num(st) SKM_sk_num(LogotypeInfo, (st)) - #define sk_LogotypeInfo_value(st, i) SKM_sk_value(LogotypeInfo, (st), (i)) -@@ -473,7 +451,6 @@ DEFINE_STACK_OF(LogotypeAudio) - DEFINE_STACK_OF(HashAlgAndValue) - DEFINE_STACK_OF(ASN1_IA5STRING) - #endif --#endif /* OPENSSL_IS_BORINGSSL */ - - - static void add_logo(struct http_ctx *ctx, struct http_cert *hcert, --- -2.39.2 - diff --git a/patches-aosp/external/wpa_supplicant_8/0004-Convert-wpa_supplicant-to-soong-for-cuttlefish.patch b/patches-aosp/external/wpa_supplicant_8/0004-Convert-wpa_supplicant-to-soong-for-cuttlefish.patch deleted file mode 100644 index ce2625e..0000000 --- a/patches-aosp/external/wpa_supplicant_8/0004-Convert-wpa_supplicant-to-soong-for-cuttlefish.patch +++ /dev/null @@ -1,182 +0,0 @@ -From da9f86906130fe29b9e31d63bb70cb0dc98d28b4 Mon Sep 17 00:00:00 2001 -From: Deyao Ren -Date: Wed, 3 May 2023 21:33:22 +0000 -Subject: [PATCH 4/5] Convert wpa_supplicant to soong for cuttlefish - -Bug: 274020242 -Test: CtsWifiTestCases, launch cvd, m checkbuild -Change-Id: I0ccb8176bb43842529c8d08d4941dd6c742f2b9d -Merged-In: I0ccb8176bb43842529c8d08d4941dd6c742f2b9d -(cherry picked from commit 1d7e56dee59fb1645b343fabfc8023746a5fccc2) ---- - wpa_supplicant/Android.bp | 2 +- - wpa_supplicant/wpa_supplicant/Android.bp | 52 +++++++++++++++++++ - .../libdrivercmdfallback/Android.bp | 32 ++++++++++++ - .../libdrivercmdfallback/driver_cmd_nl80211.c | 45 ++++++++++++++++ - 4 files changed, 130 insertions(+), 1 deletion(-) - create mode 100644 wpa_supplicant/wpa_supplicant/Android.bp - create mode 100644 wpa_supplicant/wpa_supplicant/libdrivercmdfallback/Android.bp - create mode 100644 wpa_supplicant/wpa_supplicant/libdrivercmdfallback/driver_cmd_nl80211.c - -diff --git a/wpa_supplicant/Android.bp b/wpa_supplicant/Android.bp -index db113875..e7e4acc2 100644 ---- a/wpa_supplicant/Android.bp -+++ b/wpa_supplicant/Android.bp -@@ -414,4 +414,4 @@ filegroup { - "wpa_supplicant.c", - "wps_supplicant.c", - ], --} -+} -\ No newline at end of file -diff --git a/wpa_supplicant/wpa_supplicant/Android.bp b/wpa_supplicant/wpa_supplicant/Android.bp -new file mode 100644 -index 00000000..b70e5b92 ---- /dev/null -+++ b/wpa_supplicant/wpa_supplicant/Android.bp -@@ -0,0 +1,52 @@ -+// Copyright (C) 2023 The Android Open Source Project -+// -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// http://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+ -+soong_namespace { -+ -+} -+ -+package { -+ default_applicable_licenses: [ -+ // Inherits SPDX-license-identifier-BSD-3-Clause -+ "external_wpa_supplicant_8_license", -+ ], -+} -+ -+soong_config_module_type_import { -+ from: "frameworks/opt/net/wifi/libwifi_hal/Android.bp", -+ module_types: ["wifi_cc_defaults"], -+} -+ -+wifi_cc_defaults { -+ name: "lib_vendor_wpa_supplicant", -+ soong_config_variables: { -+ board_wlan_device: { -+ emulator: { -+ static_libs: ["lib_driver_cmd_simulated_cf_bp"], -+ }, -+ // TODO(b/295186835): Convert lib_driver_cmd_* to soong -+ conditions_default: { -+ static_libs: ["lib_driver_cmd_fallback"], -+ }, -+ } -+ } -+} -+ -+cc_binary { -+ name: "wpa_supplicant", -+ defaults: [ -+ "wpa_supplicant_defaults", -+ "lib_vendor_wpa_supplicant", -+ ], -+} -diff --git a/wpa_supplicant/wpa_supplicant/libdrivercmdfallback/Android.bp b/wpa_supplicant/wpa_supplicant/libdrivercmdfallback/Android.bp -new file mode 100644 -index 00000000..3fe900b2 ---- /dev/null -+++ b/wpa_supplicant/wpa_supplicant/libdrivercmdfallback/Android.bp -@@ -0,0 +1,32 @@ -+// -+// Copyright (C) 2023 The Android Open Source Project -+// -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// http://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+ -+package { -+ default_applicable_licenses: ["Android-Apache-2.0"], -+} -+ -+cc_library_static { -+ name: "lib_driver_cmd_fallback", -+ srcs: ["driver_cmd_nl80211.c"], -+ header_libs: [ -+ "wpa_supplicant_headers", -+ ], -+ cflags: [ -+ "-Werror", -+ "-Wno-unused-parameter", -+ "-Wno-macro-redefined", -+ ], -+ soc_specific: true, -+} -\ No newline at end of file -diff --git a/wpa_supplicant/wpa_supplicant/libdrivercmdfallback/driver_cmd_nl80211.c b/wpa_supplicant/wpa_supplicant/libdrivercmdfallback/driver_cmd_nl80211.c -new file mode 100644 -index 00000000..6cdc57a5 ---- /dev/null -+++ b/wpa_supplicant/wpa_supplicant/libdrivercmdfallback/driver_cmd_nl80211.c -@@ -0,0 +1,45 @@ -+/* -+ * Copyright (C) 2023 The Android Open Source Project -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+/* -+ * Driver interaction with extended Linux CFG8021 -+ */ -+ -+#include "includes.h" -+ -+#include "common.h" -+ -+int wpa_driver_nl80211_driver_cmd(void* priv, char* cmd, char* buf, -+ size_t buf_len) { -+ return 0; -+} -+ -+int wpa_driver_set_p2p_noa(void* priv, u8 count, int start, int duration) { -+ return 0; -+} -+ -+int wpa_driver_get_p2p_noa(void* priv, u8* buf, size_t len) { -+ return 0; -+} -+ -+int wpa_driver_set_p2p_ps(void* priv, int legacy_ps, int opp_ps, int ctwindow) { -+ return -1; -+} -+ -+int wpa_driver_set_ap_wps_p2p_ie(void* priv, const struct wpabuf* beacon, -+ const struct wpabuf* proberesp, -+ const struct wpabuf* assocresp) { -+ return 0; -+} --- -2.43.0 - diff --git a/patches-aosp/external/wpa_supplicant_8/0005-Convert-hostapd-to-soong.patch b/patches-aosp/external/wpa_supplicant_8/0005-Convert-hostapd-to-soong.patch deleted file mode 100644 index aa87cc7..0000000 --- a/patches-aosp/external/wpa_supplicant_8/0005-Convert-hostapd-to-soong.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 69b3b3981b106b5d54d33a75bbf37008dbe7a24e Mon Sep 17 00:00:00 2001 -From: Deyao Ren -Date: Tue, 21 May 2024 04:31:18 +0000 -Subject: [PATCH 5/5] Convert hostapd to soong - -Cuttlefish uses wpa_supplicant apex - -Bug: 295805441 -Test: CtsWifiTestCases -Change-Id: Ic89e4a74e9c76b80146b614d740e381b9438b25b ---- - wpa_supplicant/wpa_supplicant/Android.bp | 12 ++++++++++-- - 1 file changed, 10 insertions(+), 2 deletions(-) - -diff --git a/wpa_supplicant/wpa_supplicant/Android.bp b/wpa_supplicant/wpa_supplicant/Android.bp -index b70e5b92..3f76ae85 100644 ---- a/wpa_supplicant/wpa_supplicant/Android.bp -+++ b/wpa_supplicant/wpa_supplicant/Android.bp -@@ -39,8 +39,8 @@ wifi_cc_defaults { - conditions_default: { - static_libs: ["lib_driver_cmd_fallback"], - }, -- } -- } -+ }, -+ }, - } - - cc_binary { -@@ -50,3 +50,11 @@ cc_binary { - "lib_vendor_wpa_supplicant", - ], - } -+ -+cc_binary { -+ name: "hostapd", -+ defaults: [ -+ "hostapd_defaults", -+ "lib_vendor_wpa_supplicant", -+ ], -+} --- -2.43.0 - diff --git a/patches-aosp/glodroid/configuration/0023-Switch-to-AOSP-built-in-apexed-drm_hwcomposer.patch b/patches-aosp/glodroid/configuration/0023-Switch-to-AOSP-built-in-apexed-drm_hwcomposer.patch new file mode 100644 index 0000000..1272b01 --- /dev/null +++ b/patches-aosp/glodroid/configuration/0023-Switch-to-AOSP-built-in-apexed-drm_hwcomposer.patch @@ -0,0 +1,56 @@ +From 33ed257ec83c53ecb45703c01288e798d7df89d6 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Fri, 24 Apr 2026 23:56:55 +0300 +Subject: [PATCH 23/23] Switch to AOSP built-in apexed drm_hwcomposer + +Signed-off-by: Roman Stratiienko +--- + common/graphics/board.mk | 8 -------- + common/graphics/device.mk | 11 +---------- + 2 files changed, 1 insertion(+), 18 deletions(-) + +diff --git a/common/graphics/board.mk b/common/graphics/board.mk +index e102d57..90b55bf 100644 +--- a/common/graphics/board.mk ++++ b/common/graphics/board.mk +@@ -12,14 +12,6 @@ BOARD_MESA3D_SRC_DIR := glodroid/vendor/mesa3d + BOARD_MESA3D_GALLIUM_DRIVERS := lima + BOARD_MESA3D_BUILD_LIBGBM := true + +-ifeq ($(GD_USE_RS_HWCOMPOSER),) +-BOARD_BUILD_AOSPEXT_DRMHWCOMPOSER := true +-BOARD_DRMHWCOMPOSER_SRC_DIR := glodroid/vendor/drm_hwcomposer +-else +-BOARD_BUILD_AOSPEXT_RSHWCOMPOSER := true +-BOARD_RSHWCOMPOSER_SRC_DIR := glodroid/vendor/rs-hwcomposer +-endif +- + BOARD_BUILD_AOSPEXT_MINIGBM := true + BOARD_MINIGBM_SRC_DIR := glodroid/vendor/minigbm + BOARD_MINIGBM_PATCHES_DIRS += $(BCG_PATH)/patches-minigbm +diff --git a/common/graphics/device.mk b/common/graphics/device.mk +index 3850c8d..a3481ae 100644 +--- a/common/graphics/device.mk ++++ b/common/graphics/device.mk +@@ -17,17 +17,8 @@ PRODUCT_VENDOR_PROPERTIES += ro.hardware.egl=mesa + PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.software.opengles.deqp.level-2023-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.opengles.deqp.level.xml + +-ifeq ($(GD_USE_RS_HWCOMPOSER),) + PRODUCT_PACKAGES += \ +- android.hardware.composer.hwc3-service.drm_aospext +- +- DEVICE_MANIFEST_FILE += glodroid/configuration/common/graphics/android.hardware.graphics.composer@3.xml +- PRODUCT_COPY_FILES += glodroid/configuration/common/graphics/android.hardware.graphics.composer@3.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/android.hardware.graphics.composer@3.rc +-else +-PRODUCT_PACKAGES += \ +- android.hardware.composer.hwc3-service.rs \ +- android.hardware.composer.hwc3-rs.rc android.hardware.composer.hwc3-rs.xml +-endif ++ com.android.hardware.graphics.composer.drm_hwcomposer + + ## Minigbm/Gralloc5 + PRODUCT_PACKAGES += \ +-- +2.51.0 + diff --git a/patches-aosp/glodroid/configuration/0024-Upgrade-v4l2_codec2-version-to-1.2.patch b/patches-aosp/glodroid/configuration/0024-Upgrade-v4l2_codec2-version-to-1.2.patch new file mode 100644 index 0000000..a56fd68 --- /dev/null +++ b/patches-aosp/glodroid/configuration/0024-Upgrade-v4l2_codec2-version-to-1.2.patch @@ -0,0 +1,38 @@ +From fdd041adbeda9d74bfc56da1b434c93c46026b86 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Sun, 26 Apr 2026 16:24:20 +0300 +Subject: [PATCH 24/26] Upgrade v4l2_codec2 version to 1.2 + +Signed-off-by: Roman Stratiienko +--- + common/codecs/device.mk | 2 +- + common/codecs/sepolicy/vendor/file_contexts | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/common/codecs/device.mk b/common/codecs/device.mk +index 53769a7..7c7d98e 100644 +--- a/common/codecs/device.mk ++++ b/common/codecs/device.mk +@@ -50,7 +50,7 @@ PRODUCT_VENDOR_PROPERTIES += \ + + # V4L2 codec2 + PRODUCT_PACKAGES += \ +- android.hardware.media.c2@1.0-service-v4l2 \ ++ android.hardware.media.c2@1.2-service-v4l2 \ + libv4l2_codec2_vendor_allocator \ + libc2plugin_store \ + +diff --git a/common/codecs/sepolicy/vendor/file_contexts b/common/codecs/sepolicy/vendor/file_contexts +index 91614fa..8dc202a 100644 +--- a/common/codecs/sepolicy/vendor/file_contexts ++++ b/common/codecs/sepolicy/vendor/file_contexts +@@ -2,5 +2,5 @@ + /vendor/bin/hw/android\.hardware\.media\.c2@1\.2-service-ffmpeg(.*)? u:object_r:mediacodec_exec:s0 + + # V4L2 codec2 +-/vendor/bin/hw/android\.hardware\.media\.c2@1\.0-service-v4l2 u:object_r:mediacodec_exec:s0 ++/vendor/bin/hw/android\.hardware\.media\.c2@1\.2-service-v4l2 u:object_r:mediacodec_exec:s0 + /vendor/lib(64)?/libc2plugin_store\.so u:object_r:same_process_hal_file:s0 +-- +2.51.0 + diff --git a/patches-aosp/glodroid/configuration/0025-fstab-Set-LOCAL_CHECK_ELF_FILES-to-satisfy-A16.patch b/patches-aosp/glodroid/configuration/0025-fstab-Set-LOCAL_CHECK_ELF_FILES-to-satisfy-A16.patch new file mode 100644 index 0000000..f669f07 --- /dev/null +++ b/patches-aosp/glodroid/configuration/0025-fstab-Set-LOCAL_CHECK_ELF_FILES-to-satisfy-A16.patch @@ -0,0 +1,24 @@ +From 96d28a8a6fa1f7ea61bf3fb4d069c80aa76c7d39 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Sun, 26 Apr 2026 16:25:42 +0300 +Subject: [PATCH 25/26] fstab: Set LOCAL_CHECK_ELF_FILES to satisfy A16 + +Signed-off-by: Roman Stratiienko +--- + platform/fstab/fstab.mk | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/platform/fstab/fstab.mk b/platform/fstab/fstab.mk +index f26f08a..f6203d6 100644 +--- a/platform/fstab/fstab.mk ++++ b/platform/fstab/fstab.mk +@@ -26,5 +26,6 @@ LOCAL_MODULE := fstab.$(TARGET_PRODUCT) + LOCAL_PROPRIETARY_MODULE := true + LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/ + LOCAL_PREBUILT_MODULE_FILE := $(VENDOR_FSTAB) $(RECOVERY_FSTAB) ++LOCAL_CHECK_ELF_FILES := false + + include $(BUILD_EXECUTABLE) +-- +2.51.0 + diff --git a/patches-aosp/glodroid/configuration/0026-wifi-Switch-supplicant-and-hostap-to-APEX-remove-lef.patch b/patches-aosp/glodroid/configuration/0026-wifi-Switch-supplicant-and-hostap-to-APEX-remove-lef.patch new file mode 100644 index 0000000..0b30132 --- /dev/null +++ b/patches-aosp/glodroid/configuration/0026-wifi-Switch-supplicant-and-hostap-to-APEX-remove-lef.patch @@ -0,0 +1,81 @@ +From 4be3451514ebbdc5d6a4d04659aec080bbfe4751 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Sun, 26 Apr 2026 16:31:05 +0300 +Subject: [PATCH 26/26] wifi: Switch supplicant and hostap to APEX, remove + leftovers. + +Signed-off-by: Roman Stratiienko +--- + common/wifi/board.mk | 3 --- + common/wifi/device.mk | 8 +++----- + common/wifi/p2p_supplicant_overlay.conf | 1 - + common/wifi/wpa_supplicant.conf | 6 ------ + common/wifi/wpa_supplicant_overlay.conf | 3 --- + 5 files changed, 3 insertions(+), 18 deletions(-) + delete mode 100644 common/wifi/p2p_supplicant_overlay.conf + delete mode 100644 common/wifi/wpa_supplicant.conf + delete mode 100644 common/wifi/wpa_supplicant_overlay.conf + +diff --git a/common/wifi/board.mk b/common/wifi/board.mk +index 28b2e7f..33aa433 100644 +--- a/common/wifi/board.mk ++++ b/common/wifi/board.mk +@@ -1,6 +1,3 @@ + +-# generic wifi +-WPA_SUPPLICANT_VERSION := VER_0_8_X + BOARD_WPA_SUPPLICANT_DRIVER := NL80211 + BOARD_HOSTAPD_DRIVER := NL80211 +-WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true +diff --git a/common/wifi/device.mk b/common/wifi/device.mk +index 18048bb..cb4670f 100644 +--- a/common/wifi/device.mk ++++ b/common/wifi/device.mk +@@ -1,13 +1,11 @@ +-# Add wifi-related packages +-PRODUCT_PACKAGES += libwpa_client wpa_supplicant hostapd wificond + PRODUCT_VENDOR_PROPERTIES += wifi.interface=wlan0 \ + wifi.supplicant_scan_interval=15 \ + + PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \ +- $(LOCAL_PATH)/wpa_supplicant.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant.conf \ +- $(LOCAL_PATH)/wpa_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant_overlay.conf \ +- $(LOCAL_PATH)/p2p_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/p2p_supplicant_overlay.conf \ ++ ++# Add wifi-related packages ++PRODUCT_PACKAGES += com.android.hardware.wpa_supplicant + + PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/init.wifi.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.wifi.rc \ +diff --git a/common/wifi/p2p_supplicant_overlay.conf b/common/wifi/p2p_supplicant_overlay.conf +deleted file mode 100644 +index acbace2..0000000 +--- a/common/wifi/p2p_supplicant_overlay.conf ++++ /dev/null +@@ -1 +0,0 @@ +-disable_scan_offload=1 +diff --git a/common/wifi/wpa_supplicant.conf b/common/wifi/wpa_supplicant.conf +deleted file mode 100644 +index 109d46b..0000000 +--- a/common/wifi/wpa_supplicant.conf ++++ /dev/null +@@ -1,6 +0,0 @@ +-##### wpa_supplicant configuration file template ##### +-update_config=1 +-eapol_version=1 +-ap_scan=1 +-fast_reauth=1 +-disable_scan_offload=1 +diff --git a/common/wifi/wpa_supplicant_overlay.conf b/common/wifi/wpa_supplicant_overlay.conf +deleted file mode 100644 +index e1f530d..0000000 +--- a/common/wifi/wpa_supplicant_overlay.conf ++++ /dev/null +@@ -1,3 +0,0 @@ +-disable_scan_offload=1 +-p2p_disabled=1 +-tdls_external_control=1 +-- +2.51.0 + diff --git a/patches-aosp/glodroid/configuration/0027-Update-Rust-binaries-path-to-match-A16-tree.patch b/patches-aosp/glodroid/configuration/0027-Update-Rust-binaries-path-to-match-A16-tree.patch new file mode 100644 index 0000000..129e997 --- /dev/null +++ b/patches-aosp/glodroid/configuration/0027-Update-Rust-binaries-path-to-match-A16-tree.patch @@ -0,0 +1,26 @@ +From ea1c2bc42707af6aaf7c448b1fd47e6cea3e1648 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Mon, 27 Apr 2026 11:28:38 +0300 +Subject: [PATCH 27/28] Update Rust binaries path to match A16 tree. + +Signed-off-by: Roman Stratiienko +--- + common/base/board.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/common/base/board.mk b/common/base/board.mk +index bd7c63e..b58871d 100644 +--- a/common/base/board.mk ++++ b/common/base/board.mk +@@ -177,7 +177,7 @@ BOARD_USES_GLODROID_MAKE_TARGETS := true + + BOARD_BUILD_GLODROID_KERNEL := true + +-RUST_BIN_DIR := prebuilts/rust/linux-x86/1.68.0/bin ++RUST_BIN_DIR := prebuilts/rust/linux-x86/1.88.0/bin + + # vendor_dlkm is not yet ready for files filtering + BUILD_BROKEN_INCORRECT_PARTITION_IMAGES := true +-- +2.51.0 + diff --git a/patches-aosp/glodroid/configuration/0028-Add-a-temporary-hack-for-RPI4.patch b/patches-aosp/glodroid/configuration/0028-Add-a-temporary-hack-for-RPI4.patch new file mode 100644 index 0000000..97bc954 --- /dev/null +++ b/patches-aosp/glodroid/configuration/0028-Add-a-temporary-hack-for-RPI4.patch @@ -0,0 +1,29 @@ +From 193920538aaf8529f419151eb1d7c801a46cb2d3 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Mon, 27 Apr 2026 11:29:21 +0300 +Subject: [PATCH 28/28] Add a temporary hack for RPI4 + +After updating the kernel to 6.12, the USB device appears after the init +process starts fastboot. Delay a fastboot initialization for 5 seconds +to give the kernel enough time for USB initialization. + +Signed-off-by: Roman Stratiienko +--- + common/base/init.recovery.glodroid.rc | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/common/base/init.recovery.glodroid.rc b/common/base/init.recovery.glodroid.rc +index 03274b7..32daa3e 100644 +--- a/common/base/init.recovery.glodroid.rc ++++ b/common/base/init.recovery.glodroid.rc +@@ -1,3 +1,7 @@ ++on early-init ++ # Temporary hack to let kernel USB subsystem initialize before starting fastbootd ++ wait /sys/wait_for_missing_file 5 ++ + on init + setprop sys.usb.typec.data_role device + setprop sys.usb.configfs 1 +-- +2.51.0 + diff --git a/patches-aosp/glodroid/configuration/0029-audio-Switch-to-Baylibre-s-fork-of-generic-audio-HAL.patch b/patches-aosp/glodroid/configuration/0029-audio-Switch-to-Baylibre-s-fork-of-generic-audio-HAL.patch new file mode 100644 index 0000000..ed28a9e --- /dev/null +++ b/patches-aosp/glodroid/configuration/0029-audio-Switch-to-Baylibre-s-fork-of-generic-audio-HAL.patch @@ -0,0 +1,112 @@ +From fec034f8bae95541a9a45a36357ac695fcb5e5fb Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Sat, 23 May 2026 18:41:18 +0300 +Subject: [PATCH 29/29] audio: Switch to Baylibre's fork of generic audio HAL + (AIDL/APEX) + +Signed-off-by: Roman Stratiienko +--- + common/audio/android.hardware.audio.effect@7.0.xml | 11 ----------- + common/audio/android.hardware.audio@7.1.xml | 11 ----------- + common/audio/board.mk | 10 +--------- + common/audio/device.mk | 11 +---------- + common/audio/sepolicy/vendor/tinymix.te | 7 ------- + 5 files changed, 2 insertions(+), 48 deletions(-) + delete mode 100644 common/audio/android.hardware.audio.effect@7.0.xml + delete mode 100644 common/audio/android.hardware.audio@7.1.xml + delete mode 100644 common/audio/sepolicy/vendor/tinymix.te + +diff --git a/common/audio/android.hardware.audio.effect@7.0.xml b/common/audio/android.hardware.audio.effect@7.0.xml +deleted file mode 100644 +index 1856dc3..0000000 +--- a/common/audio/android.hardware.audio.effect@7.0.xml ++++ /dev/null +@@ -1,11 +0,0 @@ +- +- +- android.hardware.audio.effect +- hwbinder +- 7.0 +- +- IEffectsFactory +- default +- +- +- +diff --git a/common/audio/android.hardware.audio@7.1.xml b/common/audio/android.hardware.audio@7.1.xml +deleted file mode 100644 +index 5954858..0000000 +--- a/common/audio/android.hardware.audio@7.1.xml ++++ /dev/null +@@ -1,11 +0,0 @@ +- +- +- android.hardware.audio +- hwbinder +- 7.1 +- +- IDevicesFactory +- default +- +- +- +diff --git a/common/audio/board.mk b/common/audio/board.mk +index b3f823d..2758465 100644 +--- a/common/audio/board.mk ++++ b/common/audio/board.mk +@@ -4,12 +4,4 @@ + # + # Copyright (C) 2022 Roman Stratiienko (r.stratiienko@gmail.com) + +-BCA_PATH := $(patsubst $(CURDIR)/%,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))) +- +-# TinyHAL (Audio) +-BOARD_USES_TINYHAL_AUDIO := true +-TINYCOMPRESS_TSTAMP_IS_LONG := true +-TINYALSA_NO_ADD_NEW_CTRLS := true +-TINYALSA_NO_CTL_GET_ID := true +- +-BOARD_VENDOR_SEPOLICY_DIRS += $(BCA_PATH)/sepolicy/vendor ++BOARD_VENDOR_SEPOLICY_DIRS += glodroid/vendor/audio/sepolicy +diff --git a/common/audio/device.mk b/common/audio/device.mk +index 7d1b194..1270c01 100644 +--- a/common/audio/device.mk ++++ b/common/audio/device.mk +@@ -5,12 +5,7 @@ + # Copyright (C) 2022 Roman Stratiienko (r.stratiienko@gmail.com) + + PRODUCT_PACKAGES += \ +- android.hardware.audio.service \ +- android.hardware.audio@7.1-impl \ +- android.hardware.audio.effect@7.0-impl \ +- audio.primary.$(TARGET_PRODUCT) \ +- audio.usb.default \ +- audio.r_submix.default \ ++ com.android.hardware.audio.generic \ + tinyalsa tinymix tinycap tinypcminfo tinyplay \ + + GD_AUDIOPOLICY_FILE ?= $(LOCAL_PATH)/audio_policy_configuration.xml +@@ -25,7 +20,3 @@ PRODUCT_COPY_FILES += \ + frameworks/av/services/audiopolicy/config/default_volume_tables.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default_volume_tables.xml \ + frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \ + frameworks/av/media/libeffects/data/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.xml \ +- +-DEVICE_MANIFEST_FILE += \ +- glodroid/configuration/common/audio/android.hardware.audio@7.1.xml \ +- glodroid/configuration/common/audio/android.hardware.audio.effect@7.0.xml \ +diff --git a/common/audio/sepolicy/vendor/tinymix.te b/common/audio/sepolicy/vendor/tinymix.te +deleted file mode 100644 +index 75dc071..0000000 +--- a/common/audio/sepolicy/vendor/tinymix.te ++++ /dev/null +@@ -1,7 +0,0 @@ +-type tinymix, domain, coredomain; +-type tinymix_exec, exec_type, system_file_type, file_type; +- +-init_daemon_domain(tinymix) +- +-allow tinymix audio_device:chr_file { ioctl open read write }; +-allow tinymix audio_device:dir search; +-- +2.51.0 + diff --git a/patches-aosp/glodroid/configuration/0030-Update-libcamera-HAL-to-BayLibre-s-TI-fork.patch b/patches-aosp/glodroid/configuration/0030-Update-libcamera-HAL-to-BayLibre-s-TI-fork.patch new file mode 100644 index 0000000..e9a68e2 --- /dev/null +++ b/patches-aosp/glodroid/configuration/0030-Update-libcamera-HAL-to-BayLibre-s-TI-fork.patch @@ -0,0 +1,76 @@ +From 0472deb19a97d8e71a902f1d62c1ae2abf17026c Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Sun, 24 May 2026 20:36:23 +0300 +Subject: [PATCH 30/32] Update libcamera HAL to BayLibre's/TI fork. + +Signed-off-by: Roman Stratiienko +--- + .../camera/android.hardware.camera.provider@2.5.xml | 13 ------------- + common/camera/board.mk | 8 -------- + common/camera/device.mk | 7 ++----- + 3 files changed, 2 insertions(+), 26 deletions(-) + delete mode 100644 common/camera/android.hardware.camera.provider@2.5.xml + +diff --git a/common/camera/android.hardware.camera.provider@2.5.xml b/common/camera/android.hardware.camera.provider@2.5.xml +deleted file mode 100644 +index 9af14d0..0000000 +--- a/common/camera/android.hardware.camera.provider@2.5.xml ++++ /dev/null +@@ -1,13 +0,0 @@ +- +- +- android.hardware.camera.provider +- hwbinder +- +- 2.5 +- +- ICameraProvider +- external/0 +- legacy/0 +- +- +- +diff --git a/common/camera/board.mk b/common/camera/board.mk +index 4d730a1..0da9cc0 100644 +--- a/common/camera/board.mk ++++ b/common/camera/board.mk +@@ -6,12 +6,4 @@ + + BCC_PATH := $(patsubst $(CURDIR)/%,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))) + +-BOARD_BUILD_AOSPEXT_LIBCAMERA := true +-BOARD_LIBCAMERA_SRC_DIR := glodroid/vendor/libcamera +-BOARD_LIBCAMERA_PIPELINES ?= simple +-BOARD_LIBCAMERA_EXTRA_MESON_ARGS := -Dandroid=enabled +-BOARD_LIBCAMERA_EXTRA_TARGETS := lib:libcamera-hal.so:hw:camera.libcamera: +- +-DEVICE_MANIFEST_FILE += $(BCC_PATH)/android.hardware.camera.provider@2.5.xml +- + BOARD_VENDOR_SEPOLICY_DIRS += $(BCC_PATH)/sepolicy/vendor +diff --git a/common/camera/device.mk b/common/camera/device.mk +index 38d763f..c5990a4 100644 +--- a/common/camera/device.mk ++++ b/common/camera/device.mk +@@ -6,17 +6,14 @@ + + #External USB Camera HAL + PRODUCT_PACKAGES += \ +- android.hardware.camera.provider@2.5-external-service \ ++ android.hardware.camera.provider-V1-external-service \ + + PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/external_camera_config.xml:$(TARGET_COPY_OUT_VENDOR)/etc/external_camera_config.xml + + #Camera HAL + PRODUCT_PACKAGES += \ +- camera.libcamera libcamera libcamera-base libcamera-cam lc-compliance \ +- android.hardware.camera.provider@2.5-service_64 \ +- +-PRODUCT_VENDOR_PROPERTIES += ro.hardware.camera=libcamera ++ com.android.hardware.camera.libcamera \ + + PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.camera.concurrent.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.concurrent.xml \ +-- +2.51.0 + diff --git a/patches-aosp/glodroid/configuration/0031-base-Add-empty-device-manifest-file.patch b/patches-aosp/glodroid/configuration/0031-base-Add-empty-device-manifest-file.patch new file mode 100644 index 0000000..89d10aa --- /dev/null +++ b/patches-aosp/glodroid/configuration/0031-base-Add-empty-device-manifest-file.patch @@ -0,0 +1,36 @@ +From 8376111f9573504ce8600fb31c27df3fba349a6c Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Sun, 24 May 2026 20:33:03 +0300 +Subject: [PATCH 31/32] base: Add empty device manifest file. + +AOSP checker relies on this file to determine the target-level. + +Signed-off-by: Roman Stratiienko +--- + common/base/device.mk | 2 ++ + common/base/device_manifest.xml | 2 ++ + 2 files changed, 4 insertions(+) + create mode 100644 common/base/device_manifest.xml + +diff --git a/common/base/device.mk b/common/base/device.mk +index e3e6200..5afb67d 100644 +--- a/common/base/device.mk ++++ b/common/base/device.mk +@@ -81,3 +81,5 @@ PRODUCT_PACKAGES += \ + + # ro.frp.pst points to a partition that contains factory reset protection information. + PRODUCT_VENDOR_PROPERTIES += ro.frp.pst=/dev/block/by-name/frp ++ ++DEVICE_MANIFEST_FILE := $(LOCAL_PATH)/device_manifest.xml +diff --git a/common/base/device_manifest.xml b/common/base/device_manifest.xml +new file mode 100644 +index 0000000..d62d9c9 +--- /dev/null ++++ b/common/base/device_manifest.xml +@@ -0,0 +1,2 @@ ++ ++ +\ No newline at end of file +-- +2.51.0 + diff --git a/patches-aosp/glodroid/configuration/0032-other-hals-Upgrade-MOCK-hals-API-version-to-satifsy-.patch b/patches-aosp/glodroid/configuration/0032-other-hals-Upgrade-MOCK-hals-API-version-to-satifsy-.patch new file mode 100644 index 0000000..d926221 --- /dev/null +++ b/patches-aosp/glodroid/configuration/0032-other-hals-Upgrade-MOCK-hals-API-version-to-satifsy-.patch @@ -0,0 +1,64 @@ +From 1b3db3234fcd51a130ccfeb997b124ec7ae51847 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Sun, 24 May 2026 20:35:15 +0300 +Subject: [PATCH 32/32] other-hals: Upgrade MOCK hals API version to satifsy + target-level 8 + +Signed-off-by: Roman Stratiienko +--- + common/other-hals/device.mk | 8 ++++---- + common/other-hals/sepolicy/vendor/file_contexts | 4 ---- + 2 files changed, 4 insertions(+), 8 deletions(-) + +diff --git a/common/other-hals/device.mk b/common/other-hals/device.mk +index 367e320..25bd5b9 100644 +--- a/common/other-hals/device.mk ++++ b/common/other-hals/device.mk +@@ -30,12 +30,12 @@ PRODUCT_PACKAGES += \ + endif + + ifeq ($(GD_NO_DEFAULT_THERMAL),) +-PRODUCT_PACKAGES += android.hardware.thermal@2.0-service.mock ++PRODUCT_PACKAGES += com.android.hardware.thermal + endif + + ifeq ($(GD_NO_DEFAULT_USB),) + PRODUCT_PACKAGES += \ +- android.hardware.usb-service.example \ ++ com.android.hardware.usb \ + android.hardware.usb.gadget-service.glodroid \ + + PRODUCT_COPY_FILES += \ +@@ -45,7 +45,7 @@ PRODUCT_COPY_FILES += \ + endif + + ifeq ($(GD_NO_DEFAULT_GATEKEEPER),) +-PRODUCT_PACKAGES += android.hardware.gatekeeper@1.0-service.software ++PRODUCT_PACKAGES += com.android.hardware.gatekeeper.nonsecure + endif + + ifeq ($(GD_NO_DEFAULT_KEYMINT),) +@@ -57,7 +57,7 @@ PRODUCT_PACKAGES += android.hardware.identity-service.example + endif + + ifeq ($(GD_NO_DEFAULT_POWER),) +-PRODUCT_PACKAGES += android.hardware.power-service.glodroid ++PRODUCT_PACKAGES += com.android.hardware.power + endif + + ifeq ($(GD_NO_DEFAULT_VIBRATOR),) +diff --git a/common/other-hals/sepolicy/vendor/file_contexts b/common/other-hals/sepolicy/vendor/file_contexts +index 56f6d0f..79f3381 100644 +--- a/common/other-hals/sepolicy/vendor/file_contexts ++++ b/common/other-hals/sepolicy/vendor/file_contexts +@@ -1,7 +1,3 @@ +-/vendor/bin/hw/android\.hardware\.usb-service\.glodroid u:object_r:hal_usb_default_exec:s0 + /vendor/bin/hw/android\.hardware\.usb\.gadget-service\.glodroid u:object_r:hal_usb_gadget_default_exec:s0 +-/vendor/bin/hw/android\.hardware\.power-service\.glodroid u:object_r:hal_power_default_exec:s0 +-/vendor/bin/hw/android\.hardware\.gatekeeper@1\.0-service\.software u:object_r:hal_gatekeeper_default_exec:s0 +-/vendor/bin/hw/android\.hardware\.thermal@2\.0-service.mock u:object_r:hal_thermal_default_exec:s0 + /vendor/bin/hw/android\.hardware\.vibrator-service\.glodroid u:object_r:hal_vibrator_default_exec:s0 + /(vendor|system/vendor)/bin/hw/android\.hardware\.drm@[0-9]+\.[0-9]+-service\.clearkey u:object_r:hal_drm_clearkey_exec:s0 +-- +2.51.0 + diff --git a/patches-aosp/glodroid/vendor/aospext/0001-mesa3d-Remove-libglapi-to-satisfy-latest-mainline-me.patch b/patches-aosp/glodroid/vendor/aospext/0001-mesa3d-Remove-libglapi-to-satisfy-latest-mainline-me.patch new file mode 100644 index 0000000..119cedc --- /dev/null +++ b/patches-aosp/glodroid/vendor/aospext/0001-mesa3d-Remove-libglapi-to-satisfy-latest-mainline-me.patch @@ -0,0 +1,25 @@ +From e570680b2c572561a913632bd271ee4ca38c0a3f Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Fri, 22 May 2026 15:51:27 +0300 +Subject: [PATCH] mesa3d: Remove libglapi to satisfy latest mainline mesa3d + +Signed-off-by: Roman Stratiienko +--- + meson_mesa3d.mk | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/meson_mesa3d.mk b/meson_mesa3d.mk +index e5c382e..8fd9e0c 100644 +--- a/meson_mesa3d.mk ++++ b/meson_mesa3d.mk +@@ -60,7 +60,6 @@ AOSPEXT_GEN_TARGETS := $(BOARD_MESA3D_EXTRA_TARGETS) + ifneq ($(strip $(BOARD_MESA3D_GALLIUM_DRIVERS)),) + AOSPEXT_GEN_TARGETS += \ + lib:libgallium_dri.so:$(MESA3D_GALLIUM_LIBDIR):libgallium_dri: \ +- lib:libglapi.so::libglapi: \ + lib:libEGL.so:egl:libEGL_mesa: \ + lib:libGLESv1_CM.so:egl:libGLESv1_CM_mesa: \ + lib:libGLESv2.so:egl:libGLESv2_mesa: \ +-- +2.51.0 + diff --git a/patches-aosp/glodroid/vendor/audio/0001-Add-Raspberry-Pi-4-400-model-detection-from-device-t.patch b/patches-aosp/glodroid/vendor/audio/0001-Add-Raspberry-Pi-4-400-model-detection-from-device-t.patch new file mode 100644 index 0000000..4f71846 --- /dev/null +++ b/patches-aosp/glodroid/vendor/audio/0001-Add-Raspberry-Pi-4-400-model-detection-from-device-t.patch @@ -0,0 +1,217 @@ +From 5fa63e15945e19161d7c04321c672d56cbba3924 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Fri, 22 May 2026 22:26:09 +0300 +Subject: [PATCH 1/4] Add Raspberry Pi 4/400 model detection from device tree + +Detect RPi model from /sys/firmware/devicetree/base/compatible +at HAL startup and auto-configure: +- primary ALSA card (Headphones on rpi4, Dummy on rpi400) +- mixer controls XML (mixer_controls.rpi4.xml / mixer_controls.rpi400.xml) + +Also add all mixer_controls*.xml to APEX prebuilts. + +AI assisted +--- + Android.bp | 18 ++++++ + apex/com.android.hardware.audio/Android.bp | 3 + + main.cpp | 64 ++++++++++++++++++++++ + mixer_controls.rpi4.xml | 18 ++++++ + mixer_controls.rpi400.xml | 29 ++++++++++ + 5 files changed, 132 insertions(+) + create mode 100644 mixer_controls.rpi4.xml + create mode 100644 mixer_controls.rpi400.xml + +diff --git a/Android.bp b/Android.bp +index 9bca800..934d62a 100644 +--- a/Android.bp ++++ b/Android.bp +@@ -295,3 +295,21 @@ prebuilt_etc { + installable: false, + } + ++prebuilt_etc { ++ name: "mixer_controls.xml", ++ src: "mixer_controls.xml", ++ installable: false, ++} ++ ++prebuilt_etc { ++ name: "mixer_controls.rpi4.xml", ++ src: "mixer_controls.rpi4.xml", ++ installable: false, ++} ++ ++prebuilt_etc { ++ name: "mixer_controls.rpi400.xml", ++ src: "mixer_controls.rpi400.xml", ++ installable: false, ++} ++ +diff --git a/apex/com.android.hardware.audio/Android.bp b/apex/com.android.hardware.audio/Android.bp +index 507f2e0..641a03a 100644 +--- a/apex/com.android.hardware.audio/Android.bp ++++ b/apex/com.android.hardware.audio/Android.bp +@@ -39,5 +39,8 @@ apex { + prebuilts: [ + "android.hardware.audio.service-aidl.generic.rc", + "android.hardware.audio.service-aidl.generic.xml", ++ "mixer_controls.xml", ++ "mixer_controls.rpi4.xml", ++ "mixer_controls.rpi400.xml", + ], + } +diff --git a/main.cpp b/main.cpp +index 985cc2a..1f101a6 100644 +--- a/main.cpp ++++ b/main.cpp +@@ -15,10 +15,15 @@ + */ + + #include ++#include + #include ++#include + #include + #include + ++#include ++#include ++ + #define LOG_TAG "AHAL_Main" + #include + #include +@@ -38,6 +43,60 @@ using aidl::android::hardware::audio::core::internal::AudioPolicyConfigXmlConver + + namespace { + ++constexpr char kEtcPath[] = "/vendor/etc"; ++constexpr char kDtCompatible[] = "/sys/firmware/devicetree/base/compatible"; ++constexpr char kRpi400Compat[] = "raspberrypi,400"; ++ ++static std::string detectRpiModel() { ++ int f = open(kDtCompatible, O_RDONLY); ++ if (f < 0) { ++ LOG(WARNING) << __func__ << ": Failed to open " << kDtCompatible ++ << ", defaulting to rpi4"; ++ return "rpi4"; ++ } ++ ++ char buf[256]; ++ memset(buf, 0, sizeof(buf)); ++ int len = read(f, buf, sizeof(buf) - 1); ++ close(f); ++ ++ if (len < 0) { ++ LOG(WARNING) << __func__ << ": Failed to read " << kDtCompatible ++ << ", defaulting to rpi4"; ++ return "rpi4"; ++ } ++ ++ std::string compat(buf, len); ++ LOG(INFO) << __func__ << ": DT compatible is '" << compat << "'"; ++ ++ if (compat.find(kRpi400Compat) != std::string::npos) { ++ LOG(INFO) << __func__ << ": Detected Raspberry Pi 400"; ++ return "rpi400"; ++ } ++ ++ LOG(INFO) << __func__ << ": Detected Raspberry Pi 4"; ++ return "rpi4"; ++} ++ ++static void configureRpiPlatform(const std::string& model) { ++ std::string cardName; ++ std::string mixerConfig; ++ ++ if (model == "rpi400") { ++ cardName = "Dummy"; ++ mixerConfig = std::string(kEtcPath) + "/mixer_controls.rpi400.xml"; ++ } else { ++ cardName = "Headphones"; ++ mixerConfig = std::string(kEtcPath) + "/mixer_controls.rpi4.xml"; ++ } ++ ++ LOG(INFO) << __func__ << ": Setting primary card_name=" << cardName; ++ LOG(INFO) << __func__ << ": Setting mixer config=" << mixerConfig; ++ ++ android::base::SetProperty("persist.vendor.audio.primary.card_name", cardName); ++ android::base::SetProperty("persist.vendor.audio.mixer.config", mixerConfig); ++} ++ + ChildInterface createModule(const std::string& name, + std::unique_ptr&& config) { + ChildInterface result; +@@ -80,6 +139,11 @@ int main() { + + LOG(INFO) << "Init for BayLibre Generic Audio AIDL HAL"; + ++ // Detect Raspberry Pi model from device tree and configure ++ // the appropriate ALSA card name and mixer controls. ++ std::string rpiModel = detectRpiModel(); ++ configureRpiPlatform(rpiModel); ++ + // Load audio policy configuration from platform-specific XML file + // The configuration file location can be customized per platform: + // - Default: /vendor/etc/audio_policy_configuration.xml +diff --git a/mixer_controls.rpi4.xml b/mixer_controls.rpi4.xml +new file mode 100644 +index 0000000..93cb652 +--- /dev/null ++++ b/mixer_controls.rpi4.xml +@@ -0,0 +1,18 @@ ++ ++ ++ ++ ++ ++ PCM Playback Volume ++ ++ ++ ++ ++ PCM Playback Switch ++ ++ ++ ++ ++ PCM Playback Volume ++ ++ +diff --git a/mixer_controls.rpi400.xml b/mixer_controls.rpi400.xml +new file mode 100644 +index 0000000..13add8a +--- /dev/null ++++ b/mixer_controls.rpi400.xml +@@ -0,0 +1,29 @@ ++ ++ ++ ++ ++ ++ PCM Playback Volume ++ ++ ++ ++ ++ PCM Playback Switch ++ ++ ++ ++ ++ PCM Playback Volume ++ ++ ++ ++ ++ Capture Switch ++ ++ ++ ++ ++ Capture Volume ++ PCM Capture Volume ++ ++ +-- +2.51.0 + diff --git a/patches-aosp/glodroid/vendor/audio/0002-Add-glodroid-APEX-path-to-effect-library-visibility.patch b/patches-aosp/glodroid/vendor/audio/0002-Add-glodroid-APEX-path-to-effect-library-visibility.patch new file mode 100644 index 0000000..9e22a46 --- /dev/null +++ b/patches-aosp/glodroid/vendor/audio/0002-Add-glodroid-APEX-path-to-effect-library-visibility.patch @@ -0,0 +1,238 @@ +From cd654d4290178144090c7e7d2809943a5589bdb2 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Fri, 22 May 2026 22:37:08 +0300 +Subject: [PATCH 2/4] Add glodroid APEX path to effect library visibility + +All 18 effect libraries (lib*sw_generic) now include +//glodroid/vendor/audio/apex/com.android.hardware.audio +in their visibility list to fix Soong build errors when +building under the glodroid tree. + +AI assisted +--- + acousticEchoCanceler/Android.bp | 1 + + automaticGainControlV1/Android.bp | 1 + + automaticGainControlV2/Android.bp | 1 + + bassboost/Android.bp | 1 + + downmix/Android.bp | 1 + + dynamicProcessing/Android.bp | 1 + + envReverb/Android.bp | 1 + + equalizer/Android.bp | 1 + + eraser/Android.bp | 1 + + extension/Android.bp | 1 + + hapticGenerator/Android.bp | 1 + + loudnessEnhancer/Android.bp | 1 + + noiseSuppression/Android.bp | 1 + + presetReverb/Android.bp | 1 + + spatializer/Android.bp | 1 + + virtualizer/Android.bp | 1 + + visualizer/Android.bp | 1 + + volume/Android.bp | 1 + + 18 files changed, 18 insertions(+) + +diff --git a/acousticEchoCanceler/Android.bp b/acousticEchoCanceler/Android.bp +index e48a5a4..56f22cd 100644 +--- a/acousticEchoCanceler/Android.bp ++++ b/acousticEchoCanceler/Android.bp +@@ -32,5 +32,6 @@ cc_library_shared { + visibility: [ + "//hardware/amlogic/yukawa/audio/apex/com.android.hardware.audio", + "//hardware/baylibre/audio/apex/com.android.hardware.audio", ++ "//glodroid/vendor/audio/apex/com.android.hardware.audio", + ], + } +diff --git a/automaticGainControlV1/Android.bp b/automaticGainControlV1/Android.bp +index 1459963..d423132 100644 +--- a/automaticGainControlV1/Android.bp ++++ b/automaticGainControlV1/Android.bp +@@ -32,5 +32,6 @@ cc_library_shared { + visibility: [ + "//hardware/amlogic/yukawa/audio/apex/com.android.hardware.audio", + "//hardware/baylibre/audio/apex/com.android.hardware.audio", ++ "//glodroid/vendor/audio/apex/com.android.hardware.audio", + ], + } +diff --git a/automaticGainControlV2/Android.bp b/automaticGainControlV2/Android.bp +index 6a3312b..24673dc 100644 +--- a/automaticGainControlV2/Android.bp ++++ b/automaticGainControlV2/Android.bp +@@ -32,5 +32,6 @@ cc_library_shared { + visibility: [ + "//hardware/amlogic/yukawa/audio/apex/com.android.hardware.audio", + "//hardware/baylibre/audio/apex/com.android.hardware.audio", ++ "//glodroid/vendor/audio/apex/com.android.hardware.audio", + ], + } +diff --git a/bassboost/Android.bp b/bassboost/Android.bp +index e8f913f..3b5dda2 100644 +--- a/bassboost/Android.bp ++++ b/bassboost/Android.bp +@@ -32,5 +32,6 @@ cc_library_shared { + visibility: [ + "//hardware/amlogic/yukawa/audio/apex/com.android.hardware.audio", + "//hardware/baylibre/audio/apex/com.android.hardware.audio", ++ "//glodroid/vendor/audio/apex/com.android.hardware.audio", + ], + } +diff --git a/downmix/Android.bp b/downmix/Android.bp +index 0460736..a78be9a 100644 +--- a/downmix/Android.bp ++++ b/downmix/Android.bp +@@ -32,6 +32,7 @@ cc_library_shared { + visibility: [ + "//hardware/amlogic/yukawa/audio/apex/com.android.hardware.audio", + "//hardware/baylibre/audio/apex/com.android.hardware.audio", ++ "//glodroid/vendor/audio/apex/com.android.hardware.audio", + ":__subpackages__", "//hardware/generic/audio/apex/com.android.hardware.audio", + ], + } +diff --git a/dynamicProcessing/Android.bp b/dynamicProcessing/Android.bp +index 00ec073..179c6cb 100644 +--- a/dynamicProcessing/Android.bp ++++ b/dynamicProcessing/Android.bp +@@ -32,6 +32,7 @@ cc_library_shared { + visibility: [ + "//hardware/amlogic/yukawa/audio/apex/com.android.hardware.audio", + "//hardware/baylibre/audio/apex/com.android.hardware.audio", ++ "//glodroid/vendor/audio/apex/com.android.hardware.audio", + ":__subpackages__", "//hardware/generic/audio/apex/com.android.hardware.audio", + ], + } +diff --git a/envReverb/Android.bp b/envReverb/Android.bp +index 380fe3b..5b9a9f4 100644 +--- a/envReverb/Android.bp ++++ b/envReverb/Android.bp +@@ -32,5 +32,6 @@ cc_library_shared { + visibility: [ + "//hardware/amlogic/yukawa/audio/apex/com.android.hardware.audio", + "//hardware/baylibre/audio/apex/com.android.hardware.audio", ++ "//glodroid/vendor/audio/apex/com.android.hardware.audio", + ], + } +diff --git a/equalizer/Android.bp b/equalizer/Android.bp +index 2532599..074a6ac 100644 +--- a/equalizer/Android.bp ++++ b/equalizer/Android.bp +@@ -32,5 +32,6 @@ cc_library_shared { + visibility: [ + "//hardware/amlogic/yukawa/audio/apex/com.android.hardware.audio", + "//hardware/baylibre/audio/apex/com.android.hardware.audio", ++ "//glodroid/vendor/audio/apex/com.android.hardware.audio", + ], + } +diff --git a/eraser/Android.bp b/eraser/Android.bp +index c583d5a..f7eb210 100644 +--- a/eraser/Android.bp ++++ b/eraser/Android.bp +@@ -32,5 +32,6 @@ cc_library_shared { + visibility: [ + "//hardware/amlogic/yukawa/audio/apex/com.android.hardware.audio", + "//hardware/baylibre/audio/apex/com.android.hardware.audio", ++ "//glodroid/vendor/audio/apex/com.android.hardware.audio", + ], + } +diff --git a/extension/Android.bp b/extension/Android.bp +index e094b69..39b35fd 100644 +--- a/extension/Android.bp ++++ b/extension/Android.bp +@@ -32,5 +32,6 @@ cc_library_shared { + visibility: [ + "//hardware/amlogic/yukawa/audio/apex/com.android.hardware.audio", + "//hardware/baylibre/audio/apex/com.android.hardware.audio", ++ "//glodroid/vendor/audio/apex/com.android.hardware.audio", + ], + } +diff --git a/hapticGenerator/Android.bp b/hapticGenerator/Android.bp +index a76596d..02c0863 100644 +--- a/hapticGenerator/Android.bp ++++ b/hapticGenerator/Android.bp +@@ -32,6 +32,7 @@ cc_library_shared { + visibility: [ + "//hardware/amlogic/yukawa/audio/apex/com.android.hardware.audio", + "//hardware/baylibre/audio/apex/com.android.hardware.audio", ++ "//glodroid/vendor/audio/apex/com.android.hardware.audio", + ":__subpackages__", "//hardware/generic/audio/apex/com.android.hardware.audio", + ], + } +diff --git a/loudnessEnhancer/Android.bp b/loudnessEnhancer/Android.bp +index 1c291e7..83cfda5 100644 +--- a/loudnessEnhancer/Android.bp ++++ b/loudnessEnhancer/Android.bp +@@ -32,6 +32,7 @@ cc_library_shared { + visibility: [ + "//hardware/amlogic/yukawa/audio/apex/com.android.hardware.audio", + "//hardware/baylibre/audio/apex/com.android.hardware.audio", ++ "//glodroid/vendor/audio/apex/com.android.hardware.audio", + ":__subpackages__", "//hardware/generic/audio/apex/com.android.hardware.audio", + ], + } +diff --git a/noiseSuppression/Android.bp b/noiseSuppression/Android.bp +index 44b23f3..160203e 100644 +--- a/noiseSuppression/Android.bp ++++ b/noiseSuppression/Android.bp +@@ -32,5 +32,6 @@ cc_library_shared { + visibility: [ + "//hardware/amlogic/yukawa/audio/apex/com.android.hardware.audio", + "//hardware/baylibre/audio/apex/com.android.hardware.audio", ++ "//glodroid/vendor/audio/apex/com.android.hardware.audio", + ], + } +diff --git a/presetReverb/Android.bp b/presetReverb/Android.bp +index 5ea8977..0f7b3f0 100644 +--- a/presetReverb/Android.bp ++++ b/presetReverb/Android.bp +@@ -32,5 +32,6 @@ cc_library_shared { + visibility: [ + "//hardware/amlogic/yukawa/audio/apex/com.android.hardware.audio", + "//hardware/baylibre/audio/apex/com.android.hardware.audio", ++ "//glodroid/vendor/audio/apex/com.android.hardware.audio", + ], + } +diff --git a/spatializer/Android.bp b/spatializer/Android.bp +index 18210df..fca5511 100644 +--- a/spatializer/Android.bp ++++ b/spatializer/Android.bp +@@ -32,5 +32,6 @@ cc_library_shared { + visibility: [ + "//hardware/amlogic/yukawa/audio/apex/com.android.hardware.audio", + "//hardware/baylibre/audio/apex/com.android.hardware.audio", ++ "//glodroid/vendor/audio/apex/com.android.hardware.audio", + ], + } +diff --git a/virtualizer/Android.bp b/virtualizer/Android.bp +index 6989e4c..bb39a99 100644 +--- a/virtualizer/Android.bp ++++ b/virtualizer/Android.bp +@@ -32,5 +32,6 @@ cc_library_shared { + visibility: [ + "//hardware/amlogic/yukawa/audio/apex/com.android.hardware.audio", + "//hardware/baylibre/audio/apex/com.android.hardware.audio", ++ "//glodroid/vendor/audio/apex/com.android.hardware.audio", + ], + } +diff --git a/visualizer/Android.bp b/visualizer/Android.bp +index 83dfcf8..b2a9cef 100644 +--- a/visualizer/Android.bp ++++ b/visualizer/Android.bp +@@ -32,6 +32,7 @@ cc_library_shared { + visibility: [ + "//hardware/amlogic/yukawa/audio/apex/com.android.hardware.audio", + "//hardware/baylibre/audio/apex/com.android.hardware.audio", ++ "//glodroid/vendor/audio/apex/com.android.hardware.audio", + ":__subpackages__", "//hardware/generic/audio/apex/com.android.hardware.audio", + ], + } +diff --git a/volume/Android.bp b/volume/Android.bp +index 450fc83..e954e33 100644 +--- a/volume/Android.bp ++++ b/volume/Android.bp +@@ -32,5 +32,6 @@ cc_library_shared { + visibility: [ + "//hardware/amlogic/yukawa/audio/apex/com.android.hardware.audio", + "//hardware/baylibre/audio/apex/com.android.hardware.audio", ++ "//glodroid/vendor/audio/apex/com.android.hardware.audio", + ], + } +-- +2.51.0 + diff --git a/patches-aosp/glodroid/vendor/audio/0003-Add-audio_effects_config.xml-to-APEX-prebuilts.patch b/patches-aosp/glodroid/vendor/audio/0003-Add-audio_effects_config.xml-to-APEX-prebuilts.patch new file mode 100644 index 0000000..99c205e --- /dev/null +++ b/patches-aosp/glodroid/vendor/audio/0003-Add-audio_effects_config.xml-to-APEX-prebuilts.patch @@ -0,0 +1,49 @@ +From 3b9cb8330a356b93f34e2f6043c0573a815803a5 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Sat, 23 May 2026 12:18:04 +0300 +Subject: [PATCH 3/4] Add audio_effects_config.xml to APEX prebuilts + +The effect service binary (android.hardware.audio.effect.service-aidl.generic) +loads audio_effects_config.xml at startup. This file was missing from both +the prebuilt_etc build rules and the APEX prebuilts list, causing the service +to fail with 'config file audio_effects_config.xml not found'. + +AI assisted +--- + Android.bp | 7 +++++++ + apex/com.android.hardware.audio/Android.bp | 1 + + 2 files changed, 8 insertions(+) + +diff --git a/Android.bp b/Android.bp +index 934d62a..42ea889 100644 +--- a/Android.bp ++++ b/Android.bp +@@ -295,6 +295,13 @@ prebuilt_etc { + installable: false, + } + ++prebuilt_etc { ++ name: "baylibre_audio_effects_config.xml", ++ src: "audio_effects_config.xml", ++ filename: "audio_effects_config.xml", ++ installable: false, ++} ++ + prebuilt_etc { + name: "mixer_controls.xml", + src: "mixer_controls.xml", +diff --git a/apex/com.android.hardware.audio/Android.bp b/apex/com.android.hardware.audio/Android.bp +index 641a03a..6fb0c60 100644 +--- a/apex/com.android.hardware.audio/Android.bp ++++ b/apex/com.android.hardware.audio/Android.bp +@@ -39,6 +39,7 @@ apex { + prebuilts: [ + "android.hardware.audio.service-aidl.generic.rc", + "android.hardware.audio.service-aidl.generic.xml", ++ "baylibre_audio_effects_config.xml", + "mixer_controls.xml", + "mixer_controls.rpi4.xml", + "mixer_controls.rpi400.xml", +-- +2.51.0 + diff --git a/patches-aosp/glodroid/vendor/audio/0004-Add-SE-policies.patch b/patches-aosp/glodroid/vendor/audio/0004-Add-SE-policies.patch new file mode 100644 index 0000000..bb925ff --- /dev/null +++ b/patches-aosp/glodroid/vendor/audio/0004-Add-SE-policies.patch @@ -0,0 +1,64 @@ +From 5d223780fd3709805e1ae5e62c32f9f7c4ddaff3 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Sat, 23 May 2026 15:08:42 +0300 +Subject: [PATCH 4/4] Add SE policies + +AI assisted +--- + sepolicy/file.te | 2 ++ + sepolicy/genfs_contexts | 2 ++ + sepolicy/hal_audio_default.te | 5 +++++ + sepolicy/property.te | 2 ++ + sepolicy/property_contexts | 1 + + 5 files changed, 12 insertions(+) + create mode 100644 sepolicy/file.te + create mode 100644 sepolicy/genfs_contexts + create mode 100644 sepolicy/hal_audio_default.te + create mode 100644 sepolicy/property.te + create mode 100644 sepolicy/property_contexts + +diff --git a/sepolicy/file.te b/sepolicy/file.te +new file mode 100644 +index 0000000..0099415 +--- /dev/null ++++ b/sepolicy/file.te +@@ -0,0 +1,2 @@ ++# sysfs type for device tree compatible string ++type sysfs_dt_compatible, fs_type, sysfs_type; +diff --git a/sepolicy/genfs_contexts b/sepolicy/genfs_contexts +new file mode 100644 +index 0000000..ee8df72 +--- /dev/null ++++ b/sepolicy/genfs_contexts +@@ -0,0 +1,2 @@ ++# Label /sys/firmware/devicetree/base/compatible ++genfscon sysfs /firmware/devicetree/base/compatible u:object_r:sysfs_dt_compatible:s0 +diff --git a/sepolicy/hal_audio_default.te b/sepolicy/hal_audio_default.te +new file mode 100644 +index 0000000..7a1438c +--- /dev/null ++++ b/sepolicy/hal_audio_default.te +@@ -0,0 +1,5 @@ ++# Allow reading device tree compatible for RPi model detection ++allow hal_audio_default sysfs_dt_compatible:file r_file_perms; ++ ++# Allow setting vendor audio properties (persist.vendor.audio.*) ++set_prop(hal_audio_default, vendor_audio_prop) +diff --git a/sepolicy/property.te b/sepolicy/property.te +new file mode 100644 +index 0000000..35495cb +--- /dev/null ++++ b/sepolicy/property.te +@@ -0,0 +1,2 @@ ++# Vendor audio HAL properties (persist.vendor.audio.*) ++vendor_internal_prop(vendor_audio_prop) +diff --git a/sepolicy/property_contexts b/sepolicy/property_contexts +new file mode 100644 +index 0000000..6bfd201 +--- /dev/null ++++ b/sepolicy/property_contexts +@@ -0,0 +1 @@ ++persist.vendor.audio. u:object_r:vendor_audio_prop:s0 +-- +2.51.0 + diff --git a/patches-aosp/glodroid/vendor/drm_hwcomposer/0001-Exclude-Android.bps-by-adding-the-underscore-suffix.patch b/patches-aosp/glodroid/vendor/drm_hwcomposer/0001-Exclude-Android.bps-by-adding-the-underscore-suffix.patch deleted file mode 100644 index b6dd63b..0000000 --- a/patches-aosp/glodroid/vendor/drm_hwcomposer/0001-Exclude-Android.bps-by-adding-the-underscore-suffix.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 80b2dcfbc427e36eae768ebd2cc98cd58d6cc5c4 Mon Sep 17 00:00:00 2001 -From: Roman Stratiienko -Date: Thu, 17 Oct 2024 12:28:01 +0300 -Subject: [PATCH] Exclude Android.bps by adding the underscore suffix - -We're building it using AOSPEXT and don't want both -to interfare with each other. - -Signed-off-by: Roman Stratiienko ---- - Android.bp => Android.bp_ | 0 - tests/{Android.bp => Android.bp_} | 0 - 2 files changed, 0 insertions(+), 0 deletions(-) - rename Android.bp => Android.bp_ (100%) - rename tests/{Android.bp => Android.bp_} (100%) - -diff --git a/Android.bp b/Android.bp_ -similarity index 100% -rename from Android.bp -rename to Android.bp_ -diff --git a/tests/Android.bp b/tests/Android.bp_ -similarity index 100% -rename from tests/Android.bp -rename to tests/Android.bp_ --- -2.43.0 - diff --git a/patches-aosp/glodroid/vendor/libcamera/0001-Fix-build-errors.patch b/patches-aosp/glodroid/vendor/libcamera/0001-Fix-build-errors.patch new file mode 100644 index 0000000..2353fcd --- /dev/null +++ b/patches-aosp/glodroid/vendor/libcamera/0001-Fix-build-errors.patch @@ -0,0 +1,97 @@ +From 7158410cfa531024956603dbe827f554a0a63b22 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Sun, 24 May 2026 12:14:08 +0300 +Subject: [PATCH] Fix build errors + +--- + Android.bp | 2 -- + src/android/hal/device/LibcameraDevice.cpp | 12 ++++++------ + src/android/hal/device/LibcameraDeviceSession.cpp | 4 ++-- + 3 files changed, 8 insertions(+), 10 deletions(-) + +diff --git a/Android.bp b/Android.bp +index 77d44059..4bd7dc2f 100644 +--- a/Android.bp ++++ b/Android.bp +@@ -18,7 +18,6 @@ cc_defaults { + "-Werror", + "-Wshadow", + "-Wno-c99-designator", +- "-D_FORTIFY_SOURCE=2", + ], + cpp_std: "c++17", + cppflags: [ +@@ -27,7 +26,6 @@ cc_defaults { + "-DHAVE_LOCALE_T", + "-Wshadow", + "-Wno-c99-designator", +- "-D_FORTIFY_SOURCE=2", + "-Wextra-semi", + "-Wno-implicit-fallthrough", + /* Real path will be set via environment variables at runtime */ +diff --git a/src/android/hal/device/LibcameraDevice.cpp b/src/android/hal/device/LibcameraDevice.cpp +index c617396d..17f22fc8 100644 +--- a/src/android/hal/device/LibcameraDevice.cpp ++++ b/src/android/hal/device/LibcameraDevice.cpp +@@ -39,7 +39,7 @@ using ::android::hardware::camera::device::implementation::fromStatus; + + LibcameraDevice::LibcameraDevice( + sp module, const std::string& cameraId, +- const SortedVector>& cameraDeviceNames) ++ [[maybe_unused]] const SortedVector>& cameraDeviceNames) + : mModule(module), mCameraId(cameraId) { + mCameraIdInt = atoi(mCameraId.c_str()); + // Should not reach here as provider also validate ID +@@ -233,7 +233,7 @@ ndk::ScopedAStatus LibcameraDevice::open(const std::shared_ptrgetCameraInfo(mCameraIdInt, &info); + if (res != OK) { +- ALOGE("%s: Could not open camera: getCameraInfo failed"); ++ ALOGE("%s: Could not open camera: getCameraInfo failed", __FUNCTION__); + device->common.close(&device->common); + _aidl_return = nullptr; + return fromStatus(Status::ILLEGAL_ARGUMENT); +@@ -260,8 +260,8 @@ ndk::ScopedAStatus LibcameraDevice::open(const std::shared_ptr& in_callback, +- std::shared_ptr* _aidl_return) { ++ [[maybe_unused]] const std::shared_ptr& in_callback, ++ [[maybe_unused]] std::shared_ptr* _aidl_return) { + _aidl_return = nullptr; + return fromStatus(Status::OPERATION_NOT_SUPPORTED); + } +@@ -278,12 +278,12 @@ ndk::ScopedAStatus LibcameraDevice::setTorchMode(bool in_on) { + return fromStatus(status); + } + +-ndk::ScopedAStatus LibcameraDevice::turnOnTorchWithStrengthLevel(int32_t in_torchStrength) { ++ndk::ScopedAStatus LibcameraDevice::turnOnTorchWithStrengthLevel([[maybe_unused]] int32_t in_torchStrength) { + // not supported by hardware module + return fromStatus(Status::OPERATION_NOT_SUPPORTED); + } + +-ndk::ScopedAStatus LibcameraDevice::getTorchStrengthLevel(int32_t* _aidl_return) { ++ndk::ScopedAStatus LibcameraDevice::getTorchStrengthLevel([[maybe_unused]] int32_t* _aidl_return) { + // not supported by hardware module + _aidl_return = nullptr; + return fromStatus(Status::OPERATION_NOT_SUPPORTED); +diff --git a/src/android/hal/device/LibcameraDeviceSession.cpp b/src/android/hal/device/LibcameraDeviceSession.cpp +index a2e7b731..3845c7ba 100644 +--- a/src/android/hal/device/LibcameraDeviceSession.cpp ++++ b/src/android/hal/device/LibcameraDeviceSession.cpp +@@ -1778,8 +1778,8 @@ ScopedAStatus LibcameraDeviceSession::signalStreamFlush(const std::vector& in_streamsToKeep, +- CameraOfflineSessionInfo* out_offlineSessionInfo, ++ [[maybe_unused]] const std::vector& in_streamsToKeep, ++ [[maybe_unused]] CameraOfflineSessionInfo* out_offlineSessionInfo, + std::shared_ptr* _aidl_return) { + ALOGI("%s()", __func__); + *_aidl_return = nullptr; +-- +2.51.0 + diff --git a/patches-aosp/glodroid/vendor/libcamera/0001-HACK-Use-minigbm-handle-structure-to-obtain-strides-.patch b/patches-aosp/glodroid/vendor/libcamera/0001-HACK-Use-minigbm-handle-structure-to-obtain-strides-.patch deleted file mode 100644 index c739411..0000000 --- a/patches-aosp/glodroid/vendor/libcamera/0001-HACK-Use-minigbm-handle-structure-to-obtain-strides-.patch +++ /dev/null @@ -1,145 +0,0 @@ -From c8e21697b2d55abc59bead13bca2d08132503ce2 Mon Sep 17 00:00:00 2001 -From: Roman Stratiienko -Date: Thu, 4 Nov 2021 14:42:00 +0200 -Subject: [PATCH 1/3] HACK: Use minigbm handle structure to obtain - strides/offsets/sizes - -Signed-off-by: Roman Stratiienko ---- - src/android/mm/cros_gralloc_handle.h | 51 ++++++++++++++++++++++++ - src/android/mm/generic_camera_buffer.cpp | 30 ++++++-------- - 2 files changed, 64 insertions(+), 17 deletions(-) - create mode 100644 src/android/mm/cros_gralloc_handle.h - -diff --git a/src/android/mm/cros_gralloc_handle.h b/src/android/mm/cros_gralloc_handle.h -new file mode 100644 -index 00000000..2b70d4ba ---- /dev/null -+++ b/src/android/mm/cros_gralloc_handle.h -@@ -0,0 +1,51 @@ -+/* -+ * Copyright 2016 The Chromium OS Authors. All rights reserved. -+ * Use of this source code is governed by a BSD-style license that can be -+ * found in the LICENSE file. -+ */ -+ -+#ifndef CROS_GRALLOC_HANDLE_H -+#define CROS_GRALLOC_HANDLE_H -+ -+#include -+#include -+ -+#define DRV_MAX_PLANES 4 -+#define DRV_MAX_FDS (DRV_MAX_PLANES + 1) -+ -+struct cros_gralloc_handle : public native_handle_t { -+ /* -+ * File descriptors must immediately follow the native_handle_t base and used file -+ * descriptors must be packed at the beginning of this array to work with -+ * native_handle_clone(). -+ * -+ * This field contains 'num_planes' plane file descriptors followed by an optional metadata -+ * reserved region file descriptor if 'reserved_region_size' is greater than zero. -+ */ -+ int32_t fds[DRV_MAX_FDS]; -+ uint32_t strides[DRV_MAX_PLANES]; -+ uint32_t offsets[DRV_MAX_PLANES]; -+ uint32_t sizes[DRV_MAX_PLANES]; -+ uint32_t id; -+ uint32_t width; -+ uint32_t height; -+ uint32_t format; /* DRM format */ -+ uint32_t tiling; -+ uint64_t format_modifier; -+ uint64_t use_flags; /* Buffer creation flags */ -+ uint32_t magic; -+ uint32_t pixel_stride; -+ int32_t droid_format; -+ int32_t usage; /* Android usage. */ -+ uint32_t num_planes; -+ uint64_t reserved_region_size; -+ uint64_t total_size; /* Total allocation size */ -+ /* -+ * Name is a null terminated char array located at handle->base.data[handle->name_offset]. -+ */ -+ uint32_t name_offset; -+} __attribute__((packed)); -+ -+typedef const struct cros_gralloc_handle *cros_gralloc_handle_t; -+ -+#endif -diff --git a/src/android/mm/generic_camera_buffer.cpp b/src/android/mm/generic_camera_buffer.cpp -index 1bd7090d..dd78d5f0 100644 ---- a/src/android/mm/generic_camera_buffer.cpp -+++ b/src/android/mm/generic_camera_buffer.cpp -@@ -10,6 +10,8 @@ - #include - #include - -+#include "cros_gralloc_handle.h" -+ - #include - - #include "libcamera/internal/formats.h" -@@ -70,6 +72,8 @@ CameraBuffer::Private::Private([[maybe_unused]] CameraBuffer *cameraBuffer, - return; - } - -+ auto cros_handle = reinterpret_cast(camera3Buffer); -+ - /* - * As Android doesn't offer an API to query buffer layouts, assume for - * now that the buffer is backed by a single dmabuf, with planes being -@@ -79,13 +83,7 @@ CameraBuffer::Private::Private([[maybe_unused]] CameraBuffer *cameraBuffer, - if (camera3Buffer->data[i] == -1 || camera3Buffer->data[i] == fd_) - continue; - -- if (fd_ != -1) { -- error_ = -EINVAL; -- LOG(HAL, Error) << "Discontiguous planes are not supported"; -- return; -- } -- -- fd_ = camera3Buffer->data[i]; -+ fd_ = camera3Buffer->data[0]; - } - - if (fd_ == -1) { -@@ -101,26 +99,24 @@ CameraBuffer::Private::Private([[maybe_unused]] CameraBuffer *cameraBuffer, - return; - } - -- const unsigned int numPlanes = info.numPlanes(); -+ const unsigned int numPlanes = cros_handle->num_planes; - planeInfo_.resize(numPlanes); - -- unsigned int offset = 0; - for (unsigned int i = 0; i < numPlanes; ++i) { -- const unsigned int planeSize = info.planeSize(size, i); -+ const unsigned int planeSize = cros_handle->sizes[i]; - -- planeInfo_[i].stride = info.stride(size.width, i, 1u); -- planeInfo_[i].offset = offset; -- planeInfo_[i].size = planeSize; -+ planeInfo_[i].stride = cros_handle->strides[i]; -+ planeInfo_[i].offset = cros_handle->offsets[i]; -+ planeInfo_[i].size = cros_handle->sizes[i]; - -- if (bufferLength_ < offset + planeSize) { -+ if (bufferLength_ < planeInfo_[i].offset + planeInfo_[i].size) { - LOG(HAL, Error) << "Plane " << i << " is out of buffer:" -- << " plane offset=" << offset -- << ", plane size=" << planeSize -+ << " plane offset=" << planeInfo_[i].offset -+ << ", plane size=" << planeInfo_[i].size - << ", buffer length=" << bufferLength_; - return; - } - -- offset += planeSize; - } - } - --- -2.40.1 - diff --git a/patches-aosp/glodroid/vendor/libcamera/0002-GLODROID-Don-t-add-ljpeg-argument-when-building-liby.patch b/patches-aosp/glodroid/vendor/libcamera/0002-GLODROID-Don-t-add-ljpeg-argument-when-building-liby.patch deleted file mode 100644 index 5ba1506..0000000 --- a/patches-aosp/glodroid/vendor/libcamera/0002-GLODROID-Don-t-add-ljpeg-argument-when-building-liby.patch +++ /dev/null @@ -1,29 +0,0 @@ -From f1d641c3c2c3273df0ce784cda29f3a0de8e4aa0 Mon Sep 17 00:00:00 2001 -From: Roman Stratiienko -Date: Sat, 3 Dec 2022 13:02:08 +0200 -Subject: [PATCH 2/3] GLODROID: Don't add -ljpeg argument when building libyuv - as subproject - -We don't have sysroot with libdir when building within AOSP. -Instead all dependencies are linked directly as path/lib.so link argument. - -Signed-off-by: Roman Stratiienko ---- - src/android/meson.build | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/src/android/meson.build b/src/android/meson.build -index 68646120..9b83acaa 100644 ---- a/src/android/meson.build -+++ b/src/android/meson.build -@@ -29,7 +29,6 @@ if not libyuv_dep.found() - '-Wno-sign-compare', - '-Wno-unused-variable', - '-Wno-unused-parameter') -- libyuv_vars.append_link_args('-ljpeg') - libyuv = cmake.subproject('libyuv', options : libyuv_vars) - libyuv_dep = libyuv.dependency('yuv') - endif --- -2.40.1 - diff --git a/patches-aosp/glodroid/vendor/libcamera/0003-HACK-Support-for-RaspberryPI.patch b/patches-aosp/glodroid/vendor/libcamera/0003-HACK-Support-for-RaspberryPI.patch deleted file mode 100644 index 2446d82..0000000 --- a/patches-aosp/glodroid/vendor/libcamera/0003-HACK-Support-for-RaspberryPI.patch +++ /dev/null @@ -1,41 +0,0 @@ -From c91a61462c4a1c7a017975997c0816d6866bcea0 Mon Sep 17 00:00:00 2001 -From: Roman Stratiienko -Date: Mon, 7 Aug 2023 16:13:56 +0300 -Subject: [PATCH 3/3] HACK: Support for RaspberryPI - -Signed-off-by: Roman Stratiienko ---- - src/android/camera_stream.cpp | 3 +++ - src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 2 +- - 2 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp -index 045e6006..3600ec56 100644 ---- a/src/android/camera_stream.cpp -+++ b/src/android/camera_stream.cpp -@@ -132,6 +132,9 @@ int CameraStream::configure() - mutex_ = std::make_unique(); - - camera3Stream_->max_buffers = configuration().bufferCount; -+ // Android requires at least one buffer -+ if (camera3Stream_->max_buffers == 0) -+ camera3Stream_->max_buffers = 1; - - return 0; - } -diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp -index e0bedcd8..e0458a42 100644 ---- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp -+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp -@@ -297,7 +297,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate() - return Invalid; - - if (RPi::PipelineHandlerBase::updateStreamConfig(out.cfg, out.format)) -- status = Adjusted; -+ status = status;// Adjusted; - } - - return status; --- -2.40.1 - diff --git a/patches-aosp/glodroid/vendor/mesa3d/0001-HACK-utils-Set-cache-type-back-to-DISK_CACHE_MULTI_F.patch b/patches-aosp/glodroid/vendor/mesa3d/0001-HACK-utils-Set-cache-type-back-to-DISK_CACHE_MULTI_F.patch index 0134877..12d48c4 100644 --- a/patches-aosp/glodroid/vendor/mesa3d/0001-HACK-utils-Set-cache-type-back-to-DISK_CACHE_MULTI_F.patch +++ b/patches-aosp/glodroid/vendor/mesa3d/0001-HACK-utils-Set-cache-type-back-to-DISK_CACHE_MULTI_F.patch @@ -1,37 +1,45 @@ -From 711bdf59ceab2f5c4453646f18b4ef880f59a387 Mon Sep 17 00:00:00 2001 +From 094ca21cc59987cb6597cd3b9e028ab43e06e66c Mon Sep 17 00:00:00 2001 From: Roman Stratiienko -Date: Thu, 12 Dec 2024 00:42:12 +0200 +Date: Fri, 22 May 2026 22:18:40 +0300 Subject: [PATCH] HACK: utils: Set cache type back to DISK_CACHE_MULTI_FILE This avoids minijail issue that can be observerd when audiocodecs allocate the memory via gbm. -Change-Id: I6a966eab3f0db092fd5d3f3cfa3a94f1595a0e60 +Change-Id: I5e4246421f2170d30f9171dc3b3eb288c543c8cd Signed-off-by: Roman Stratiienko --- - src/util/disk_cache.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) + src/util/disk_cache.c | 17 +---------------- + 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c -index 940b0a04145..a9ee3d49cd3 100644 +index 1f4338820dd..8035ac11270 100644 --- a/src/util/disk_cache.c +++ b/src/util/disk_cache.c -@@ -274,12 +274,12 @@ disk_cache_create(const char *gpu_name, const char *driver_id, - else if (debug_get_bool_option("MESA_DISK_CACHE_MULTI_FILE", false)) - cache_type = DISK_CACHE_MULTI_FILE; - else { +@@ -223,22 +223,7 @@ disk_cache_create(const char *gpu_name, const char *driver_id, + uint64_t max_size = 0; + const char *max_size_str; + +- if (debug_get_bool_option("MESA_DISK_CACHE_SINGLE_FILE", false)) { +- cache_type = DISK_CACHE_SINGLE_FILE; +- } else if (debug_get_bool_option("MESA_DISK_CACHE_DATABASE", false)) { - cache_type = DISK_CACHE_DATABASE; -+ cache_type = DISK_CACHE_MULTI_FILE; - /* Since switching the default cache to , remove the - * old cache folder if it hasn't been modified for more than 7 days. - */ -- if (!getenv("MESA_SHADER_CACHE_DIR") && !getenv("MESA_GLSL_CACHE_DIR")) +- /* Since switching the default cache to , remove the +- * old cache folder if it hasn't been modified for more than 7 days. +- */ +- if (!os_get_option("MESA_SHADER_CACHE_DIR") && !os_get_option("MESA_GLSL_CACHE_DIR") && +- disk_cache_enabled()) - disk_cache_delete_old_cache(); -+ //if (!getenv("MESA_SHADER_CACHE_DIR") && !getenv("MESA_GLSL_CACHE_DIR")) -+ //disk_cache_delete_old_cache(); - } +- } else if (debug_get_bool_option("MESA_DISK_CACHE_MULTI_FILE", true)) { +- cache_type = DISK_CACHE_MULTI_FILE; +- } else { +- return NULL; +- } +- ++ cache_type = DISK_CACHE_MULTI_FILE; + max_size_str = os_get_option("MESA_SHADER_CACHE_MAX_SIZE"); - /* Create main writable cache. */ + if (!max_size_str) { -- -2.43.0 +2.51.0 diff --git a/patches-aosp/glodroid/vendor/tinyhal/0001-GLODROID-config-Distinguish-between-rpi4b-and-rpi400.patch b/patches-aosp/glodroid/vendor/tinyhal/0001-GLODROID-config-Distinguish-between-rpi4b-and-rpi400.patch deleted file mode 100644 index 3f489e6..0000000 --- a/patches-aosp/glodroid/vendor/tinyhal/0001-GLODROID-config-Distinguish-between-rpi4b-and-rpi400.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 908728c07755c65c99acfae3d5c15de530d8aaf9 Mon Sep 17 00:00:00 2001 -From: Roman Stratiienko -Date: Sun, 2 Apr 2023 01:51:49 +0300 -Subject: [PATCH] GLODROID: config: Distinguish between rpi4b and rpi400 board - variants. - -Patch is temporary solution for raspberry-pi 400 to bypass audio. - -Change-Id: I13cd26048d8a33ddc2d4b862a27fa10fd59cd676 -Signed-off-by: Roman Stratiienko ---- - audio/audio_hw.c | 32 ++++++++++++++++++++++++++++++-- - 1 file changed, 30 insertions(+), 2 deletions(-) - -diff --git a/audio/audio_hw.c b/audio/audio_hw.c -index 3aa24b0..e1e94c5 100644 ---- a/audio/audio_hw.c -+++ b/audio/audio_hw.c -@@ -2471,8 +2471,36 @@ static int adev_open(const hw_module_t *module, const char *name, - adev->hw_device.close_input_stream = adev_close_input_stream; - adev->hw_device.dump = adev_dump; - -- property_get("ro.product.device", property, "generic"); -- snprintf(file_name, sizeof(file_name), "%s/audio.%s.xml", ETC_PATH, property); -+ int f = open("/sys/firmware/devicetree/base/compatible", O_RDONLY); -+ if (f < 0) { -+ ret = -errno; -+ ALOGE("Failed to open /sys/firmware/devicetree/base/compatible"); -+ goto fail; -+ } -+ -+ char buf[256]; -+ memset(buf, 0, sizeof(buf)); -+ int len = read(f, buf, sizeof(buf)); -+ if (len < 0) { -+ ret = -errno; -+ ALOGE("Failed to read /sys/firmware/devicetree/base/compatible"); -+ goto fail; -+ } -+ -+ close(f); -+ -+ char *config_name; -+ const char RPI400_COMPAT[] = "raspberrypi,400"; -+ if (strncmp(buf, RPI400_COMPAT, sizeof(RPI400_COMPAT) - 1) == 0) { -+ config_name = "rpi400"; -+ } else { -+ config_name = "rpi4"; -+ } -+ -+ ALOGI("Compatible is '%s', using config '%s'", buf, config_name); -+ -+// property_get("ro.product.device", property, "generic"); -+ snprintf(file_name, sizeof(file_name), "%s/audio.%s.xml", ETC_PATH, config_name); - - ALOGV("Reading configuration from %s\n", file_name); - adev->cm = init_audio_config(file_name); --- -2.34.1 - diff --git a/patches-aosp/hardware/interfaces/0002-HCI-Fix-improper-rfkill-handling.patch b/patches-aosp/hardware/interfaces/0002-HCI-Fix-improper-rfkill-handling.patch deleted file mode 100644 index cd2c1ae..0000000 --- a/patches-aosp/hardware/interfaces/0002-HCI-Fix-improper-rfkill-handling.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 100e07a6bd96c34c87013f1ef7d1e0ed1f094f27 Mon Sep 17 00:00:00 2001 -From: Roman Stratiienko -Date: Thu, 12 Dec 2024 05:19:03 +0200 -Subject: [PATCH 2/2] HCI: Fix improper rfkill handling - -Current behavior with kernel rfkill module loaded produces a cascade of -crash events starting from the following logcat error: - - unable to bind bluetooth user channel: Operation not possible due to RF-kill - -However, the same device configuration worked well with btlinux HAL, -which I assume was used as a base for this HAL. - -After some investigation, I found that the rfkill(1) function call in the -btlinux call changed the state to 1, which is RFKILL_STATE_UNBLOCKED. -The current rfkill(1) sets the soft block value to 1, which corresponds -to the state value 0 (RFKILL_STATE_SOFT_BLOCKED). - -Fix it by providing the correct values to the rfkill() call. - -Change-Id: I7a62744f9c21d80b9f8fa37f6c172afa2a5b6c8a -Signed-off-by: Roman Stratiienko ---- - bluetooth/aidl/default/net_bluetooth_mgmt.cpp | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/bluetooth/aidl/default/net_bluetooth_mgmt.cpp b/bluetooth/aidl/default/net_bluetooth_mgmt.cpp -index 24693effcd..6b0cd63166 100644 ---- a/bluetooth/aidl/default/net_bluetooth_mgmt.cpp -+++ b/bluetooth/aidl/default/net_bluetooth_mgmt.cpp -@@ -259,8 +259,8 @@ int NetBluetoothMgmt::rfkill(int block) { - int NetBluetoothMgmt::openHci(int hci_interface) { - ALOGI("opening hci interface %d", hci_interface); - -- // Block Bluetooth. -- rfkill(1); -+ // Unblock Bluetooth. -+ rfkill(0); - - // Wait for the HCI interface to complete initialization or to come online. - int hci = waitHciDev(hci_interface); -@@ -300,8 +300,8 @@ void NetBluetoothMgmt::closeHci() { - bt_fd_ = -1; - } - -- // Unblock Bluetooth. -- rfkill(0); -+ // Block Bluetooth. -+ rfkill(1); - } - - } // namespace aidl::android::hardware::bluetooth::impl --- -2.43.0 - diff --git a/patches-aosp/system/core/0001-RFC-Fix-boot-from-one-mmc-dev-while-android-present-.patch b/patches-aosp/system/core/0001-RFC-Fix-boot-from-one-mmc-dev-while-android-present-.patch deleted file mode 100644 index 1da1381..0000000 --- a/patches-aosp/system/core/0001-RFC-Fix-boot-from-one-mmc-dev-while-android-present-.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 993056a3a0e0b8fc8722fcd0dc94ab5981794ce8 Mon Sep 17 00:00:00 2001 -From: Roman Stratiienko -Date: Tue, 21 Mar 2023 23:28:07 +0200 -Subject: [PATCH] RFC: Fix boot from one mmc dev while android present on - another mmc dev. - -TODO: Send a bug report to Google. - -The 'device_handler_->HandleUevent(uevent);' function may not process -the uevent (e.g. different path in androidboot.boot_devices cmdline -argumment is specified). - -Current code logic will remove the partition names from devices list -and stop processing uevents even if no symlink is created. - -Current patch workarounds an issue, but proper fix is required. - -Change-Id: I516c3697b96eaddac920104c0f56d95df5c9c649 -Signed-off-by: Roman Stratiienko ---- - init/block_dev_initializer.cpp | 9 ++++----- - 1 file changed, 4 insertions(+), 5 deletions(-) - -diff --git a/init/block_dev_initializer.cpp b/init/block_dev_initializer.cpp -index 05e00edfd..e03a2a663 100644 ---- a/init/block_dev_initializer.cpp -+++ b/init/block_dev_initializer.cpp -@@ -91,16 +91,15 @@ ListenerAction BlockDevInitializer::HandleUevent(const Uevent& uevent, - if (!partition_name.empty()) { - iter = devices->find(partition_name); - } -- if (iter == devices->end()) { -- return ListenerAction::kContinue; -- } -+ } -+ if (iter != devices->end()) { -+ devices->erase(iter); - } - - LOG(VERBOSE) << __PRETTY_FUNCTION__ << ": found partition: " << name; - -- devices->erase(iter); - device_handler_->HandleUevent(uevent); -- return devices->empty() ? ListenerAction::kStop : ListenerAction::kContinue; -+ return ListenerAction::kContinue; - } - - bool BlockDevInitializer::InitDevices(std::set devices) { --- -2.34.1 - diff --git a/unfold_aosp.sh b/unfold_aosp.sh index f562fd0..e6ef5f5 100755 --- a/unfold_aosp.sh +++ b/unfold_aosp.sh @@ -4,7 +4,7 @@ LOCAL_PATH=$(pwd) echo Init repo tree using AOSP manifest pushd aosptree -repo init -u https://android.googlesource.com/platform/manifest -b refs/tags/android-platform-15.0.0_r3 ${GD_REPO_INIT_ARGS} +repo init -u https://android.googlesource.com/platform/manifest -b refs/tags/android-16.0.0_r4 ${GD_REPO_INIT_ARGS} cd .repo/manifests mv default.xml aosp.xml cp ${LOCAL_PATH}/manifests/glodroid.xml glodroid.xml