Closed Reactor13 closed 1 year ago
we have the same problems
we have the same problems
I have been tested it on latest XCode 14.2 on latest iOS 16.2. There is no result, still 110-130% CPU usage...
for example PiP - ON
PiP - Off
@Reactor13 @kleruk88
Thanks for the report.
I will investigate, do you use uiPipView.startPictureInPicture(withRefreshInterval: )
to start PiP?
@Reactor13 @kleruk88 Thanks for the report. I will investigate, do you use
uiPipView.startPictureInPicture(withRefreshInterval: )
to start PiP?
We have tried both modes. It doesn't affect. CPU usage increases in any case immediately after the appearance of the PIP window itself and even if it is not updated / rendered afterwards.
How do I control the display size of picture in picture and display it on the interface with my camera?Object-C代码
Reactor13 @.***> 于2022年12月18日周日 04:49写道:
Huge CPU usage since iOS 16.1
Hi. Our users point that since iOS 16.1 our app with PiP drain battery very fast.
We had tested it. So. If PiP disabled then our app use about 2-5% CPU time. As soon as the PiP is turned on, the usage instantly grows to 110% - 130%.
We have changed the library code in such a way as to exclude any influence of our code. There was no content rendering for the test. Just a black window. And yet the load is the same 110% - 130%.
Can you confirm that you are experiencing the same issue? Is it library specific or is it a system bug. If this is a system bug, then let's create a defect in Apple Bug Tracker. Because iOS 16.2 has already been released, but the problem has not been solved.
— Reply to this email directly, view it on GitHub https://github.com/uakihir0/UIPiPView/issues/17, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYXPMNLIPO5APLIMHDSN6DWNYRNXANCNFSM6AAAAAATCEDRYA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Any updates? News?
iOS 16.3 problem still exists
Just downloaded and ran the example from this project. All the same. After clicking Toogle PIP, the processor is loaded at 100%
Xcode 14.2, iOS 16.3, iPhone 14 Pro
Looking at the Profiler, CPU usage is not that much, but this is only the usage of the application, and when we look at the usage of the iPhone as a whole, it becomes a reasonably large usage rate as you have described. Below are the results from the Profiler, focused on PiP usage.
On the other hand, when we look at the percentage of time elapsed in the application, the percentage of CPU usage is less than half of the problematic points, which means that the usage is not nearly as problematic as it could be. From this point of view, it seems likely that the cause is a change in the usage of threads per timer due to the OS version upgrade.
If the code is modified not to render, TimeProfiler looks like the following, and the status remains the same. From this point of view, I think there is a problem in the usage of AVPictureInPictureController
or it is a bug in the OS. I will investigate further.
I have found that AVKit is consuming time during PiP, but I don't know how to control this.
@uakihir0 thank you for answer and investigation report.
Posted in forum. https://developer.apple.com/forums/thread/724632
Posted in forum. https://developer.apple.com/forums/thread/724632
From your post image we can see that the cpu time usage is conern with play timer, so I wondering that maybe CMTimeRange(start: .negativeInfinity, duration: .positiveInfinity) is the problem, so I change this line to CMTimeRange(start: .zero, duration: CMTimeMake(value: 3600*24, timescale: 1)). guess what, the cpu usage is drop to 0! so func pictureInPictureControllerTimeRangeForPlayback(_ pictureInPictureController: AVPictureInPictureController) -> CMTimeRange { CMTimeRange(start: .negativeInfinity, duration: .positiveInfinity) }
is the problem. don't return negativeInfinity and positiveInfinity, just a finity value it is!
@eximpression Thank you, I have confirmed that the CPU usage will go down.
🔥 Thank you!
Huge CPU usage since iOS 16.1
Hi. Our users point that since iOS 16.1 our app with PiP drain battery very fast.
We had tested it. So. If PiP disabled then our app use about 2-5% CPU time. As soon as the PiP is turned on, the usage instantly grows to 110% - 130%.
We have changed the library code in such a way as to exclude any influence of our code. There was no content rendering for the test. Just a black window. And yet the load is the same 110% - 130%.
Can you confirm that you are experiencing the same issue? Is it library specific or is it a system bug. If this is a system bug, then let's create a defect in Apple Bug Tracker. Because iOS 16.2 has already been released, but the problem has not been solved.