From cf3ba0fcb280cf69b6c3471f93e112b10d1c5a80 Mon Sep 17 00:00:00 2001 From: Dean Brettle Date: Mon, 29 Jul 2024 10:37:01 -0700 Subject: [PATCH 1/8] Try building with newer gcc on MacOS. --- .github/workflows/test_suite_mac.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test_suite_mac.yml b/.github/workflows/test_suite_mac.yml index aa526a8d088..2cbdec99f7c 100644 --- a/.github/workflows/test_suite_mac.yml +++ b/.github/workflows/test_suite_mac.yml @@ -27,6 +27,9 @@ jobs: submodules: true fetch-depth: 15 - name: Build Webots + env: + CC: gcc-14 + CXX: gcc-14 run: | make webots_target -j4 build: @@ -50,6 +53,9 @@ jobs: if: ${{ github.event_name == 'schedule' }} run: python scripts/packaging/set_commit_and_date_in_version.py $(git log -1 --format='%H') - name: Webots Package Creation + env: + CC: gcc-14 + CXX: gcc-14 run: | export JAVA_HOME="$(/usr/libexec/java_home -v 16)" export PATH=/Library/Frameworks/Python.framework/Versions/3.11/bin:/usr/local/bin/:$PATH From d5a982fdc6cb9522d78ba6d54cea79c57f859ae0 Mon Sep 17 00:00:00 2001 From: Dean Brettle Date: Mon, 29 Jul 2024 15:13:22 -0700 Subject: [PATCH 2/8] Revert "Try building with newer gcc on MacOS." This reverts commit cf3ba0fcb280cf69b6c3471f93e112b10d1c5a80. --- .github/workflows/test_suite_mac.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/test_suite_mac.yml b/.github/workflows/test_suite_mac.yml index 2cbdec99f7c..aa526a8d088 100644 --- a/.github/workflows/test_suite_mac.yml +++ b/.github/workflows/test_suite_mac.yml @@ -27,9 +27,6 @@ jobs: submodules: true fetch-depth: 15 - name: Build Webots - env: - CC: gcc-14 - CXX: gcc-14 run: | make webots_target -j4 build: @@ -53,9 +50,6 @@ jobs: if: ${{ github.event_name == 'schedule' }} run: python scripts/packaging/set_commit_and_date_in_version.py $(git log -1 --format='%H') - name: Webots Package Creation - env: - CC: gcc-14 - CXX: gcc-14 run: | export JAVA_HOME="$(/usr/libexec/java_home -v 16)" export PATH=/Library/Frameworks/Python.framework/Versions/3.11/bin:/usr/local/bin/:$PATH From a53adbb2a1118b907377664b19a1ead2b06c6080 Mon Sep 17 00:00:00 2001 From: Dean Brettle Date: Mon, 29 Jul 2024 15:15:23 -0700 Subject: [PATCH 3/8] Log OpenAl exception even in CI. --- src/webots/sound/WbSoundEngine.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/webots/sound/WbSoundEngine.cpp b/src/webots/sound/WbSoundEngine.cpp index fe63612ca33..45e21bd338f 100644 --- a/src/webots/sound/WbSoundEngine.cpp +++ b/src/webots/sound/WbSoundEngine.cpp @@ -106,8 +106,7 @@ static void init() { gDevice = QString(defaultDeviceName); } catch (const QString &e) { WbLog::toggle(stderr); - if (WbSysInfo::environmentVariable("CI").isEmpty()) - WbLog::warning(QObject::tr("Cannot initialize the sound engine: %1").arg(e)); + WbLog::warning(QObject::tr("Cannot initialize the sound engine: %1").arg(e)); return; } WbLog::toggle(stderr); From 6922df92024a3525fd13bfb90fcae688dc877d2c Mon Sep 17 00:00:00 2001 From: Dean Brettle Date: Mon, 29 Jul 2024 15:47:56 -0700 Subject: [PATCH 4/8] Print OpenAl init exceptions on stdout. --- src/webots/sound/WbSoundEngine.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/webots/sound/WbSoundEngine.cpp b/src/webots/sound/WbSoundEngine.cpp index 45e21bd338f..d3dba703a77 100644 --- a/src/webots/sound/WbSoundEngine.cpp +++ b/src/webots/sound/WbSoundEngine.cpp @@ -49,6 +49,7 @@ #include #include +#include static WbWorld *gWorld = NULL; static bool gOpenAL = false; @@ -107,6 +108,8 @@ static void init() { } catch (const QString &e) { WbLog::toggle(stderr); WbLog::warning(QObject::tr("Cannot initialize the sound engine: %1").arg(e)); + std::cout << QObject::tr("Cannot initialize the sound engine: %1").arg(e).toUtf8().constData() << std::endl; + return; } WbLog::toggle(stderr); From 1ae3177b6ac91da191916ef1f632088afdefe914 Mon Sep 17 00:00:00 2001 From: Dean Brettle Date: Mon, 29 Jul 2024 15:52:18 -0700 Subject: [PATCH 5/8] Log some tracing messages to stdout. --- src/webots/sound/WbSoundEngine.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/webots/sound/WbSoundEngine.cpp b/src/webots/sound/WbSoundEngine.cpp index d3dba703a77..e8e2aaa7cd9 100644 --- a/src/webots/sound/WbSoundEngine.cpp +++ b/src/webots/sound/WbSoundEngine.cpp @@ -93,10 +93,13 @@ static void init() { gVolume = WbPreferences::instance()->value("Sound/volume", 80).toInt(); WbLog::toggle(stderr); // we want to disable stderr to avoid warnings in the console try { + std::cout << "Calling alcGetString()" << std::endl; const ALCchar *defaultDeviceName = alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER); if (defaultDeviceName == NULL) throw QObject::tr("Cannot find OpenAL default device"); + std::cout << "Calling alcOpenDevice()" << std::endl; gDefaultDevice = alcOpenDevice(defaultDeviceName); + std::cout << "Called alcOpenDevice()" << std::endl; if (gDefaultDevice == NULL) throw QObject::tr("Cannot initialize OpenAL default device '%1'").arg(defaultDeviceName); gContext = alcCreateContext(gDefaultDevice, NULL); From e1338e5cb1bd8213c1926bab66bb3fb916d802a5 Mon Sep 17 00:00:00 2001 From: Dean Brettle Date: Mon, 29 Jul 2024 16:35:29 -0700 Subject: [PATCH 6/8] Install blackhole-2ch for macos CI. --- .github/workflows/test_suite_mac.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test_suite_mac.yml b/.github/workflows/test_suite_mac.yml index aa526a8d088..f9346d016b8 100644 --- a/.github/workflows/test_suite_mac.yml +++ b/.github/workflows/test_suite_mac.yml @@ -46,6 +46,9 @@ jobs: pip install setuptools npm install -g appdmg brew install swig + # blackhole-2ch provides a loopback audio device so that OpenAL doesn't hang for over 6 + # minutes trying to open the Null Audio Device + brew install blackhole-2ch - name: Set Commit SHA in Version if: ${{ github.event_name == 'schedule' }} run: python scripts/packaging/set_commit_and_date_in_version.py $(git log -1 --format='%H') From efde02f821366faeb96b7fe2189fbae31ee7186c Mon Sep 17 00:00:00 2001 From: Dean Brettle Date: Mon, 29 Jul 2024 17:39:25 -0700 Subject: [PATCH 7/8] Revert blackhold-2ch and Ignore Null Audio Device. --- .github/workflows/test_suite_mac.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test_suite_mac.yml b/.github/workflows/test_suite_mac.yml index f9346d016b8..aa526a8d088 100644 --- a/.github/workflows/test_suite_mac.yml +++ b/.github/workflows/test_suite_mac.yml @@ -46,9 +46,6 @@ jobs: pip install setuptools npm install -g appdmg brew install swig - # blackhole-2ch provides a loopback audio device so that OpenAL doesn't hang for over 6 - # minutes trying to open the Null Audio Device - brew install blackhole-2ch - name: Set Commit SHA in Version if: ${{ github.event_name == 'schedule' }} run: python scripts/packaging/set_commit_and_date_in_version.py $(git log -1 --format='%H') From f21f2083bbf42a06606fbc6832030bc15ebe2e29 Mon Sep 17 00:00:00 2001 From: Dean Brettle Date: Mon, 29 Jul 2024 17:39:57 -0700 Subject: [PATCH 8/8] Ignore Null Audio Device. --- src/webots/sound/WbSoundEngine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webots/sound/WbSoundEngine.cpp b/src/webots/sound/WbSoundEngine.cpp index e8e2aaa7cd9..f0003bf82e2 100644 --- a/src/webots/sound/WbSoundEngine.cpp +++ b/src/webots/sound/WbSoundEngine.cpp @@ -95,7 +95,7 @@ static void init() { try { std::cout << "Calling alcGetString()" << std::endl; const ALCchar *defaultDeviceName = alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER); - if (defaultDeviceName == NULL) + if (defaultDeviceName == NULL || !strcmp(defaultDeviceName, "Null Audio Device")) throw QObject::tr("Cannot find OpenAL default device"); std::cout << "Calling alcOpenDevice()" << std::endl; gDefaultDevice = alcOpenDevice(defaultDeviceName);