Compare commits

...

19 commits

Author SHA1 Message Date
New Author Name
92e8c73bb8 sm8350-common: Remove FM Tuner from audio input devices
* This fixes google voice recorder

Change-Id: If42676a0087e055e3164da4b0cc43987e32d82b3
2025-04-07 21:40:30 +00:00
jjpprrrr
aa37733459 sm8350-common: audio: Remove quad mic
*This fixes in-game mic for various games
2025-04-07 21:40:30 +00:00
New Author Name
ad38de0fca sm8350-common: audio: Disable stereo support for voip
This breaks in-game voice chat and audio in some messaging apps
   causing it to plays with a higher pitch and speed, making it sound
   like chipmunks.

Change-Id: Ic951a4fd43a4b647d5f6f271259a65be18289627
2025-04-07 21:40:13 +00:00
Demon000
61f7528fbe sm8350-common: overlay: Disable proximity usage during doze
* we have a virtual (ultrasound) proximity sensor
   so this will never work
2025-04-07 21:39:44 +00:00
Michael Bestas
54ebe18f05 sm8350-common: gps: Reduce LOWI debug level
* Kill logcat spam
2025-04-07 21:39:25 +00:00
Danny Lin
6c501cd4c0 sm8350-common: overlay: Don't pin launcher app in memory
Similar to what we did for the camera app, unpin the launcher app from
memory as well. While the default launcher (Launcher3) isn't
particularly big, it doesn't make much sense to pin because the launcher
does not typically load new resources much. Most of its resources should
already be loaded in memory after it starts, so pinning the APK is
redundant.
2025-04-07 21:39:15 +00:00
Jake Weinstein
f07856993d sm8350-common: rootdir: Move background cpuset to CPU0-1
Background tasks are not UX-critical.
Free up cores to work on more important
UX tasks.
2025-04-07 21:38:28 +00:00
Jake Weinstein
e98e50ce49 sm8350-common: rootdir: Do not allow restricted tasks to run on big cores
The restricted cpuset is for system tasks that are
throttled because the screen is off. Google only
runs these tasks on the little cluster
to save power and we will follow suit.
2025-04-07 21:38:28 +00:00
Jun Wang
1e5532f898 sm8350-common: props: Disable Skia tracing by default
If the prop "debug.hwui.skia_atrace_enabled" is enabled, too many
skia tracing calls will be printed in every frame. This has obvious
overhead on performance/power, and can cause many janks. So disable
it by default, and user can set it manually if necessary.
2025-04-07 21:38:10 +00:00
Kuba Wojciechowski
516ea60850 sm8350-common: Set screen recorder max framerate to 120Hz
haydn has 120Hz display, so why not just use it
2025-04-07 21:37:38 +00:00
Murat Kozan
09c145c900 sm8350-common: Allow perf hal to create vendor/lm
ANDR-PERF-LM: Core: lmMain() 287: Waiting for LM data dir: /data/vendor/lm/, Error: No such file or directory
2025-04-07 21:37:38 +00:00
Peng Xu
dd409c8fe2 sm8350-common: Enable support for IEEE80211AX
* This is to allow supporting WiFi 6 mobile hotspots,
   to be noted this is only supported on SDM855+ platforms.

Change-Id: Iab61bd12499968e8823b3078acd1c7b8bce46136
2025-04-07 21:37:38 +00:00
Mahesh Palivela
0d3a0bbd2a sm8350-common: Enable support for IEEE80211AC
* This is to allow supporting GO with 11AC support.

Change-Id: I08793eaa6295c5cfe5ac11eeee2f92213af78844
2025-04-07 21:37:38 +00:00
Kumar Anand
552a60d338 sm8350-common: Enable automatic channel selection
* Automatic Channel Selection algorithms and implementations
   are used to enable interfaces to automatically figure
   out which channel configuration to use for initiating
   communication, for any mode of operation which initiates
   radiation (AP, Mesh, IBSS, P2P).

   https://wireless.wiki.kernel.org/en/users/documentation/acs

Change-Id: I5c95994ea52495990cf9244c703bc88db170f7f6
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2025-04-07 21:37:38 +00:00
Praveen Chavan
15f2f80d2f sm8350-common: props: Add a property to enable prefetching video
persist.mm.enable.prefetch, if set to true, will enable
prefetching of video input from upstream source to help
improve playback performance for high frame-rate and
high bitrate content

Change-Id: I814785befd9844364afb50eb7d48439406ae0750
Signed-off-by: saikiran2001 <bjsaikiran@gmail.com>
Signed-off-by: thepriyanshujangid <priyanshujangid@yahoo.com>
2025-04-07 21:37:15 +00:00
Jun Wang
5fe2586b3c sm8350-common: props: Enable the pre-rendering feature
* Pre-rendering feature can improve FPS and reduce the janks
   in scrolling cases.

Change-Id: I2152d0a1a8f9e337cb0355c8874e72f0f3c2cb46
Signed-off-by: NotHarshhaa <reddyharshhaa12@gmail.com>
Signed-off-by: chemusqui1 <61394758+chemusqui1@users.noreply.github.com>
2025-04-07 21:36:59 +00:00
Kuba Wojciechowski
97f5b6efd7 sm8350-common: Disable kpti
* As per qualcomm - "SM8150/SM8250/SM8350/SM7250/SM7150/SM6150 - KPTI Not
required".
* It can also help increase performance by a lot in some scenarios.
2025-04-07 21:36:42 +00:00
Akash Srivastava
26b9a5d0f2 sm8350-common: rootdir: Chown the cgroup.procs nodes
* Perf-hal tries to access the nodes but requires permissions as reflected in the logs
* 11-10 19:25:50.044  1055  1080 E ANDR-PERF-OPTSHANDLER: Cannot open/create foreground cgroup file
2025-04-07 21:36:31 +00:00
kamikaonashi
9590e9c1e8 sm8350-common: parts: restore brightness after HBM usage
after disabling HBM, the brightness would rise back up, save brightness before enabling HBM and restore it after disabling
2025-04-07 21:34:28 +00:00
14 changed files with 109 additions and 42 deletions

View file

@ -93,6 +93,7 @@ BOARD_KERNEL_CMDLINE += swiotlb=0
BOARD_KERNEL_CMDLINE += pcie_ports=compat
BOARD_KERNEL_CMDLINE += iptable_raw.raw_before_defrag=1
BOARD_KERNEL_CMDLINE += ip6table_raw.raw_before_defrag=1
BOARD_KERNEL_CMDLINE += kpti=off
# Lineage Health
TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_BYPASS := false
@ -195,5 +196,9 @@ WIFI_HIDL_FEATURE_DUAL_INTERFACE := true
WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true
WPA_SUPPLICANT_VERSION := VER_0_8_X
CONFIG_ACS := true
CONFIG_IEEE80211AC := true
CONFIG_IEEE80211AX := true
# Inherit proprietary blobs
include vendor/xiaomi/sm8350-common/BoardConfigVendor.mk

View file

@ -90,7 +90,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<item>Telephony Tx</item>
<item>Built-In Mic</item>
<item>Built-In Back Mic</item>
<item>FM Tuner</item>
<item>Telephony Rx</item>
</attachedDevices>
<defaultOutputDevice>Speaker</defaultOutputDevice>
@ -190,7 +189,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<mixPort name="voip_rx" role="source"
flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_VOIP_RX">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="8000,16000,32000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
samplingRates="8000,16000,32000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
</mixPort>
<mixPort name="incall_music_uplink" role="source"
flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
@ -210,11 +209,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
</mixPort>
<mixPort name="quad mic" role="sink">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="48000"
channelMasks="AUDIO_CHANNEL_INDEX_MASK_4"/>
</mixPort>
<mixPort name="voip_tx" role="sink"
flags="AUDIO_INPUT_FLAG_VOIP_TX">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
@ -324,11 +318,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
</devicePort>
<devicePort tagName="FM Tuner" type="AUDIO_DEVICE_IN_FM_TUNER" role="source">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="48000"
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
</devicePort>
<devicePort tagName="Wired Headset Mic" type="AUDIO_DEVICE_IN_WIRED_HEADSET" role="source">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
@ -381,13 +370,11 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<route type="mix" sink="voice_rx"
sources="Telephony Rx"/>
<route type="mix" sink="primary input"
sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BT SCO Headset Mic,FM Tuner,Telephony Rx"/>
sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BT SCO Headset Mic,Telephony Rx"/>
<route type="mix" sink="usb_surround_sound"
sources="USB Device In,USB Headset In"/>
<route type="mix" sink="fast input"
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,Wired Headset Mic"/>
<route type="mix" sink="quad mic"
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,Wired Headset Mic"/>
<route type="mix" sink="voip_tx"
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In,Wired Headset Mic"/>
<route type="mix" sink="record_24"

View file

@ -22,7 +22,7 @@
# Log level
# EL_LOG_OFF = 0, EL_ERROR = 1, EL_WARNING = 2, EL_INFO = 3, EL_DEBUG = 4, EL_VERBOSE = 5, EL_LOG_ALL = 100
LOWI_LOG_LEVEL = 3
LOWI_LOG_LEVEL = 2
LOWI_USE_LOWI_LP = 0
LOWI_HE_RTT_SUPPORT = 1
LOWI_USE_NLMSG_FOR_CAPS = 1

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016-2023 crDroid Android 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.
-->
<resources>
<!-- If not zero, limits the internal screen recorder's framerate to the set value. -->
<integer name="config_screenRecorderMaxFramerate">120</integer>
</resources>

View file

@ -203,9 +203,6 @@
<item>"/system/bin/surfaceflinger"</item>
</string-array>
<!-- Should the pinner service pin the Home application? -->
<bool name="config_pinnerHomeApp">true</bool>
<!-- Enable doze mode
ComponentName of a dream to show whenever the system would otherwise have gone to sleep. -->
<string translatable="false" name="config_dozeComponent">com.android.systemui/com.android.systemui.doze.DozeService</string>

View file

@ -55,6 +55,9 @@
<item>0</item>
</integer-array>
<!-- Whether usage of the proximity sensor during doze is supported -->
<bool name="doze_proximity_sensor_supported">false</bool>
<!-- Preferred max refresh rate at keyguard, if supported by the display. -->
<integer name="config_keyguardMaxRefreshRate">60</integer>
</resources>

View file

@ -13,11 +13,11 @@ import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.IBinder;
import android.os.PowerManager;
import androidx.preference.PreferenceManager;
import android.provider.Settings;
import androidx.preference.PreferenceManager;
import org.lineageos.settings.utils.FileUtils;
import org.lineageos.settings.display.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@ -31,11 +31,13 @@ public class AutoHBMService extends Service {
private ExecutorService mExecutorService;
private SensorManager mSensorManager;
Sensor mLightSensor;
private Sensor mLightSensor;
private SharedPreferences mSharedPrefs;
private boolean dcDimmingEnabled;
private int mStoredBrightness = -1;
public void activateLightSensorRead() {
submit(() -> {
mSensorManager = (SensorManager) getApplicationContext().getSystemService(Context.SENSOR_SERVICE);
@ -54,11 +56,23 @@ public class AutoHBMService extends Service {
private void enableHBM(boolean enable) {
if (enable) {
// Store current brightness before enabling HBM
if (mStoredBrightness == -1) {
mStoredBrightness = Settings.System.getInt(getContentResolver(),
Settings.System.SCREEN_BRIGHTNESS, 255);
}
FileUtils.writeLine(HBM, "1");
FileUtils.writeLine(BACKLIGHT, "2047");
Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, 255);
} else {
FileUtils.writeLine(HBM, "0");
// Restore brightness when disabling HBM
if (mStoredBrightness != -1) {
FileUtils.writeLine(BACKLIGHT, String.valueOf(mStoredBrightness));
Settings.System.putInt(getContentResolver(),
Settings.System.SCREEN_BRIGHTNESS, mStoredBrightness);
mStoredBrightness = -1;
}
}
}
@ -67,7 +81,6 @@ public class AutoHBMService extends Service {
}
private SensorEventListener mSensorEventListener = new SensorEventListener() {
@Override
public void onSensorChanged(SensorEvent event) {
float lux = event.values[0];
@ -88,7 +101,7 @@ public class AutoHBMService extends Service {
mExecutorService.submit(() -> {
try {
Thread.sleep(timeToDisableHBM * 1000);
} catch (InterruptedException e) {
} catch (InterruptedException ignored) {
}
if (lux < luxThreshold) {
mAutoHBMActive = false;
@ -108,9 +121,9 @@ public class AutoHBMService extends Service {
private BroadcastReceiver mScreenStateReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
if (Intent.ACTION_SCREEN_ON.equals(intent.getAction())) {
activateLightSensorRead();
} else if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
} else if (Intent.ACTION_SCREEN_OFF.equals(intent.getAction())) {
deactivateLightSensorRead();
}
}
@ -142,11 +155,8 @@ public class AutoHBMService extends Service {
public void onDestroy() {
super.onDestroy();
unregisterReceiver(mScreenStateReceiver);
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
if (pm.isInteractive()) {
deactivateLightSensorRead();
}
}
@Override
public IBinder onBind(Intent intent) {

View file

@ -16,14 +16,12 @@
*
*/
package org.lineageos.settings.hbm;
import android.provider.Settings;
import android.content.Context;
import android.content.SharedPreferences;
import androidx.preference.Preference;
import androidx.preference.Preference.OnPreferenceChangeListener;
import androidx.preference.PreferenceManager;
import org.lineageos.settings.utils.FileUtils;
import org.lineageos.settings.display.*;
@ -57,10 +55,22 @@ public class HBMModeSwitch implements OnPreferenceChangeListener {
if (dcDimmingEnabled) {
return false;
}
FileUtils.writeLine(getHBM(), enabled ? "1" : "0");
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(mContext);
if (enabled) {
// Save current brightness level
int currentBrightness = Settings.System.getInt(mContext.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, 128);
sharedPrefs.edit().putInt("last_brightness", currentBrightness).apply();
FileUtils.writeLine(getHBM(), "1");
FileUtils.writeLine(getBACKLIGHT(), "2047");
Settings.System.putInt(mContext.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, 255);
} else {
FileUtils.writeLine(getHBM(), "0");
// Restore last brightness level
int lastBrightness = sharedPrefs.getInt("last_brightness", 128);
Settings.System.putInt(mContext.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, lastBrightness);
}
return true;
}

View file

@ -17,7 +17,6 @@
*/
package org.lineageos.settings.hbm;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
@ -28,12 +27,10 @@ import android.service.quicksettings.Tile;
import android.service.quicksettings.TileService;
import androidx.preference.PreferenceManager;
import android.provider.Settings;
import org.lineageos.settings.utils.FileUtils;
import org.lineageos.settings.display.*;
public class HBMModeTileService extends TileService {
private static final String HBM = "/sys/devices/platform/soc/soc:qcom,dsi-display-primary/hbm_enabled";
private static final String HBM_KEY = "hbm";
private static final String BACKLIGHT = "/sys/class/backlight/panel0-backlight/brightness";
@ -80,6 +77,7 @@ public class HBMModeTileService extends TileService {
public void onStopListening() {
super.onStopListening();
}
@Override
public void onClick() {
super.onClick();
@ -88,12 +86,24 @@ public class HBMModeTileService extends TileService {
if (dcDimmingEnabled) {
return;
}
final boolean enabled = !(sharedPrefs.getBoolean(HBM_KEY, false));
FileUtils.writeLine(HBM, enabled ? "1" : "0");
if (enabled) {
// Save current brightness level
int currentBrightness = Settings.System.getInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, 128);
sharedPrefs.edit().putInt("last_brightness", currentBrightness).apply();
FileUtils.writeLine(HBM, "1");
FileUtils.writeLine(BACKLIGHT, "2047");
Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, 255);
} else {
FileUtils.writeLine(HBM, "0");
// Restore last brightness level
int lastBrightness = sharedPrefs.getInt("last_brightness", 128);
Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, lastBrightness);
}
sharedPrefs.edit().putBoolean(HBM_KEY, enabled).commit();
updateUI(enabled);
}

View file

@ -191,7 +191,8 @@ echo 10 10 10 10 10 10 10 95 > /proc/sys/kernel/sched_coloc_busy_hyst_cpu_busy_p
echo 325 > /proc/sys/kernel/walt_low_latency_task_threshold
# cpuset parameters
echo 0-3 > /dev/cpuset/background/cpus
echo 0-1 > /dev/cpuset/background/cpus
echo 0-3 > /dev/cpuset/restricted/cpus
echo 0-3 > /dev/cpuset/system-background/cpus
# configure governor settings for silver cluster

View file

@ -192,6 +192,9 @@ on post-fs-data
chmod 2770 /data/vendor/perfd
rm /data/vendor/perfd/default_values
# Change lm related dirs
mkdir /data/vendor/lm 0700 root root
mkdir /data/vendor/secure_element 0777 system system
# Mark the copy complete flag to not completed

View file

@ -137,6 +137,23 @@ on boot
chown system /sys/devices/system/cpu/hyp_core_ctl/enable
chown system /sys/devices/system/cpu/hyp_core_ctl/hcc_min_freq
chown system system /dev/cpuset/cgroup.procs
chown system system /dev/cpuset/foreground/cgroup.procs
chown system system /dev/cpuset/background/cgroup.procs
chown system system /dev/cpuset/system-background/cgroup.procs
chown system system /dev/cpuset/top-app/cgroup.procs
chmod 0666 /dev/cpuset/foreground/cgroup.procs
chmod 0666 /dev/cpuset/background/cgroup.procs
chmod 0666 /dev/cpuset/system-background/cgroup.procs
chmod 0666 /dev/cpuset/top-app/cgroup.procs
chmod 0666 /dev/cpuset/cgroup.procs
chown system system /dev/stune/background/cgroup.procs
chown system system /dev/stune/top-app/cgroup.procs
chmod 0666 /dev/stune/background/cgroup.procs
chmod 0666 /dev/stune/top-app/cgroup.procs
write /sys/block/sda/queue/wbt_lat_usec 75000
# Set fingerprint related permissions

View file

@ -4,6 +4,9 @@ vendor.bluetooth.soc=hastings
# CNE
persist.vendor.cne.feature=1
# Disable Skia tracing by default
debug.hwui.skia_atrace_enabled=false
# Graphics
debug.sf.disable_backpressure=1
debug.sf.enable_hwc_vds=1

View file

@ -221,6 +221,7 @@ vendor.gralloc.disable_ubwc=0
debug.stagefright.c2inputsurface=-1
media.stagefright.thumbnail.prefer_hw_codecs=true
ro.config.vc_call_vol_steps=11
persist.mm.enable.prefetch=true
# NFC
ro.vendor.nfc.repair=1
@ -228,7 +229,7 @@ ro.vendor.se.type=eSE,HCE,UICC
# Perf
ro.vendor.extension_library=libqti-perfd-client.so
ro.vendor.perf.scroll_opt=0
ro.vendor.perf.scroll_opt=true
# Radio
keyguard.no_require_sim=true