Bewerken

Delen via


PKEY_AudioDevice_EnableEndpointByDefault

In Windows 7 and later versions of Windows, the endpoint builder categorizes endpoints into form factors. These form factors are based on the KSNODETYPE GUID of a pin on the kernel streaming (KS) filter to which the endpoint is connected. When the audio endpoint builder enumerates certain endpoints, for example those with form factor types such as UnknownFormFactor, the endpoint builder creates these endpoints as disabled and hidden. So you must use the Sound program in Control Panel to enable such endpoints before you can use them.

If you want to override this behavior so that your endpoint is created as enabled or disabled by default, Windows 7 provides the PKEY_AudioDevice_EnableEndpointByDefault registry key that allows you to do that.

The endpoint builder creates endpoints with any of the following KSNODETYPE values as disabled and hidden.

KS node type Form factor

KSNODETYPE_ANALOG_CONNECTOR

UnknownFormFactor

KSCATEGORY_AUDIO

UnknownFormFactor

KSNODETYPE_BIDIRECTIONAL_UNDEFINED

UnknownFormFactor

KSNODETYPE_EMBEDDED_UNDEFINED

UnknownFormFactor

KSNODETYPE_EQUALIZATION_NOISE

UnknownFormFactor

KSNODETYPE_EXTERNAL_UNDEFINED

UnknownFormFactor

KSNODETYPE_INPUT_UNDEFINED

UnknownFormFactor

KSNODETYPE_LEVEL_CALIBRATION_NOISE_SOURCE

UnknownFormFactor

KSNODETYPE_OUTPUT_UNDEFINED

UnknownFormFactor

KSNODETYPE_TELEPHONY_UNDEFINED

UnknownFormFactor

In Windows 7 and later versions of Windows, endpoints with a form factor of LineLevel but with a KSNODETYPE not equal to KSNODETYPE_LINE_CONNECTOR are also created as disabled and hidden. The following endpoints fall into this category.

KS node type Form factor

KSNODETYPE_1394_DA_STREAM

LineLevel

KSNODETYPE_1394_DV_STREAM_SOUNDTRACK

LineLevel

KSNODETYPE_ANALOG_TAPE

LineLevel

KSNODETYPE_CABLE_TUNER_AUDIO

LineLevel

KSNODETYPE_CD_PLAYER

LineLevel

KSNODETYPE_DAT_IO_DIGITAL_AUDIO_TAPE

LineLevel

KSNODETYPE_DCC_IO_DIGITAL_COMPACT_CASSETTE

LineLevel

KSNODETYPE_DSS_AUDIO

LineLevel

KSNODETYPE_DVD_AUDIO

LineLevel

KSNODETYPE_LEGACY_AUDIO_CONNECTOR

LineLevel

KSNODETYPE_MINIDISK

LineLevel

KSNODETYPE_MULTITRACK_RECORDER

LineLevel

KSNODETYPE_PHONOGRAPH

LineLevel

KSNODETYPE_RADIO_RECEIVER

LineLevel

KSNODETYPE_RADIO_TRANSMITTER

LineLevel

KSNODETYPE_SATELLITE_RECEIVER_AUDIO

LineLevel

KSNODETYPE_SYNTHESIZER

LineLevel

KSNODETYPE_TV_TUNER_AUDIO

LineLevel

KSNODETYPE_VCR_AUDIO

LineLevel

KSNODETYPE_VIDEO_DISC_AUDIO

LineLevel

The following INF file snippet shows how to use PKEY_AudioDevice_EnableEndpointByDefault to enable or disable an endpoint by default.

[Version]
...
Class=MEDIA
ClassGuid={4d36e96c-e325-11ce-bfc1-08002be10318}
...

[USBAudio]
...

[USBAudio.Interfaces]
AddInterface=%KSCATEGORY_AUDIO%,"GLOBAL",USBAudio.Interface
...

[USBAudio.Interface]
AddReg=Xyz.AddReg
...

;; AddReg section to set default behavior of endpoint
[Xyz.AddReg]
HKR,"EP\\n",%PKEY_AudioEndpoint_Association%,,%KSNODETYPE_GUID%
HKR,"EP\\n",%PKEY_AudioDevice_EnableEndpointByDefault%,0x00010001,EnableEndpointByDefaultMaskValue
...

[Strings]
KSCATEGORY_AUDIO="{6994AD04-93EF-11D0-A3CC-00A0C9223196}"
PKEY_AudioEndpoint_Association="{1DA5D803-D492-4EDD-8C23-E0C0FFEE7F0E},2"
PKEY_AudioDevice_EnableEndpointByDefault="{F3E80BEF-1723-4FF2-BCC4-7F83DC5E46D4},4"
...

In the preceding example, EnableEndpointByDefaultMaskValue represents a DWORD mask value that is a combination of an enable or a disable flag (FLAG_ENABLE or FLAG_DISABLE) and a data flow flag (FLOW_MASK_RENDER or FLOW_MASK_CAPTURE).

The following INF file snippet shows how a CD player is set up so that it is enabled by default and is configured as an input device (FLOW_MASK_CAPTURE).

[Version]
...
Class=MEDIA
ClassGuid={4d36e96c-e325-11ce-bfc1-08002be10318}
...

[USBAudio]
...

[USBAudio.Interfaces]
AddInterface=%KSCATEGORY_AUDIO%,"GLOBAL",USBAudio.Interface
...

[USBAudio.Interface]
AddReg=MDVAD.EPProperties.AddReg
...

;; AddReg section is used to set default behavior of endpoint for CD player.
;; Enable by default for KSNODETYPE_CD_PLAYER
[MDVAD.EPProperties.AddReg]
HKR,"EP\\0",%PKEY_AudioEndpoint_Association%,,%KSNODETYPE_CD_PLAYER%
HKR,"EP\\0",%PKEY_AudioDevice_EnableEndpointByDefault%,0x00010001,0x00000201
...

[Strings]
KSCATEGORY_AUDIO="{6994AD04-93EF-11D0-A3CC-00A0C9223196}"
KSNODETYPE_CD_PLAYER="{DFF220E3-F70F-11D0-B917-00A0C9223196}"
PKEY_AudioEndpoint_Association="{1DA5D803-D492-4EDD-8C23-E0C0FFEE7F0E},2"
PKEY_AudioDevice_EnableEndpointByDefault="{F3E80BEF-1723-4FF2-BCC4-7F83DC5E46D4},4"
…

In the preceding example, the bitwise OR combination of FLOW_MASK_CAPTURE and FLAG_ENABLE is equivalent to the bitwise OR combination of 0x00000200 and 0x00000001 with a result of 0x00000201. The following table shows the values of the flags and masks that you can use with PKEY_AudioDevice_EnableEndpointByDefault.

Flag or endpoint mask Value

FLAG_DISABLE

0x00000000

FLAG_ENABLE

0x00000001

FLOW_MASK_CAPTURE

0x00000200

FLOW_MASK_RENDER

0x00000100