Skip to content

arpi 10 : framework patch

Peter Yoon edited this page Apr 28, 2022 · 1 revision

Use GuidedActionEditText for TvSettings password input

To enable Keyboard enter-key for Wifi password entrance,

Apply following patch under packages/apps/TvSettings

Settings/res/layout/setup_password_item.xml
@@ line 35
-   <EditText
+   <androidx.leanback.widget.GuidedActionEditText
        android:id="@+id/guidedactions_item_title"
        style="@style/Setup.Action.TextInput"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:focusable="true"
        android:gravity="center_vertical"
        android:imeOptions="actionNext|flagNoExtractUi"
+       android:inputType="text" />
-       android:inputType="text">
-   </EditText>

Disable Low Power Mode of Bluetooth

Workaround for bt_hci timeout. From https://github.com/android-rpi/device_arpi_rpi4/issues/25#issuecomment-673996293

Apply following patch under hardware/interfaces

bluetooth/1.0/default/vendor_interface.cc
@@ line 342 @@ void VendorInterface::OnFirmwareConfigured(
   lib_interface_->op(BT_VND_OP_GET_LPM_IDLE_TIMEOUT, &lpm_timeout_ms);
   ALOGI("%s: lpm_timeout_ms %d", __func__, lpm_timeout_ms);

-  bt_vendor_lpm_mode_t mode = BT_VND_LPM_ENABLE;
+  bt_vendor_lpm_mode_t mode = BT_VND_LPM_DISABLE;
   lib_interface_->op(BT_VND_OP_LPM_SET_MODE, &mode);

Enable Legacy SW video decoder

HW decoder and Codec2 SW decoder are not supported yet.

Legacy stagefright SW decoder could be enabled by applying following changes under frameworks/av

media/libstagefright/colorconversion/SoftwareRenderer.cpp
@@ line 128 @@ void SoftwareRenderer::resetFormatIfChanged(
     case OMX_COLOR_FormatYUV420Planar:
+        {
+            halFormat = HAL_PIXEL_FORMAT_RGBA_8888;
+            bufWidth = (mCropWidth + 1) & ~1;
+            bufHeight = (mCropHeight + 1) & ~1;
+            break;
+        }
     case OMX_COLOR_FormatYUV420SemiPlanar:
@@ line 182
         CHECK(mConverter->isValid());
+    } else if (halFormat == HAL_PIXEL_FORMAT_RGBA_8888 &&
+            mColorFormat == OMX_COLOR_FormatYUV420Planar) {
+        mConverter = new ColorConverter(
+                mColorFormat, OMX_COLOR_Format32BitRGBA8888);
+        CHECK(mConverter->isValid());
     }



media/codec2/vndk/C2Store.cpp
@@ line 851 @@ C2PlatformComponentStore::C2PlatformComponentStore()
     //emplace("libcodec2_soft_av1dec_aom.so"); // deprecated for the gav1 implementation
-    emplace("libcodec2_soft_av1dec_gav1.so");
-    emplace("libcodec2_soft_avcdec.so");
     emplace("libcodec2_soft_avcenc.so");
@@ line 873
     emplace("libcodec2_soft_vp8enc.so");
-    emplace("libcodec2_soft_vp9dec.so");
     emplace("libcodec2_soft_vp9enc.so");

Video decoding could be tested by 'adb install Cobalt_arm32.apk'

The apk is built from https://www.cobalt.dev/development/setup-android.html