크롬에서만 웹캠이 인식이 안 되는 문제..?

현상

회사 동료가 맥os 노트북을 사용중인데, 크롬에서만 웹캠이 인식이 되지 않음

https://webcamtests.com/ 에 접속해서 웹캠 테스트시, 다른 브라우저에서는 잘 되는데 크롬에서만 웹캠이 인식되지 않음.

추적

1
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --enable-logging --v=0

터미널에서 위 명령어를 이용해 크롬을 열었을 때의 로그이다

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
objc[1355]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x7ffa4ed973f0) and /Applications/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Versions/110.0.5481.100/Libraries/libGLESv2.dylib (0x113fc7220). One of the two will be used. Which one is undefined.
[/Users/build/sandbox/BuildRepos/Sol-Windows-1/External/VirtualMonitor-macOS/MersiveRelayCam/RelayPlugin/VtcComLib/VtcComLib.cpp] initializer()
[/Users/build/sandbox/BuildRepos/Sol-Windows-1/External/VirtualMonitor-macOS/MersiveRelayCam/RelayPlugin/avCam/avCam/avCamLib.mm] initializer()
2023-02-23 16:35:05.230 Google Chrome Helper (Plugin)[1378:11107] -[__NSCFNumber deviceFormatForStream:formatDescription:centerStageSupported:backgroundBlurSupported:studioLightingSupported:hasAutofocus:]: unrecognized selector sent to instance 0x10800340101
2023-02-23 16:35:05.233 Google Chrome Helper (Plugin)[1378:11107] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber deviceFormatForStream:formatDescription:centerStageSupported:backgroundBlurSupported:studioLightingSupported:hasAutofocus:]: unrecognized selector sent to instance 0x10800340101'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007ff80c0d03eb __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x00007ff80bc1ce25 objc_exception_throw + 48
	2   CoreFoundation                      0x00007ff80c16752b -[NSObject(NSObject) __retain_OA] + 0
	3   CoreFoundation                      0x00007ff80c03a62b ___forwarding___ + 1324
	4   CoreFoundation                      0x00007ff80c03a068 _CF_forwarding_prep_0 + 120
	5   AVFCapture                          0x00007ff8272bb098 -[AVCaptureDALDevice _refreshFormatsAndKVONotify:] + 853
	6   AVFCapture                          0x00007ff8272ba772 -[AVCaptureDALDevice _refreshStreamsAndKVONotify:] + 1737
	7   AVFCapture                          0x00007ff8272b9c18 -[AVCaptureDALDevice _refreshPropertiesAndKVONotify:] + 65
	8   AVFCapture                          0x00007ff8272b978e -[AVCaptureDALDevice _refreshConnectionID:KVONotify:] + 200
	9   AVFCapture                          0x00007ff8272b4d92 -[AVCaptureDALDevice initWithUniqueID:connectionID:] + 332
	10  AVFCapture                          0x00007ff8272b15c4 +[AVCaptureDALDevice _refreshDevices] + 2072
	11  AVFCapture                          0x00007ff8272b19a7 __39+[AVCaptureDALDevice _ensureDeviceList]_block_invoke + 28
	12  libdispatch.dylib                   0x00007ff80bdfca44 _dispatch_client_callout + 8
	13  libdispatch.dylib                   0x00007ff80bdfdc32 _dispatch_once_callout + 20
	14  AVFCapture                          0x00007ff8272b0d52 +[AVCaptureDALDevice devices] + 38
	15  AVFCapture                          0x00007ff82737b6a1 +[AVCaptureDevice_Tundra _devicesWithAllowIOSMacEnvironment:] + 297
	16  AVFCapture                          0x00007ff82737bd0a +[AVCaptureDevice_Tundra devices] + 59
	17  Google Chrome Framework             0x0000000124805dc1 ChromeMain + 114543585
	18  Google Chrome Framework             0x0000000124807cdc ChromeMain + 114551548
	19  Google Chrome Framework             0x00000001248019eb ChromeMain + 114526219
	20  Google Chrome Framework             0x0000000122a145a4 ChromeMain + 83145668
	21  Google Chrome Framework             0x0000000122a1d27d ChromeMain + 83181725
	22  Google Chrome Framework             0x0000000121e0e13a ChromeMain + 70537050
	23  Google Chrome Framework             0x000000011df5868e ChromeMain + 4781230
	24  Google Chrome Framework             0x000000011e8f6286 ChromeMain + 14864550
	25  Google Chrome Framework             0x000000011ddb2647 ChromeMain + 3052647
	26  Google Chrome Framework             0x0000000120ab3f06 ChromeMain + 50244902
	27  Google Chrome Framework             0x0000000120ab8f0a ChromeMain + 50265386
	28  Google Chrome Framework             0x0000000120a8f86b ChromeMain + 50095755
	29  Google Chrome Framework             0x000000011df1ccc9 ChromeMain + 4537065
	30  Google Chrome Framework             0x000000011db8b05a ChromeMain + 794234
	31  Google Chrome Framework             0x0000000120aa0ed1 ChromeMain + 50167025
	32  CoreFoundation                      0x00007ff80c057b78 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
	33  CoreFoundation                      0x00007ff80c057b27 __CFRunLoopDoSource0 + 157
	34  CoreFoundation                      0x00007ff80c057901 __CFRunLoopDoSources0 + 212
	35  CoreFoundation                      0x00007ff80c05657b __CFRunLoopRun + 929
	36  CoreFoundation                      0x00007ff80c055b60 CFRunLoopRunSpecific + 560
	37  HIToolbox                           0x00007ff8159a3766 RunCurrentEventLoopInMode + 292
	38  HIToolbox                           0x00007ff8159a3576 ReceiveNextEventCommon + 679
	39  HIToolbox                           0x00007ff8159a32b3 _BlockUntilNextEventMatchingListInModeWithFilter + 70
	40  AppKit                              0x00007ff80f1a62f3 _DPSNextEvent + 909
	41  AppKit                              0x00007ff80f1a5174 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1219
	42  AppKit                              0x00007ff80f1977b7 -[NSApplication run] + 586
	43  Google Chrome Framework             0x00000001201dfcc6 ChromeMain + 40987366
	44  Google Chrome Framework             0x000000011efabf14 ChromeMain + 21900596
	45  Google Chrome Framework             0x000000011e9f63bf ChromeMain + 15913439
	46  Google Chrome Framework             0x000000011e9f58c1 ChromeMain + 15910625
	47  Google Chrome Framework             0x000000011f3eaccd ChromeMain + 26352365
	48  Google Chrome Framework             0x000000011f6045c0 ChromeMain + 28554208
	49  Google Chrome Framework             0x000000011f3d2fe9 ChromeMain + 26254857
	50  Google Chrome Framework             0x000000011f2e778c ChromeMain + 25290156
	51  Google Chrome Framework             0x000000011fd7094f ChromeMain + 36337519
	52  Google Chrome Framework             0x000000011dac939d ChromeMain + 445
	53  Google Chrome Helper (Plugin)       0x0000000107d4391c main + 252
	54  dyld                                0x00007ff80bc49310 start + 2432
)

WebSwapCGLLayer 관련한 에러인데, 라이브러리 구조가 문제가 있는 듯 하다.

WebSwapCGLLayer 키워드로 구글링을 하다 보니 비슷한 이슈를 찾았다.

해당 이슈의 스레드를 보면 이 문제가 크로미움 버그 리포트에도 등록되어 있는 것을 찾을 수 있다.

버그 리포트를 자세히 읽어보면 2023년 2월 22일에 크롬 카나리아 버전에 편입되었음도 알 수 있다.

해결

방법 1

크롬 카나리아 버전을 이용하면 된다

방법 2

문제가 되는 플러그인을 삭제하면 되는데, 경로는 다음과 같다

1
/Library/CoreMediaIO/Plug-Ins/DAL/RelayCam.plugin

즉 다음 명령어를 입력하면 된다

1
sudo rm -rf /Library/CoreMediaIO/Plug-Ins/DAL/RelayCam.plugin

PS

원인을 못찾아서 한참 헤매다가 동료가 구글 크롬을 터미널에서 실행하면 런타임 로그를 볼 수 있다는 것을 알려줘서 추적할 수 있었다 :)