Commit Graph
102 Commits
Author SHA1 Message Date
Abdurrahman Kaan DikeçandClaude Opus 5.5 0ec79df54d U30 Air runs the mainline kernels: VBUS from extcon-gpio, GPIO LEDs; unique USB serial numbers; bundles name their devices
- ssphy (6.18, 7.2): the U30 Air's device tree gives the PHY the PMIC's Type-C block as extcon, which has no driver
  under mainline, and the PHY deferred for ever (no USB at all). When extcon names that block, the PHY now takes
  VBUS from the extcon-usb-gpio node both boards have. CONFIG_LEDS_GPIO for its LEDs.
- init: the USB serial number is MU300LINUX-<serial number> (macOS gave a second device with the same one no network
  interface), and the serial number is read from the device tree's bootargs as well, since a mainline kernel
  forces its own command line.
- kernel bundles carry ./devices ("f50 u30air"); mu300-update and both installers keep a bundle without it off a
  U30 Air (its 5.4 ramdisk lacks the U30 Air modules, its mainline kernel the fix above). This replaces the
  "5.4 only" rule: the U30 Air gets every kernel and Ubuntu 26.04 from the next release on.
- FINDINGS 33c, README: what runs on the U30 Air under mainline (all but the battery reading).

Tested on the U30 Air with one-shot trials and --trial-guard, an F50 on the same Mac: 6.18 and 7.2 with USB network,
mobile data, VPN, hotspot (a Wi-Fi client for 3 minutes, no drops, 0% loss), Bluetooth and LEDs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
2026-09-28 08:59:56 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 26eb8d2b7a U30 Air: battery in mu300-toolkit, mu300-device, README and FINDINGS; build-mode installs get the VPN engines
- mu300-toolkit shows the battery (info and the live monitor) where there is one: level and whether it runs on
  USB power (the SQC charger reports "Unknown" once the battery is full, so the status alone says little)
- mu300-device: f50 or u30air, from /run/mu300/device or, under a boot image from before it existed (an older
  release's or a mainline kernel), from the device tree like init; mu300-led and mu300-lan-ip use it
- install.sh --build never put xray, hev-socks5-tunnel and sing-box into the image (only make-release did):
  mu300-vpn failed with "xray: not found". Found installing the U30 Air from a local build.
- README: supported devices; FINDINGS 33: the U30 Air port, the misc/boot_b lookup, two devices on one computer
- mu300-scp.py honours MU300_HOST like mu300-ssh.py

Tested: U30 Air installed with install.sh --build (Linux by default, Ubuntu 24.04, 5.4): 192.168.78.1 with MACs
from its serial, 93/93 modules, power/network/Wi-Fi LEDs, VPN over mobile data (~110 Mbit/s to a USB client),
the device's own LAN kept out of the tunnel with an F50's vpn.conf.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
2026-09-28 08:59:56 +03:00
github-actions[bot] b0c34409e7 chore(stats): update traffic and download metrics [skip ci] 2026-09-28 05:10:45 +00:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 3b2f7f3306 installer: the system menu no longer names Ubuntu 24.04 before asking 24.04 or 26.04
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
2026-09-27 20:30:07 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 e2670c98e0 README: screenshots of the installer (start, the kernel question in Turkish, the summary)
Rendered from real installer output (docs/images/installer/*.txt) with docs/images/installer/render.sh.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
2026-09-27 20:04:08 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 2cff7b0519 wcn pcie: a Wi-Fi card that is late at boot no longer panics the board (5.4 and mainline)
A PCIe scan that timed out removed the half-probed card, and sprd_pcie_remove() completed remove_done, which only
sprd_pcie_remove_card() initialises: an oops in __wake_up_locked and a panic, back to Android (caught while
rebooting OpenWrt on 5.4 for v2026.09.29). remove_done is initialised before each scan, remove guards against a
probe that set no data, and a timed-out scan is retried once.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
2026-09-27 15:38:39 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 92036fe230 init: find the Linux region itself instead of the offset written into the replaceable init
The installer writes the device's region offset into boot/init, but that copy lives in the device's ramdisk
segment; the generic segment behind it (every mu300-update boot image since v2026.09.27, and a mainline kernel
from the installer) brings its own init with the test board's offset. Devices whose region is elsewhere booted
into standalone mode and went back to Android after 300 s - reported for a 6.18 install, and very likely the
"5.4 update always ends in Android" report too. init now computes the region as the installer places it (first
2 MiB boundary after the last partition) and takes the first candidate that holds the mu300root filesystem.

Tested with a default offset that was wrong on purpose: found the region, booted.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
2026-09-27 14:50:52 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 eb5336875c 5.4: the IPA delegate fix of the mainline modules (OpenWrt crashed on some boots)
Testing v2026.09.29 caught OpenWrt on 5.4 falling back to Android: "Kernel panic - not syncing: CFI failure
(target: 0x0)" in dele-4-5, the delegate's connection thread - FINDINGS 31f, which was fixed only in the mainline
copy of the driver. The 5.4 tree gets the same change as kernel/patches/sipa-delegate-einprogress.patch.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
2026-09-27 14:24:21 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 abe1950ada 7.2 as a third kernel: installer, mu300-update and releases; the two driver fixes in 5.4 too
- installer choice 3 installs the newest stable mainline kernel (7.2.8 for now) the way 6.18 is installed;
  mu300-update kernel 5.4|6.18|7.2; the release carries mu300-kernel-7.2.tar.gz next to the 6.18 one
- upstream builds keep each kernel's outputs apart: OUTDIR=out-7.2 for build.sh/build-modules.sh,
  MU300_UPSTREAM_OUT for make-bundle.sh; make-release.sh packs both and checks each build's version
- 7.x: trusty and six Mali workqueues declare WQ_PERCPU (7.x warns about queues that say neither); a Mali queue
  name within the 31 characters
- 5.4: the Wi-Fi complock (irqsave) and Bluetooth tty port fixes as kernel/patches, applied by build-all.sh

Tested on the device: 7.2.8 on OpenWrt and Ubuntu with an empty dmesg, mobile data, hotspot, Bluetooth, GPU.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
2026-09-27 13:34:56 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 b38b6a4115 mainline: power off through the PMIC; what the command line's crutches keep, measured
- patch 0001 (spi-sprd-adi) registers a UMP9620 power-off handler ahead of PSCI SYSTEM_OFF, the vendor
  sc27xx-poweroff sequence (SLP_CTRL, then PWR_PD_HW). Tested: the power is cut (ramoops, kept across reboot, is
  gone), and the battery-less board restarts on a powered USB port.
- FINDINGS 31h: regulator_ignore_unused keeps the SIM's LDO on, fw_devlink=permissive the USB gadget (without it
  the board ran without USB and counted as booted), pd_ignore_unused has no effect, clk_ignore_unused keeps 315
  unused clocks on

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
2026-09-27 12:50:43 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 368ac9499c mainline modules: no warning left in dmesg, no thread parked in D state
- sipx, sblock, sbuf, smem, smsg, unisoc-mailbox: drop the "base_addr" attributes with neither show nor store,
  created on platform devices that are never registered (eight warnings per boot, readable by nobody)
- sipa_dummy: set the MAC with eth_hw_addr_set()
- slog_bridge: wait for the modem log with msleep_interruptible(); sc2355 tx thread: wait in TASK_IDLE - both
  kept the idle load average at 2.0

Ubuntu and OpenWrt on 6.18: dmesg without WARNING/Oops/BUG, mobile data, hotspot, Bluetooth up, idle load ~0.4.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
2026-09-27 12:42:34 +03:00
github-actions[bot] 886e2fcf97 chore(stats): update traffic and download metrics [skip ci] 2026-09-27 05:08:10 +00:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 74668a8ebb mainline: fix the three vendor bugs behind 6.18's boot warnings; ship modules.builtin
- sprd_wlan_combo: complock is taken in the PCIe tx-complete interrupt, so take it with irqsave everywhere
  (with _bh only, that interrupt on the lock holder's CPU deadlocks)
- sprdbt_tty: do not link the unused second port past the end of a one-line tty driver's ports[]
- sipa_eth, seth, sipa_usb: set the random MAC with eth_hw_addr_random() instead of writing dev_addr
- the 6.18 bundle carries modules.builtin(.modinfo); mu300-update installs them with an empty modules.order

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
2026-09-27 02:18:42 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 22258b7460 mu300-update: self-update replaces the file behind /usr/local/bin's link, not the link
The link in /usr/local/bin became a regular file, which usr/local's keep rule would have carried into every later
system, hiding its updater. Also: README and FINDINGS 32 on the one-boot fallback of older boot images and the
way back with su -c mu300-linux.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 01:30:49 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 5b5ad2cb30 mu300-update: download everything first, keep the IPA awake, and update itself
A device on an older boot image could end up starting only Android after an update. After about two quiet minutes
its IPA fails to power off and the mobile downlink stays dead until the next boot; the update unpacked a system
for minutes and then started the next download, which hung (curl had no timeout) or ended in a silent reset - and a
reset while boot_b is written leaves slot b unbootable. Reproduced from the installer image with kernel #11.

- every file (systems, kernel bundle) is downloaded and checked against SHA256SUMS before anything changes;
  partial files resume, stalled transfers time out, a dead downlink gives advice instead of a hang
- a ping every 3 s keeps the IPA from going idle while apply/boot/kernel run
- the mobile-data watchdog is stopped while the systems and boot_b are written
- the release carries mu300-update, and apply continues with it when it differs
- the account merge writes a copy and renames it (no half-written passwd at first boot); mu300-accounts runs
  before tmpfiles, sysusers and D-Bus
- rollback, clean and apply never remove the directory the running system booted from

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 00:49:10 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 1cee306e7e mainline: the IPA delegate survives traffic at load time (OpenWrt crashes and dead downlink); docs
The crash capture of the last commit caught both OpenWrt 6.18 crashes in the delegate's connection thread
(dele-4-5): a call through NULL (lr conn_thread+0x188) and a 22 s soft lockup in console_flush_all. The probe:
"driver CB returned with -115 / PROD_CP does not exist / cp_delegator_init failed: -22". OpenWrt brings the WAN
up before the delegate is loaded, so CONS_WWAN_UL is granted when sipa_delegator_start() makes it depend on
PROD_CP; that returns -EINPROGRESS, which the vendor code took for a failure - it deleted PROD_CP again,
cp_delegator_init() ignored that, failed on the Wi-Fi dependencies, and the failed probe freed the delegator
under the thread it had already started. The downlink died with it. On Ubuntu the delegate loads before there
is traffic and the call returns 0.

Fixed in sipa_dele: -EINPROGRESS is success; sipa_delegator_start()'s result is checked; the Wi-Fi offload
dependencies (unused here) only warn; the delegator is not devm-allocated. OpenWrt 4 boots in a row: delegate
bound, internet, no crash record (before: 1 crash in 4, the delegate never bound).

Also: the IPA's per-packet TX error (bursts while the delegate is not up yet) is rate limited, and the forced
command line has loglevel=3 - errors stay in dmesg and the journal, only critical messages go to the 115200
baud console (the vendor kernel runs at 1). Ubuntu on the final build: delegate bound, no oops, internet.

docs/FINDINGS.md gets a chapter on mainline as a daily kernel (31-31f); upstream/README.md is brought up to date.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 21:54:41 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 4aaa21fc03 gadget: NCM by default; RNDIS only on request, because macOS takes configuration 1 too
With RNDIS in configuration 1 and NCM in configuration 2, macOS chose configuration 1 (measured:
kUSBCurrentConfiguration 1), found no driver for the RNDIS control interface and had no network. Windows only
ever uses configuration 1 as well, so no order serves both. The single NCM + ACM configuration does: measured
from boot on macOS (AppleUSBNCMControl/Data, DHCP, SSH and internet over USB, no "inactive" link as with ECM)
and live on Windows 11 (UsbNcm.sys). MU300_USBNET="rndis ncm" keeps the RNDIS layout for Windows without NCM.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 15:53:47 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 261e1ba0c7 USB network without a driver on Windows: NCM, and RNDIS once the kernel has it
The gadget offered ECM, for which Windows has no driver. Now:
* NCM replaces ECM as the network function (ECM stays the fallback, MU300_USBNET=ecm restores the old gadget),
  and the device class is IAD (0xEF/2/1) so Windows' composite driver keeps each function's interfaces together.
  Tested live on the device: Windows 11 bound its inbox UsbNcm.sys, took a DHCP lease and reached the device and
  the internet; the ACM console stayed COM4.
* RNDIS for every Windows from 7 on, in configuration 1 with MS OS descriptors (compatible ID RNDIS/5162001) -
  Windows only ever uses the first configuration - and NCM in configuration 2, which Linux and macOS take, as with
  g_ether. boot/init renames the netdevs after binding (RNDIS registers first and would take usb0): usb0 stays
  the CDC link, rndis0 joins br-lan too.
  This needs CONFIG_USB_CONFIGFS_RNDIS, now in the kernel fragment. Unisoc's sprd_usb_f_rndis module cannot stand
  in: with CONFIG_USB_PAM it hands the data path to the IPA on connect, so its netdev never passes a packet
  (measured: Windows bound it, rndis0 stayed at 0/0). Without the stock function boot/init builds the single NCM
  configuration, as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 14:58:24 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 a0f248d2e0 FINDINGS: DSP-side VBC registers only through the driver's proc write
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-26 14:58:24 +03:00
github-actions[bot] e6f1dc51b1 chore(stats): update traffic and download metrics [skip ci] 2026-09-26 04:45:27 +00:00
github-actions[bot] f7a20b2aec chore(stats): update traffic and download metrics [skip ci] 2026-09-25 04:43:23 +00:00
github-actions[bot] 46b3b55fc4 chore(stats): update traffic and download metrics [skip ci] 2026-09-24 04:32:23 +00:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 e832186b57 audio and Ubuntu fixes from bringing audio up on a second board
A clean install on a second F50, with the audio stack added, turned up these:

* sms-pdu.awk used and()/or()/lshift()/rshift(), which busybox awk and gawk have and Ubuntu's mawk does not: every
  USSD answer and every SMS failed to decode on Ubuntu ("function and never defined"). They are b_* helpers in
  plain arithmetic now, without "^" either (busybox awk without math support rejects it). Checked against
  reference output from the old file on decode (GSM7, UCS2, alphanumeric sender, concatenated), encode and USSD:
  identical under mawk and busybox awk.
* /etc/modprobe.d/mu300-audio.conf keeps modprobe away from the 23 audio modules. Once depmod has indexed them,
  udev and request_module() load audio_mem and the card first, without the parameters mu300-audio-dsp passes;
  both are permanent and the card never registers until a reboot.
* mu300-voice holds the AGDSP domain (agdsp_access_en) during a call: closing a voice stream otherwise reads an
  AGCP register after the domain has dropped and panics the kernel (SError in check_agcp_mcdt_clock). It also
  starts the call scene, the hostless FE_VOICE, with the new tools/pcmhost - the HAL's pcm_start(), which aplay
  cannot do. Audio still does not move on this board; FINDINGS 24b has what was measured.
* The Ubuntu image gets alsa-utils (the audio scripts need amixer/aplay) and mu300-audio.service enabled (it skips
  itself without the audio modules). mu300-audio-dsp status no longer dies on an empty status read.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-23 09:24:19 +03:00
github-actions[bot] 5505d0092c chore(stats): update traffic and download metrics [skip ci] 2026-09-23 04:34:52 +00:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 4be83cbcb7 ubuntu: start the IPA delegate (it was never loaded), and confirm a boot once SSH is up
extra-modules and sipa-dele-start looked for sipa-dele.ko in /lib/modules/<release>/. OpenWrt keeps modules
there; the Ubuntu image keeps them under extra/. On Ubuntu the check failed silently, the delegate was never
started, and every Ubuntu image since it moved out of the module list had mobile data with an address and no
downlink. Both now look in both places. On the test unit it was hidden by a VPN still going through an HTTP
proxy on the computer at the other end of the USB cable - wget worked with sipa_eth0 at rx 0 and tx 0.

mu300-boot-ok was ordered after multi-user.target, so any service that never finished left the boot
unconfirmed and the next reboot counted it as failed. It now follows the USB network and SSH only.

Measured on Ubuntu on the device: the delegate loads at boot, rx climbs, the Xray tunnel reaches its server over
the bearer (exit IP is the server's), and boot-ok runs at 79 s after SSH at 47 s, re-arming 5 attempts.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-23 00:08:26 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 c08d4f315e boot: let the user choose how many failed boots fall back to Android, default 5
Default-Linux mode re-armed slot b with tries=2, which allows exactly one boot that may fail. Boot-ok comes about
a minute after power-on, so a single plug pull in that minute sent the device to Android - what just happened on
a test unit (uboot_log: slot b tries_remaining 1, check rollback, Booting slot_a). The initramfs counter meant to
allow five such boots never got a say, because LK rolled back first.

The installer (install.sh and install.ps1) now explains the trade-off and asks for N, 1-6, default 5; it is stored
in .mu300/boot-attempts and can be changed later with `mu300-next-boot attempts N`. Slot b is armed with
tries=N+1, so N unconfirmed boots in a row are allowed and the next is Android. The initramfs counter reads the
same N and fires on the same boot.

mu300-next-boot builds the block at run time from the initramfs' tries=2 block (mu300-update does not replace
the boot image, and older ones carry only that one), taking the CRC-32 from gzip's trailer. It first rebuilds
tries=2 and requires a byte-for-byte match with the initramfs' block, and falls back to it otherwise.

mu300-os now carries default-boot to the system it switches to: the initramfs reads it per system, so switching to
one where it was never set made the first reboot there go to Android.

Measured on the device (OpenWrt, N=5, boot-ok suppressed twice): LK booted slot b from tries 6, 5 and 4, and a
good boot re-armed 6. The shell CRC matches Python's zlib for tries 2-7.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-22 23:50:18 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 69b29f37c6 vpn: keep kill-switch configurations on sing-box, and never let xray lock a device out
An update keeps vpn.conf, and the old example set KILL_SWITCH=1. With the xray engine that is a lockout: before
the tunnel exists the server's name goes through dnsmasq and the certificate fetch through openssl, both
unmarked, so the kill switch drops both, the engine never comes up, and the kill switch then blocks everything
else. sing-box does its bootstrap lookup on its own marked socket and never had the problem.

An unset ENGINE now picks sing-box when KILL_SWITCH=1 and xray otherwise, so an updated device runs exactly what it
ran before. ENGINE=xray with the kill switch on runs without it and says so.

Measured on the device: an old-style config selects sing-box, a new one xray; xray with KILL_SWITCH=1 removes the
kill switch table, warns, and reaches the server; stopping leaves no rules, no xtun and no engine processes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-22 23:22:40 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 2d444befaf vpn: Xray engine on a kernel TUN, with a self-managing certificate pin
mu300-vpn gains ENGINE=xray, now the default: Xray-core speaks VLESS and hev-socks5-tunnel owns a plain kernel TUN
(xtun), handing every flow to Xray's SOCKS port on loopback. It reads the same VLESS_URI through the same parser;
ENGINE=sing-box keeps the old engine, and an image without the xray binaries falls back to it by itself.

The script does the routing neither program does, with sing-box's rule prefs and table so routing_cleanup and the
kill switch cover both: Xray's own sockets carry the 0x2d0 mark to main, the LAN and the server's address go to
main, everything else to xtun, and the device's own DNS is DNAT'd to REMOTE_DNS. The server name is resolved
before any of that exists and handed to Xray as an address. Xray, hev and the rules are torn down together on
every exit path.

Xray 26 removed allowInsecure. For a link that asks for it the leaf certificate is fetched with openssl once,
pinned as TLS_PIN_SHA256 in vpn.conf, and re-fetched only when Xray reports a pin mismatch (a renewal), after which
the service restarts. That report is info-level, so Xray runs at info and only warnings reach the system log.

Release: tools/fetch-xray.sh pins both binaries by sha256; make-release, assemble.sh and the OpenWrt build carry
them, and both images get openssl. The example config ships KILL_SWITCH=0 until the kill switch is re-tested
with Xray.

Measured on OpenWrt on the device: exit IP is the server's, apk works through the tunnel, a Wi-Fi client is
forwarded into xtun, and the three pin paths (none, present, mismatched) behave as described. Ubuntu is not yet
run on the device. FINDINGS 26e also records that busybox nc here has no -w - the reason an earlier test read
every destination as closed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-22 23:16:46 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5 71c998825f mobile data: gate the delegate on CGATT, and stop a LED write from hiding a live call
Three things, all from one session chasing "there is no internet" down the wrong hole twice.

sipa-dele-start waited on dmesg lines that the modem *loader* prints, so it was satisfied on its first check
and loaded the [permanent] module as early as before. It now waits for AT+CGATT? to answer 1, which cannot be
true before the CP's packet domain is running.

mobile-data's up() ended by turning the blue LED on. The PMIC rejected that write once, and under set -e the
failing && list ended the function one line before it reported success - with the context already up. The
caller saw a failure for a call that was live. LED writes go through a led() helper that cannot fail.

FINDINGS 13g records what the outage actually was - the internet PDP context had gone while the IMS one
stayed, and sipa_eth0 kept the previous address so every interface-level check still passed - plus the two
measurements that lie about it: sing-box's tun answers ICMP itself (sub-millisecond replies with tx_packets
frozen, and -I does not escape its ip rules), and with sing-box stopped the kill-switch turns the same ping
into EPERM. An idle SIPA reads as a broken one; none of those counters mean anything unless traffic is
leaving while they are read.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-22 22:45:54 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5 05bcf6d696 install: offer to make room on the 32 GB variant, and give it back on uninstall
That variant ships with userdata filling the disk, so there is no gap behind it
and the installer had nothing to do but refuse. It can now shrink userdata to
make one, and uninstall can grow it back.

Only userdata, and only because it is the last partition: its end moves and
nothing else does, so every other partition keeps its offset and the AVB
descriptors and the boot chain stay valid. That is the whole safety argument and
it does not transfer to any other partition here, which is why the tool refuses
when the partition named is not the last one.

tools/resize-last-partition.py does the edit and is deliberately fussy. It
validates both GPT signatures, both header CRCs and both entry-array CRCs, checks
that the two headers agree about the layout and sit where a GPT puts them, and
refuses a new end that is past the usable area or that would leave the partition
empty. It re-parses what it produced before the caller is allowed to write it.
Verified against this device's real table: it reads the 64 GB unit correctly
(userdata 12275712..54218751, 20.00 GiB, 32.39 GiB free behind it), shrinks and
refills round-trip, and all three guards fire.

install.sh asks how many GiB Linux should get, keeps at least 4 GiB for Android
and 800 MiB for Linux, aligns the boundary, prints what each side ends up with
and requires ERASE to be typed. It writes the backup GPT before the primary, so a
power cut between the two leaves the old table and a device that still boots, and
it reads the table back and checks the new end took before clearing Android's
data filesystem. --check reports and offers nothing.

uninstall.sh offers the reverse, off by default: on the 64 GB variant growing
userdata would hand it the factory gap, so the numbers are printed and the answer
has to be yes.

Both paths are labelled EXPERIMENTAL and tell the user to take a full backup with
tools/backup-device.sh first. They rewrite the partition table and erase
everything in Android; this has been done by hand on exactly one device (issue #2).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-22 20:46:37 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5 ab19e854c9 never stream a binary through adb exec-out "su -c ..." (issue #2)
On some devices su runs the command on a pty, and the tty layer's ONLCR rewrites
every LF as CRLF. exec-out exists to avoid exactly that translation, but the pty
su allocates puts it back, so every binary read came back inflated by about one
byte in 256 - silently, with no error anywhere.

jizni reported it with a proof that leaves no room: `dd bs=1M count=64` cannot
emit more than 67108864 bytes, and 67357842 arrived. For six firmware files the
CRLF count in the corrupted copy equals the LF count in the good one exactly, and
normalising the corrupted copy back makes it byte-identical.

What it costs when it happens: the Wi-Fi firmware reaches /lib/firmware mangled,
the driver loads without complaint and no phy is ever created - the install
reports success, 5G works and there is simply no hotspot, with nothing in any log
pointing at it. The boot image is built from a corrupted dump, so it is the wrong
size and its header and AVB tail are wrong. The vendor tar fails to extract. The
GPU closure dies in struct.unpack_from. The bootloader_control block is read from
a shifted offset.

Every binary read now goes through a file on the device and `adb pull`, which
never touches a pty and is correct whether or not that device's su allocates one:
install.sh (boot_a, the misc head, the six firmware files), uninstall.sh,
backup-device.sh, collect-logs.sh, reset-password.sh, extract-subset.sh,
extract_subset.py, pull_closure.py and both .ps1 scripts.

install.sh also refuses to continue when a firmware file could not be read, which
is what turns the worst case above into a loud failure instead of a device that
boots without Wi-Fi.

Secondary problems from the same report, all confirmed in the source:

* install.ps1 piped into the `Python` helper, an advanced function with no
  pipeline-bound parameter - the binding fails, and its body would not forward
  $input to the child's stdin even if it bound. Calls the interpreter directly.
* Python detection read only Get-Command's .Source, which is empty for the
  Microsoft Store's app-execution alias, so a working interpreter was "not found".
  Falls back to .Path.
* extract_subset.py created the output directory before validating the archive, so
  a failed run left an empty directory that every later run then skipped.
  Validates first.
* regdb-load's `sleep 0.3` is rejected by busybox sleep, so the wait loop spun
  instead of waiting.

FINDINGS 9b gains the 32 GB variant: shrinking `userdata`, which is the last
partition so nothing else moves and the boot chain stays valid, recovers 10 GiB
and the installer then runs unmodified.

Worth recording that this never reproduced here - the backups taken with
backup-device.sh on the maintainer's device are all exact partition sizes - which
is why it survived this long, and why the fix is written to be correct on both
kinds of device rather than conditional on detecting one.

Reported-by: jizni
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-22 20:37:31 +03:00
github-actions[bot] 05b47270e5 chore(stats): update traffic and download metrics [skip ci] 2026-09-22 04:38:51 +00:00
Abdurrahman Kaan DikeçandClaude Opus 5 4a1dfef098 audio: fix shm_shift, which had been silently doing nothing
Two mistakes stacked, and each one hid the other.

The patch was first written into audio_mem_whale2_parse_dt. This board's node is
compatible = "unisoc,audio-mem-sharkl5", so the code compiled, loaded, accepted
its module parameter and never ran. Moving it to the sharkl5 parser was the
obvious fix and it still did nothing, because of the second one:
build-audio.sh guarded the patch with `grep -q shm_shift`, and the first version
had already put that string in the tree - so the corrected patch was never
applied. The module kept the pr_info string from the old build, which made
`strings audio_mem.ko` look right while the call sat in the wrong function.

Then the regenerated patch would not compile: it had been diffed against a tree
that already carried the draft, so the declaration came out as a *context* line
and only the helper was an addition - putting the helper above the variable it
uses. It is now generated against pristine + audio-mem-fixed-region, which is the
base it actually builds on, and the guard keys on the function name instead of a
string an earlier version also had.

It works now: "moved the shared-memory addresses down by 0x100000, cmdaddr is now
0xaf880000", with smsg, aud-str, dsp-vbc and reg-dump following, all matching the
Moto G35's device tree.

Which turns that experiment into a clean negative. At its own addresses, its own
7 MiB region and its own shared memory, the Moto image still never answers, while
the donor image answers on the first try at this board's addresses. Whatever it
wants beyond a matching memory map, it is not the addresses.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-22 01:03:12 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5 7fa8eab542 audio: an AGDSP image has its addresses built in, so make room for both layouts
Why the Moto G35 image takes this device down, from its own device tree rather
than a guess: pulled out of vendor_boot.img in the same firmware, it puts
audio-mem at 0xaf600000 and a 7 MiB DSP region at 0xaf900000, with cmdaddr
0xaf880000 - a megabyte below this board's 0xaf700000 / 0xafa00000 / 0xaf980000.
Written to the wrong base the image runs into memory belonging to something else.
Read the other way it is reassuring: the donor image answers SIPC at 0xaf980000,
so it is built for this layout and is where it should be.

CONFIG_OF_RESERVED_MEM_ADD now reserves 0xaf600000,3M;0xaf900000,7M, contiguous
to 0xb0000000 and a superset of what this board uses, so one boot image can host
either. audio-mem-shm-shift.patch adds shm_shift for the addresses that are
absolute in the device tree instead of derived from the region - ddr32_base and
dspbin_base already move everything else.

The experiment itself is inconclusive rather than negative. At its own addresses
the Moto image no longer takes the board down and ldinfo reads 0xaf900000 /
7340032, but the DSP does not answer and shm_shift is not confirmed to have
taken effect - cmdaddr still shows as 0xaf980000 in the SIPC trace. FINDINGS says
so, along with two things that cost time here: audio_mem has three DT parsers and
this board uses the sharkl5 one, so a change made in whale2's compiles, loads,
accepts its parameter and does nothing; and the boot service loads audio_mem at
startup where it is [permanent], so trying another layout needs the service
disabled and a reboot first.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-22 00:38:20 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5 bffa114f60 audio: the AP side is proven done - the FIFO fills once and nobody empties it
Read the VBC registers during a stalled stream (only safe then; reading AGCP MMIO
with the domain asleep hangs the board). AUD_EN 0x300 and AUD_DMA_EN 0x3: the
playback FIFO is enabled and both DMA channels are on. PLY_FIFO0/1_STS 0x24a1 -
the low nine bits are 0xa1, so 161 words are sitting in the FIFO and not moving,
which is hw_ptr's 160 frames exactly. The DMA filled the FIFO once and stopped
because nothing is draining it, and in this design the consumer is the DSP.

That closes the AP side. Also closes parameters and modes: both sets were tried
with the param_id that works - the community's donor set, which comes from a ZTE
Voyage 41S (the same T760/UMS9620 as this board, and a phone with real audio),
and the U30 Air's native set - across modes 0, 2, 7, 9, 28 and Loopback 63, all
stalling identically. The sets are equivalent where it could matter: dsp_vbc mode
7 is byte-identical between them and audio_structure differs only in tuning, so
neither is a stripped build.

What remains is inside the AGDSP image: it answers SIPC commands on the first try
and never reads its input FIFO.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-21 23:55:47 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5 e066a62e1e audio: enable the MCDT clock in the driver, and load the DSP profiles properly
kernel/patches/mcdt-enable-clock.patch: check_agcp_mcdt_clock() reads BIT_MCDT_EN
and, when it is clear, every MCDT accessor returns early without touching the
hardware - so MCDT gets configured into a void while setup still looks like it
worked. Nothing in the driver set writes that bit. Since the driver already holds
the regmap and knows the bit, have it enable the block it is about to program.
The write only happens when the bit is clear and the result is read back, so a
controller that genuinely cannot be enabled still reports false.

mu300-audio-dsp gains a "profiles" command. The kernel takes the DSP parameters
through request_firmware(), so tools/vbc-profile's output in /lib/firmware is all
it needs, and the select value matters: (mode << 24) | (param_id << 16) | dsp_case
does nothing visible with param_id 0, but with 0x5e - what a working device of
this family carries - the mode is copied into the DSP's shared memory at
sprd,shmaddr-dsp-vbc. The mode numbers are call scenes (Handset, Handsfree,
Headset, BTHS, ... each NB/WB/SWB/FB/VOIP); there is no media mode in there at
all, which is worth knowing before chasing media playback through them.

FINDINGS records the reference comparison. A ZTE MU5358 registers the same
sprdphone-sc2730 card and does carry call audio; between idle and an active call
exactly 18 of its controls move, all routing and output. Applying the same shape
here - every S_*_CODEC switch at once, the codec output tree, agdsp_access_en -
changes nothing. Neither the F50's own Android nor a U30 Air (same ums9620) has
any audio to compare against, but the U30 Air does carry the native UMS9620
parameter XMLs, which are a better source than the community's donor copies.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-21 23:48:50 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5 5eb7333697 mu300-peek: warn that AGCP MMIO is unreadable while the domain sleeps
Reading VBC at 0x56510000 with the AGDSP domain powered down hangs the bus and
the watchdog takes the board with it - which on this device also costs slot B its
boot trial, so LK rolls back to Android. I did this while trying to check whether
the AP01 FIFO was draining, on the assumption that a read-only peek could not
hurt. It can. The same goes for MCDT and the AGCP AHB syscon; DDR and the
always-on syscons are fine at any time.

The repo copy of the tool was also still the read-only version; this brings over
the set/clr support that found BIT_MCDT_EN.

FINDINGS now lists all three ways the board has been taken down in this area -
the Moto firmware, opening a capture stream, and this - together with the
recovery, which needs ANDROID_SERIAL pinned because a second F50-family unit
answers adb at the same time.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-21 22:49:13 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5 cceff98ef2 audio: MCDT was switched off, and where the stall actually is
BIT_MCDT_EN (bit 12 of MODULE_EB0_STS at 0x64900000) was clear, so
check_agcp_mcdt_clock() returned false and every MCDT register access was
skipped - setup included, since mcdt_reg_read/raw_write/update all return early
without touching the hardware. "mcdt_dac_dma_enable ... mcdt_dma_ap_channel=1"
still prints, which is what makes it look healthy. Nothing in the audio drivers
ever writes that bit; they only read it.

I had written the "agcp mcdt clocl not available" message off as a teardown
artifact because that is where it first appears - after agdsp_access_disable()
drops the power domain. It was telling the truth. Setting the bit while the
domain is powered silences it and it persists. This matters for the voice path,
which runs through MCDT; normal playback does not, and its trace has no MCDT
lines at all.

Also records where media playback actually stops, with the measurements rather
than the guesses: the DMA advances once by 160 frames - exactly the burst:160
the driver programs - and then stops, with both sprd_dma interrupt counters at
zero throughout. Around that, the trigger path runs in full, the codec DAC and
its clocks are powered, and the DSP answers. Dynamic debug on the four audio
modules is what makes it visible and is the first thing to turn on when picking
this up. The device-type, mute, volume, codec-output, Virt Output Switch and
agdsp_access_en controls were all tried and change nothing.

With a warning attached: two experiments here took the board down hard enough
that slot B lost its trial and LK rolled back to Android.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-21 22:31:51 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5 0170376c8b tools: build the VBC DSP profiles the kernel asks for, without the HAL
vbc_profile_loading() takes its parameters through request_firmware() under the
bare names audio_structure, dsp_vbc, cvs and dsp_smartamp, so the kernel will
read them straight out of /lib/firmware and the proprietary audio HAL is not in
the picture at all. Writing 1 to the matching "… Profile Update" control loads a
blob; writing a mode to "… Profile Select" applies it. The format is a 24-byte
header ("audio_profile", num_mode, len_mode) and then num_mode * len_mode bytes.

The vendor ships the same data as XML, which carries both numbers in its root
element and then every field with an offset, a width and a value. The one thing
about it that is not guessable: id is an offset into the whole mode array rather
than into the mode it appears under - mode 1's first field sits at struct_size,
mode 2's at twice that. Read per-mode, every field outside mode 0 lands out of
range, which is exactly what the first attempt did. The converter checks the two
readings against each other and would say so rather than quietly truncating.

Verified on the device: all three blobs load with "vbc_profile_loading, return
0", selecting mode 0 applies them, and the DSP acknowledges the 620-byte
parameter payload that follows.

The XML is vendor parameter data and stays out of this repo; the tool takes a
path to a copy.

Also records two things about the audio path that cost time. "[MCDT] agcp mcdt
clocl not available" is a teardown artifact - it is logged after hw_free, once
agdsp_access_disable() has dropped the power domain, while during setup the same
block is fine and MODULE_EB0_STS reads 0x2063e2d1 with every relevant bit set.
And the real remaining symptom, measured rather than inferred: with everything in
place the DMA advances once, by 160 frames, and then freezes -

    state: RUNNING  hw_ptr: 160  appl_ptr: 24160  avail: 0   (t=2s through t=10s)

so the path is wired end to end and the DSP takes a first chunk. What makes it
come back for the second is the open question.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-21 21:11:08 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5 d02ab02e0f audio: the AGDSP is running after all - the blocker is its profiles
Retracting the previous commit's conclusion. It said the core was not executing
the image, on the strength of /dev/audio_dsp_log returning nothing. That was one
negative signal treated as a measurement: this firmware does not log at all.

The test that settles it is aud_send_cmd's own trace, because its exit line is
only reachable when aud_recv_cmd returned a reply - an unanswered command retries
four times and leaves through "failed to get command" instead. The kernel logs

    [Audio:SIPC] aud_send_cmd out,cmd =5 id:0 ret-value:0,repeat_count=1

on every PCM open. A reply on the first attempt: the DSP is up and answering.
mu300-audio-dsp now reports power-up and liveness as two separate things and uses
this for the second, instead of the log.

Two more inferences corrected. 0xaf700000 is sprd,ddr32-dma, a DMA buffer - the
AP/DSP mailbox is at sprd,cmdaddr 0xaf980000 and sprd,smsg-addr 0xaf980400, and
it does fill in once the domain powers. And /audio-mem-mgr's own compatible is
"unisoc,audio-mem-sharkl5" on a board whose syscons are "sprd,ums9620-glbregs",
so the SharkL5 string in the firmware header was never evidence of a wrong chip;
Motorola's genuine QogirN6Pro image carries the same label.

What actually blocks a PCM is configuration the Whale HAL supplies on Android.
vbc_profile_loading() pulls it in with request_firmware() under the bare names
audio_structure, dsp_vbc, cvs and dsp_smartamp, so the kernel will take them from
/lib/firmware with no HAL in the picture, triggered by writing 1 to the matching
"… Profile Update" control. The format is a 24-byte header ("audio_profile",
num_mode, len_mode) followed by num_mode * len_mode bytes, and the community's
donor-params XML carries exactly those numbers plus every field's offset, bits
and value. Converting one to the other is the next piece of work.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-21 20:57:10 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5 3ca268624f tools: mu300-peek, and what it proves about the AGDSP
This kernel is built with CONFIG_DEVMEM unset, so there is no /dev/mem and no
way to look at either the AGDSP's reserved DDR or the syscon registers that
sprd_audcp_boot writes through regmap. mu300_peek.ko is a dozen lines that
memremap or ioremap an address and hex-dump it to dmesg, and fails its own init
on purpose so the next insmod does not need an rmmod first.

With it, the AP side of the AGDSP is now verified rather than assumed. After
"start": bootprotect holds the 0x9620 magic, bootvector is 0x57d00040 which is
(0xafa00000 + 0x80) >> 1 exactly, bootaddress_sel is set, both force-shutdown
bits are clear and all three resets are released. The firmware is in DDR where
it should be - peeking 0xafa00000 shows the image's own header.

So the core is powered, pointed at the right address, and writes nothing: the
communication area at 0xaf700000 is byte-for-byte identical before and during
power-up, holding only the AP's own ring descriptors. agdsp_access and
audiocp_boot also read the same power-status register with the same mask, so
they cannot be disagreeing about whether the domain came up.

That leaves the image, which is a donor from a SharkL5/L6 device - the F50 has
no l_agdsp partition to take one from, and super carries no AUDCP header either.
What this needs is a genuine Qogirn6pro/UMS9620 AGDSP image. Everything else is
ready for one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-21 20:11:28 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5 18481f2d5e audio: correct the record - the AGDSP core is not running
I reported the DSP as running and wrote it into FINDINGS. It is not, and the
mistake was reading a powered domain as an executing one: agdsp_access_enable()
takes the AGDSP up through the PMU whether or not the core has an image to run,
so "wake up done" with no timeout and status core=0 sys=0 say nothing about the
firmware.

The test that does settle it is the DSP's own log. A running AGDSP writes to
/dev/audio_dsp_log over the audio SIPC sblock channel; here a read returns zero
bytes and the kernel says "sblock_receive wait interrupted". mu300-audio-dsp
now reports power-up and running as two separate lines.

This is not a Linux problem. The Android module says so in its own service.sh -
"AudioCP still times out on F50 even with the donor memory layout" - and the
Whale HAL module's README lists bridging cellular RX/TX through AudioRecord/
AudioTrack as explicitly outside what it achieves, which is exactly what a SIP
gateway needs. What works there is media audio and calls over a Bluetooth
headset's SCO link, which bypasses the AGDSP entirely.

Ruled out along the way, each checked rather than assumed: the firmware is
byte-identical to the image Android uses; the memory really is reserved; ldinfo
matches the image size so the whole of it is copied; and the load order does not
matter - writing it with sound@0 unbound, the way Android does, changes nothing.
That last one also makes the old "start reboots the device unless the card is
registered" rule untenable, so it is marked as not reproducible rather than left
standing as an explanation.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-21 19:58:26 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5 12cc5a4b13 mu300-audio-dsp: the DSP does load - open the routes and stop misreading idle
Two corrections, both measured, and together they are the difference between
"the audio DSP does not work on this board" and a running one.

  * The card registers with every route switched off. Opening a PCM then fails
    with "Unable to install hw params", which reads like a driver that cannot do
    16-bit 48 kHz; the real line is "no backend DAIs enabled for FE_NORMAL_AP01"
    a few above it in dmesg. The DPCM front ends reach their back ends through
    ~70 S_..._SWITCH mixer controls, all off at probe, which Android's HAL sets
    from configuration there is nothing to inherit from here. New "routes"
    command, also run by "start".
  * An idle AGDSP reads exactly like one that never started: the power domain is
    only up while a PCM is open, so sys_status is 7 the rest of the time. "start"
    checked it one second after writing the firmware and called a perfectly good
    load a failure. It now opens a PCM and watches agdsp_access_enable() take the
    domain up, and says so: "loaded - it woke when a PCM was opened".

With both in place the DSP runs - status core=0 sys=0 while a PCM is open - and
FE_ST_VOICE_PCM_P opens through BE_DAI_ID_VOICE_PCM_P, which is the path a call
needs and which needs no speaker. The header warning that "start" reboots the
device is gone: that was the card-ordering bug and it is fixed.

Also notes that agdsp_store() clamps each write to ldinfo's size, so a firmware
larger than the reserved region is truncated in silence while dd reports success.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-21 19:23:13 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5 3097f7784e mu300-ussd: send a USSD code and read the answer off the right channel
Three traps, all measured on the device:

  * The code has to be hex. AT+CUSD=1,"*101#",15 answers +CME ERROR: 3, and
    still does after AT+CSCS="GSM", so this is not the character set doing what
    the character set is documented to do. The hex form is accepted regardless
    of AT+CSCS.
  * The answer does not come back on the channel the command went out on. The
    command gets a bare OK on nr1 and the +CUSD arrives seconds later on nr0,
    the unsolicited channel, so anything waiting for it on nr1 waits for ever.
    mu300-atd already drains nr0 to a log, and that log is what this reads -
    waiting on a file also costs the modem nothing, which matters because
    polling it with AT commands is what jammed the channel in the first place.
  * The third +CUSD field is a CBS coding scheme, not an SMS one: 15 is the GSM
    alphabet, 72 is UCS2, which is what a Turkish menu comes back as. The body
    is hex-dumped one byte per character rather than packed into septets, so
    sms-pdu.awk gets a "ussd" mode instead of reusing the PDU path.

Verified end to end: *101# returns the SIM's own number, and a dcs=72 body
decodes with its Turkish characters intact.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-21 19:14:26 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5 18c5fa09b3 Bring the DSP up at boot too, now that the safe order is known
mu300-audio runs "start" rather than "load": it loads the drivers and the DMA engine, binds the card, and only
then writes the firmware - and the script refuses to touch the reset registers unless the card is registered,
which is the ordering that keeps the device from rebooting.

Verified from a clean boot with nothing typed: cards shows sprdphone-sc2730, the service log says "DSP started
from /lib/firmware/agdsp.bin (6291456 bytes)", and FE_ST_VOICE_PCM_P is at 01-53.

Two things that looked like faults and are not. The start is once per boot - from the cold state it works every
time, and re-running it on a DSP that has already booted leaves sys=7 while every step still reports success.
And sys flips between 0 and 7 by itself, which is the DSP's own power management; reading the status at an
arbitrary moment says little.

What says the path works is opening the endpoint: /dev/snd/pcmC1D53p opens and closes cleanly and takes its DMA
buffer from the reserved region (audio_mem_alloc addr = 0xaf725000). A call carrying audio through it is still
not done.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-21 16:01:39 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5 c61611bd73 The DSP reboot was an ordering problem, and status is a struct
Two answers, one of them a mistake of mine.

Starting the DSP reboots the device only when the sound card is not registered. Measured both ways: with
sprdphone-sc2730 up, writing the firmware and the reset registers leaves the device running - uptime went from
972 to 1225 seconds across the attempt; with the card missing, which is the state before sprd-dma is loaded,
the console shows an orderly CPU shutdown and "reboot: Restarting system" seconds later. Registering the card
is what exercises agdsp_access_enable, so with no card the AGDSP power domain is never up and start_store
writes RESET_SEL, CORE_RESET and SYS_RESET into a domain that is off. mu300-audio-dsp start now refuses unless
the card is there.

The register sequence itself was compared against the driver and the device tree and is fine, including the
boot vector: "dsp reboot by DDR!" means the dsp-reboot-mode property is absent and the mode is 0, which is the
branch that does set the vector.

And status is not a number. It is three u32s - core, sys, sleep - where sys is 0 for "power up finished" and 7
for "power off". After the first firmware write it read core=0 sys=0 sleep=6: the DSP was up, and the script
had been reporting failure because it compared the raw struct against the string "1".

Still open: the start is not repeatable. The first attempt after a boot works; later ones leave sys=7 with
every step reporting success - stop accepted and it does reset ppos, 1536 records written, ldinfo showing
0xafa00000 and 0x600000, start accepted, and not one line of kernel output. The suspicion is that the power
request agdsp_access_enable asserts has to be held across the start, and that the card bring-up at boot
provides that window once.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-21 08:57:55 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5 6cdc991331 Bring the sound card up at boot
mu300-audio on OpenWrt and mu300-audio.service on Ubuntu, both running "load" and never "start" - so nothing
at boot can reach the firmware write that reboots the device. The procd one backgrounds itself the way the
rest of the hardware bring-up does: binding the card takes about half a minute of waiting on probes, and
busybox init does not spawn the consoles until sysinit has returned.

Verified from a clean boot with no help: cards shows sprdphone-sc2730 and FE_ST_VOICE_PCM_P is at 01-53.

The README's sound row said the amplifier does not respond, which was true and is no longer the whole story.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-21 07:43:45 +03:00
github-actions[bot] 72eb19bbfb chore(stats): update traffic and download metrics [skip ci] 2026-09-21 04:42:15 +00:00
Abdurrahman Kaan DikeçandClaude Opus 5 56d3a6a69b The sound card comes up: sprdphone-sc2730, with the voice PCM at 01-53
cat /proc/asound/cards now has a second entry, and /proc/asound/pcm has nineteen devices on it including
FE_ST_VOICE_PCM_P at card 1 device 53 - the same card the community Android modules produce, and the endpoint
sipserver's detectVoicePCMDevice looks for. mu300-audio-dsp load does the whole thing in one command and it
survives a reboot.

The last obstacle was the DMA engine, and nothing points at it. CONFIG_SPRD_DMA is a module that nothing pulls
in, so /sys/class/dma is empty, sprd-pcm-audio defers for want of a channel, its component never registers, and
snd_soc_register_card fails with "ASoC: failed to init link FE_NORMAL_AP01: -517" - a message that names a link
and never mentions DMA. virt-dma and sprd-dma bring up two controllers with sixty channels and the platform
components follow.

The card's probe runs before any of that exists and is not retried, because it returns 0 even when the
registration deferred. Binding sound@0 again once everything is in place is what finishes it.

sprd-card-dummy-on-defer.patch handles the links whose codecs this board does not have. Two details cost a boot
each: it must apply only to the codec, since giving the cpu dai a dummy kills the card at link 0 instead of 57;
and the dummy has to be filled in directly rather than by returning -ENOENT, because
asoc_sprd_card_dummy_codec_sel reads 'sound-dai' as a u32 and insists on a zero phandle, so it answers -EINVAL
for a node that exists and merely never arrives.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-21 07:05:32 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5 5fa2191f80 The card's last link, and where the DSP bring-up stops
sprd-card-dummy-on-defer.patch settles dai link 57. BE_FAST_P_SMART_AMP asks for the smart amplifier this
board does not have, so snd_soc_of_get_dai_name defers for ever and asoc_sprd_card_probe abandons all 58 links
- the other 57 parse, BE_VOICE_PCM_P among them. A link whose codec phandle is simply absent already falls
back to a dummy one frame up; dummy_on_defer=1 extends that to one that keeps deferring. Only for the codec:
args_count is NULL exactly on the codec call, and giving the cpu dai a dummy kills the card at link 0 instead
of 57, which is how the narrower condition was found.

The firmware is 6 MiB, which is what settles which region is which - the DSP binary goes in audiodsp-mem at
0xafa00000 and the 3 MiB at 0xaf700000 is the shared memory. sprd_audcp_boot confirms it: base_addr_phy =
0xafa00000, bin size = 0x600000. No image is in this repository and none can be.

Where it stops: starting the DSP reboots the device. The drivers load, the firmware writes, and seconds later
the console shows an orderly CPU shutdown and "reboot: Restarting system" - deliberate, from userspace, not a
panic. start_store writes AUDCPBOOT_CTRL_SYS_RESET and CORE_RESET through regmap and on this board that
appears to reach past the audio core. So mu300-audio-dsp grew a "load" command that stops short of it and
brings up everything else; "start" is the opt-in that reboots, and says so.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-21 06:47:06 +03:00