-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[audio] Replace OpenAL Soft audio library by mini_al #385
Comments
More issue discussion on mini-al github: mackron/miniaudio#3 |
Replacement is almost complete, being tested in multiple platforms, but it is a really big library change so, thinking about some transition mechanism. Maybe supporting OpenAL Soft and mini_al for some time? Or just move fordward and remove OpenAL Soft completely on next raylib iteration? Thinking about it... |
Before doing the transition I need to verify it works properly on all the platforms. OpenAL is quite an stablished library used for commercial games (proved to be stable) while mini_al is a brand new library still under development. I really like it but I need to test it carefully before a full replacement... |
|
On macOS you will want to define -DMAL_NO_COREAUDIO as that is not implemented yet, so it can fallback to OpenAL. I only tested if lib and audio examples can be built with raylib-go, but I cannot test in vmware, OpenGL support in virtual machine is not good enough for GLFW to open window. |
Also, there is no need to link to -framework OpenAL on macOS, it is dlopen-ed. |
Defining MAL_NO_COREAUDIO isn't necessary - it's just placeholder. There shouldn't be anything there that breaks the build (correct me if I'm wrong!). |
It failed to build, I don't have now the exact error, I will add it in couple of minutes here. |
|
Oops. That will get fixed tonight when I get home. Thanks! Edit: That's fixed in the mini_al repository (dev branch). |
Transition to Also reviewed code formatting on audio module. A more detailed review on new mini_al based audio implementation is required. I want to understand in detail how it works... Still a bit confussed about |
I thought mini_al will fallback to OpenAL on OSX/macOS, there are maybe some issues with that? Also, I played with emscripten recently and it seems it will use SDL anyway for main loop and probably some other things, so for HTML5 now it will use both SDL and OpenAL? |
Hi @gen2brain, mini_al fallback for OpenAL Soft seems not to work at the moment due to mackron/miniaudio#3 (comment). It was proposed to use SDL backend for audio but it implied a 4-9 MB builds (includes all SDL library, completely overloading!) vs 1 MB with current raylib OpenAL implementation. Considering that current OpenAL Soft backend for emscripten does not require any special linkage (emscripten detects and uses it automatically), just enabled that option for HTML5. As far as I know, raylib does not use SDL at all, it uses GLFW emscripten implementation, more lightweight. Actually OpenAL Soft usage is just a custom emscripten implementation to default browser Audio. About OSX, I couldn't test it so, before enabling a library that I don't know if it works on that platform, I preferred to just leave the raylib OpenAL Soft backend for the moment. |
Ok, I thought that main loop in emscripten (emulated/pseudo loop etc.) already uses SDL that comes with emscripten, not sure why I thought that. |
I can help you out with that if you have any questions. |
Hi @mackron! Thanks for your help! I'll keep you updated! :) |
Hey I just tried out the develop branch today and I'm getting the same error as above when I try to compile my game:
I figured it belongs here rather than it's own thread.. any solution? |
Hi @SethArchambault, just tested it and it works on my side... Are you testing it on Windows 10? Compiling with MinGW? |
This is on MacOS Sierra, but I just downloaded now, and seems to be working in the latest commit of the develop branch! |
Just did a quick review on commit 7bf6bec mini_al implementation just works great! As a side effect, executable size has been reduced from ~1.4MB to ~770KB when using audio, I love it! |
Just a quick bug I noticed while scanning this code: https://github.com/raysan5/raylib/blob/develop/src/audio.c#L636 The master volume is getting to to 1, but should be set to |
Since the beginning of raylib I've been looking for a lightweight alternative library to OpenAL Soft (#52) and finally, there seems to be a solid candidate for that: mini_al by @dr-soft and proposed by @gen2brain (#52 (comment)).
Don't misundertood, OpenAL Soft is great, easy-to-use, lots of features... but it's also a big library, sometimes difficult to build, with not-really-zlib-compatible license (#372 (comment))... and adds a big dependency to raylib.
One of the final goals for raylib is avoiding any external dependency, being a self contained library that you can download, compile and run in any platform.
It seems mini_al fits perfectly on what I was looking for, actually, library is in active development and new features and platforms are being added. Additionally, @mackron started working on mini_al support for raylib and also, @gen2brain started porting mini-al to Go language, perfect for raylib-go binding. Also love mini_al logo. :P
Many thanks to @mackron and @gen2brain for their help on this project!
The text was updated successfully, but these errors were encountered: