Skip to content

Conversation

@playmer
Copy link
Contributor

@playmer playmer commented Jun 12, 2023

On the WASAPI backend, you can now call SDL_OpenAudioDevice for capture on playback devices.

Description

  • Modified SDL_AudioDriverImpl to allow backends to declare the capability to capture playback devices.
  • Modified WASAPI backend to declare the above capability.
  • Modified SDL_audio to allow users to record Playback devices when the backend declares this capability
  • Modified WASAPI backend to pass the LOOPBACK flag when capture is requested on a Playback device.

Existing Issue(s)

#7691

@slouken slouken requested a review from icculus June 12, 2023 02:56
@slouken
Copy link
Collaborator

slouken commented Jun 28, 2023

Hi! :)

@icculus
Copy link
Collaborator

icculus commented Jun 28, 2023

Hi! :)

Was that for me? :)

So what I want to do is make this use the same hint PulseAudio does: SDL_HINT_AUDIO_INCLUDE_MONITORS, to say "I want the output of other audio devices as a capture device too," which is exactly what we're doing here.

But also, the whole audio subsystem is about to look completely different when #7704 merges, so we should hold off on this a little longer and then incorporate the meat of this patch in once that's done.

If this is urgent, then let's just merge it now and I'll do the reworking mentioned above as part of #7704.

@playmer
Copy link
Contributor Author

playmer commented Jun 28, 2023

The hi was for verification on the SDL discord, we were slightly concerned about impersonation. Sorry for inadvertently getting your attentions icculus! This isn't urgent!

@icculus
Copy link
Collaborator

icculus commented Aug 7, 2023

The new audio subsystem is merged, so I expect to play around with this PR pretty soon. Just giving a status update here, you haven't been forgotten. :)

@icculus icculus self-assigned this Aug 7, 2023
@icculus icculus added this to the 3.2.0 milestone Aug 7, 2023
@slouken slouken modified the milestones: 3.2.0, 3.0 ABI May 20, 2024
@icculus
Copy link
Collaborator

icculus commented Sep 29, 2024

Still want this, but I'm going to kick this to 3.2.0 (since it's not an ABI change)...but definitely want some form of this in the official first release.

@icculus icculus modified the milestones: 3.0 ABI, 3.2.0 Sep 29, 2024
@icculus icculus added the icculus-priority Things @icculus is looking at within a larger milestone. label Jan 8, 2025
@slouken slouken modified the milestones: 3.2.0, 3.4.0 Jan 18, 2025
@icculus icculus removed the icculus-priority Things @icculus is looking at within a larger milestone. label Jan 19, 2025
@slouken
Copy link
Collaborator

slouken commented Nov 2, 2025

@playmer, can you update this PR for the latest main?

@playmer
Copy link
Contributor Author

playmer commented Nov 2, 2025

Sure, didn't want to step on Ryan's toes. I'll try to take a look today.

@icculus
Copy link
Collaborator

icculus commented Nov 2, 2025

Please step on my toes, this is something we want for 3.4.0.

@playmer playmer force-pushed the user/playmer/SDL3CapturePlaybackDevicesOnWasapi branch from df46791 to 6c0d3f5 Compare November 3, 2025 05:50
@playmer
Copy link
Contributor Author

playmer commented Nov 3, 2025

Wanted to push up my initial port to actual SDL3, I've tested it with this and it seems to be working: https://gist.github.com/playmer/0437306c0d72b273f2f41144c0da3f71 (sorry, hardcoded audio devices, didn't want to do anything too fancy at the moment so just repurposed the simple_playback example)

But I should probably take another look later this week with fresh eyes and make sure I'm not doing anything terrible.

@icculus
Copy link
Collaborator

icculus commented Nov 3, 2025

This PR is good.

I have minor tweaks, but I'll fix those after merge.

@icculus icculus merged commit 641deb9 into libsdl-org:main Nov 3, 2025
43 checks passed
@playmer playmer deleted the user/playmer/SDL3CapturePlaybackDevicesOnWasapi branch November 4, 2025 00:58
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