Sync up to v309

This commit is contained in:
Andy CrossGate Yan 2021-06-17 13:27:15 +00:00
parent 04747ed5c6
commit e3d1f63058
3 changed files with 85 additions and 66 deletions

View File

@ -1,66 +0,0 @@
From f3953cb4a425f0e91b52f5f23d54c0a09162815f Mon Sep 17 00:00:00 2001
From: wangchenyang <daniellingyx@gmail.com>
Date: Thu, 24 Dec 2020 16:55:50 +0800
Subject: [PATCH 18/30] Codec2: Initialize InputSurfaceWrapper::Config
structure fields
Initialize the fields of Config structure of
InputSurfaceWrapper class. If not initialised, there
is a chance of junk values being used during configure
Bug: 171763471
Bug: 175443996
Test: TH
Change-Id: Id5ac827df0c2ef6ad761ab5a235162a9358c1704
(cherry picked from commit a1ab7eb891728b77cc4bf03fedd21574bd8ec586)
---
media/codec2/sfplugin/InputSurfaceWrapper.h | 28 ++++++++++-----------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/media/codec2/sfplugin/InputSurfaceWrapper.h b/media/codec2/sfplugin/InputSurfaceWrapper.h
index bb35763f41..479acb109b 100644
--- a/media/codec2/sfplugin/InputSurfaceWrapper.h
+++ b/media/codec2/sfplugin/InputSurfaceWrapper.h
@@ -61,24 +61,24 @@ public:
/// Input Surface configuration
struct Config {
// IN PARAMS (GBS)
- float mMinFps; // minimum fps (repeat frame to achieve this)
- float mMaxFps; // max fps (via frame drop)
- float mCaptureFps; // capture fps
- float mCodedFps; // coded fps
- bool mSuspended; // suspended
- int64_t mTimeOffsetUs; // time offset (input => codec)
- int64_t mSuspendAtUs; // suspend/resume time
- int64_t mStartAtUs; // start time
- bool mStopped; // stopped
- int64_t mStopAtUs; // stop time
+ float mMinFps = 0.0; // minimum fps (repeat frame to achieve this)
+ float mMaxFps = 0.0; // max fps (via frame drop)
+ float mCaptureFps = 0.0; // capture fps
+ float mCodedFps = 0.0; // coded fps
+ bool mSuspended = false; // suspended
+ int64_t mTimeOffsetUs = 0; // time offset (input => codec)
+ int64_t mSuspendAtUs = 0; // suspend/resume time
+ int64_t mStartAtUs = 0; // start time
+ bool mStopped = false; // stopped
+ int64_t mStopAtUs = 0; // stop time
// OUT PARAMS (GBS)
- int64_t mInputDelayUs; // delay between encoder input and surface input
+ int64_t mInputDelayUs = 0; // delay between encoder input and surface input
// IN PARAMS (CODEC WRAPPER)
- float mFixedAdjustedFps; // fixed fps via PTS manipulation
- float mMinAdjustedFps; // minimum fps via PTS manipulation
- uint64_t mUsage; // consumer usage
+ float mFixedAdjustedFps = 0.0; // fixed fps via PTS manipulation
+ float mMinAdjustedFps = 0.0; // minimum fps via PTS manipulation
+ uint64_t mUsage = 0; // consumer usage
};
/**
--
2.25.1

View File

@ -0,0 +1,54 @@
From bf7c5e06d196b9863c1cc61fa073442c353f5075 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@cryptomilk.org>
Date: Mon, 7 Jun 2021 13:23:02 -0400
Subject: [PATCH] On Samsung devices, we need to tell Audio HAL if we're
running narrow band or wide band
Change-Id: Ibfa0f632d9acbb920a85a613ce4e2f1d26556bd1
---
.../android/bluetooth/hfp/HeadsetStateMachine.java | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/com/android/bluetooth/hfp/HeadsetStateMachine.java b/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
index 8a6bc5527..667f215b6 100644
--- a/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
+++ b/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
@@ -82,6 +82,9 @@ public class HeadsetStateMachine extends StateMachine {
private static final String HEADSET_WBS = "bt_wbs";
private static final String HEADSET_AUDIO_FEATURE_ON = "on";
private static final String HEADSET_AUDIO_FEATURE_OFF = "off";
+ private static final String HEADSET_G_SCO_SAMPLERATE = "g_sco_samplerate";
+ private static final String HEADSET_G_WB_SAMPLERATE = "16000";
+ private static final String HEADSET_G_NB_SAMPLERATE = "8000";
static final int CONNECT = 1;
static final int DISCONNECT = 2;
@@ -1511,6 +1514,12 @@ public class HeadsetStateMachine extends StateMachine {
HEADSET_WBS + "=" + mAudioParams.getOrDefault(HEADSET_WBS,
HEADSET_AUDIO_FEATURE_OFF)
});
+ keyValuePairs = keyValuePairs.concat(";"
+ + HEADSET_G_SCO_SAMPLERATE
+ + "="
+ + mAudioParams.getOrDefault(
+ HEADSET_G_SCO_SAMPLERATE,
+ HEADSET_G_NB_SAMPLERATE));
Log.i(TAG, "setAudioParameters for " + mDevice + ": " + keyValuePairs);
mSystemInterface.getAudioManager().setParameters(keyValuePairs);
}
@@ -1649,10 +1658,12 @@ public class HeadsetStateMachine extends StateMachine {
String prevWbs = mAudioParams.getOrDefault(HEADSET_WBS, HEADSET_AUDIO_FEATURE_OFF);
switch (wbsConfig) {
case HeadsetHalConstants.BTHF_WBS_YES:
+ mAudioParams.put(HEADSET_G_SCO_SAMPLERATE, HEADSET_G_WB_SAMPLERATE);
mAudioParams.put(HEADSET_WBS, HEADSET_AUDIO_FEATURE_ON);
break;
case HeadsetHalConstants.BTHF_WBS_NO:
case HeadsetHalConstants.BTHF_WBS_NONE:
+ mAudioParams.put(HEADSET_G_SCO_SAMPLERATE, HEADSET_G_NB_SAMPLERATE);
mAudioParams.put(HEADSET_WBS, HEADSET_AUDIO_FEATURE_OFF);
break;
default:
--
2.25.1

View File

@ -0,0 +1,31 @@
From f40e85b84e53cccee6a80e5aff2db2adec55dfeb Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 7 Jun 2021 17:09:13 -0400
Subject: [PATCH 5/5] Add a property to disable eSCO
eSCO is troublesome on some old devices.
It is unknown whether it applies to any Treble device, but investigation
is ongoing, this will help the investigation.
---
hci/src/hci_packet_parser.cc | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hci/src/hci_packet_parser.cc b/hci/src/hci_packet_parser.cc
index 88dc4c6cd..3bd0efe21 100644
--- a/hci/src/hci_packet_parser.cc
+++ b/hci/src/hci_packet_parser.cc
@@ -107,6 +107,11 @@ static void parse_read_local_supported_commands_response(
STREAM_TO_ARRAY(supported_commands_ptr, stream,
(int)supported_commands_length);
+ bool disable_eSCO = property_get_bool("persist.sys.bt.disable_esco", false);
+ if(disable_eSCO) {
+ supported_commands_ptr[29] &= ~0x08;
+ }
+
buffer_allocator->free(response);
}
--
2.25.1