Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVCaptureSession startRunning] should be called from background thread. #1209

Closed
mkrn opened this issue May 26, 2023 · 1 comment · Fixed by #1216
Closed

AVCaptureSession startRunning] should be called from background thread. #1209

mkrn opened this issue May 26, 2023 · 1 comment · Fixed by #1216
Milestone

Comments

@mkrn
Copy link

mkrn commented May 26, 2023

Describe the bug

When moving from background and restarting the session, getting this potential performance error:



Thread Performance Checker: -[AVCaptureSession startRunning] should be called from background thread. Calling it on the main thread can lead to UI unresponsiveness
PID: 27833, TID: 5433148
Backtrace
=================================================================
3   eventLiveSDK                        0x0000000106cc28d0 $s10HaishinKit7IOMixerC28resumeCaptureSessionIfNeeded33_55B1BC63E0149083A89C4632F373BF2CLLyyF + 324
4   eventLiveSDK                        0x0000000106cc3bc4 $s10HaishinKit7IOMixerC15didBecomeActive33_55B1BC63E0149083A89C4632F373BF2CLLyy10Foundation12NotificationVF + 44
5   eventLiveSDK                        0x0000000106cc3e18 $s10HaishinKit7IOMixerC15didBecomeActive33_55B1BC63E0149083A89C4632F373BF2CLLyy10Foundation12NotificationVFTo + 120
6   CoreFoundation                      0x00000001badbb404 5CDC5D9A-E506-3740-B64E-BB30867B4F1B + 226308
7   CoreFoundation                      0x00000001bae62474 5CDC5D9A-E506-3740-B64E-BB30867B4F1B + 910452
8   CoreFoundation                      0x00000001bae45724 5CDC5D9A-E506-3740-B64E-BB30867B4F1B + 792356
9   CoreFoundation                      0x00000001badcfa08 _CFXNotificationPost + 704
10  Foundation                          0x00000001b51bcffc C431ACB6-FE04-3D28-B677-4DE6E1C7D81F + 380924
11  UIKitCore                           0x00000001bd1d2530 179501B6-0FC2-344A-B969-B4E3961EBE10 + 2692400
12  UIKitCore                           0x00000001bd1d1fe0 179501B6-0FC2-344A-B969-B4E3961EBE10 + 2691040
13  UIKitCore                           0x00000001bd1d1dcc 179501B6-0FC2-344A-B969-B4E3961EBE10 + 2690508
14  UIKitCore                           0x00000001bd1d197c 179501B6-0FC2-344A-B969-B4E3961EBE10 + 2689404
15  UIKitCore                           0x00000001bd1d1848 179501B6-0FC2-344A-B969-B4E3961EBE10 + 2689096
16  UIKitCore                           0x00000001bd8b3fa8 179501B6-0FC2-344A-B969-B4E3961EBE10 + 9908136
17  UIKitCore                           0x00000001bd94cf98 _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 224
18  UIKitCore                           0x00000001bd07d958 179501B6-0FC2-344A-B969-B4E3961EBE10 + 1296728
19  UIKitCore                           0x00000001bd4f07a8 179501B6-0FC2-344A-B969-B4E3961EBE10 + 5961640
20  UIKitCore                           0x00000001bd1500b8 179501B6-0FC2-344A-B969-B4E3961EBE10 + 2158776
21  UIKitCore                           0x00000001bd14ff28 179501B6-0FC2-344A-B969-B4E3961EBE10 + 2158376
22  UIKitCore                           0x00000001bd14fd68 179501B6-0FC2-344A-B969-B4E3961EBE10 + 2157928
23  FrontBoardServices                  0x00000001d09a9cdc 65E92D01-137F-3E16-98A6-A33706699695 + 15580
24  FrontBoardServices                  0x00000001d09a9b18 65E92D01-137F-3E16-98A6-A33706699695 + 15128
25  FrontBoardServices                  0x00000001d09ad294 65E92D01-137F-3E16-98A6-A33706699695 + 29332
26  FrontBoardServices                  0x00000001d09ad1b0 65E92D01-137F-3E16-98A6-A33706699695 + 29104
27  libdispatch.dylib                   0x000000010282605c _dispatch_client_callout + 20
28  libdispatch.dylib                   0x0000000102829ad8 _dispatch_block_invoke_direct + 368
29  FrontBoardServices                  0x00000001d09b73b0 65E92D01-137F-3E16-98A6-A33706699695 + 70576
30  FrontBoardServices                  0x00000001d09b6f4c 65E92D01-137F-3E16-98A6-A33706699695 + 69452
31  FrontBoardServices                  0x00000001d09b972c 65E92D01-137F-3E16-98A6-A33706699695 + 79660
32  CoreFoundation                      0x00000001bae59f54 5CDC5D9A-E506-3740-B64E-BB30867B4F1B + 876372
33  CoreFoundation                      0x00000001bae6632c 5CDC5D9A-E506-3740-B64E-BB30867B4F1B + 926508
34  CoreFoundation                      0x00000001badea210 5CDC5D9A-E506-3740-B64E-BB30867B4F1B + 418320
35  CoreFoundation                      0x00000001badffba8 5CDC5D9A-E506-3740-B64E-BB30867B4F1B + 506792
36  CoreFoundation                      0x00000001bae04ed4 CFRunLoopRunSpecific + 612
37  GraphicsServices                    0x00000001f4106368 GSEventRunModal + 164
38  UIKitCore                           0x00000001bd2e33d0 179501B6-0FC2-344A-B969-B4E3961EBE10 + 3810256
39  UIKitCore                           0x00000001bd2e3034 UIApplicationMain + 340
40  SwiftUI                             0x00000001be8f0014 494A7D57-90AF-3E90-9623-7038275B8D87 + 1904660
41  SwiftUI                             0x00000001be85116c 494A7D57-90AF-3E90-9623-7038275B8D87 + 1253740
42  SwiftUI                             0x00000001be83a4bc 494A7D57-90AF-3E90-9623-7038275B8D87 + 1160380
43  appnew                              0x00000001006c6814 $s6appnew0A3AppV5$mainyyFZ + 40
44  appnew                              0x00000001006c6e44 main + 12
45  dyld                                0x00000001d946c960 CB3FF411-4762-34D2-86A4-ECA13F9FB6C3 + 88416```

### To Reproduce

Trigger didBecomeActive 

### Expected behavior

Not have performance errors

### Version

Latest

### Smartphone info.

_No response_

### Additional context

_No response_

### Screenshots

_No response_

### Relevant log output

_No response_
@mkrn
Copy link
Author

mkrn commented Jun 8, 2023

Also, got this crash happened a few times today, which may be related:

NSGenericException: *** -[AVCaptureSession startRunning] startRunning may not be called between calls to beginConfiguration and commitConfiguration

shogo4405 added a commit that referenced this issue Jun 11, 2023
shogo4405 added a commit that referenced this issue Jun 11, 2023
@shogo4405 shogo4405 added this to the 1.5.2 milestone Jun 11, 2023
shogo4405 added a commit that referenced this issue Jun 11, 2023
…-thread

fixed #1209 AVCaptureSession startRunning] should be called from background thread.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants