Skip to content

iPad 7: don't force the speaker format on the headphone PCM - #42

Open
jerricky26 wants to merge 1 commit into
OrchardLinux:mainfrom
jerricky26:j171-headphones-wireplumber
Open

jerricky26 wants to merge 1 commit into
OrchardLinux:mainfrom
jerricky26:j171-headphones-wireplumber

Conversation

@jerricky26

Copy link
Copy Markdown
Contributor

Follow-up to OrchardLinux/orchard#100 and OrchardLinux/omarchy-a@1fae6ab.

61-omarchy-a-ipad7-speakers.conf matches alsa.card_name = "J171 Speakers" / "J172 Speakers" and sets S16LE, 48 kHz, and a 4-channel map. That is correct for the speaker PCM. The headphone jack is a second PCM on the same card (hw:N,1, S32_LE, 2ch only). The card-name match applies the speaker format to both, and PipeWire never creates the headphones sink:

spa.alsa: hw:Speakers,1p: no format found (def:259) formats:S32_LE

62-omarchy-a-speaker-name.conf also matches every alsa_output.platform-sound.* node and names it "Speakers", including the headphones node.

Changes

  • Narrow 61 so the S16LE/4ch map applies only when node.name is alsa_output.platform-sound.HiFi__Speaker__sink, still limited to the J171 and J172 card names, so J71b's own rule is untouched:
matches = [
  { alsa.card_name = "J171 Speakers", node.name = "alsa_output.platform-sound.HiFi__Speaker__sink" }
  { alsa.card_name = "J172 Speakers", node.name = "alsa_output.platform-sound.HiFi__Speaker__sink" }
]
  • Narrow 62 to that same Speaker node, and add a rule that names the headphones node "Headphones" and sets S32LE / 48 kHz / [ FL, FR ].
  • Raise the headphones node to priority.session / priority.driver 1100. Speakers and headphones are separate nodes, and WirePlumber ranks them by PCM number (1000 vs 728), so the speakers stay the default even with the jack in. UCM PlaybackPriority only ranks routes. With 1100, plug switches the default to headphones and unplug switches it back. A user-saved default (a Bluetooth sink) still wins while it is connected.

The same card-name-only match is in 61-omarchy-a-j71b-speakers.conf. Once the shared headphone link from the orchard kernel PR is on J71b, that rule would block its headphones sink the same way. I can narrow its match to the Speaker node in this PR too, without changing its channel map.

Hardware test (one J171)

Official Omarchy A 0.3.0, with the headphone kernel from the orchard PR. Before this change, the headphones sink did not exist. After a live user override of the same rules: wired headphones played, unplug returned the default to the speakers, and the speakers were heard. BT earbuds were not connected during the test.

Signed-off-by: Duke Eagleman 301139544+jerricky26@users.noreply.github.com

The 61-omarchy-a-ipad7-speakers rule matched the whole card and forced
S16LE/4ch onto the headphone PCM, which only accepts S32_LE, so PipeWire
never created the headphones sink. 62 also named every platform-sound
output "Speakers". Narrow both to the Speaker node, and add a headphones
rule for S32LE/2ch, the Headphones nick, and priority 1100 so the jack
becomes the default while it is plugged.

Signed-off-by: Duke Eagleman <301139544+jerricky26@users.noreply.github.com>
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.

1 participant