emoacht / HelloSwitcher

A Windows desktop tool to help switching cameras for Windows Hello
MIT License
38 stars 8 forks source link

wondering if this tool will help solve a problem #1

Closed spavett closed 3 years ago

spavett commented 3 years ago

I have a new Dell XPS laptop with windows hello face recognition built in. I also have a Logitech Brio, and external monitor connected to a Dell Thunderbolt dock. I work with the laptop lid open so both cameras are available to the system. I find a pattern of functionality:

I noticed that there was no way to specify which camera to use and wondered if some sort of race condition was present in windows hello face recognition where two cameras are present where eventually the sign-in process will bug out. Is this something you have encountered and does this switcher prevent it happening?

emoacht commented 3 years ago

Hello, I have not experienced a similar issue with my combination (Surface Pro 4 and Lenovo 500 FHD Webcam) and have no idea what actually happens in your system. Said that, this app intentionally disables specified built-in camera when specified USB camera is connected. Naturally it may change your system's issue.

Actually, I have been working on the improvement of this app and almost finished. Logitech Brio is one of rare web cam models capable of Windows Hello but I don't know much. So I am interested in how it looks like in the OS. If you don't mind, could you execute following command line command and post the result? It will help to make this app compatible with that camera.

pnputil /enum-devices /class camera /connected
spavett commented 3 years ago

Thanks for the response. Since my initial post I tried disabling the integrated webcam and the system used the Brio for a few unlocks but then the devices stopped working again so it seems the root cause is elsewhere. Might be a thunderbolt issue as the Brio can use a lot of bandwidth with its 4k res and there always appears to be an association with system Thunderbolt Controllers stopping at the same time when things go wrong.

The Logitech Brio seems to come up in various classes but not under camera.

steve@DESKTOP-ECSHQVU ❯ pnputil /enum-devices /class Camera /connected
Microsoft PnP Utility

Instance ID:                USB\VID_0BDA&PID_5510&MI_00\6&212fed36&0&0000
Device Description:         Integrated Webcam
Class Name:                 Camera
Class GUID:                 {ca3e7ab9-b4c3-4ae6-8251-579ef933890f}
Manufacturer Name:          Microsoft
Status:                     Started
Driver Name:                usbvideo.inf

Instance ID:                USB\VID_0BDA&PID_5510&MI_02\6&212fed36&0&0002
Device Description:         Integrated Webcam
Class Name:                 Camera
Class GUID:                 {ca3e7ab9-b4c3-4ae6-8251-579ef933890f}
Manufacturer Name:          Microsoft
Status:                     Started
Driver Name:                usbvideo.inf

As you see there are two integrated cameras I have no idea why there are two. There's only one web cam in the laptop itself. The Brio comes up under Imaging Devices in Device Manager but this class appears to be called Image in pnputil

steve@DESKTOP-ECSHQVU ❯ pnputil /enum-devices /class Image /connected
Microsoft PnP Utility

Instance ID:                USB\VID_046D&PID_085E&MI_00\7&3aaf9c37&0&0000
Device Description:         Logitech BRIO
Class Name:                 Image
Class GUID:                 {6bdd1fc6-810f-11d0-bec7-08002be2092f}
Manufacturer Name:          Logitech
Status:                     Started
Driver Name:                oem35.inf

It also shows up in the long list of USB Class devices

steve@DESKTOP-ECSHQVU ❯ pnputil /enum-devices /class USB /connected
Microsoft PnP Utility

Instance ID:                USB\VID_046D&PID_085E\2053DAE4
Device Description:         Logitech BRIO
Class Name:                 USB
Class GUID:                 {36fc9e60-c465-11cf-8056-444553540000}
Manufacturer Name:          Logitech
Status:                     Started
Driver Name:                oem59.inf

as well as an audio device

steve@DESKTOP-ECSHQVU ❯ pnputil /enum-devices /class audioEndpoint /connected
Microsoft PnP Utility

Instance ID:                SWD\MMDEVAPI\{0.0.1.00000000}.{6c6b8288-a6f5-4f90-803e-ca756e3114c5}
Device Description:         Microphone (Logitech BRIO)
Class Name:                 AudioEndpoint
Class GUID:                 {c166523c-fe0c-4a94-a586-f1a80cfbbf3e}
Manufacturer Name:          Microsoft
Status:                     Started
Driver Name:                audioendpoint.inf

Hope that helps with your update.

emoacht commented 3 years ago

Thank you for the quick response. The results of PnPUtil are quite helpful. The two built-in cameras may indicate ordinary camera and IR one. I would like to ask one more test of Win32 API. I am interested in whether it is possible to tell the two built-in USB cameras and Logitech Brio are removable or not. Could you execute the attached executable file and post the result again?

spavett commented 3 years ago

Can you share the code for the exe?

emoacht commented 3 years ago

No problem. I made some clean up and post it at https://gist.github.com/emoacht/0afa084cf30123f121492ab26fb8174d I am deleting the executable file. So could you build it on your own and execute it?

spavett commented 3 years ago

Updated output when plugged in to the dock...

/// 0 ///
ClassGuid:        {36fc9e60-c465-11cf-8056-444553540000}
DeviceInstanceId: USB\VID_08BB&PID_2902\C&115B6A5E&0&3
HardwareId:       USB\VID_08BB&PID_2902&REV_0100
FriendlyName:
IsRemovable:      True (CM_DEVCAP_REMOVABLE, CM_DEVCAP_SURPRISEREMOVALOK)
/// 1 ///
ClassGuid:        {36fc9e60-c465-11cf-8056-444553540000}
DeviceInstanceId: USB\ROOT_HUB30\7&2456A4D2&0&0
HardwareId:       USB\ROOT_HUB30&VID8086&PID15EC&REV0006
FriendlyName:
IsRemovable:      False (CM_DEVCAP_SURPRISEREMOVALOK)
/// 2 ///
ClassGuid:        {36fc9e60-c465-11cf-8056-444553540000}
DeviceInstanceId: USB\ROOT_HUB30\4&B777A39&0&0
HardwareId:       USB\ROOT_HUB30&VID8086&PID06ED&REV0000
FriendlyName:
IsRemovable:      False (CM_DEVCAP_SURPRISEREMOVALOK)
/// 3 ///
ClassGuid:        {53d29ef7-377c-4d14-864b-eb3a85769359}
DeviceInstanceId: USB\VID_27C6&PID_533C\5&338395B4&0&1
HardwareId:       USB\VID_27C6&PID_533C&REV_0100
FriendlyName:
IsRemovable:      False (CM_DEVCAP_SURPRISEREMOVALOK)
/// 4 ///
ClassGuid:        {88bae032-5a81-49f0-bc3d-a4ff138216d6}
DeviceInstanceId: USB\VID_0BDA&PID_5510&MI_04\6&212FED36&0&0004
HardwareId:       USB\VID_0BDA&PID_5510&REV_9179&MI_04
FriendlyName:     Camera DFU Device
IsRemovable:      False (0)
/// 5 ///
ClassGuid:        {36fc9e60-c465-11cf-8056-444553540000}
DeviceInstanceId: USB\ROOT_HUB30\5&143B23AF&0&0
HardwareId:       USB\ROOT_HUB30&VID10DE&PID1ADA&REV00A1
FriendlyName:
IsRemovable:      False (CM_DEVCAP_SURPRISEREMOVALOK)
/// 6 ///
ClassGuid:        {36fc9e60-c465-11cf-8056-444553540000}
DeviceInstanceId: USB\VID_0BDA&PID_0487\A&27150676&0&4
HardwareId:       USB\VID_0BDA&PID_0487&REV_0147
FriendlyName:
IsRemovable:      True (CM_DEVCAP_REMOVABLE, CM_DEVCAP_SURPRISEREMOVALOK)
/// 7 ///
ClassGuid:        {745a17a0-74d3-11d0-b6fe-00a0c90f57da}
DeviceInstanceId: USB\VID_413C&PID_B06F\C&115B6A5E&0&5
HardwareId:       USB\VID_413C&PID_B06F&REV_0101
FriendlyName:
IsRemovable:      True (CM_DEVCAP_REMOVABLE, CM_DEVCAP_SURPRISEREMOVALOK)
/// 8 ///
ClassGuid:        {36fc9e60-c465-11cf-8056-444553540000}
DeviceInstanceId: USB\VID_0BDA&PID_5487\A&27150676&0&2
HardwareId:       USB\VID_0BDA&PID_5487&REV_0147
FriendlyName:
IsRemovable:      True (CM_DEVCAP_REMOVABLE, CM_DEVCAP_SURPRISEREMOVALOK)
/// 9 ///
ClassGuid:        {ca3e7ab9-b4c3-4ae6-8251-579ef933890f}
DeviceInstanceId: USB\VID_0BDA&PID_5510&MI_00\6&212FED36&0&0000
HardwareId:       USB\VID_0BDA&PID_5510&REV_9179&MI_00
FriendlyName:     Integrated Webcam
IsRemovable:      True (CM_DEVCAP_REMOVABLE, CM_DEVCAP_SILENTINSTALL, CM_DEVCAP_SURPRISEREMOVALOK)
/// 10 ///
ClassGuid:        {36fc9e60-c465-11cf-8056-444553540000}
DeviceInstanceId: USB\VID_0BDA&PID_402E\200901010001
HardwareId:       USB\VID_0BDA&PID_402E&REV_0001
FriendlyName:
IsRemovable:      True (CM_DEVCAP_REMOVABLE, CM_DEVCAP_UNIQUEID, CM_DEVCAP_SURPRISEREMOVALOK)
/// 11 ///
ClassGuid:        {e0cbf06c-cd8b-4647-bb8a-263b43f0f974}
DeviceInstanceId: USB\VID_8087&PID_0026\5&338395B4&0&14
HardwareId:       USB\VID_8087&PID_0026&REV_0002
FriendlyName:
IsRemovable:      False (CM_DEVCAP_SURPRISEREMOVALOK)
/// 12 ///
ClassGuid:        {36fc9e60-c465-11cf-8056-444553540000}
DeviceInstanceId: USB\ROOT_HUB30\9&3104866A&0&0
HardwareId:       USB\ROOT_HUB30&VID8086&PID15F0&REV0006
FriendlyName:
IsRemovable:      False (CM_DEVCAP_SURPRISEREMOVALOK)
/// 13 ///
ClassGuid:        {745a17a0-74d3-11d0-b6fe-00a0c90f57da}
DeviceInstanceId: USB\VID_08BB&PID_2902&MI_03\D&13CA4AA6&0&0003
HardwareId:       USB\VID_08BB&PID_2902&REV_0100&MI_03
FriendlyName:
IsRemovable:      False (CM_DEVCAP_SURPRISEREMOVALOK)
/// 14 ///
ClassGuid:        {4d36e96c-e325-11ce-bfc1-08002be10318}
DeviceInstanceId: USB\VID_046D&PID_085E&MI_03\7&3AAF9C37&0&0003
HardwareId:       USB\VID_046D&PID_085E&REV_0317&MI_03
FriendlyName:     Logitech BRIO
IsRemovable:      False (CM_DEVCAP_SILENTINSTALL, CM_DEVCAP_SURPRISEREMOVALOK)
/// 15 ///
ClassGuid:        {4d36e96c-e325-11ce-bfc1-08002be10318}
DeviceInstanceId: USB\VID_0BDA&PID_402E&MI_00\D&E651DD6&0&0000
HardwareId:       USB\VID_0BDA&PID_402E&REV_0001&MI_00
FriendlyName:
IsRemovable:      False (CM_DEVCAP_SURPRISEREMOVALOK)
/// 16 ///
ClassGuid:        {36fc9e60-c465-11cf-8056-444553540000}
DeviceInstanceId: USB\VID_0BDA&PID_5413\B&1A029561&0&3
HardwareId:       USB\VID_0BDA&PID_5413&REV_0121
FriendlyName:
IsRemovable:      False (CM_DEVCAP_SURPRISEREMOVALOK)
/// 17 ///
ClassGuid:        {36fc9e60-c465-11cf-8056-444553540000}
DeviceInstanceId: USB\VID_0BDA&PID_5510\200901010001
HardwareId:       USB\VID_0BDA&PID_5510&REV_9179
FriendlyName:
IsRemovable:      False (CM_DEVCAP_UNIQUEID, CM_DEVCAP_SURPRISEREMOVALOK)
/// 18 ///
ClassGuid:        {4d36e972-e325-11ce-bfc1-08002be10318}
DeviceInstanceId: USB\VID_0BDA&PID_8153\111000001
HardwareId:       USB\VID_0BDA&PID_8153&REV_3111
FriendlyName:     Realtek USB GbE Family Controller
IsRemovable:      True (CM_DEVCAP_REMOVABLE, CM_DEVCAP_UNIQUEID, CM_DEVCAP_SURPRISEREMOVALOK)
/// 19 ///
ClassGuid:        {745a17a0-74d3-11d0-b6fe-00a0c90f57da}
DeviceInstanceId: USB\VID_413C&PID_B06E\B&1A029561&0&5
HardwareId:       USB\VID_413C&PID_B06E&REV_0101
FriendlyName:
IsRemovable:      True (CM_DEVCAP_REMOVABLE, CM_DEVCAP_SURPRISEREMOVALOK)
/// 20 ///
ClassGuid:        {ca3e7ab9-b4c3-4ae6-8251-579ef933890f}
DeviceInstanceId: USB\VID_0BDA&PID_5510&MI_02\6&212FED36&0&0002
HardwareId:       USB\VID_0BDA&PID_5510&REV_9179&MI_02
FriendlyName:     Integrated Webcam
IsRemovable:      True (CM_DEVCAP_REMOVABLE, CM_DEVCAP_SILENTINSTALL, CM_DEVCAP_SURPRISEREMOVALOK)
/// 21 ///
ClassGuid:        {36fc9e60-c465-11cf-8056-444553540000}
DeviceInstanceId: USB\VID_046D&PID_085E\2053DAE4
HardwareId:       USB\VID_046D&PID_085E&REV_0317
FriendlyName:
IsRemovable:      True (CM_DEVCAP_REMOVABLE, CM_DEVCAP_UNIQUEID, CM_DEVCAP_SURPRISEREMOVALOK)
/// 22 ///
ClassGuid:        {4d36e96c-e325-11ce-bfc1-08002be10318}
DeviceInstanceId: USB\VID_08BB&PID_2902&MI_00\D&13CA4AA6&0&0000
HardwareId:       USB\VID_08BB&PID_2902&REV_0100&MI_00
FriendlyName:     USB Audio CODEC
IsRemovable:      False (CM_DEVCAP_SILENTINSTALL, CM_DEVCAP_SURPRISEREMOVALOK)
/// 23 ///
ClassGuid:        {36fc9e60-c465-11cf-8056-444553540000}
DeviceInstanceId: USB\ROOT_HUB30\7&904153E&0&0
HardwareId:       USB\ROOT_HUB30&VID8086&PID15EC&REV0006
FriendlyName:
IsRemovable:      False (CM_DEVCAP_SURPRISEREMOVALOK)
/// 24 ///
ClassGuid:        {6bdd1fc6-810f-11d0-bec7-08002be2092f}
DeviceInstanceId: USB\VID_046D&PID_085E&MI_00\7&3AAF9C37&0&0000
HardwareId:       USB\VID_046D&PID_085E&REV_0317&MI_00
FriendlyName:     Logitech BRIO
IsRemovable:      True (CM_DEVCAP_REMOVABLE, CM_DEVCAP_SILENTINSTALL, CM_DEVCAP_SURPRISEREMOVALOK)
/// 25 ///
ClassGuid:        {745a17a0-74d3-11d0-b6fe-00a0c90f57da}
DeviceInstanceId: USB\VID_046D&PID_085E&MI_05\7&3AAF9C37&0&0005
HardwareId:       USB\VID_046D&PID_085E&REV_0317&MI_05
FriendlyName:
IsRemovable:      False (CM_DEVCAP_SURPRISEREMOVALOK)
/// 26 ///
ClassGuid:        {36fc9e60-c465-11cf-8056-444553540000}
DeviceInstanceId: USB\VID_0BDA&PID_0413\B&257CFF21&0&3
HardwareId:       USB\VID_0BDA&PID_0413&REV_0121
FriendlyName:
IsRemovable:      False (CM_DEVCAP_SURPRISEREMOVALOK)
emoacht commented 3 years ago

Thank you for the results again. Logitech Brio (shown in 24) seems okay. But built-in cameras (shown in 9 and 20) are unexpected. They must not be removable. Quite odd. Anyways, It is great help to improve this app.

emoacht commented 3 years ago

Released updated version. It should work with the devices of your system. I am not sure it can solve your issue though.

emoacht commented 3 years ago

Any new development? If no, I will close this issue.

spavett commented 3 years ago

Hi again. I will test during the weekend - been quite busy. On 26/02/2021 02:50:31, emoacht notifications@github.com wrote: Any new development? If no, I will close this issue. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub [https://github.com/emoacht/HelloSwitcher/issues/1#issuecomment-786373882], or unsubscribe [https://github.com/notifications/unsubscribe-auth/AAGVC2EELFP5I7FOG2RMMDTTA4D7NANCNFSM4XV6QNTQ].