Fix PM8909 CONGA stereo headphone output on nokia-sparkler for a1125 (ampere)
Set CDC_A_RX_COM_OCP_CTL to 0x12 (350 mA limit instead of 0xD1), unlock CDC_D_SEC_ACCESS / CDC_A_SEC_ACCESS (0xA5) around the PERPH_RESET_CTL4 1 -> 0 soft reset in pm8916_wcd_analog_probe(), expand msm8916_wcd_digital_force_sync_ctl() across all stateful registers in msm8916_wcd_digital_reg_defaults[], and split PM8909 CONGA (CDC_D_PERPH_SUBTYPE == 0x02) from CAJON_2_0 (CDC_A_PERPH_SUBTYPE == 0x0a) in patch 0015 so CAJON-only HPH test/bias writes no longer silence right-channel HPHR output on nokia-sparkler while preserving CAJON_2_0 on nokia-beatles and existing audio/standby invariants. Rebuilt kernel/modules, updated test-audio-quality.py and docs, and rebuilt and verified all four a1125 (ampere) target images.
This commit is contained in:
1 parent
9619cc9541
commit
fa876abde1
13 files changed
+165
-91
No files matched your search
+9
-9
@@ -16,9 +16,9 @@ Release versions follow the `<year-letter><MM><DD>` format (where `2026` is `a`,
|
||||
|
||||
Upcoming release build (`a1125` / `ampere` via `scripts/version.sh`) targeting **Nokia 8110 4G (`nokia-argon`)**, **Nokia 2720 Flip (`nokia-beatles`)**, **Nokia 800 Tough (`nokia-coconut`)**, and **Nokia 8000 4G (`nokia-sparkler`)** while keeping `a1120` (`cocojamboo`) as the current published release.
|
||||
|
||||
### Audio playback quality (`0015` WCD `48 kHz` interpolators, PM8909 `CAJON_2_0` analog codec, PipeWire downmix & unity gain staging) across all targets
|
||||
### Audio playback quality (`0015` WCD `48 kHz` interpolators, PM8909 `CONGA` / `CAJON_2_0` analog codec, PipeWire downmix & unity gain staging) across all targets
|
||||
|
||||
- **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`.
|
||||
- **48 kHz WCD digital interpolators/decimators, MBHC wired jack autodetection, & PM8909 `CONGA` / `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 full stateful `msm8916_wcd_digital_reg_defaults[]` syncing in `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; set `CDC_A_RX_COM_OCP_CTL = 0x12` (`350 mA` limit instead of `0xD1`) and unlocked `CDC_D_SEC_ACCESS` / `CDC_A_SEC_ACCESS` (`0xA5`) around `PERPH_RESET_CTL4` `1 -> 0` reset in `pm8916_wcd_analog_probe()`; split PM8909 `CONGA` (`CDC_D_PERPH_SUBTYPE == 0x02`, `wcd_reg_defaults_conga` `NCP_FBCTRL = 0x28`, omitting `CAJON`-only `RX_HPH_TEST_CAJON_CFG` `0x80` / `NCP_VCTRL` / `RX_HPH_BIAS_PA` / `RX_HPH_BIAS_CNP` / `RX_HPH_CNP_EN_PU_MASK` writes that silenced `HPHR` right-channel headphone output on `nokia-sparkler`) from `CAJON_2_0` (`CDC_A_PERPH_SUBTYPE == 0x0a`, `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 restored defaults across `s2` standby gating without clobbering `SPK DAC Switch`, configured non-boost Class-D `SPK PA` (`SPKR_DRV_CTL = 0x69`/`0xE9`), `HPHL DAC`/`HPHR DAC`/`HPH PA` DAPM sequencing, and `+6 dB` analog `EAR PA` headroom (`RX_EAR_CTL BIT(5)`) for PM8909; 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 live on connected `nokia-sparkler` (`PMIC REV: 0 CODEC Version: 2 (CONGA)` with full stereo `997 Hz` L / `2113 Hz` R headphone output matching within `0.07 dB` on `HiFi__Headset__source` and audible Left/Right/Both confirmation), and previously verified on `nokia-beatles` (`CAJON_2_0`, `050/070/090 = 0x00000068`, `198/290/2b0 = 0x00000003`, idle MBHC readiness, `pm8909_s2` `state=disabled`).
|
||||
- **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`: `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`
|
||||
- `images/bananarchy-nokia-argon.img`: `34490465fe0f6ec89283495d0c1afc754205cfc8b6048895d8452ab4e677048e`
|
||||
- `images/bananarchy-nokia-beatles.img`: `c77b1fbfff31a08ce34d28ee950ea04211074bf7a2d45c97b7d24dabad178c4`
|
||||
- `images/boot-bananarchy-nokia-beatles.img`: `e42f548a025a1b902995333dedd1b5807a7bf750e758c8aa0ab8843cf45a3227`
|
||||
- `images/bananarchy-nokia-coconut.img`: `b2189eb9f3be83af33770abce61574047d3232a49760aac4894600f9e5d2b8cd`
|
||||
- `images/boot-bananarchy-nokia-coconut.img`: `379fd1ca70671505520609d4a2745b4eb1784152bbc2dca2d80b438b3d65e382`
|
||||
- `images/bananarchy-nokia-sparkler.img`: `3ebd73a99f63a849282f84f4aeba08cf499346a600b5adedb66633d1588414db`
|
||||
- `images/boot-bananarchy-nokia-sparkler.img`: `d00909d3b970af8cd93a7e53d3ef6a291b5ed55518ba858aae034439fa2acf02`
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in new issue
Block a user