Enumerating inactive volume sessions

In my last blog post on this topic I showed how to get all kinds of information for the active audio sessions, including the Windows 8 Store package identifier for the process (if there was one.)

However, I recently had a need to pull information for inactive sessions too – and it needed to run downlevel as far as possible (in particular, to Windows 7.) This meant I couldn’t use the Store APIs, since they were new for Windows 8. I actually wanted to go down to Windows Vista, but I needed the IAudioSessionControl2 interface, and that was new for windows 7.

Browse source

Download binary

Output on my system:

>volume-sessions.exe

— Devices of EDataFlow eRender (0) —
Speakers (Realtek High Definition Audio)
Peak: 0
Peak, channel 1 of 2: 0
Peak, channel 2 of 2: 0
Not muted
Volume range: 0% to 100% (-46.5 dB to 0 dB in steps of 0.03125 dB)
Master (%): 65.7804%
Master (dB): -6 dB
Volume, channel 1 of 2: 65.7804%
Volume, channel 2 of 2: 65.7804%
Volume, channel 1 of 2: -6 dB
Volume, channel 2 of 2: -6 dB

Session #1 of 3
State: AudioSessionStateInactive (0)
Icon path:
Display name:
Grouping parameter: {a68c25a9-fb30-4144-8002-d8c7615e81ed}
Session identifier: {0.0.0.00000000}.{2cbea9df-ca93-4e17-9708-e14139fd7044}|DeviceHarddiskVolume1Program Files (x86)Internet Exploreriexplore.exe%b{00000000-0000-0000-0000-000000000000}
Session instance identifier: {0.0.0.00000000}.{2cbea9df-ca93-4e17-9708-e14139fd7044}|DeviceHarddiskVolume1Program Files (x86)Internet Exploreriexplore.exe%b{00000000-0000-0000-0000-000000000000}|1%b10288
Process ID: 10288 (single-process)
System sounds session: no
Peak value: 0
ERROR: IAudioMeterInformation::GetMeteringChannelCount() reports zero channels
Master volume: 1 (0 dB FS)
Not muted
Volume, channel #1 of 2: 100% (0 dB FS)
Volume, channel #2 of 2: 100% (0 dB FS)

Session #2 of 3
State: AudioSessionStateInactive (0)
Icon path:
Display name:
Grouping parameter: {8bd029a1-b7da-48ed-bf89-0094a5961dd0}
Session identifier: {0.0.0.00000000}.{2cbea9df-ca93-4e17-9708-e14139fd7044}|DeviceHarddiskVolume1WindowsSystem32WWAHost.exe%b{00000000-0000-0000-0000-000000000000}
Session instance identifier: {0.0.0.00000000}.{2cbea9df-ca93-4e17-9708-e14139fd7044}|DeviceHarddiskVolume1WindowsSystem32WWAHost.exe%b{00000000-0000-0000-0000-000000000000}|1%b220
Process ID: 220 (single-process)
System sounds session: no
Peak value: 0
Peak, channel 1 of 2: 0
Peak, channel 2 of 2: 0
Master volume: 1 (0 dB FS)
Not muted
Volume, channel #1 of 2: 100% (0 dB FS)
Volume, channel #2 of 2: 100% (0 dB FS)

Session #3 of 3
State: AudioSessionStateInactive (0)
Icon path: @%SystemRoot%System32AudioSrv.Dll,-203
Display name: @%SystemRoot%System32AudioSrv.Dll,-202
Grouping parameter: {f12ec33c-5337-4bed-8bb5-2114e7d91d23}
Session identifier: {0.0.0.00000000}.{2cbea9df-ca93-4e17-9708-e14139fd7044}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}
Session instance identifier: {0.0.0.00000000}.{2cbea9df-ca93-4e17-9708-e14139fd7044}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}|1%b#
Process ID: 0 (multi-process)
System sounds session: yes
Peak value: 0
ERROR: IAudioMeterInformation::GetMeteringChannelCount() reports zero channels
Master volume: 1 (0 dB FS)
Not muted
Volume, channel #1 of 2: 100% (0 dB FS)
Volume, channel #2 of 2: 100% (0 dB FS)
— Devices of EDataFlow eCapture (1) —
No such devices.

EDIT September 22 2015: moved source to github https://github.com/mvaneerde/blog/tree/master/inactive-volume-sessions

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s