Fix #121911: macOS: Interference with sound in other applications

Turns out closing AudioUnit handle could interfere with other software.

It is something Apple is investigating, to see if it is API not used
correctly, or whether there is something to be fixed in the Core Audio.

Until then disable the code which closes audio handles. It rolls back
to the situation when the computer might not be able to sleep properly,
but it is how the previous release was, and overall it is less annoying
than causing an interference.

Once the issue is looked into by Apple we will re-iterate over having
both issues (interference and power management) resolved.

Pull Request: https://projects.blender.org/blender/blender/pulls/124400
This commit is contained in:
Sergey Sharybin 2024-07-09 15:20:49 +02:00 committed by Sergey Sharybin
parent afeb38f76f
commit 6d3b4f1c32
2 changed files with 5 additions and 3 deletions

View File

@ -165,7 +165,8 @@ m_audio_unit(nullptr)
m_specs = specs;
open();
close();
// NOTE: Keep the device open until #121911 is investigated/resolved from Apple side.
// close();
create();
}

View File

@ -71,8 +71,9 @@ void OpenCloseDevice::playing(bool playing)
if(m_delayed_close_thread.joinable())
m_delayed_close_thread.join();
m_delayed_close_running = true;
m_delayed_close_thread = std::thread(&OpenCloseDevice::closeAfterDelay, this);
// NOTE: Disabled until #121911 is investigated/resolved from Apple side.
// m_delayed_close_running = true;
// m_delayed_close_thread = std::thread(&OpenCloseDevice::closeAfterDelay, this);
}
}
}