From b3428d18d277ab7b9388b0c476d5cc1f1faa55e9 Mon Sep 17 00:00:00 2001 From: Konsta Date: Wed, 6 Oct 2021 11:20:34 +0300 Subject: [PATCH 1/3] HACK: rpi4: disable bluetooth low power mode * https://github.com/android-rpi/device_arpi_rpi4/wiki/arpi-12-:-framework-patch#disable-low-power-mode-of-bluetooth Change-Id: I17344d16d8520a1c70a13609d6cbe93b5911a339 --- bluetooth/1.0/default/vendor_interface.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bluetooth/1.0/default/vendor_interface.cc b/bluetooth/1.0/default/vendor_interface.cc index 1d15dd6f11..5d23efe9b0 100644 --- a/bluetooth/1.0/default/vendor_interface.cc +++ b/bluetooth/1.0/default/vendor_interface.cc @@ -347,7 +347,7 @@ void VendorInterface::OnFirmwareConfigured(uint8_t result) { 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); ALOGD("%s Calling StartLowPowerWatchdog()", __func__); From 74d8122db39196b8305672c4d4e34e65b61a3d9d Mon Sep 17 00:00:00 2001 From: Konsta Date: Sat, 20 Aug 2022 18:28:56 +0300 Subject: [PATCH 2/3] HACK: rpi4: add hardware reset when disabling bluetooth * https://github.com/android-rpi/device_arpi_rpi4/wiki/arpi-12-:-framework-patch#add-hw-reset-on-bluetooth-hci-startup_timer_expired Change-Id: I7d25dc056e176aa4d2c021ac4e67c4dbfb8e82de --- bluetooth/1.0/default/vendor_interface.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bluetooth/1.0/default/vendor_interface.cc b/bluetooth/1.0/default/vendor_interface.cc index 5d23efe9b0..35ea82d1d3 100644 --- a/bluetooth/1.0/default/vendor_interface.cc +++ b/bluetooth/1.0/default/vendor_interface.cc @@ -277,6 +277,18 @@ bool VendorInterface::Open(InitializeCompleteCallback initialize_complete_cb, return true; } +#include +#include +static void hw_reset(bool reset) { + unsigned buf[8] = { 8 * 4, 0, 0x38041, 8, 8, 128, 0, 0}; + buf[6] = reset ? 0 : 1; + int fd = open("/dev/vcio", 0); + if (fd >= 0) { + ioctl(fd, _IOWR(100, 0, char *), buf); + close(fd); + } +} + void VendorInterface::Close() { // These callbacks may send HCI events (vendor-dependent), so make sure to // StopWatching the file descriptor after this. @@ -311,6 +323,10 @@ void VendorInterface::Close() { delete firmware_startup_timer_; firmware_startup_timer_ = nullptr; } + + hw_reset(true); + sleep(2); + hw_reset(false); } size_t VendorInterface::Send(uint8_t type, const uint8_t* data, size_t length) { From fe6467153428b65e12d3bc8833412339932efb4c Mon Sep 17 00:00:00 2001 From: cornwarecjp Date: Thu, 11 May 2023 14:36:54 +0200 Subject: [PATCH 3/3] Increase the maximum allowed camera buffer size Some cameras report a much larger image size than needed. This change makes the code more accepting towards the reported value, so that it doesn't fail on these cameras. --- .../include/ext_device_v3_4_impl/ExternalCameraDeviceSession.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/camera/device/3.4/default/include/ext_device_v3_4_impl/ExternalCameraDeviceSession.h b/camera/device/3.4/default/include/ext_device_v3_4_impl/ExternalCameraDeviceSession.h index 184c16e591..1219ef9c25 100644 --- a/camera/device/3.4/default/include/ext_device_v3_4_impl/ExternalCameraDeviceSession.h +++ b/camera/device/3.4/default/include/ext_device_v3_4_impl/ExternalCameraDeviceSession.h @@ -109,7 +109,7 @@ struct ExternalCameraDeviceSession : public virtual RefBase, static const int kMaxProcessedStream = 2; static const int kMaxStallStream = 1; - static const uint32_t kMaxBytesPerPixel = 2; + static const uint32_t kMaxBytesPerPixel = 4; class OutputThread : public android::Thread { public: