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

Replace fmod on Linux with SDL Audio or something similar #16355

Open
slackmoehrle opened this issue Aug 11, 2016 · 38 comments
Open

Replace fmod on Linux with SDL Audio or something similar #16355

slackmoehrle opened this issue Aug 11, 2016 · 38 comments

Comments

@slackmoehrle
Copy link
Contributor

Users have stated that we are not truly open-source on Linux because we require fmod. This isn't free and they have no other options. During our weekly meeting @ricardoquesada suggested that we could offer SDL Audio as an alternative and let users turn on fmod if they choose to. @linshun agreed. The timing of this change is TBD.

@slackmoehrle is happy to test when ready.

@ricardoquesada
Copy link
Contributor

yes, other alternatives are:

@minggo
Copy link
Contributor

minggo commented Aug 22, 2016

Can refer to #16410. The PR use OpenAL for linux.

@JOOpdenhoevel
Copy link

I don't really know how powerful/fast/etc. those alternatives are, but from my point of view, OpenAL has a big advantage: It's a cross-platform library. The implementation for Windows only uses OpenAL, MPEG, and Vorbis, which are available for Windows as well as for Linux. Due to this fact, I could simply copy the source files and it worked. All tests were positive, the C++ test and the Lua test. Another option would be to merge those implementations into one which would make maintaining the engine way easier. I could do that for Linux and Windows if you like this idea.

@minggo
Copy link
Contributor

minggo commented Aug 23, 2016

@Janonard you are right. @dumganhar i think you can take a look too. I think it is better that we can use OpenAL as possible, then it is easy to main the codes.

@minggo
Copy link
Contributor

minggo commented Aug 23, 2016

Another option would be to merge those implementations into one which would make maintaining the engine way easier. I could do that for Linux and Windows if you like this idea.

Yep, it is better.

@dumganhar
Copy link

Agree this.

We only need OpenSLES for Android & OpenAL for other platforms. Easily maintaining our engine is really important.

BTW, we also need to improve New Audio Engine since I think the logic isn't very clear for developer to understand, we need to do more encapsulation, abstraction and documentation.

@chuckhacker
Copy link

@cirosantilli
Copy link

In particular, this blocks a Debian package from being created.

And creates problems that we can't solve properly because no source, e.g.:

@v1993
Copy link
Contributor

v1993 commented Oct 22, 2017

It also may create big problems with licensing target product.

@v1993
Copy link
Contributor

v1993 commented Mar 5, 2018

Is there any progress in this direction?

@v1993
Copy link
Contributor

v1993 commented May 11, 2018

Any progress?

@halx99
Copy link
Contributor

halx99 commented Jul 20, 2018

@dumganhar Actual, OpenAL also can be use at android platform, recently, I have done it, and seems ok.

@minggo
Copy link
Contributor

minggo commented Jul 20, 2018

Any document about it?

@halx99
Copy link
Contributor

halx99 commented Jul 20, 2018

Just compile openal, mpg123, ogg for android arm, then copy win32 implementation to android, and do some changes for log & file stream adapt.

@minggo
Copy link
Contributor

minggo commented Jul 20, 2018

I think OpenAL uses some system functions provided by Android, and i don't know if it has issue on some devices or some Android versions. It is not provided by Android, and also not Android documentation mention it, so it has big risk.

@halx99
Copy link
Contributor

halx99 commented Jul 20, 2018

you can see it's backends has a opensl.c for android.

@halx99
Copy link
Contributor

halx99 commented Jul 20, 2018

So, at android platform, OpenAL based on OpenSL. use it, we only needs maintains one audio engine framework.

@minggo
Copy link
Contributor

minggo commented Jul 20, 2018

Sounds good.

@halx99
Copy link
Contributor

halx99 commented Jul 22, 2018

@minggo @dumganhar Recently, I finish this, you can see the patch: https://github.com/halx99/x-studio365/tree/master/cocos2d-x-patch

@drelaptop drelaptop self-assigned this Jul 22, 2018
@minggo
Copy link
Contributor

minggo commented Jul 23, 2018

@halx99 It is great.
@drelaptop please take a look. It is good if we can use OpenAL for all platforms.

@drelaptop
Copy link
Contributor

OK, this week I will try to test and confirm OpenAL works or not on android platform. If works well, I can do replace recently.

@halx99
Copy link
Contributor

halx99 commented Jul 23, 2018

@drelaptop By the way, I have test with ndkr14b + gcc, it work fine. maybe you need test ndkr16 + clang.

@halx99
Copy link
Contributor

halx99 commented Jul 23, 2018

@drelaptop I create 2 pr, you can simple to apply it to test it.
#18958
cocos2d/cocos2d-x-3rd-party-libs-bin#317

I have test on ndk-r17 + clang, it also work fine.

@drelaptop
Copy link
Contributor

you are so efficient, I will check it at once.

@crazyhappygame
Copy link
Contributor

crazyhappygame commented Jul 24, 2018

Please read my comments about Android OpenAL and mpg123
#18961 (comment)
I think that we should not add new LGPL *.so libraries to Android!

I am fine with OpenAL and mpg123 for Linux (it is better than fmod :) )

@drelaptop
Copy link
Contributor

@slackmoehrle could you help us check the License issue in your free time?

@ildar
Copy link

ildar commented Nov 9, 2018

@halx99 , can I ask if it's any progress with Linux migration?
BTW, @crazyhappygame , as windows part already uses OpenAL isn't it straightforward?

@crazyhappygame
Copy link
Contributor

I am fine with OpenAL and mpg123 for Linux (it is better than fmod :) )

(nothing changed for Android I think that we should not add new LGPL *.so libraries to Android!)

@halx99
Copy link
Contributor

halx99 commented Nov 9, 2018

I have test on ubuntu 18.04, the OpenAL works fine.

@ildar
Copy link

ildar commented Nov 9, 2018 via email

@halx99
Copy link
Contributor

halx99 commented Nov 9, 2018

Actually, LGPL.*.so allow free to use, and the apple os platform intrgrate OpenAL ad system framework, so, I think all platform, OpenAL is a good choice for audio framework backend.

@halx99
Copy link
Contributor

halx99 commented Nov 9, 2018

And, in our project practice, OpenAL works well at android platform, and solve a deadlock bug on some android device when quickly stop/play music, see: #18000

@ildar
Copy link

ildar commented Nov 9, 2018 via email

@halx99
Copy link
Contributor

halx99 commented Nov 9, 2018

I have build with cocos2d-x-3.17

@crazyhappygame
Copy link
Contributor

@halx99 could you create PR for Linux only?

@halx99
Copy link
Contributor

halx99 commented Nov 9, 2018

I will create when I have time

@drelaptop drelaptop modified the milestones: 3.17.1, next Nov 12, 2018
@drelaptop
Copy link
Contributor

that will be better, if we do #16307 after this issue solved.

@halx99
Copy link
Contributor

halx99 commented Nov 20, 2018

#18000, this is another reason why I recommand we also should use openal at android platform.

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

No branches or pull requests