1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
|
/*++
Copyright (c) Microsoft Corporation All Rights Reserved
Module Name:
minipairs.h
Abstract:
Local audio endpoint filter definitions.
--*/
#ifndef _SYSVAD_MINIPAIRS_H_
#define _SYSVAD_MINIPAIRS_H_
#include "speakertopo.h"
#include "speakertoptable.h"
#include "speakerwavtable.h"
#include "speakerhstopo.h"
#include "speakerhstoptable.h"
#include "speakerhswavtable.h"
#include "michstopo.h"
#include "michstoptable.h"
#include "michswavtable.h"
#include "micarraytopo.h"
#include "micarray1toptable.h"
#include "micarraywavtable.h"
#include "cellulartopo.h"
#include "cellularwave.h"
#include "cellulartoptable.h"
#include "cellularwavtable.h"
#include "fmtopo.h"
#include "fmwave.h"
#include "fmtoptable.h"
#include "fmwavtable.h"
#include "handsetspeakertopo.h"
#include "handsetspeakertoptable.h"
#include "handsetspeakerwavtable.h"
#include "handsetmictopo.h"
#include "handsetmictoptable.h"
#include "handsetmicwavtable.h"
NTSTATUS
CreateMiniportWaveRTSYSVAD
(
_Out_ PUNKNOWN *,
_In_ REFCLSID,
_In_opt_ PUNKNOWN,
_In_ POOL_TYPE,
_In_ PUNKNOWN,
_In_opt_ PVOID,
_In_ PENDPOINT_MINIPAIR
);
NTSTATUS
CreateMiniportTopologySYSVAD
(
_Out_ PUNKNOWN *,
_In_ REFCLSID,
_In_opt_ PUNKNOWN,
_In_ POOL_TYPE,
_In_ PUNKNOWN,
_In_opt_ PVOID,
_In_ PENDPOINT_MINIPAIR
);
//
// Describe buffer size constraints for WaveRT buffers
//
static struct
{
KSAUDIO_PACKETSIZE_CONSTRAINTS2 TransportPacketConstraints;
KSAUDIO_PACKETSIZE_PROCESSINGMODE_CONSTRAINT AdditionalProcessingConstraints[1];
} SysvadWaveRtPacketSizeConstraintsRender =
{
{
2 * HNSTIME_PER_MILLISECOND, // 2 ms minimum processing interval
FILE_BYTE_ALIGNMENT, // 1 byte packet size alignment
0, // no maximum packet size constraint
2, // 2 processing constraints follow
{
STATIC_AUDIO_SIGNALPROCESSINGMODE_DEFAULT, // constraint for default processing mode
128, // 128 samples per processing frame
0, // NA hns per processing frame
},
},
{
{
STATIC_AUDIO_SIGNALPROCESSINGMODE_MOVIE, // constraint for movie processing mode
1024, // 1024 samples per processing frame
0, // NA hns per processing frame
},
}
};
const SYSVAD_DEVPROPERTY SysvadWaveFilterInterfacePropertiesRender[] =
{
{
&DEVPKEY_KsAudio_PacketSize_Constraints2, // Key
DEVPROP_TYPE_BINARY, // Type
sizeof(SysvadWaveRtPacketSizeConstraintsRender), // BufferSize
&SysvadWaveRtPacketSizeConstraintsRender, // Buffer
},
};
static struct
{
KSAUDIO_PACKETSIZE_CONSTRAINTS2 TransportPacketConstraints;
} SysvadWaveRtPacketSizeConstraintsCapture =
{
{
2 * HNSTIME_PER_MILLISECOND, // 2 ms minimum processing interval
FILE_BYTE_ALIGNMENT, // 1 byte packet size alignment
0x100000, // 1 MB maximum packet size
1, // 1 processing constraint follows
{
STATIC_AUDIO_SIGNALPROCESSINGMODE_COMMUNICATIONS, // constraint for communications processing mode
0, // NA samples per processing frame
20 * HNSTIME_PER_MILLISECOND, // 200000 hns (20ms) per processing frame
},
},
};
const SYSVAD_DEVPROPERTY SysvadWaveFilterInterfacePropertiesCapture[] =
{
{
&DEVPKEY_KsAudio_PacketSize_Constraints2, // Key
DEVPROP_TYPE_BINARY, // Type
sizeof(SysvadWaveRtPacketSizeConstraintsCapture), // BufferSize
&SysvadWaveRtPacketSizeConstraintsCapture, // Buffer
},
};
//
// Render miniports.
//
/*********************************************************************
* Topology/Wave bridge connection for speaker (internal) *
* *
* +------+ +------+ *
* | Wave | | Topo | *
* | | | | *
* System --->|0 2|---> Loopback | | *
* | | | | *
* Offload --->|1 3|--------------->|0 1|---> Line Out *
* | | | | *
* +------+ +------+ *
*********************************************************************/
static
PHYSICALCONNECTIONTABLE SpeakerTopologyPhysicalConnections[] =
{
{
KSPIN_TOPO_WAVEOUT_SOURCE, // TopologyIn
KSPIN_WAVE_RENDER_SOURCE, // WaveOut
CONNECTIONTYPE_WAVE_OUTPUT
}
};
static
ENDPOINT_MINIPAIR SpeakerMiniports =
{
eSpeakerDevice,
SPEAKER_TOPONAME, // defined in cellulartopo.h for use with cellular routing control
NULL, // optional template name
CreateMiniportTopologySYSVAD,
&SpeakerTopoMiniportFilterDescriptor,
0, NULL, // Interface properties
L"WaveSpeaker", // make sure this or the template name matches with KSNAME_WaveSpeaker in the inf's [Strings] section
NULL, // optional template name
CreateMiniportWaveRTSYSVAD,
&SpeakerWaveMiniportFilterDescriptor,
ARRAYSIZE(SysvadWaveFilterInterfacePropertiesRender), // Interface properties
SysvadWaveFilterInterfacePropertiesRender,
SPEAKER_DEVICE_MAX_CHANNELS,
SpeakerPinDeviceFormatsAndModes,
SIZEOF_ARRAY(SpeakerPinDeviceFormatsAndModes),
SpeakerTopologyPhysicalConnections,
SIZEOF_ARRAY(SpeakerTopologyPhysicalConnections),
ENDPOINT_OFFLOAD_SUPPORTED,
SpeakerModulesWaveFilter,
SIZEOF_ARRAY(SpeakerModulesWaveFilter),
&SpeakerModuleNotificationDeviceId,
};
/*********************************************************************
* Topology/Wave bridge connection for speaker (external:headset) *
* *
* +------+ +------+ *
* | Wave | | Topo | *
* | | | | *
* System --->|0 2|---> Loopback | | *
* | | | | *
* Offload --->|1 3|--------------->|0 1|---> Line Out *
* | | | | *
* +------+ +------+ *
*********************************************************************/
static
PHYSICALCONNECTIONTABLE SpeakerHsTopologyPhysicalConnections[] =
{
{
KSPIN_TOPO_WAVEOUT_SOURCE, // TopologyIn
KSPIN_WAVE_RENDER_SOURCE, // WaveOut
CONNECTIONTYPE_WAVE_OUTPUT
}
};
static
ENDPOINT_MINIPAIR SpeakerHsMiniports =
{
eSpeakerHsDevice,
SPEAKER_HEADSET_TOPONAME, // defined in cellulartopo.h for use with cellular routing control
NULL, // optional template name
CreateMiniportTopologySYSVAD,
&SpeakerHsTopoMiniportFilterDescriptor, // use the speaker headset topo filter descriptor, not headset.
0, NULL, // Interface properties
L"WaveSpeakerHeadset", // make sure this or the template name matches with KSNAME_WaveSpeakerHeadset in the inf's [Strings] section
NULL, // optional template name
CreateMiniportWaveRTSYSVAD,
&SpeakerHsWaveMiniportFilterDescriptor,
0, NULL, // Interface properties
SPEAKERHS_DEVICE_MAX_CHANNELS,
SpeakerHsPinDeviceFormatsAndModes,
SIZEOF_ARRAY(SpeakerHsPinDeviceFormatsAndModes),
SpeakerHsTopologyPhysicalConnections,
SIZEOF_ARRAY(SpeakerHsTopologyPhysicalConnections),
ENDPOINT_OFFLOAD_SUPPORTED,
NULL, 0, NULL, // audio module settings.
};
//
// headset microphone miniports.
//
/*********************************************************************
* Topology/Wave bridge connection for mic in *
* *
* +------+ +------+ *
* | Topo | | Wave | *
* | | | | *
* Mic in --->|0 1|===>|0 1|---> Capture Host Pin *
* | | | | *
* +------+ +------+ *
*********************************************************************/
static
PHYSICALCONNECTIONTABLE MicHsTopologyPhysicalConnections[] =
{
{
KSPIN_TOPO_BRIDGE, // TopologyOut
KSPIN_WAVE_BRIDGE, // WaveIn
CONNECTIONTYPE_TOPOLOGY_OUTPUT
}
};
static
ENDPOINT_MINIPAIR MicHsMiniports =
{
eMicHsDevice,
MIC_HEADSET_TOPONAME, // defined in cellulartopo.h for use with cellular routing control
NULL, // optional template name
CreateMiniportTopologySYSVAD,
&MicHsTopoMiniportFilterDescriptor,
0, NULL, // Interface properties
L"WaveMicHeadset", // make sure this or the template name matches with KSNAME_WaveMicHeadset in the inf's [Strings] section
NULL, // optional template name
CreateMiniportWaveRTSYSVAD,
&MicHsWaveMiniportFilterDescriptor,
0, NULL, // Interface properties
MICHS_DEVICE_MAX_CHANNELS,
MicHsPinDeviceFormatsAndModes,
SIZEOF_ARRAY(MicHsPinDeviceFormatsAndModes),
MicHsTopologyPhysicalConnections,
SIZEOF_ARRAY(MicHsTopologyPhysicalConnections),
ENDPOINT_NO_FLAGS,
NULL, 0, NULL, // audio module settings.
};
//
// Capture miniports.
//
/*********************************************************************
* Topology/Wave bridge connection for mic array 1 (front) *
* *
* +------+ +------+ *
* | Topo | | Wave | *
* | | | | *
* Mic in --->|0 1|===>|0 1|---> Capture Host Pin *
* | | | | *
* +------+ +------+ *
*********************************************************************/
static
PHYSICALCONNECTIONTABLE MicArray1TopologyPhysicalConnections[] =
{
{
KSPIN_TOPO_BRIDGE, // TopologyOut
KSPIN_WAVE_BRIDGE, // WaveIn
CONNECTIONTYPE_TOPOLOGY_OUTPUT
}
};
static
ENDPOINT_MINIPAIR MicArray1Miniports =
{
eMicArrayDevice1,
L"TopologyMicArray1", // make sure this or the template name matches with KSNAME_TopologyMicArray1 in the inf's [Strings] section
NULL, // optional template name
CreateMicArrayMiniportTopology,
&MicArray1TopoMiniportFilterDescriptor,
0, NULL, // Interface properties
L"WaveMicArray1", // make sure this or the tempalte name matches with KSNAME_WaveMicArray1 in the inf's [Strings] section
NULL, // optional template name
CreateMiniportWaveRTSYSVAD,
&MicArrayWaveMiniportFilterDescriptor,
ARRAYSIZE(SysvadWaveFilterInterfacePropertiesCapture), // Interface properties
SysvadWaveFilterInterfacePropertiesCapture,
MICARRAY_DEVICE_MAX_CHANNELS,
MicArrayPinDeviceFormatsAndModes,
SIZEOF_ARRAY(MicArrayPinDeviceFormatsAndModes),
MicArray1TopologyPhysicalConnections,
SIZEOF_ARRAY(MicArray1TopologyPhysicalConnections),
ENDPOINT_SOUNDDETECTOR_SUPPORTED,
NULL, 0, NULL, // audio module settings.
};
/*********************************************************************
* Topology/Wave bridge connection for cellular endpoint *
* *
* +------+ +------+ *
* | Wave1| | Topo | *
* | | | | *
* | | | | *
* | | | | *
* System BiDi <--|0 1|<---------------|1 0|<-- BIDI *
* | | | | *
* +------+ | | *
* | | *
* +------+ | | *
* | Wave2| | | *
* | | | | *
* | | | | *
* | | | | *
* System BiDi <--|0 1|<---------------|3 2|<-- BIDI *
* | | | | *
* +------+ +------+ *
* *
*********************************************************************/
static
PHYSICALCONNECTIONTABLE CellularTopologyPhysicalConnections[] =
{
{
KSPIN_TOPO_BIDI1_BRIDGE, // TopologyOut
KSPIN_WAVE_BIDI_BRIDGE, // WaveIn
CONNECTIONTYPE_TOPOLOGY_OUTPUT
}
};
static
ENDPOINT_MINIPAIR CellularMiniports =
{
eCellularDevice,
L"TopologyCellular", // make sure this or the template name matches with KSNAME_TopologyCellular in the inf's [Strings] section
NULL, // optional template name
CreateCellularMiniportTopology,
&CellularTopoMiniportFilterDescriptor,
0, NULL, // Interface properties
L"WaveCellular", // make sure this or the template name matches with KSNAME_WaveCellular in the inf's [Strings] section
NULL, // optional template name
CreateCellularMiniportWaveRT,
&CellularWaveMiniportFilterDescriptor,
0, NULL, // Interface properties
CELLULAR_DEVICE_MAX_CHANNELS,
CellularPinDeviceFormatsAndModes,
SIZEOF_ARRAY(CellularPinDeviceFormatsAndModes),
CellularTopologyPhysicalConnections,
SIZEOF_ARRAY(CellularTopologyPhysicalConnections),
ENDPOINT_CELLULAR_PROVIDER1,
NULL, 0, NULL, // audio module settings.
};
static
PHYSICALCONNECTIONTABLE CellularTopologyPhysicalConnections2[] =
{
{
KSPIN_TOPO_BIDI2_BRIDGE, // TopologyOut
KSPIN_WAVE_BIDI_BRIDGE, // WaveIn
CONNECTIONTYPE_TOPOLOGY_OUTPUT
}
};
static
ENDPOINT_MINIPAIR CellularMiniports2 =
{
eCellularDevice,
L"TopologyCellular", // make sure this or the template name matches with KSNAME_TopologyCellular in the inf's [Strings] section
NULL, // optional template name
CreateCellularMiniportTopology,
&CellularTopoMiniportFilterDescriptor,
0, NULL, // Interface properties
L"WaveCellular2", // make sure this or the template name matches with KSNAME_WaveCellular in the inf's [Strings] section
NULL, // optional template name
CreateCellularMiniportWaveRT,
&CellularWaveMiniportFilterDescriptor,
0, NULL, // Interface properties
CELLULAR_DEVICE_MAX_CHANNELS,
CellularPinDeviceFormatsAndModes,
SIZEOF_ARRAY(CellularPinDeviceFormatsAndModes),
CellularTopologyPhysicalConnections2,
SIZEOF_ARRAY(CellularTopologyPhysicalConnections2),
ENDPOINT_CELLULAR_PROVIDER2,
NULL, 0, NULL, // audio module settings.
};
/*********************************************************************
* Topology/Wave bridge connection for handset speaker endpoint *
* *
* +------+ +------+ *
* | Wave | | Topo | *
* | | | | *
* System --->|0 1|---> Loopback | | *
* | | | | *
* | 2|--------------->|0 1|---> Line Out *
* | | | | *
* +------+ +------+ *
*********************************************************************/
static
PHYSICALCONNECTIONTABLE HandsetSpeakerTopologyPhysicalConnections[] =
{
{
KSPIN_TOPO_WAVEOUT_SOURCE, // TopologyIn
KSPIN_WAVE_RENDER2_SOURCE, // WaveOut (no offloading)
CONNECTIONTYPE_WAVE_OUTPUT
}
};
static
ENDPOINT_MINIPAIR HandsetSpeakerMiniports =
{
eHandsetSpeakerDevice,
HANDSET_SPEAKER_TOPONAME, // defined in cellulartopo.h for use with cellular routing control
NULL, // optional template name
CreateHandsetSpeakerMiniportTopology,
&HandsetSpeakerTopoMiniportFilterDescriptor,
0, NULL, // Interface properties
L"WaveHandsetSpeaker", // make sure this or the template name matches with KSNAME_WaveHandsetSpeaker in the inf's [Strings] section
NULL, // optional template name
CreateMiniportWaveRTSYSVAD,
&HandsetSpeakerWaveMiniportFilterDescriptor,
0, NULL, // Interface properties
HANDSETSPEAKER_DEVICE_MAX_CHANNELS,
HandsetSpeakerPinDeviceFormatsAndModes,
SIZEOF_ARRAY(HandsetSpeakerPinDeviceFormatsAndModes),
HandsetSpeakerTopologyPhysicalConnections,
SIZEOF_ARRAY(HandsetSpeakerTopologyPhysicalConnections),
ENDPOINT_LOOPBACK_SUPPORTED,
NULL, 0, NULL, // audio module settings.
};
//
// handset microphone miniports.
//
/*********************************************************************
* Topology/Wave bridge connection for mic in *
* *
* +------+ +------+ *
* | Topo | | Wave | *
* | | | | *
* Mic in --->|0 1|===>|0 1|---> Capture Host Pin *
* | | | | *
* +------+ +------+ *
*********************************************************************/
static
PHYSICALCONNECTIONTABLE HandsetMicTopologyPhysicalConnections[] =
{
{
KSPIN_TOPO_BRIDGE, // TopologyOut
KSPIN_WAVE_BRIDGE, // WaveIn
CONNECTIONTYPE_TOPOLOGY_OUTPUT
}
};
static
ENDPOINT_MINIPAIR HandsetMicMiniports =
{
eHandsetMicDevice,
HANDSET_MIC_TOPONAME, // defined in cellulartopo.h for use with cellular routing control
NULL, // optional template name
CreateMiniportTopologySYSVAD,
&HandsetMicTopoMiniportFilterDescriptor,
0, NULL, // Interface properties
L"WaveHandsetMic", // make sure this or the template name matches with KSNAME_WaveHandsetMic in the inf's [Strings] section
NULL, // optional template name
CreateMiniportWaveRTSYSVAD,
&HandsetMicWaveMiniportFilterDescriptor,
0, NULL, // Interface properties
HANDSETMIC_DEVICE_MAX_CHANNELS,
HandsetMicPinDeviceFormatsAndModes,
SIZEOF_ARRAY(HandsetMicPinDeviceFormatsAndModes),
HandsetMicTopologyPhysicalConnections,
SIZEOF_ARRAY(HandsetMicTopologyPhysicalConnections),
ENDPOINT_NO_FLAGS,
NULL, 0, NULL, // audio module settings.
};
/*********************************************************************
* Topology/Wave bridge connection for FM RX *
* *
* +------+ +------+ *
* | Topo | | Wave | *
* | | | | *
* FM RX --->|0 1|===>|1 0|---> Capture Host Pin *
* | | | | *
* +------+ +------+ *
*********************************************************************/
static
PHYSICALCONNECTIONTABLE FmRxTopologyPhysicalConnections[] =
{
{
KSPIN_TOPO_FMRX_BRIDGE, // TopologyOut
KSPIN_WAVE_FMRX_BRIDGE, // WaveIn
CONNECTIONTYPE_TOPOLOGY_OUTPUT
}
};
static
ENDPOINT_MINIPAIR FmRxMiniports =
{
eFmRxDevice,
L"TopologyFmRx", // make sure this name matches with KSNAME_TopologyFmRx
NULL, // optional template name
CreateFmMiniportTopology,
&FmTopoMiniportFilterDescriptor,
0, NULL, // Interface properties
L"WaveFmRx", // make sure this or the template name matches with KSNAME_WaveFmRx in the inf's [Strings] section
NULL, // optional template name
CreateFmMiniportWaveRT,
&FmWaveMiniportFilterDescriptor,
0, NULL, // Interface properties
FMRX_DEVICE_MAX_CHANNELS,
FmRxPinDeviceFormatsAndModes,
SIZEOF_ARRAY(FmRxPinDeviceFormatsAndModes),
FmRxTopologyPhysicalConnections,
SIZEOF_ARRAY(FmRxTopologyPhysicalConnections),
ENDPOINT_NO_FLAGS,
NULL, 0, NULL, // audio module settings.
};
//=============================================================================
//
// Render miniport pairs. NOTE: the split of render and capture is arbitrary and
// unnessary, this array could contain capture endpoints.
//
static
PENDPOINT_MINIPAIR g_RenderEndpoints[] =
{
&SpeakerMiniports,
&SpeakerHsMiniports,
&HandsetSpeakerMiniports,
&CellularMiniports, // SIM 1
&CellularMiniports2 // SIM 2
};
#define g_cRenderEndpoints (SIZEOF_ARRAY(g_RenderEndpoints))
//=============================================================================
//
// Capture miniport pairs. NOTE: the split of render and capture is arbitrary and
// unnessary, this array could contain render endpoints.
//
static
PENDPOINT_MINIPAIR g_CaptureEndpoints[] =
{
&MicHsMiniports,
&MicArray1Miniports,
&HandsetMicMiniports,
&FmRxMiniports
};
#define g_cCaptureEndpoints (SIZEOF_ARRAY(g_CaptureEndpoints))
//=============================================================================
//
// Total miniports = # endpoints * 2 (topology + wave).
//
#define g_MaxMiniports ((g_cRenderEndpoints + g_cCaptureEndpoints) * 2)
#endif // _SYSVAD_MINIPAIRS_H_
|