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

Enable back support for OpenAL #831

Open
wants to merge 30 commits into
base: master
Choose a base branch
from

Conversation

damiencarol
Copy link
Contributor

@damiencarol damiencarol commented Mar 4, 2024

Fix a few misalignment between the code for FMod and OpenAL.

The reason is that the FMod code changed a bit and the part that supports OpenAL was not modified.

What this PR do
Allows to compile with OpenAL and have sound/music support without any crashes (tested on Linux, test for Windows will come).

I'm trying to minimize the changes to have a digest PR, don't shoot me to not fix everything around sound/music :)

What I found:

  1. sometimes instead of using #ifdef SOUND we need #ifdef MUSIC
  2. some parts are just missing maintenance, for ex:
    • ex: when some variables were moved for FMod, the variables for OpenAL were not
    • some functions were added for FMod but not for OpenAL (like playSoundNotificationPlayer)

Status of tests:

Linux Windows Compilation flags
No sound ? -DFMOD_ENABLED=OFF -DOPENAL_ENABLED=0
OpenAL ? -DFMOD_ENABLED=OFF -DOPENAL_ENABLED=1
FMod (with 2.01.23 ) ? ? -DFMOD_ENABLED=ON -DOPENAL_ENABLED=0
FMod (with 2.02.20 ) ? -DFMOD_ENABLED=ON -DOPENAL_ENABLED=0

✅ => I'm able to complete a game (gemili) by using most of the secret levels and play with sound levels in the settings

My first impression is that the OpenAL is more accurate/better, at least on Linux (OpenAL Soft implementation). The music are better when I compare with the version with FMod distributed with Steam, my reference.

@damiencarol
Copy link
Contributor Author

Mmm, the error in the CI is not linked to code compilation error or anything. It seems the CI is broken today :/

Initiating build-linux_fmod_steam.sh
Error! No key provided for encrypted dependencies zip. Aborting.
Error: Process completed with exit code 1.

@damiencarol damiencarol marked this pull request as ready for review March 5, 2024 15:10
@damiencarol damiencarol changed the title [WIP] Enable back support for OpenAL Enable back support for OpenAL Mar 5, 2024
@damiencarol damiencarol changed the base branch from master to sound/openal March 6, 2024 12:52
@damiencarol
Copy link
Contributor Author

damiencarol commented Mar 9, 2024

@WALLOFJUSTICE it's complete now. we can review.

@damiencarol damiencarol changed the base branch from sound/openal to develop March 11, 2024 10:32
@damiencarol damiencarol changed the title Enable back support for OpenAL * enable back support for OpenAL Mar 11, 2024
@damiencarol damiencarol marked this pull request as draft March 12, 2024 08:46
@damiencarol
Copy link
Contributor Author

damiencarol commented Mar 12, 2024

found a bug, switching it back to draft.

@damiencarol
Copy link
Contributor Author

Added better management when a music fail to load to prevent NPE

@damiencarol damiencarol marked this pull request as ready for review March 13, 2024 09:16
@damiencarol damiencarol changed the base branch from develop to master March 18, 2024 18:08
@damiencarol damiencarol changed the title * enable back support for OpenAL Enable back support for OpenAL Apr 10, 2024
@CloudyProton
Copy link

It builds successfully with -DFMOD_ENABLED=OFF -DOPENAL_ENABLED=1

libvorbis-dev and libopenal-dev installed

but fails to complete the loading screen when launching barony. Output:

[16-18-53] [PhysFS]: Loading music file music/ruins02.ogg...
[16-18-53] [PhysFS]: Loading music file music/underworld00.ogg...
[16-18-53] [PhysFS]: Loading music file music/underworld01.ogg...
[16-18-53] [PhysFS]: Loading music file music/underworld02.ogg...
[16-18-53] [PhysFS]: Loading music file music/hell00.ogg...
[16-18-53] [PhysFS]: Loading music file music/hell01.ogg...
[16-18-53] [PhysFS]: Loading music file music/hell02.ogg...
[16-18-53] [PhysFS]: Loading music file music/minotaur00.ogg...
[16-18-53] [PhysFS]: Loading music file music/minotaur01.ogg...
[16-18-53] [PhysFS]: Loading music file music/caves00.ogg...
[16-18-53] [PhysFS]: Loading music file music/caves01.ogg...
[16-18-53] [PhysFS]: Loading music file music/caves02.ogg...
[16-18-53] [PhysFS]: Loading music file music/citadel00.ogg...
[16-18-53] [PhysFS]: Loading music file music/citadel01.ogg...
[16-18-53] [PhysFS]: Loading music file music/citadel02.ogg...
[16-18-53] [PhysFS]: Loading music file music/intro.ogg...
[16-18-53] [OpenAL]: fail to load music file music/intro00.ogg...
[16-18-53] [PhysFS]: Loading music file music/intro01.ogg...
[16-18-53] [PhysFS]: Loading music file music/intro02.ogg...
[16-18-53] [PhysFS]: Loading music file music/intro01.ogg...
[16-18-53] [OpenAL]: fail to load music file music/intro00.ogg...
[16-18-53] [PhysFS]: Loading music file music/intro01.ogg...
Aborted

So I tried copying an existing ogg vorbis audio file as "intro00.ogg" to no avail.

[16-14-48] [PhysFS]: Loading music file music/underworld02.ogg...
[16-14-48] [PhysFS]: Loading music file music/hell00.ogg...
[16-14-48] [PhysFS]: Loading music file music/hell01.ogg...
[16-14-48] [PhysFS]: Loading music file music/hell02.ogg...
[16-14-48] [PhysFS]: Loading music file music/minotaur00.ogg...
[16-14-48] [PhysFS]: Loading music file music/minotaur01.ogg...
[16-14-48] [PhysFS]: Loading music file music/caves00.ogg...
[16-14-48] [PhysFS]: Loading music file music/caves01.ogg...
[16-14-48] [PhysFS]: Loading music file music/caves02.ogg...
[16-14-48] [PhysFS]: Loading music file music/citadel00.ogg...
[16-14-48] [PhysFS]: Loading music file music/citadel01.ogg...
[16-14-48] [PhysFS]: Loading music file music/citadel02.ogg...
[16-14-48] [PhysFS]: Loading music file music/intro01.ogg...
[16-14-48] [PhysFS]: Loading music file music/intro00.ogg...
[16-14-48] [PhysFS]: Loading music file music/intro01.ogg...
[16-14-48] [PhysFS]: Loading music file music/intro02.ogg...
[16-14-48] [PhysFS]: Loading music file music/intro02.ogg...
[16-14-48] [PhysFS]: Loading music file music/intro00.ogg...
[16-14-48] [PhysFS]: Loading music file music/intro01.ogg...
[16-14-48] [PhysFS]: Loading music file music/intro02.ogg...
Aborted

The game data sold through GOG does not contain any such "intro00.ogg".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants