Skip to content

feat(libSceAudioIn): implement sceAudioInIsPadEmbeddedMic - #6101

Closed
fdfawef324 wants to merge 1 commit into
boykopovar:mainfrom
fdfawef324:claude/audioin-is-pad-embedded-mic
Closed

fdfawef324 wants to merge 1 commit into
boykopovar:mainfrom
fdfawef324:claude/audioin-is-pad-embedded-mic

Conversation

@fdfawef324

Copy link
Copy Markdown
Contributor

What

sceAudioInIsPadEmbeddedMic (X+4jdIS75P0) is no longer NotImplemented. On main, a title that calls it stops there with sceAudioInIsPadEmbeddedMic not implemented. #2355 shows such a call: right after sceAudioInOpen and sceAudioInGetSilentState, with the new handle in edi, and the 32-bit result is used.

  • It looks the handle up as sceAudioInGetSilentState, sceAudioInInput and sceAudioInClose do, under the same lock. A handle that names no open port (0, negative, above 8, a free slot or a closed port) returns AUDIO_IN_ERROR_INVALID_HANDLE (0x80260101), the same error those calls return.
  • An open handle returns 0. AnyPS5 never selects a controller's embedded microphone: every port opens the host's default SDL capture device, or none when there is no device, and returns 0 even when that host device is a DualSense microphone (recorded as debt).

Astro Bot imports it (PPSA21567, #357). Nobody has reported a stop on it there, so the Unblocks line says none.

The Unknown function info entry in docs/dev/debt/libSceAudioIn.md changes from "still throws" to the behaviour above, with what is not verified:

  • the result's meaning comes from the name;
  • a DualSense microphone that is the host's default capture device still returns 0;
  • the invalid-handle code is taken from the other calls. KytyPS5 returns 0x80260101 for a closed port as well; shadPS4 returns 0x80260109 (NOT_OPENED). This applies to every AudioIn call on main, so this PR keeps 0x80260101 and does not change the others;
  • the console's value for an embedded microphone is unknown.

With this, no AudioIn export is left without an implementation, so the TechnicalDebt.md index line on assumed signatures now names only NpSessionSignaling, as 8ef51df did for PlayerInvitationDialog.

No other open PR implements this function. The searches were sceAudioInIsPadEmbeddedMic, IsPadEmbeddedMic, PadEmbeddedMic (all states) and libSceAudioIn in:title; sceAudioInIsPadEmbeddedMic and PadEmbeddedMic were searched again among open PRs right before opening this one.

Test: core/libs/tests/GuestAudioIn.cpp

  • guest_audio_in_capture: the port opened on the SDL disk capture device returns 0.
  • guest_audio_in_no_device: the port opened with SDL_AUDIODRIVER=none returns 0. Handle 0, handle -1, handle 9, an unused slot and a closed port each return 0x80260101.

Tested

Windows Server 2025 (10.0.26100), WinLibs MinGW-w64 GCC 15.2.0, Ninja, Release, BUILD_TESTING=ON, rebased on main 922abe6.

  • Red, with main's Export.cpp and this test change: guest_audio_in_capture and guest_audio_in_no_device both abort (0xc0000409) on terminate called after throwing an instance of 'std::runtime_error', what(): sceAudioInIsPadEmbeddedMic not implemented.
  • Green, with this change: both pass in 4 of 4 runs (0.23-0.52 s and 0.17-0.95 s). These are the only tests of libSceAudioIn.

Not tested: Linux, macOS, a console, and any title.

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 under Silent stubs in their library's technical debt file
  • 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
  • Unblocks: none
  • GPUs tested: n/a (no AGC, shader recompiler or VideoOut change)
  • AI-assisted: yes (Claude Code)

Part of #2355

🤖 Generated with Claude Code

sceAudioInIsPadEmbeddedMic threw NotImplemented, so a title that asks
whether a port it just opened captures from the controller's embedded
microphone stopped there.

It now looks the handle up as sceAudioInGetSilentState, sceAudioInInput
and sceAudioInClose do: a handle that names no open port returns
AUDIO_IN_ERROR_INVALID_HANDLE (0x80260101). AnyPS5 never selects a
controller's embedded microphone: every port opens the host's default
SDL capture device, or none, so an open handle returns 0, also when that
host device is a DualSense microphone.

guest_audio_in_capture and guest_audio_in_no_device check 0 for an open
port with and without a host device, and the invalid-handle error for
handle 0, a negative handle, an out-of-range handle, an unused slot and
a closed port.

The debt entry records that the result is read from the name, that
shadPS4 returns NOT_OPENED (0x80260109) for a closed port where KytyPS5
returns 0x80260101, and that neither result, nor the console's value for
an embedded microphone, is verified on a console. With this, no AudioIn
export is left without an implementation, so the index line on assumed
AudioIn signatures now names only NpSessionSignaling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Progress report (922abe6 → e0a6bf6)

📈 System libraries: 88.72% (+0.03%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceAudioIn sceAudioInIsPadEmbeddedMic

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#6039 docs/dev/TechnicalDebt.md L19-20

@fdfawef324

Copy link
Copy Markdown
Contributor Author

Closing this myself to respect the queue policy in #4826: no title has been shown to stop here on main yet. The branch stays on my fork; I'll reopen it with the title ID and the log line if one of the titles I run (Demon's Souls, GTA V, Black Myth: Wukong, Resident Evil 4, Astro Bot) stops on it.

AI-assisted: yes

@fdfawef324 fdfawef324 closed this Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant