DisplayName and IconPath are sometimes empty string.
bferdinandus opened this issue · 1 comments
bferdinandus commented
Hello,
Could you help me out?
I'm using these commands to be able to get the audio sessions for the active device
MMDeviceEnumerator deviceEnumerator = new MMDeviceEnumerator();
MMDevice device = deviceEnumerator.GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eMultimedia);
SessionCollection sessions = device.AudioSessionManager2.Sessions;
foreach (AudioSessionControl2 session in sessions)
{
Console.WriteLine($"Session Identifier: {session.GetSessionIdentifier}");
Console.WriteLine($"Session Name: {session.DisplayName}");
Console.WriteLine($"Session IconPath: {session.IconPath}");
Console.WriteLine("===================");
}
When the active device is my USB Headset then the DisplayName and IconPath are filled.
Session Identifier: {0.0.0.00000000}.{e4aa5a18-bf9b-470f-b5e2-f88a9d5c5998}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}
Session Name: @%SystemRoot%\System32\AudioSrv.Dll,-202
Session IconPath: @%SystemRoot%\System32\AudioSrv.Dll,-203
===================
Session Identifier: {0.0.0.00000000}.{e4aa5a18-bf9b-470f-b5e2-f88a9d5c5998}|\Device\HarddiskVolume4\Program Files\Mozilla Firefox\firefox.exe%b{00000000-0000-0000-0000-000000000000}
Session Name: Mozilla Firefox
Session IconPath: C:\Program Files\Mozilla Firefox\firefox.exe
===================
Session Identifier: {0.0.0.00000000}.{e4aa5a18-bf9b-470f-b5e2-f88a9d5c5998}|\Device\HarddiskVolume4\Program Files\VideoLAN\VLC\vlc.exe%b{4533F59D-59EE-00C6-ADB2-C68B501A6655}
Session Name: VLC media player
Session IconPath:
===================
But if I select my speakers as output then the DisplayName and IconPath are empty for some of the items.
Session Identifier: {0.0.0.00000000}.{e13e75ff-84a0-4dd6-bed0-ad11a8c3887b}|\Device\HarddiskVolume4\Program Files\VideoLAN\VLC\vlc.exe%b{4533F59D-59EE-00C6-ADB2-C68B501A6655}
Session Name: VLC media player
Session IconPath:
===================
Session Identifier: {0.0.0.00000000}.{e13e75ff-84a0-4dd6-bed0-ad11a8c3887b}|\Device\HarddiskVolume4\Program Files\Mozilla Firefox\firefox.exe%b{00000000-0000-0000-0000-000000000000}
Session Name:
Session IconPath:
===================
Session Identifier: {0.0.0.00000000}.{e13e75ff-84a0-4dd6-bed0-ad11a8c3887b}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}
Session Name: @%SystemRoot%\System32\AudioSrv.Dll,-202
Session IconPath: @%SystemRoot%\System32\AudioSrv.Dll,-203
===================
Maybe this is a specific problem for Mozilla Firefox? Why does the Name and IconPath of Mozilla disappear when I switch output devices?
With regards, Ben
morphx666 commented
Hi Ben,
Could you please try running the sample I just published (CoreAudioForms.Framework.Sessions) and see if you can reproduce the problem?