fix(audioout): drop vibration ports when no pad audio device is open #2032

Merged
Aryansh1520 merged 2 commits from upstream-pr/2032 into main 2026-10-10 08:05:41 +00:00
Aryansh1520 commented 2026-10-09 05:31:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Aryansh1520 on 2026-10-09T05:31:43Z.


What

Without a DualSense audio device, AudioOut2MixPorts mixed every port into the main output, including PAD_VIBRATION ports. Their waveforms drive the controller's haptic actuators on the console and are never heard through the speakers. Mixed into the main output, they made PPSA28997's (God of War Sons of Sparta) combat about 20 dB louder than its dialogue. When no pad audio device is open, vibration ports are now left out; pad speaker ports still go to the main output as before. With a pad audio device, routing is unchanged.

Tested

  • Linux (CachyOS, kernel 7.2), GCC, no DualSense connected: PPSA28997's combat and dialogue play at consistent levels.
  • audio_out2_port_layouts covers the no-pad path (TestPadPortsWithoutPadDevice): vibration ports are left out of the main mix while pad speaker audio still reaches it. It fails without the fix; all six audio_out* tests pass with it.
  • tools/check_conventions.py --base origin/main passes.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4796419119 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2032). Originally posted by [Aryansh1520](https://github.com/Aryansh1520) on 2026-10-09T05:31:43Z. --- ### What Without a DualSense audio device, `AudioOut2MixPorts` mixed every port into the main output, including `PAD_VIBRATION` ports. Their waveforms drive the controller's haptic actuators on the console and are never heard through the speakers. Mixed into the main output, they made PPSA28997's (God of War Sons of Sparta) combat about 20 dB louder than its dialogue. When no pad audio device is open, vibration ports are now left out; pad speaker ports still go to the main output as before. With a pad audio device, routing is unchanged. ### Tested - Linux (CachyOS, kernel 7.2), GCC, no DualSense connected: PPSA28997's combat and dialogue play at consistent levels. - `audio_out2_port_layouts` covers the no-pad path (`TestPadPortsWithoutPadDevice`): vibration ports are left out of the main mix while pad speaker audio still reaches it. It fails without the fix; all six `audio_out*` tests pass with it. - `tools/check_conventions.py --base origin/main` passes. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
MarcZX10 commented 2026-10-09 05:37:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T05:37:26Z.


The routing change matches the reported behavior, but the PR adds no regression test. The existing AudioOut2PadMix tests cover vibration routing only when a pad output exists; they do not check AudioOut2MixPorts with padOut == nullptr, where the new drop decision lives. Could you add a focused test proving vibration data is omitted from the main mix while pad-speaker audio still reaches it? This looks practical with the existing AudioOut2 test setup. I’ll hold approval until that path is covered and CI runs.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6075010387 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2032#issuecomment-6075010387). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T05:37:26Z. --- The routing change matches the reported behavior, but the PR adds no regression test. The existing `AudioOut2PadMix` tests cover vibration routing only when a pad output exists; they do not check `AudioOut2MixPorts` with `padOut == nullptr`, where the new drop decision lives. Could you add a focused test proving vibration data is omitted from the main mix while pad-speaker audio still reaches it? This looks practical with the existing AudioOut2 test setup. I’ll hold approval until that path is covered and CI runs.
Aryansh1520 commented 2026-10-09 05:52:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Aryansh1520 on 2026-10-09T05:52:09Z.


Added TestPadPortsWithoutPadDevice to AudioOut2PortLayouts.cpp. The test uses SDL's disk driver, so no pad audio device is open and AudioOut2MixPorts runs with padOut == nullptr. It pushes a stereo vibration port (type 0x6, constant 0.75) together with a mono pad speaker port (type 0x3) in one context. It checks that the main mix is exactly the folded speaker data, and that a vibration port pushed on its own leaves the main mix silent.

Without the fix in AudioOut2Port.cpp, audio_out2_port_layouts fails; with it, all six audio_out* tests pass (Linux, GCC).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6075177556 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2032#issuecomment-6075177556). Originally posted by [Aryansh1520](https://github.com/Aryansh1520) on 2026-10-09T05:52:09Z. --- Added `TestPadPortsWithoutPadDevice` to `AudioOut2PortLayouts.cpp`. The test uses SDL's disk driver, so no pad audio device is open and `AudioOut2MixPorts` runs with `padOut == nullptr`. It pushes a stereo vibration port (type 0x6, constant 0.75) together with a mono pad speaker port (type 0x3) in one context. It checks that the main mix is exactly the folded speaker data, and that a vibration port pushed on its own leaves the main mix silent. Without the fix in `AudioOut2Port.cpp`, `audio_out2_port_layouts` fails; with it, all six `audio_out*` tests pass (Linux, GCC).
MarcZX10 commented 2026-10-09 05:54:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T05:54:57Z.

Review: COMMENTED


Thanks for adding the no-pad regression case. I built exact head 873dd864 on Linux with GCC 12; audio_out2_port_layouts passed 1/1 in 2.32 s, and check_conventions.py --base upstream/main passed. GitHub currently reports no checks on this head. Please get the required platform jobs running (or have a maintainer approve any held workflow) before merge; I will hold approval until the checks are visible.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5466240890 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2032#pullrequestreview-5466240890). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T05:54:57Z. **Review:** COMMENTED --- Thanks for adding the no-pad regression case. I built exact head `873dd864` on Linux with GCC 12; `audio_out2_port_layouts` passed 1/1 in 2.32 s, and `check_conventions.py --base upstream/main` passed. GitHub currently reports no checks on this head. Please get the required platform jobs running (or have a maintainer approve any held workflow) before merge; I will hold approval until the checks are visible.
Aryansh1520 commented 2026-10-09 10:36:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Aryansh1520 on 2026-10-09T10:36:59Z.


CI has now run on 873dd864: linux, windows, conventions, changes and report all pass (relinker skipped).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6079204370 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2032#issuecomment-6079204370). Originally posted by [Aryansh1520](https://github.com/Aryansh1520) on 2026-10-09T10:36:59Z. --- CI has now run on 873dd864: linux, windows, conventions, changes and report all pass (relinker skipped).
oneandonlydean commented 2026-10-09 20:14:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T20:14:56Z.


Conflicts with main in core/libs/prx/libSceAudioOut/tests/AudioOut2PortLayouts.cpp (b7b281678b); please rebase.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6088513249 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2032#issuecomment-6088513249). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T20:14:56Z. --- Conflicts with main in `core/libs/prx/libSceAudioOut/tests/AudioOut2PortLayouts.cpp` (b7b281678b); please rebase.
Aryansh1520 commented 2026-10-10 07:17:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Aryansh1520 on 2026-10-10T07:17:27Z.


Rebased onto main (f9cd694c) and resolved the conflict in AudioOut2PortLayouts.cpp: main's TestMeasuredMainPortFormats and this PR's TestPadPortsWithoutPadDevice now both run. All six audio_out* tests and conventions pass locally (Linux, GCC).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095038796 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2032#issuecomment-6095038796). Originally posted by [Aryansh1520](https://github.com/Aryansh1520) on 2026-10-10T07:17:27Z. --- Rebased onto main (f9cd694c) and resolved the conflict in `AudioOut2PortLayouts.cpp`: main's `TestMeasuredMainPortFormats` and this PR's `TestPadPortsWithoutPadDevice` now both run. All six `audio_out*` tests and conventions pass locally (Linux, GCC).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!2032
No description provided.