Repository navigation
fix(audio): detect headphone jack on AYANEO Pocket S2 - #663
Merged
Merged
Conversation
Headphones plugged into the 3.5mm jack were never detected and audio kept playing from the speakers. Two independent causes: - The Pocket S2 DTS lacked qcom,hphl-jack-type-normally-closed and qcom,ground-jack-type-normally-closed on the WCD939x codec. Without them the MBHC code assumes the opposite switch polarity and plug detection loops forever (Elect Insert never fires, Headphone Jack stays off). The vendor Android DT sets msm-mbhc-hphl-swh = msm-mbhc-gnd-swh = 0, which maps to normally-closed, like Pocket Micro2 and FIT Elite. - The APS2 UCM profile used JackControl "Headset Jack", which is the input device name rather than an ALSA control. PipeWire therefore never learned the jack state and stayed on the speaker. Use "Headphone Jack" like all other devices. Generated by: Claude | Model: Claude Sonnet 4.6 | Role: AI-Generated Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
|
Hey Rebuilt against Armada preview 20261024.fea5c39. Headphone detection and output switching work, but playback becomes badly distorted above roughly 10% volume. Have you ever experienced distortion? |
5 tasks done
JPyke3
approved these changes
Oct 30, 2026
JPyke3
left a comment
Member
There was a problem hiding this comment.
This change looks all good. It seems like there is a distortion issue but that can be fixed outside the scope of this PR. This one just provides DTS definitions
Disk image
Downloads as a zip holding |
Author
Author
Contributor
|
I do have a fix but kept as draft. Sleep breaks it and I had no time to deal with it yet. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On the AYANEO Pocket S2, headphones plugged into the 3.5mm jack are never detected and audio keeps playing from the speakers.
Cause
Two independent issues:
qcom,hphl-jack-type-normally-closed/qcom,ground-jack-type-normally-closed. Without themwcd_dt_parse_mbhc_data()setshphl_swh/gnd_swhtotrue, i.e. the opposite switch polarity, and MBHC plug detection loops forever (mbhc sw intrrises,Elect Insertstays 0,Headphone Jackstays off). The vendor Android DT hasqcom,msm-mbhc-hphl-swh = <0>andqcom,msm-mbhc-gnd-swh = <0>, which map to normally-closed, as on Pocket Micro2 and FIT Elite.APS2/HiFi.confusedJackControl "Headset Jack", which is the input device name, not an ALSA control (the controls areHeadphone Jack,Mic Jack,DP0 Jack). PipeWire reported the port asavailability unknownand stayed on the speaker. All other devices useHeadphone Jack.Changes
packages/kernel/dts/sm8650-ayaneo-ps2.dts.patch: add both jack-type properties to&wcd939x.system_files/usr/share/alsa/ucm2/Qualcomm/sm8650/APS2/HiFi.conf:JackControl "Headphone Jack".Testing
Tested on a Pocket S2 running 20261007.816091e with a 4-pole headset, by swapping in a patched
sm8650-ayaneo-ps2.dtband a bind-mounted UCM file (not a full image build):Headphone Jack/Mic Jackgo toon, PipeWire marks the Headphones portavailableand the Speakernot available, default sink switches to Headphones, audio plays in the headphones.availability unknownand stays on the speaker, so the UCM change is required.Not verified: the headset microphone (the sensed plug type was
HPH Type = 2, and the Headset UCM device is still commented out), and a full image build with the patch applied (the DTS patch was only dry-run against the DTS withpatch).🤖 Generated with Claude Code