Fix MBHC wired headphone autodetection across all targets for a1125 (ampere)
Retain PM8909 MBHC digital debounce clock (DIG_CLK_CTL_D_MBHC_CLK_EN) and master bias (CDC_A_MASTER_BIAS_CTL = 0x30) across s2 standby gating while keeping the 100 uA button ISRC and button IRQs disabled when unplugged, check CDC_A_MBHC_RESULT_2 on boot/set_jack/switch IRQs with 3/4-pole FSM classification, fix iface=CARD jack queries, event coalescing, and stale unplugged Headphones boot fallback in bananarchy-soundmonitor and sxmo audio scripts, harden host tests against CPU contention, and rebuild all a1125 (ampere) target images.
This commit is contained in:
1 parent
aba38a58f2
commit
9619cc9541
19 files changed
+516
-93
No files matched your search
+9
-9
@@ -18,8 +18,8 @@ Upcoming release build (`a1125` / `ampere` via `scripts/version.sh`) targeting *
|
||||
|
||||
### Audio playback quality (`0015` WCD `48 kHz` interpolators, PM8909 `CAJON_2_0` analog codec, PipeWire downmix & unity gain staging) across all targets
|
||||
|
||||
- **48 kHz WCD digital interpolators/decimators & PM8909 `CAJON_2_0` analog codec (`patches/kernel/0015-msm8909-wcd-digital-interpolator-cajon-analog.patch`, `scripts/build-kernel-audio.sh`)**: fixed `REGCACHE_FLAT` in `msm8916-wcd-digital.c` missing `.reg_defaults` (which previously zeroed `LPASS_CDC_RX1/2/3_B5_CTL` POR `0x68` (`48 kHz`) to `0x00` (`8 kHz` narrowband HSP filter), `TX1/2_CLK_FS_CTL` POR `0x03` to `0x00`, and `LPASS_CDC_CLK_OTHR_CTL` POR `0x04` to `0x00` on `regcache_sync()`, while placing non-zero operating values directly in `.reg_defaults` would let `regcache_mark_dirty()` / `no_sync_defaults` skip re-writing `RX1/2/3_B5_CTL` after MSM8905 `INT_DIGITAL_CDC_CLK` resets, and marking `.volatile_reg` would expose unclocked `0x0771c000` LPASS AHB debugfs reads) by adding complete 97-register `0x00` hardware-reset `msm8916_wcd_digital_reg_defaults[]` with `valid_reg` (without `.volatile_reg`), `probe()` non-zero POR writes via `regmap_write_bits()`, unconditional `regmap_write_bits()` (`force=true`) in `hw_params()` (`RX1/2/3_B5_CTL = (rx_fs_rate << 5) | BIT(3)`, `TX1/2_CLK_FS_CTL = tx_fs_rate`), `enable_interpolator()`, and `enable_dec()`, plus `msm8916_wcd_digital_force_sync_ctl()` across `startup()`/`runtime_resume()` and `.use_pmdown_time = 0`; fixed MSM8905 (`Q6_ADSP_VERSION_2_6`) `q6afe.c` and `q6core.c` clock/version handling by passing explicit `AFE_PORT_ID_PRIMARY_MI2S_RX` (`0x1000`) in `q6afe_set_param_v2()` for `Q6AFE_LPASS_CLK_ID_INTERNAL_DIGITAL_CODEC_CORE` on ADSP `< 2.7`, retaining `afe->digital_cdc_clk_freq` across `q6afe_port_stop(PRIMARY_MI2S_RX)` until runtime suspend disables `mclk`, and falling back to `q6core_get_svc_versions()` in `q6core_query_versions_locked()` without latching `Q6_ADSP_VERSION_UNKNOWN` on early APR timeouts; detected PM8909 `CAJON_2_0` (`CDC_A_PERPH_SUBTYPE == 0x0a`) in `msm8916-wcd-analog.c` to apply Qualcomm `cajon2p0` defaults (`NCP_FBCTRL = 0xA8`, `NCP_VCTRL = 0xA4`/`0xA7`, `RX_HPH_BIAS_PA = 0xFA`, `SPKR_ANA_BIAS_SET = 0x41`, `TX_1_2_OPAMP_BIAS = 0x4C`, `RX_EAR_STATUS = 0x10`) and restore them across `s2` standby gating without clobbering `SPK DAC Switch`, configured the non-boost Class-D `SPK PA` (`SPKR_DRV_CTL = 0x69`/`0xE9` without nonexistent 5 V `BOOST_SET`/`CMFB_SET` bits), and added `CAJON_2_0` `HPHL DAC`/`HPHR DAC`/`HPH PA` DAPM sequencing and `+6 dB` analog `EAR PA` headroom (`RX_EAR_CTL BIT(5)`). Verified initial `0015` build live on connected `nokia-sparkler` (`Nokia 8000 4G`): `050/070/090 = 0x68` (`48 kHz` halfband interpolators), `290/2b0 = 0x03`, `198 = 0x03`, `CAJON_2_0` analog regmap `f146 = 0x30`, `f165 = 0x4c`, `f183 = 0xa8`, `f185 = 0xa4`, `f194 = 0xfa`, `f1b3 = 0x41`, `f1b0 = 0x83`, `f1b2 = 0xe9`, `f1b5 = 0xff`, and idle `pm8909_s2` `state=disabled` / `use_count=0` (live MSM8905 `nokia-beatles` verification pending reboot/reflash after the updated `0015` build).
|
||||
- **Lossless PipeWire stereo-to-mono downmix, TPDF dithering, and `<= 0 dB` unity gain staging (`create-item.lua`, `msm8916-s16le.conf`, `10-bananarchy-audio.conf`, `UCM2`, `sxmo_audio.sh`, `bananarchy-soundmonitor`, `sxmo_hook_ring.sh`, `xdrawer.cpp`, `callscreen_plugin.cpp`, `files_plugin.cpp`, `ringtones_plugin.cpp`, `scripts/test-audio-quality.py`)**: added per-node `item.features.mono` support in `overlay/rootfs/usr/share/wireplumber/scripts/node/create-item.lua` to replace unpositioned `[ FC, AUX0 ]` mapping (where WirePlumber 0.5 `si_audio_adapter_find_format` marks `AUX*` nodes `0x1000..0x1fff` as `item.node.unpositioned = "true"`, causing `si-standard-link` to skip `PortConfig` downmixing and route `output_FL -> playback_AUX0` while leaving positioned `playback_FC` unlinked and Speaker silent), and updated all four `msm8916-s16le.conf` copies to lock `audio.rate = 48000` and `dither.method = "triangular"` across internal ALSA nodes while enabling `item.features.mono = true` (`[ MONO ]` `PortConfig` keeping hardware `hw:0,0` in `2 ch` `48 kHz` `S16_LE` while keeping `Headphones` and Bluetooth A2DP sinks in full `2 ch` `[ FL, FR ]` stereo) and `channelmix.normalize = true` on `HiFi__Speaker__sink` and `HiFi__Earpiece__sink`, paired with `/etc/pipewire/{client,pipewire-pulse}.conf.d/10-bananarchy-audio.conf` (`channelmix.normalize = true`, `dither.method = "triangular"`) so stereo music sums `0.5 * FL + 0.5 * FR` without discarding `FR` or halving `sxmo_vibrate` amplitude; kept PipeWire's software sink at `100%` unity (`0.0 dB`) whenever `/proc/asound/card0` is present (`bananarchy_sync_internal_pw_vol`, `bananarchy_set_sink_volume` covering `@DEFAULT_AUDIO_SINK@`, sink ID fallback, and `pactl @DEFAULT_SINK@`, plus 500 ms `alsa_output.platform-7702000.sound.HiFi__*__sink` readiness wait in `sync_pipewire_profile` and initial `has_internal_sink()` / `internal_synced` jack-aware sync in `bananarchy-soundmonitor`) and capped ALSA hardware digital playback mappings (`Speaker`/`Earpiece` `52..84`, `Headphones` `51..83`, UCM2 initial `80`/`84`) at `<= 84` (`0 dB` unity) to eliminate `+4..+8 dB` 16-bit digital clipping; added `scripts/test-audio-quality.py` wired into `scripts/check-rebuild.sh`. Verified live on `nokia-sparkler`: `mpv:output_MONO -> HiFi__Speaker__sink:playback_MONO [active]` with `pcm0p/sub0` `RUNNING`, `0.5 * FL + 0.5 * FR` confirmed via `parecord` monitor DFT (`440 Hz = 6979.1`, `660 Hz = 7746.8`), and `sxmo_vibrate` `vib_rc=0`.
|
||||
- **48 kHz WCD digital interpolators/decimators, MBHC wired jack autodetection, & PM8909 `CAJON_2_0` analog codec (`patches/kernel/0015-msm8909-wcd-digital-interpolator-cajon-analog.patch`, `scripts/build-kernel-audio.sh`)**: fixed `REGCACHE_FLAT` in `msm8916-wcd-digital.c` missing `.reg_defaults` (which previously zeroed `LPASS_CDC_RX1/2/3_B5_CTL` POR `0x68` (`48 kHz`) to `0x00` (`8 kHz` narrowband HSP filter), `TX1/2_CLK_FS_CTL` POR `0x03` to `0x00`, and `LPASS_CDC_CLK_OTHR_CTL` POR `0x04` to `0x00` on `regcache_sync()`, while placing non-zero operating values directly in `.reg_defaults` would let `regcache_mark_dirty()` / `no_sync_defaults` skip re-writing `RX1/2/3_B5_CTL` after MSM8905 `INT_DIGITAL_CDC_CLK` resets, and marking `.volatile_reg` would expose unclocked `0x0771c000` LPASS AHB debugfs reads) by adding complete 97-register `0x00` hardware-reset `msm8916_wcd_digital_reg_defaults[]` with `valid_reg` (without `.volatile_reg`), `probe()` non-zero POR writes via `regmap_write_bits()`, unconditional `regmap_write_bits()` (`force=true`) in `hw_params()` (`RX1/2/3_B5_CTL = (rx_fs_rate << 5) | BIT(3)`, `TX1/2_CLK_FS_CTL = tx_fs_rate`), `enable_interpolator()`, and `enable_dec()`, plus `msm8916_wcd_digital_force_sync_ctl()` across `startup()`/`runtime_resume()` and `.use_pmdown_time = 0`; fixed MSM8905 (`Q6_ADSP_VERSION_2_6`) `q6afe.c` and `q6core.c` clock/version handling by passing explicit `AFE_PORT_ID_PRIMARY_MI2S_RX` (`0x1000`) in `q6afe_set_param_v2()` for `Q6AFE_LPASS_CLK_ID_INTERNAL_DIGITAL_CODEC_CORE` on ADSP `< 2.7`, retaining `afe->digital_cdc_clk_freq` across `q6afe_port_stop(PRIMARY_MI2S_RX)` until runtime suspend disables `mclk`, and falling back to `q6core_get_svc_versions()` in `q6core_query_versions_locked()` without latching `Q6_ADSP_VERSION_UNKNOWN` on early APR timeouts; detected PM8909 `CAJON_2_0` (`CDC_A_PERPH_SUBTYPE == 0x0a`) in `msm8916-wcd-analog.c` to apply Qualcomm `cajon2p0` defaults (`NCP_FBCTRL = 0xA8`, `NCP_VCTRL = 0xA4`/`0xA7`, `RX_HPH_BIAS_PA = 0xFA`, `SPKR_ANA_BIAS_SET = 0x41`, `TX_1_2_OPAMP_BIAS = 0x4C`, `RX_EAR_STATUS = 0x10`) and restore them across `s2` standby gating without clobbering `SPK DAC Switch`, configured the non-boost Class-D `SPK PA` (`SPKR_DRV_CTL = 0x69`/`0xE9` without nonexistent 5 V `BOOST_SET`/`CMFB_SET` bits), added `CAJON_2_0` `HPHL DAC`/`HPHR DAC`/`HPH PA` DAPM sequencing and `+6 dB` analog `EAR PA` headroom (`RX_EAR_CTL BIT(5)`), and fixed `0012` MBHC jack autodetection starvation by preserving `DIG_CLK_CTL_D_MBHC_CLK_EN` (`0xf04A BIT(3)`) and `CDC_A_MASTER_BIAS_CTL = 0x30` while gating the `100 uA` button ISRC (`CDC_A_MBHC_FSM_CTL`), `MICB_1_INT_TX2_INT_RBIAS`, button IRQs, and Linux `pm8909_s2` regulator vote off at unplugged idle, reading `CDC_A_MBHC_RESULT_2` (`0xf159 BIT(4)` `SWCH_LEVEL_REMOVE`) in `probe()`, `set_jack()`, and `pm8916_mbhc_switch_irq_handler()` (`phys_ins != waiting_ins` clear-edge guard), and distinguishing 3-pole TRS vs 4-pole TRRS headsets via `MBHC_BUTTON_PRESS_DET` after FSM settle. Verified initial `0015` build live on connected `nokia-sparkler` (`Nokia 8000 4G`): `050/070/090 = 0x68`, `290/2b0 = 0x03`, `198 = 0x03`, `CAJON_2_0` analog regmap `f146 = 0x30`, `f165 = 0x4c`, `f183 = 0xa8`, `f185 = 0xa4`, `f194 = 0xfa`, `f1b3 = 0x41`, `f1b0 = 0x83`, `f1b2 = 0xe9`, `f1b5 = 0xff`, and idle `pm8909_s2` `state=disabled` / `use_count=0`; verified updated `0015` build live on connected `nokia-beatles` (`Nokia 2720 Flip`): `050/070/090 = 0x00000068` and `198/290/2b0 = 0x00000003` safely readable at idle, during playback, and after `2.5 s` idle suspend without AHB hangs, alongside idle MBHC readiness (`f04a = 0x08`, `f146 = 0x30`, `f147 = 0xb4`, `f150 = 0xf1`, `f151 = 0x00`, `f015 = 0x80`, `f159 = 0x10`) and `pm8909_s2` `state=disabled` / `num_users=0`.
|
||||
- **Lossless PipeWire stereo-to-mono downmix, TPDF dithering, `<= 0 dB` unity gain staging, and jack autodetection (`create-item.lua`, `msm8916-s16le.conf`, `10-bananarchy-audio.conf`, `UCM2`, `sxmo_audio.sh`, `sxmo_modemaudio.sh`, `sxmo_hook_statusbar.sh`, `bananarchy-soundmonitor`, `sxmo_hook_ring.sh`, `xdrawer.cpp`, `callscreen_plugin.cpp`, `files_plugin.cpp`, `ringtones_plugin.cpp`, `scripts/test-audio-quality.py`)**: added per-node `item.features.mono` support in `overlay/rootfs/usr/share/wireplumber/scripts/node/create-item.lua` to replace unpositioned `[ FC, AUX0 ]` mapping (where WirePlumber 0.5 `si_audio_adapter_find_format` marks `AUX*` nodes `0x1000..0x1fff` as `item.node.unpositioned = "true"`, causing `si-standard-link` to skip `PortConfig` downmixing and route `output_FL -> playback_AUX0` while leaving positioned `playback_FC` unlinked and Speaker silent), and updated all four `msm8916-s16le.conf` copies to lock `audio.rate = 48000` and `dither.method = "triangular"` across internal ALSA nodes while enabling `item.features.mono = true` (`[ MONO ]` `PortConfig` keeping hardware `hw:0,0` in `2 ch` `48 kHz` `S16_LE` while keeping `Headphones` and Bluetooth A2DP sinks in full `2 ch` `[ FL, FR ]` stereo) and `channelmix.normalize = true` on `HiFi__Speaker__sink` and `HiFi__Earpiece__sink`, paired with `/etc/pipewire/{client,pipewire-pulse}.conf.d/10-bananarchy-audio.conf` (`channelmix.normalize = true`, `dither.method = "triangular"`) so stereo music sums `0.5 * FL + 0.5 * FR` without discarding `FR` or halving `sxmo_vibrate` amplitude; kept PipeWire's software sink at `100%` unity (`0.0 dB`) whenever `/proc/asound/card0` is present (`bananarchy_sync_internal_pw_vol`, `bananarchy_set_sink_volume` covering `@DEFAULT_AUDIO_SINK@`, sink ID fallback, and `pactl @DEFAULT_SINK@`, plus 500 ms `alsa_output.platform-7702000.sound.HiFi__*__sink` readiness wait in `sync_pipewire_profile` and initial `has_internal_sink()` / `internal_synced` jack-aware sync in `bananarchy-soundmonitor`); fixed `bananarchy-soundmonitor.c`, `sxmo_audio.sh`, `sxmo_modemaudio.sh`, and `sxmo_hook_statusbar.sh` jack autodetection (`iface=CARD,name='Headphone Jack'`/`'Mic Jack'` queries, `50 ms` `drain_jack_events()` coalescing into one atomic `sxmo_audio.sh device set` switch, stale persisted `Headphones`/`Headset` boot fallback when unplugged, call handoff Mic/Headset preservation, and dark-screen statusbar volume updates); and capped ALSA hardware digital playback mappings (`Speaker`/`Earpiece` `52..84`, `Headphones` `51..83`, UCM2 initial `80`/`84`) at `<= 84` (`0 dB` unity) to eliminate `+4..+8 dB` 16-bit digital clipping; added `scripts/test-audio-quality.py` wired into `scripts/check-rebuild.sh`. Verified live on `nokia-sparkler` (`mpv:output_MONO -> HiFi__Speaker__sink:playback_MONO [active]`, `0.5 * FL + 0.5 * FR` DFT, `sxmo_vibrate` `vib_rc=0`) and on `nokia-beatles` boot with stale `~/.config/sxmo/audio_out_device = Headphones` (`/tmp/sxmo_audio_out_device = Speaker`, `wpctl` `Built-in Audio Speaker playback [vol: 1.00]`, `Active Profile: HiFi (Mic1, Speaker)`).
|
||||
|
||||
### Cellular PS attach, Dual-SIM QMI WDS subscription binding (`libmm-wds-bind.so`), and mobile data (`wwan0`) fixes across all targets
|
||||
|
||||
@@ -49,13 +49,13 @@ Upcoming release build (`a1125` / `ampere` via `scripts/version.sh`) targeting *
|
||||
- **microSD PM8909 `l11` static `200 mA` load removal & `sdhci-msm` probe/active HPM + standby LPM `set_load` (`patches/kernel/0012-msm8909-standby-wifi-wcd-panel-ldo-bms.patch`, `devices/*/*.dts`, `prebuilt/kernel-6.12.1-msm8916/`)**: removed static `regulator-system-load = <0x30d40>;` from PM8909 `l11` across all 6 DTS files while extending `sdhci-msm.c` (`sdhci_msm_register_vreg()`, `sdhci_msm_set_vmmc()`, `msm_toggle_vqmmc()`, `sdhci_msm_runtime_resume()`, `sdhci_msm_runtime_suspend()`) and rebuilding `vmlinuz`/modules/DTBs so microSD probe and UHS-I tuning receive full `200 mA` / `20 mA` HPM without brownout (`-5`/`-110`) and idle runtime suspend drops `vmmc`/`vqmmc` to `2 mA`/`0 mA` PM8909 LPM.
|
||||
- **Offline verification (`scripts/test-imsd-volte.py`, `scripts/test-standby-power-policy.py`, `scripts/check-rebuild.sh`, `BATTERY-OPTIMIZATION-ANALYSIS.md`)**: added host regression tests for Combined EPS/IMSI (`cs_attach=1`), `searching_lte`, and 0-packet `2.2 s` QRTR idle silence in `test-imsd-volte.py`; added host tests for `CPU_GOV_PATH` + idempotent `screenoff`/`screenon` across dark/cover-lit/open, `standby.mode`/`rat_timer.pid`, `bananarchy-dsds --sig-hysteresis` QMI `0x0045`/`0x0050` wire framing over `AF_UNIX` `SOCK_SEQPACKET`, and `30-bananarchy-network-status.sh` dark gating in `test-standby-power-policy.py`; guarded DTS/DTBs against `regulator-system-load` in `check-rebuild.sh`; and documented Section 24 in `BATTERY-OPTIMIZATION-ANALYSIS.md`.
|
||||
- **Rebuilt local `a1125` (`ampere`) image SHA-256 checksums (`--mkinitfs`, no release `.zip` archives built yet)**:
|
||||
- `images/bananarchy-nokia-argon.img`: `6279d2b99600aee7751f501257ac48d485eaeee3b3f31c0f98a2b8522400bcd1`
|
||||
- `images/bananarchy-nokia-beatles.img`: `f067a130984d7fe6f79fdf46b3ff657bbe19fe12400e5db1e6ebd4cac24d1e6c`
|
||||
- `images/boot-bananarchy-nokia-beatles.img`: `d32c7a38ac85df7faa71d2649d7c6ead1adcef0af39c3e91f08993965ddd44b9`
|
||||
- `images/bananarchy-nokia-coconut.img`: `4d6733b633ca78ec7fe5de93e1ed0564a3aa116088aee3634147759a414af2c7`
|
||||
- `images/boot-bananarchy-nokia-coconut.img`: `fdad08c8501de6b53c6ac76b7886849834fc8840ffec289b41a5c58e924ac803`
|
||||
- `images/bananarchy-nokia-sparkler.img`: `068f4fa606bee9c63ac6044902e04a28d596b04edcd230d9703a2687951ee4bb`
|
||||
- `images/boot-bananarchy-nokia-sparkler.img`: `026852df5acc871738322ff1de3febf91c097f0f1d745fbbe71f22661023b0e2`
|
||||
- `images/bananarchy-nokia-argon.img`: `5df590a5c0a74a1594882e3d83a81c7691bdd3bfc396a320eb6e84e27f41b356`
|
||||
- `images/bananarchy-nokia-beatles.img`: `55cb9c17347735ff066f9a88f3b3e5c574281296ff78ac796cf79e2bbd0c2b81`
|
||||
- `images/boot-bananarchy-nokia-beatles.img`: `4500324c8c875588b60063befb9f852069ce5a84b70c92025708c412ddc9a30e`
|
||||
- `images/bananarchy-nokia-coconut.img`: `5d629a64b6c82b0ce46af7135e2eff8620142043903c2e65f27a7163a9b21b32`
|
||||
- `images/boot-bananarchy-nokia-coconut.img`: `c6c1d3fe3ad8eae39cc0ec6eeae14de136fd7524430976cb39ba79255a5dd9c2`
|
||||
- `images/bananarchy-nokia-sparkler.img`: `efd541291277e702f67b18b9bf90a7571e459c87c124a705d6dad265dc032be8`
|
||||
- `images/boot-bananarchy-nokia-sparkler.img`: `ba922d89ad0a778086ef6a400d48b816125ad017d24d5bd81ad601d77293342e`
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in new issue
Block a user