-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
🔴 IINA 1.3.0 BUG: Error Cannot prevent display sleep! #3842
Comments
It looks like IINA should be logging the details of the error. Can you try to enable logging (Preferences > Advanced > Enable logging, the quit & reopen IINA) and then if it happens again, grab the iina.log file and attach it here? |
SummaryThis is not a bug in IINA. This is how IINA informs you that macOS power management is broken on the Mac IINA is being run on. Please take the follow actions: Check if you have any products from Rogue Amoeba installed on your Mac. If any are found check to see if there are pending updates to those products that have not been installed. It is critical that Rogue Amoeba's Audio Capture Engine (ACE) framework is up to date. The ACE framework may be included in products from other companies as discussed in the post Licensing Rogue Amoeba's ACE SDK. If you do not have products from Rogue Amoeba installed check for any audio related applications and see if they use the ACE framework. Make sure any audio related applications are up to date. Check if you have Zoom installed on your Mac. If you do and are familiar with the history of security problems (see articles like tom's guide Zoom security issues: What's gone wrong and what's been fixed) and still want to use it, check to see if there are pending updates that have not been installed. Make certain the latest version is installed. Please let us know if these actions resolve the issue. If not then when the problem occurs capture and post the IINA log file as @svobs requested. Only the IINA log is needed, no need for the mpv log in this case. Also, before rebooting macOS please open a terminal window and run the following command:
Add the AnalysisAs we don't have an IINA log, this analysis is based on previous history with this kind of failure. The log can tell us if this is the issue seen before or a new variation on it. IINA BehaviorThe root cause of the issue is not in any way the fault of IINA. IINA is reporting that it called the macOS IOKit framework method IOPMAssertionCreateWithName and that method was not successful. IINA is calling that method merely to request that macOS not put the display to sleep. That request is never supposed to fail, and yet in this case it did. The error code returned by macOS should be in the IINA log. The behavior of IINA in this case has changed in 1.3.0. In 1.2.0 IINA was trying to post the above error message, but failed to use the main thread resulting in a crash. In 1.3.0 that code has been corrected to properly post the alert. What can be questioned about IINA's behavior is whether this situation should be treated as a fatal error. A typical software industry practice is to not even check the return code when calling a method "that can't fail". That is definitely a bad practice in my opinion and at minimum such failures need to be logged. It should be noted that it is likely because most applications do not alert users to such problems that whatever the root cause of the problem at hand is it was not noticed by developers or quality assurance and was released out the door to the public where it is quietly causing hard to track down trouble. So should IINA just log that power management is malfunctioning and quietly continue on? It might only result in the "don't let the display sleep while playing" feature appearing to be unreliable. But with macOS power management malfunctioning there could be other problems happening on the Mac that could cause odd IINA behavior. @lhc70000, @saagarjha thoughts on IINA's behavior in this case? macOS BehaviorNote that the macOS power management malfunction is not due to IINA. The root cause of this issue appears to have to do with other products improperly interacting with macOS. IINA is merely reporting that macOS is broken and is not involved in the core issue. Even though IINA is not involved, as Mac users we still want to know what might be breaking our Mac's without our knowledge and causing such problems, so one such case has been deeply investigated. Issue #3478, "INA 1.2.0 crashes instantly (Big Sur)" is an example of the 1.2.0 behavior where instead of IINA displaying the alert seen above, IINA crashed while trying to display that alert. In that case a lot of investigation caused us to suspect Rogue Amoeba's Audio Capture Engine (ACE) framework was the culprit. After updating to the latest version the problem no longer reproduced. We know this thanks to @VanyaTheSpark who patiently worked with me to gather enough information to pinpoint the cause. Thanks again @VanyaTheSpark! In that case it was found that the macOS component
The expectation in that case was that macOS power management was returning this error code to IINA:
If you want to know more see the many replies to issue #3478. The pattern reported above where everything works upon rebooting macOS but after a time the failure comes back is consistent with macOS power management working fine until it runs out of memory. Restarting macOS restarts the power management daemon, clearing the problem until again memory is exhausted. To confirm that is what is happening in this case we'd want to see the error reported in the IINA log file. In researching issue #3478 posts on the net indicated other problems with macOS power management. So it is possible something else could be going on with macOS power management. |
Thanks for the detailed answer, I will upload the log next time I have a problem again |
I will keep an eye out for the log file. The IINA log should tell us the error macOS is reporting which will either confirm the suspicion that the power management portion of macOS has run out of memory, or point to a different problem. The IINA log is insufficient to track down what is causing power management to fail. To try and figure that out we'd want collect information that section of macOS. That is what this command does:
|
Can we add an option to temporarily turn off this error prompt? In Ventura beta 4, this error box pops up almost all the time and makes people crash |
It is certainly possible to add some sort of preference to IINA that would cause IINA to ignore this error. BUT don't forget that if you are seeing this power management in macOS is BROKEN. Alarming that you are reporting this is happening a lot with Ventura Beta. That might be something that needs to be reported to Apple. When this happens IINA will log the error returned by macOS. We need to see what error is being reported. The other critical diagnostic information can be gathered using pmset -g everything >pmset.txt That will create a file |
归档.zip |
This needs to be reported to Apple as soon as possible. Please use the Feedback Assistant application, which I believe comes with macOS Betas, to report this to Apple. You do not want to mention "IINA" in your report as an Apple developer quickly skimming the report might think you are asking Apple to fix IINA and just close the report. I suggest something like the following... Subject:
Description:
Include Searching the macOS 13 Ventura Beta 4 Release Notes I did not find any known bugs in this area. So it is important to let Apple know |
Thank you for your help. I will feed back this problem to apple |
For reference, I have also seen this in macOS 12 Monterey (12.4) |
@BenSokol, thanks for the additional data point. If it happens again please:
The IINA log file will tell us the failure reported by macOS. So far it has been this:
That indicates So why has It appears that there is more than one way
From a software architecture viewpoint what is bad about the above scenario is that one malfunctioning macOS daemon, The As to what is causing the failure for @Thomas-Harrell under Big Sur, or the failure you experienced under Monterey, we need to collect the evidence I noted above and see what it tells us. If either of you have any audio related applications installed, make sure they are up to date in case an old version of the ACE driver is triggering the problem. |
I'm getting the same error on Ventura 13.0 Beta (22A5321d) |
@hereisderek Have you reported this to Apple using the Feedback Assistant application? It is looking like Apple may have introduced a new defect into macOS power management in Ventura. When reporting this to Apple be sure not to start out discussing IINA or the Apple engineer may think you are asking Apple about a defect in IINA and toss your report in the trash. See my advice on reporting this to Apple in my previous post above. The IINA issue is that IINA is treating this macOS failure as a fatal error. The change to IINA this issue requests is to be able to configure IINA to work when this portion of macOS is malfunctioning. IINA is not responsible for this macOS failure, just reacting to it. If power management in macOS is going to be this unreliable then IINA will need to be more forgiving. But this is not good. Apple needs to fix the macOS power management daemon. In this case don't have the IINA log file, so we can't confirm this is another case of the macOS power management daemon, low-batt@gag 2022-08-16$ grep -c 'pid 114(powerd):.*InternalPreventSleep.*com\.apple\.powermanagement\.wakeschedule' pmset.txt
16986 This doesn't look good either:
It seems like there is a new defect in the area of power management in macOS Ventura. Of course I'm not an Apple software developer. We need to hear from Apple as to why macOS is malfunctioning. |
To all of the people on Ventura On a Terminal run the command: which outputs (on my machine) hundreds of lines Running:
You can cancel the schedule with: Now IINA should not display the error any longer. On my macbook doing the above steps also helped the fans stop spinning when on idle and the machine goes back to sleep properly, only on my hackintosh it keeps coming back oddly enough. you could also delete the file As @low-batt stated this problem is completely unrelated to IINA. If you are on macOS Ventura and facing the same issue please send feedback through the Feedback Assistant application in hopes Apple finally fixes this issue. |
I had the issue occur again yesterday on macOS Monterey 12.5 (21G72). Tried Force quitting Regardless, IINA should be updated to not cause repeated prompts for this issue. Yes, it is Apple's bug; However, IINA shouldn't be broken (basically unusable) when it occurs. |
@BenSokol, I'm currently discussing with the developers on how IINA should handle this failure with macOS reliability continuing to decline. We may end up removing the alert and just logging the issue. I've been putting the emphasis on this being an Apple defect that needs to be reported to Apple in the hopes that Ventura will not go out the door broken like this. But yes, the IINA behavior needs to be changed. NOTE that we don't know what is happening in your case. The post from @Arch-0 confirms the macOS failure we have been discussing is a regression in Ventura. If that is correct then that is not what you are experiencing in macOS 12.5. The other time this was deeply investigated was in issue #3478. That was traced to a defect in Rogue Amoeba's Audio Capture Engine (ACE) framework that is fixed in the latest version of the ACE driver. That driver is embedded in products from other companies. If you post the
Post that file and I will take a look and see what it tells us. Also check your machine for If it is not that then it is some new way power management is failing that we have not seen yet. @Arch-0, Excellent information. Thanks for posting. Checking the recent
The
Horrible to see Apple messing up macOS power management like this. |
Poking around the net using the additional information posted by @Arch-0, people are blaming the issue on this new Mail feature listed on the Apple page New features available with macOS Ventura:
Most people are reporting this because it is causing People are reporting the workaround posted by @Arch-0:
Is working, but the problem comes back after waking the Mac from sleep. Sure hope Apple fixes this before Ventura goes out the door. |
I still wish there was an option to disable IINA asking macOS to prevent display sleep because whether its Apple's fault or not, this makes IINA unusable and I had to start using VLC again which is a little frustrating. |
I have asked the developers how to deal with macOS becoming so unreliable. Likely IINA will be changed to just log and error message indicating macOS is broken. |
It would be great if IINA displayed the message with an option to never show the warning again instead of outright removing the warning and just logging it. I find the warning useful albeit annoying. |
@Arch-0 I will propose such a fix. Working on it... |
|
The commit in the pull request will: - Change SleepPreventer.preventSleep to only display an alert once per IINA invocation - Change Utility.showAlert to support a suppression button - Add a button to the alert to allow the user to permanently suppress the alert - Change the alert to include the error code returned by macOS Additional text was added to the alert's message requiring localization. This fixes how IINA reports a macOS power management failure. The root cause of the failure is in macOS and must be fixed by Apple.
@Thomas-Harrell Thank you very much for posting that information. Glad to hear the ACE driver was responsible in your case. One worry is that there are other causes for this macOS power management failure other than use of an old version of the ACE driver and the regression in the Ventura Beta. |
The commit in the pull request will: - Change SleepPreventer.preventSleep to only display an alert once per IINA invocation - Change Utility.showAlert to support a suppression button - Add a button to the alert to allow the user to permanently suppress the alert - Change the alert to include the error code returned by macOS Additional text was added to the alert's message requiring localization. This fixes how IINA reports a macOS power management failure. The root cause of the failure is in macOS and must be fixed by Apple.
The commit in the pull request will: - Change SleepPreventer.preventSleep to only display an alert once per IINA invocation - Change Utility.showAlert to support a suppression button - Add a button to the alert to allow the user to permanently suppress the alert - Change the alert to include the error code returned by macOS Additional text was added to the alert's message requiring localization. This fixes how IINA reports a macOS power management failure. The root cause of the failure is in macOS and must be fixed by Apple.
I've posted a proposed fix to the alert. The fix:
Critical brutal mean reviews are welcome. To: The failure is always logged. The log messages look like:
Of course the above text will change if the error code returned by macOS is not |
The commit in the pull request will: - Change SleepPreventer.preventSleep to only display an alert once per IINA invocation - Change Utility.showAlert to support a suppression button - Add a button to the alert to allow the user to permanently suppress the alert - Change the alert to include the error code returned by macOS Additional text was added to the alert's message requiring localization. This fixes how IINA reports a macOS power management failure. The root cause of the failure is in macOS and must be fixed by Apple.
The commit in the pull request will: - Change SleepPreventer.preventSleep to only display an alert once per IINA invocation - Change Utility.showAlert to support a suppression button - Add a button to the alert to allow the user to permanently suppress the alert - Change the alert to include the error code returned by macOS Additional text was added to the alert's message requiring localization. This fixes how IINA reports a macOS power management failure. The root cause of the failure is in macOS and must be fixed by Apple.
The commit in the pull request will: - Change SleepPreventer.preventSleep to only display an alert once per IINA invocation - Change Utility.showAlert to support a suppression button - Add a button to the alert to allow the user to permanently suppress the alert - Change the alert to include the error code returned by macOS Additional text was added to the alert's message requiring localization. This fixes how IINA reports a macOS power management failure. The root cause of the failure is in macOS and must be fixed by Apple.
@alexoftheweek Thanks for reporting this. This app?: https://fireball.studio/oneswitch If you execute this when IINA is reporting the problem: pmset -g everything >pmset.txt And post the |
Comments on MacRumors indicate the six developer Beta of Ventura, which was just released publicly, contains a fix to |
Can confirm this issue has disappeared and IINA is working flawlessly again for me since the update to Ventura Public Beta 4 (Build 22A5331f) |
@stalonium Excellent news. Thanks for reporting. Even though the current macOS problem has been fixed it is clear the IINA behavior should be improved. The PR is currently in review. Some sort of change will be merged to allow users to suppress this alert. This area of macOS seems to be problematic. The report from @alexoftheweek that One Switch can trigger this failure is concerning. @alexoftheweek If you encounter this problem again please use Although macOS daemon failures are an issue for Apple and not the IINA project, it is still useful for all of us Mac users to know these failures are occurring and what is causing them. It is not readily apparent that background processes are malfunctioning, so a user that is experiencing poor video playback may not know that it is due to one of these daemons looping and consuming CPU time and thus interfering with playback. |
The commit in the pull request will: - Change SleepPreventer.preventSleep to only display an alert once per IINA invocation - Change Utility.showAlert to support a suppression button - Add a button to the alert to allow the user to permanently suppress the alert - Change the alert to include the error code returned by macOS Additional text was added to the alert's message requiring localization. This fixes how IINA reports a macOS power management failure. The root cause of the failure is in macOS and must be fixed by Apple.
The commit in the pull request will: - Change SleepPreventer.preventSleep to only display an alert once per IINA invocation - Change Utility.showAlert to support a suppression button - Add a button to the alert to allow the user to permanently suppress the alert - Change the alert to include the error code returned by macOS Additional text was added to the alert's message requiring localization. This fixes how IINA reports a macOS power management failure. The root cause of the failure is in macOS and must be fixed by Apple.
The commit in the pull request will: - Change SleepPreventer.preventSleep to only display an alert once per IINA invocation - Change Utility.showAlert to support a suppression button - Add a button to the alert to allow the user to permanently suppress the alert - Change the alert to include the error code returned by macOS Additional text was added to the alert's message requiring localization. This fixes how IINA reports a macOS power management failure. The root cause of the failure is in macOS and must be fixed by Apple.
* Fix Error Cannot prevent display sleep!, #3842 The commit in the pull request will: - Change SleepPreventer.preventSleep to only display an alert once per IINA invocation - Change Utility.showAlert to support a suppression button - Add a button to the alert to allow the user to permanently suppress the alert - Change the alert to include the error code returned by macOS Additional text was added to the alert's message requiring localization. This fixes how IINA reports a macOS power management failure. The root cause of the failure is in macOS and must be fixed by Apple.
The fix in PR #3924 has been merged into the develop branch. The fix improves IINA's behavior when macOS power management malfunctions as was occurring in the macOS Ventura Beta releases. If IINA ever displays the alert shown above then macOS power management is broken on your machine and that needs to be investigated. |
All of a sudden I am getting this very annoying alert on a headless mac mini. It pops up twice every time you play or pause a video. Never had a problem until now. Is there a quick fix for now until a new update can fix it? I tried installing v.1.2.0, but when I try to play a video, IINA crashes. |
The fix that keeps IINA from repeating this alert as well as allowing you to permanently suppress this alert has been merged into develop. At the moment the fix is only available in an unsigned nightly build or if you build IINA yourself from the develop branch. This alert is present in 1.2.0, however the code to display the alert was incorrect and triggered a crash. So 1.2.0 crashing is expected. For 1.3.0 the code was corrected to properly display the alert and to log the error code macOS returned. The alert means macOS power management is broken on your Mac. That is BAD. Problems with power management should not be tolerated. We should try and figure out what is going wrong on your Mac. Open Terminal, run this command:
Drag and drop the resulting Also open Console and check for crash reports, especially from macOS daemons. In particular see if You did not mention the version of macOS the Mac mini is running. So far we have only identified two root causes of the macOS power daemon failing. The recent one was due to a regression added by Apple in a Ventura Beta release. Executing The other known macOS power management failure was not due to Apple. It was traced to an old version of the Audio Capture Engine (ACE) framework from Rogue Amoeba. That framework is included in products from other companies. It could be some company is shipping a product with an outdated ACE framework. |
Thanks! Here is the file. Running 11.6 Big Sur. |
In both of the previous cases macOS power management was returning this error code to IINA:
The macOS This first clip from
I'm expecting that sequence represents a user logging in and then logging out. But after that as soon as
Not sure what to make of that. As the assertions are being released it should not run There was a 3rd macOS power management failure that was not seen with IINA. I found a post on the net discussing macOS returning this error:
As if macOS lost communication (no such device) with the power management chip. At this point we need to check the IINA log and see what error macOS is returning. Logging is disabled by default. To enabled logging follow these instructions:
Once IINA is restarted a new directory will appear in the The log files can also be accessed using Terminal as shown here: low-batt@gag com.colliderli.iina$ pwd
/Users/low-batt/Library/Logs/com.colliderli.iina
low-batt@gag com.colliderli.iina$ ls
2022-10-04-17-57-15_jVrbWy
low-batt@gag com.colliderli.iina$ cd 2022-10-04-17-57-15_jVrbWy
low-batt@gag 2022-10-04-17-57-15_jVrbWy$ ls
iina.log mpv.log
low-batt@gag 2022-10-04-17-57-15_jVrbWy$ DO NOT FORGET to disable logging once you have obtained log files for the problem being investigated. IINA does not restrict the size of log files or delete old logs. If you leave logging enabled the logs will continue to accumulate. In the IINA log file look for the text "Cannot prevent display sleep". Post the line of the log file with that text here, or drag-n-drop the log file to this issue and I will poke though it and see what it tells us. |
I updated to Ventura, now I don't get the error. So all is good! Not too concerned about some underlying issue. I'll be upgrading this to the M2 Mac Mini whenever it comes out anyhow. :) Thanks for all your help. |
Very glad to hear upgrading macOS to Ventura fixed this. Ventura definitely has some odd graphics problems. If you encounter odd problems look for IINA issues marked with the macOS Ventura label. Hopefully Apple will quickly release an update to Ventura that fixes these issues. |
The root cause was a defect in some of the macOS Ventura Beta releases. No such problems have been reported in the official release of macOS Ventura. This problem also can be triggered by an old version of the Audio Capture Engine (ACE) framework from Rogue Amoeba. The ACE framework is also included in products from other companies. If you encounter this failure be sure you are not using an old version of this framework. IINA behavior when macOS power management is broken was poor. That has been fixed in IINA 1.3.1. You now have the ability to suppress the alert from IINA. |
Thanks for adding the way to disable the alert in iina. Fyi, i have seen this occur once (a few days ago) after updating to the official release of macOS Ventura (13.0 (22A380)). Had to reboot to fix it. |
@BenSokol I appreciate the report. Did you upgrade from Monterey or a Ventura Beta? If you were previously running a Ventura Beta then hopefully the problem was due to bad state left by the Beta version that has now been cleaned up. If however you experienced this upon upgrading from Monterey, then that is especially disturbing. In the failure seen with the Ventura Beta the In my opinion problems in the power management area of macOS must not be tolerated. Apple needs to take quality in this area of macOS seriously. The problem introduced in the Ventura Beta was obvious in the output of The behavior of IINA in this case definitely needed to be improved. I'm hoping the problems in this area of macOS have been fixed and nobody will need to take advantage of new ability to suppress this alert. If that proves not to be the case I'd like to know about it. |
I updated directly from 12.6 (Monterey). I didn't run the macOS public/dev beta this year, however i have in past years. |
Well that is disturbing. Makes me worried that Apple only reduced the problem so that it takes a while to appear. I too upgraded from Monterey 12.6 directly to the Ventura public release. I have not encountered this problem. The suspension is that the offending changes support the new mail "send later" feature. I am not using email on my Mac that is running Ventura. If you encounter this again then before rebooting and clearing the problem please capture information about the problem. Record the error code reported in the IINA alert. If you have IINA logging enabled there will be a log message that should have a description of what that error code means. Open Terminal, run this command:
Open Console and look for any crash reports, especially for Use the Feedback Assistant to report the problem to Apple. Include We need to keep bombarding Apple with reports until they fix macOS. |
System and IINA version:
Expected behavior:
Actual behavior:
After running IINA for a period of time, about 2-3 days, there is a high probability of appearing
After this error, opening the media file, continuing playback after a pause, and dragging the progress bar will all result in this error
Restore settings and reinstall software did not fix it
After restarting the computer, the problem can be solved, but after a period of operation, it will reopen again
Crash report:
mpv log:
Steps to reproduce:
The text was updated successfully, but these errors were encountered: