Implement 0014 keypad debouncer, Sparkler LRA filter, standby fixes, and stage a1125 (ampere)
- Extend 0012 standby optimizations with removable-SD-only MMC_CAP_AGGRESSIVE_PM | MMC_CAP2_FULL_PWR_CYCLE in sdhci-msm, proxy mem clock and BIMC XO re-parenting + 0x45000 BIT(2) early-vote clear in qcom_q6v5_mss / gcc-msm8909, 100 MHz opp-99999975 floor across qcom-msm8909.dtsi and all 6 device DTS/DTBs, disabled-by-default Bluetooth with bt_enabled persistence, NM ipv6.method=ignore + standby wlan0/disable_ipv6 muting, and post-park DSDS signal hysteresis - Add ABI-preserving system-core keypad debouncer patch 0014 (drivers/input/input.c key_debounce_ms + pm8941-pwrkey press/release chatter holdoff), replace ignored col-scan-delay-ms with col-scan-delay-us = <0x32> and raise DT debounce intervals across all 6 DTS/DTBs, configure per-target key_debounce_ms at boot and xset r rate 300 25, and add C/DTS verification in scripts/test-keypad-debouncer.py - Isolate Nokia 8000 4G (nokia-sparkler / nokia-leo) media playback from the shared 157 Hz SPK_DRV vibrator channel via dynamic Speaker-only filtering in music.so, files.so, and ringtones.so, explicit RX3/SPK mixer zeroing on Earpiece/Headphones/Bluetooth routes in sxmo_audio.sh and preview plugins, and Sparkler/Leo-only /etc/mpv/mpv.conf provisioning - Register upcoming build a1125 (ampere) in scripts/version.sh, scripts/check-rebuild.sh, AGENTS.md, and CHANGELOG.md, fix --for-rebuild pre-rebuild stale output checks in check-rebuild.sh/test-cover-dt.py, rebuild vmlinuz/DTBs/plugins and all 4 --mkinitfs target images stamped a1125 (ampere), and pin their verified SHA-256 checksums
This commit is contained in:
1 parent
c529463ae3
commit
5d427e39ab
55 files changed
+78935
-77569
No files matched your search
@@ -77,6 +77,45 @@ struct BrowserItem {
|
||||
};
|
||||
|
||||
constexpr const char* kMpvSockPath = "/tmp/xmusic_mpv.sock";
|
||||
constexpr const char* kSparklerSpeakerAf =
|
||||
"lavfi=[highpass=f=260:poles=2,highpass=f=260:poles=2,"
|
||||
"bandreject=f=157:width_type=h:w=80]";
|
||||
|
||||
bool isHapticAudioSpeakerDevice() {
|
||||
const char* env = std::getenv("BANANARCHY_HAPTIC_AUDIO_GUARD");
|
||||
if (env && *env == '1') return true;
|
||||
if (env && *env == '0') return false;
|
||||
|
||||
static int cached = -1;
|
||||
if (cached >= 0) return cached == 1;
|
||||
|
||||
int fd = ::open("/sys/firmware/devicetree/base/compatible",
|
||||
O_RDONLY | O_CLOEXEC);
|
||||
if (fd < 0) {
|
||||
cached = 0;
|
||||
return false;
|
||||
}
|
||||
char buf[256];
|
||||
ssize_t n = ::read(fd, buf, sizeof(buf) - 1);
|
||||
::close(fd);
|
||||
if (n <= 0) {
|
||||
cached = 0;
|
||||
return false;
|
||||
}
|
||||
buf[n] = '\0';
|
||||
const char* p = buf;
|
||||
const char* end = buf + n;
|
||||
while (p < end && *p) {
|
||||
if (std::strcmp(p, "nokia,sparkler") == 0 ||
|
||||
std::strcmp(p, "nokia,leo") == 0) {
|
||||
cached = 1;
|
||||
return true;
|
||||
}
|
||||
p += std::strlen(p) + 1;
|
||||
}
|
||||
cached = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string getExtLower(const std::string& name) {
|
||||
size_t dot = name.rfind('.');
|
||||
@@ -258,6 +297,39 @@ std::string getConfigDirPath() {
|
||||
return getHomePath() + "/.config/sxmo";
|
||||
}
|
||||
|
||||
std::string normalizeAudioRoute(const std::string& raw) {
|
||||
std::string low = toLowerStr(raw);
|
||||
if (low.find("bluetooth") != std::string::npos ||
|
||||
low.find("bluez") != std::string::npos) {
|
||||
return "Bluetooth";
|
||||
}
|
||||
if (low.find("headphone") != std::string::npos ||
|
||||
low.find("headset") != std::string::npos) {
|
||||
return "Headphones";
|
||||
}
|
||||
if (low.find("earpiece") != std::string::npos) {
|
||||
return "Earpiece";
|
||||
}
|
||||
return "Speaker";
|
||||
}
|
||||
|
||||
std::string readActiveAudioRoute() {
|
||||
std::string outDev;
|
||||
{
|
||||
std::ifstream ifs("/tmp/sxmo_audio_out_device");
|
||||
if (ifs && std::getline(ifs, outDev) && !outDev.empty()) {
|
||||
return normalizeAudioRoute(outDev);
|
||||
}
|
||||
}
|
||||
{
|
||||
std::ifstream ifs(getConfigDirPath() + "/audio_out_device");
|
||||
if (ifs && std::getline(ifs, outDev) && !outDev.empty()) {
|
||||
return normalizeAudioRoute(outDev);
|
||||
}
|
||||
}
|
||||
return "Speaker";
|
||||
}
|
||||
|
||||
int readSavedSpeakerVol() {
|
||||
std::string outDev = "Speaker";
|
||||
{
|
||||
@@ -371,6 +443,7 @@ int runMusicApp(int argc, char** argv) {
|
||||
int ipcFd = -1;
|
||||
std::string ipcReadBuf;
|
||||
std::string pendingLoadPath;
|
||||
std::string appliedMpvAf;
|
||||
bool isPlaying = false;
|
||||
bool isPaused = false;
|
||||
double timePosSec = 0.0;
|
||||
@@ -401,12 +474,24 @@ int runMusicApp(int argc, char** argv) {
|
||||
return w == static_cast<ssize_t>(msg.size());
|
||||
};
|
||||
|
||||
auto syncSparklerMpvFilter = [&](bool force = false) {
|
||||
if (!isHapticAudioSpeakerDevice() || ipcFd < 0) return;
|
||||
std::string wantAf =
|
||||
(readActiveAudioRoute() == "Speaker") ? kSparklerSpeakerAf : "";
|
||||
if (!force && wantAf == appliedMpvAf) return;
|
||||
if (sendIpcRaw("{\"command\":[\"set_property\",\"af\",\"" +
|
||||
jsonEscape(wantAf) + "\"]}")) {
|
||||
appliedMpvAf = wantAf;
|
||||
}
|
||||
};
|
||||
|
||||
auto stopMpvDaemon = [&]() {
|
||||
if (ipcFd >= 0) {
|
||||
::close(ipcFd);
|
||||
ipcFd = -1;
|
||||
}
|
||||
ipcReadBuf.clear();
|
||||
appliedMpvAf.clear();
|
||||
if (mpvPid > 0) {
|
||||
::kill(mpvPid, SIGTERM);
|
||||
for (int i = 0; i < 15; ++i) {
|
||||
@@ -430,9 +515,16 @@ int runMusicApp(int argc, char** argv) {
|
||||
::close(ipcFd);
|
||||
ipcFd = -1;
|
||||
}
|
||||
appliedMpvAf.clear();
|
||||
}
|
||||
}
|
||||
if (mpvPid <= 0) {
|
||||
bool wantSpeakerFilter =
|
||||
isHapticAudioSpeakerDevice() && readActiveAudioRoute() == "Speaker";
|
||||
std::string afOpt = wantSpeakerFilter
|
||||
? (std::string("--af=") + kSparklerSpeakerAf)
|
||||
: "";
|
||||
appliedMpvAf = wantSpeakerFilter ? kSparklerSpeakerAf : "";
|
||||
::unlink(kMpvSockPath);
|
||||
pid_t pid = ::fork();
|
||||
if (pid == 0) {
|
||||
@@ -452,11 +544,21 @@ int runMusicApp(int argc, char** argv) {
|
||||
}
|
||||
std::string ipcArg =
|
||||
std::string("--input-ipc-server=") + kMpvSockPath;
|
||||
::execlp("mpv", "mpv", "--no-video", "--no-terminal", "--quiet",
|
||||
"--ao=pipewire,pulse,alsa", "--audio-channels=stereo",
|
||||
"--audio-samplerate=48000", "--idle=yes", "--keep-open=no",
|
||||
"--volume-max=150", "--volume=100", ipcArg.c_str(),
|
||||
static_cast<char*>(nullptr));
|
||||
if (!afOpt.empty()) {
|
||||
::execlp("mpv", "mpv", "--no-config", "--no-video", "--no-terminal",
|
||||
"--quiet", "--ao=pipewire,pulse,alsa",
|
||||
"--audio-channels=stereo", "--audio-samplerate=48000",
|
||||
"--idle=yes", "--keep-open=no", "--volume-max=150",
|
||||
"--volume=100", afOpt.c_str(), ipcArg.c_str(),
|
||||
static_cast<char*>(nullptr));
|
||||
} else {
|
||||
::execlp("mpv", "mpv", "--no-config", "--no-video", "--no-terminal",
|
||||
"--quiet", "--ao=pipewire,pulse,alsa",
|
||||
"--audio-channels=stereo", "--audio-samplerate=48000",
|
||||
"--idle=yes", "--keep-open=no", "--volume-max=150",
|
||||
"--volume=100", ipcArg.c_str(),
|
||||
static_cast<char*>(nullptr));
|
||||
}
|
||||
::_exit(127);
|
||||
} else if (pid > 0) {
|
||||
mpvPid = pid;
|
||||
@@ -482,6 +584,7 @@ int runMusicApp(int argc, char** argv) {
|
||||
sendIpcRaw("{\"command\":[\"observe_property\",2,\"duration\"]}");
|
||||
sendIpcRaw("{\"command\":[\"observe_property\",3,\"pause\"]}");
|
||||
sendIpcRaw("{\"command\":[\"observe_property\",4,\"media-title\"]}");
|
||||
syncSparklerMpvFilter(true);
|
||||
if (!pendingLoadPath.empty()) {
|
||||
std::string p = pendingLoadPath;
|
||||
pendingLoadPath.clear();
|
||||
@@ -532,6 +635,7 @@ int runMusicApp(int argc, char** argv) {
|
||||
|
||||
ensureMpvRunning();
|
||||
if (tryConnectIpc()) {
|
||||
syncSparklerMpvFilter(false);
|
||||
sendIpcRaw("{\"command\":[\"loadfile\",\"" + jsonEscape(loadTarget) +
|
||||
"\",\"replace\"]}");
|
||||
sendIpcRaw("{\"command\":[\"set_property\",\"pause\",false]}");
|
||||
@@ -1481,6 +1585,9 @@ int runMusicApp(int argc, char** argv) {
|
||||
if (mpvPid > 0 && ipcFd < 0) {
|
||||
tryConnectIpc();
|
||||
}
|
||||
if (isPlaying && !isPaused && ipcFd >= 0) {
|
||||
syncSparklerMpvFilter(false);
|
||||
}
|
||||
if (drainIpcSocket() && visible) {
|
||||
render();
|
||||
}
|
||||
@@ -1559,6 +1666,8 @@ int runMusicApp(int argc, char** argv) {
|
||||
for (const auto& cmd : readFifoLines(fifoFd)) {
|
||||
if (cmd == "CLOSE") {
|
||||
hideWindow();
|
||||
} else if (cmd == "AUDIO_ROUTE") {
|
||||
syncSparklerMpvFilter(false);
|
||||
} else if (cmd == "RELOAD_THEME") {
|
||||
pt.reload();
|
||||
if (visible) render();
|
||||
|
||||
Reference in new issue
Block a user