Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAR Implementation and Windows Server 2022 #122

Open
amurzeau opened this issue Aug 16, 2021 · 1 comment
Open

SAR Implementation and Windows Server 2022 #122

amurzeau opened this issue Aug 16, 2021 · 1 comment

Comments

@amurzeau
Copy link
Collaborator

The way SAR is designed is largely obsolete. I can talk about this now: if you want to solve this problem, look in the 10.0.22000 Windows SDK headers um\audioclientactivationparams.h for VIRTUAL_AUDIO_DEVICE_PROCESS_LOOPBACK and knock yourself out =)

@eiz I tried to read some documentation about that but I didn't understand the underlying goal.
Do you mean that Windows 10 will have a way to do what SAR is doing, but without needing a custom driver ?

@amurzeau amurzeau changed the title SAR Implementation and Windows 10 21H1 SAR Implementation and Windows Server 2022 Aug 16, 2021
@amurzeau
Copy link
Collaborator Author

The header contains this:

// Identifier for virtual audio device that supports audio loopback based on
// a process ID instead of the device interface path of a physical audio device.
// Use this for the deviceInterfacePath parameter of ActivateAudioInterfaceAsync when
// AUDIOCLIENT_ACTIVATION_PARAMS::ActivationType is set to AUDIOCLIENT_ACTIVATION_TYPE_PROCESS_LOOPBACK.
#define VIRTUAL_AUDIO_DEVICE_PROCESS_LOOPBACK L"VAD\\Process_Loopback"
typedef /* [v1_enum] */ 
enum PROCESS_LOOPBACK_MODE
    {
        PROCESS_LOOPBACK_MODE_INCLUDE_TARGET_PROCESS_TREE	= 0,
        PROCESS_LOOPBACK_MODE_EXCLUDE_TARGET_PROCESS_TREE	= 1
    } 	PROCESS_LOOPBACK_MODE;

// This structure is used when creating an IAudioClient using ActivateAudioInterfaceAsync
// for process-based loopback capture. The captured audio either includes or excludes audio rendered
// by the specified process and its child processes, based on how the ProcessLoopbackMode field is set.
typedef struct AUDIOCLIENT_PROCESS_LOOPBACK_PARAMS
    {
    DWORD TargetProcessId;
    PROCESS_LOOPBACK_MODE ProcessLoopbackMode;
    } 	AUDIOCLIENT_PROCESS_LOOPBACK_PARAMS;

typedef /* [v1_enum] */ 
enum AUDIOCLIENT_ACTIVATION_TYPE
    {
        AUDIOCLIENT_ACTIVATION_TYPE_DEFAULT	= 0,
        AUDIOCLIENT_ACTIVATION_TYPE_PROCESS_LOOPBACK	= 1
    } 	AUDIOCLIENT_ACTIVATION_TYPE;

// Activation parameter structure that can be used with ActivateAudioInterfaceAsync
// to create an IAudioClient.
typedef struct AUDIOCLIENT_ACTIVATION_PARAMS
    {
    AUDIOCLIENT_ACTIVATION_TYPE ActivationType;
    union 
        {
        AUDIOCLIENT_PROCESS_LOOPBACK_PARAMS ProcessLoopbackParams;
        } 	DUMMYUNIONNAME;
    } 	AUDIOCLIENT_ACTIVATION_PARAMS;

It seems to me that the goal is to allow an UWP app to capture audio output by some processes only (using the process ID) via the ActivateAudioInterfaceAsync function and a fake capture device.

So this does not seems to render SAR useless, as it is still not possible to output audio to a virtual user defined audio device.

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

No branches or pull requests

1 participant