Skip to content

audio: improve Pocket S2 headphone playback and recovery - #817

Draft
mrdidit wants to merge 1 commit into
armada-os:mainfrom
mrdidit:fix/pocket-s2-headphone-recovery
Draft

mrdidit wants to merge 1 commit into
armada-os:mainfrom
mrdidit:fix/pocket-s2-headphone-recovery

Conversation

@mrdidit

@mrdidit mrdidit commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Pocket S2 headphone audio can distort, cut out or remain silent depending on boot and resume state. This series updates the jack configuration, PCM/ULP playback path and supporting WCD939x recovery handling.

Changes

  • Configure the S2 jack polarity, headphone profile and Class-H/SoundWire transport; preserve DP/local-output switching.
  • Align codec startup/shutdown and shared headphone supplies, and coordinate USBSS impedance measurement and codec-reset protection.
  • Check SoundWire cache/resume failures and add conditional USBSS state restoration every 15 seconds while the S2 is awake.

The S2 profile, device-tree settings and periodic recovery activation are device-specific. Supporting WCD939x, SoundWire, USBSS and common MBHC changes affect shared drivers. The 18 kernel patches remain ordered for review; fork CI and signing configuration are excluded.

Validation

The audio patch, device-tree and UCM files match test image 20261031.782257f, which built successfully and booted with verified kernel/module identities. Axiom Verge headphone audio is clean at maximum selected volume. Two follow-up checks, one reboot and one full shutdown/start with headphones connected after boot, also produced clean audio.

Local checks passed: 14 SoundWire and 77 USBSS failure/lifecycle cases, affected ARM64 object and PM-configuration builds, and the ALSA UCM duplicate-section test. This PR is based on b7b322a; its new full-image CI result is separate from the tested image.

Still under test

A pop occurs before clean output; its timing has not been measured. Sleep/wake, extended repeatability, other affected devices and the periodic worker's power/USB impact need validation. Repeated USBSS check-3 restoration also occurs on Android and during clean playback; its connection to the earlier distortion is unresolved. Headset microphone support is outside this change. Keep as draft while these checks continue.

Credits: rafalrojek's S2 jack work in #663; ovid-io's PCM and transport analysis in #803; Diogo Trindade's shared headphone sequencing; Qualcomm Android sources and the existing ROCKNIX PCM support. Pinned references and adaptations are recorded in packages/kernel/PATCHES.md.

AI assistance: OpenAI Codex (6 Astra, including Ultra) for investigation, implementation and review.

Configure the S2 PCM/ULP route and Class-H transport, align codec and jack
lifecycle, coordinate USBSS measurement and reset protection, and check
SoundWire cache/resume failures. Add S2-specific conditional USBSS recovery.

Retain the tested runtime changes from 782257f on current Armada main and
reconcile patch provenance. Exclude fork CI and container signing changes.

Based on rafalrojek's jack work in armada-os#663, ovid-io's transport analysis in armada-os#803,
Diogo Trindade's d7896ca shared sequencing and Qualcomm Android references.
@github-actions

Copy link
Copy Markdown

Disk image

armada-disk-pr817, built from 8bf1842

Downloads as a zip holding armada-*.img.gz and its .sha256.
GitHub requires you to be signed in to download run artifacts.

@rafalrojek

Copy link
Copy Markdown

Tested this on a real AYANEO Pocket S2 (image 20261029.664da8c, this PR's DTB, the five modules and the UCM applied on top of it).

Results, by ear:

  • Headphones and speakers: the volume slider works over the full range.
  • No crackle or noise at the top of the slider.
  • No pop at playback start.
  • Speaker/headphone switching is instant.
  • Suspend and resume with music playing in the headphones: sound comes back.

For comparison, the current image only changes headphone volume over roughly the first third of the slider. Our own attempt (#834: digital volume cap + UCM) only hid that, so I am closing it in favour of this PR.

One note for reviewers: the RX digital volume stays at 84, so there is no software ceiling on the headphone output. That sounded fine to me, but it is worth keeping in mind for people who listen at high volume.

@mrdidit

mrdidit commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

@rafalrojek

thank you for testing, I'll compare with #876 and then I try to spend some time work on sleep/wake validation.

@FeralAI FeralAI self-assigned this Nov 15, 2026
@FeralAI

FeralAI commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Hey @mrdidit, I'm merging a few other fixes for headphones that should fix Portal, Thor, Odin 3 and possibly the S2, but it relies on your 0081c patch. I'm hoping you can PR that separately, then I'll merge that and the other fixes so we can test what else from this draft might be still be needed.

@mrdidit

mrdidit commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Hey @FeralAI

#914

745 is not related but if you guys can have a look in return. 🥺😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants