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

Thread safety issues with sf::SoundStream and OpenAL #541

Closed
Ceylo opened this Issue Mar 1, 2014 · 38 comments

Comments

Projects
None yet
8 participants
@Ceylo
Contributor

Ceylo commented Mar 1, 2014

OpenAL does not look to be thread safe, at least on Mac OS X, thus loading and playing several SoundStreams at the same time produces crashes:

#include <SFML/Audio.hpp>
int main()
{
    sf::Music m1, m2;
    while (true) {
        m1.openFromFile("sound.wav");
        m2.openFromFile("sound.wav");

        m1.play();
        m2.play();
        m1.stop();
        m2.stop();
    }
    return 0;
}

produced various crashes:

Process:         a.out [54856]
Path:            /Users/USER/Desktop/a.out
Identifier:      a.out
Version:         0
Code Type:       X86-64 (Native)
Parent Process:  bash [54789]
Responsible:     Terminal [33222]
User ID:         501

Date/Time:       2014-03-02 00:26:49.738 +0100
OS Version:      Mac OS X 10.9.2 (13C64)
Report Version:  11
Anonymous UUID:  9F6CC766-79FF-3090-9823-BD0B80A3AA2A

Sleep/Wake UUID: A2222B85-C3AB-431A-8355-49F316E8C6DE

Crashed Thread:  5

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: EXC_I386_GPFLT

Thread 0:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff92afea3a __semwait_signal + 10
1   libsystem_pthread.dylib         0x00007fff8bae47f3 pthread_join + 433
2   org.sfml-dev.sfml-system        0x000000010d240d46 sf::Thread::wait() + 22
3   a.out                           0x000000010d223d5a main + 490
4   libdyld.dylib                   0x00007fff8997b5fd start + 1

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib          0x00007fff92aff662 kevent64 + 10
1   libdispatch.dylib               0x00007fff96a6243d _dispatch_mgr_invoke + 239
2   libdispatch.dylib               0x00007fff96a62152 _dispatch_mgr_thread + 52

Thread 2:
0   libsystem_kernel.dylib          0x00007fff92afee6a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8bae1f08 _pthread_wqthread + 330
2   libsystem_pthread.dylib         0x00007fff8bae4fb9 start_wqthread + 13

Thread 3:
0   libsystem_kernel.dylib          0x00007fff92afee6a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8bae1f08 _pthread_wqthread + 330
2   libsystem_pthread.dylib         0x00007fff8bae4fb9 start_wqthread + 13

Thread 4:: com.apple.audio.IOThread.client
0   libsystem_kernel.dylib          0x00007fff92afaa1a mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff92af9d18 mach_msg + 64
2   com.apple.audio.CoreAudio       0x00007fff96aaf918 HALB_MachPort::SendMessageWithReply(unsigned int, unsigned int, unsigned int, unsigned int, mach_msg_header_t*, bool, unsigned int) + 98
3   com.apple.audio.CoreAudio       0x00007fff96aaf8a6 HALB_MachPort::SendSimpleMessageWithSimpleReply(unsigned int, unsigned int, int, int&, bool, unsigned int) + 42
4   com.apple.audio.CoreAudio       0x00007fff96aae02e HALC_ProxyIOContext::IOWorkLoop() + 950
5   com.apple.audio.CoreAudio       0x00007fff96aadbcd HALC_ProxyIOContext::IOThreadEntry(void*) + 97
6   com.apple.audio.CoreAudio       0x00007fff96aada8d HALB_IOThread::Entry(void*) + 75
7   libsystem_pthread.dylib         0x00007fff8bae0899 _pthread_body + 138
8   libsystem_pthread.dylib         0x00007fff8bae072a _pthread_start + 137
9   libsystem_pthread.dylib         0x00007fff8bae4fc9 thread_start + 13

Thread 5 Crashed:
0   com.apple.audio.OpenAL          0x000000010d26608d OALSource::RemoveBuffersFromQueue(unsigned int, unsigned int*) + 473
1   com.apple.audio.OpenAL          0x000000010d25a77d alSourceUnqueueBuffers + 441
2   org.sfml-dev.sfml-audio         0x000000010d22e620 sf::SoundStream::streamData() + 688
3   org.sfml-dev.sfml-system        0x000000010d24159a sf::priv::ThreadImpl::entryPoint(void*) + 26
4   libsystem_pthread.dylib         0x00007fff8bae0899 _pthread_body + 138
5   libsystem_pthread.dylib         0x00007fff8bae072a _pthread_start + 137
6   libsystem_pthread.dylib         0x00007fff8bae4fc9 thread_start + 13
Process:         a.out [54587]
Path:            /Users/USER/Desktop/a.out
Identifier:      a.out
Version:         0
Code Type:       X86-64 (Native)
Parent Process:  bash [54534]
Responsible:     Terminal [33222]
User ID:         501

Date/Time:       2014-03-01 23:56:25.515 +0100
OS Version:      Mac OS X 10.9.2 (13C64)
Report Version:  11
Anonymous UUID:  9F6CC766-79FF-3090-9823-BD0B80A3AA2A

Sleep/Wake UUID: A2222B85-C3AB-431A-8355-49F316E8C6DE

Crashed Thread:  5

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000

Application Specific Information:
abort() called
*** error for object 0x7fd6d8e1a0c0: double free


Thread 0:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff92afea3a __semwait_signal + 10
1   libsystem_pthread.dylib         0x00007fff8bae47f3 pthread_join + 433
2   org.sfml-dev.sfml-system        0x0000000109719d46 sf::Thread::wait() + 22
3   a.out                           0x00000001096fdd10 main + 480
4   libdyld.dylib                   0x00007fff8997b5fd start + 1

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib          0x00007fff92aff662 kevent64 + 10
1   libdispatch.dylib               0x00007fff96a6243d _dispatch_mgr_invoke + 239
2   libdispatch.dylib               0x00007fff96a62152 _dispatch_mgr_thread + 52

Thread 2:
0   libsystem_kernel.dylib          0x00007fff92afee6a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8bae1f08 _pthread_wqthread + 330
2   libsystem_pthread.dylib         0x00007fff8bae4fb9 start_wqthread + 13

Thread 3:
0   libsystem_kernel.dylib          0x00007fff92afee6a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8bae1f08 _pthread_wqthread + 330
2   libsystem_pthread.dylib         0x00007fff8bae4fb9 start_wqthread + 13

Thread 4:: com.apple.audio.IOThread.client
0   libsystem_kernel.dylib          0x00007fff92afaa1a mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff92af9d18 mach_msg + 64
2   com.apple.audio.CoreAudio       0x00007fff96aaf918 HALB_MachPort::SendMessageWithReply(unsigned int, unsigned int, unsigned int, unsigned int, mach_msg_header_t*, bool, unsigned int) + 98
3   com.apple.audio.CoreAudio       0x00007fff96aaf8a6 HALB_MachPort::SendSimpleMessageWithSimpleReply(unsigned int, unsigned int, int, int&, bool, unsigned int) + 42
4   com.apple.audio.CoreAudio       0x00007fff96aae02e HALC_ProxyIOContext::IOWorkLoop() + 950
5   com.apple.audio.CoreAudio       0x00007fff96aadbcd HALC_ProxyIOContext::IOThreadEntry(void*) + 97
6   com.apple.audio.CoreAudio       0x00007fff96aada8d HALB_IOThread::Entry(void*) + 75
7   libsystem_pthread.dylib         0x00007fff8bae0899 _pthread_body + 138
8   libsystem_pthread.dylib         0x00007fff8bae072a _pthread_start + 137
9   libsystem_pthread.dylib         0x00007fff8bae4fc9 thread_start + 13

Thread 5 Crashed:
0   libsystem_kernel.dylib          0x00007fff92afe866 __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff8bae135c pthread_kill + 92
2   libsystem_c.dylib               0x00007fff92f3cb1a abort + 125
3   libsystem_malloc.dylib          0x00007fff894ab690 szone_error + 587
4   com.apple.audio.units.Components    0x000000010a427583 MixerSource::Initialize(AUMixer3D*) + 1759
5   com.apple.audio.units.Components    0x000000010a429dfb AUMixer3D::SetProperty(unsigned int, unsigned int, unsigned int, void const*, unsigned int) + 261
6   com.apple.audio.units.Components    0x000000010a403ec6 AUBase::DispatchSetProperty(unsigned int, unsigned int, unsigned int, void const*, unsigned int) + 1426
7   com.apple.audio.units.Components    0x000000010a492dda AUMethodSetProperty(void*, unsigned int, unsigned int, unsigned int, void const*, unsigned int) + 127
8   com.apple.audio.toolbox.AudioToolbox    0x00007fff9505e526 _AT_AudioUnitSetProperty + 147
9   com.apple.audio.OpenAL          0x000000010973a1e0 OALContext::GetAvailableStereoBus(unsigned int) + 298
10  com.apple.audio.OpenAL          0x000000010974055b OALSource::SetupMixerBus() + 123
11  com.apple.audio.OpenAL          0x000000010974107d OALSource::Play() + 329
12  com.apple.audio.OpenAL          0x0000000109733fdc alSourcePlay + 29
13  org.sfml-dev.sfml-audio         0x00000001097083df sf::SoundStream::streamData() + 111
14  org.sfml-dev.sfml-system        0x000000010971a59a sf::priv::ThreadImpl::entryPoint(void*) + 26
15  libsystem_pthread.dylib         0x00007fff8bae0899 _pthread_body + 138
16  libsystem_pthread.dylib         0x00007fff8bae072a _pthread_start + 137
17  libsystem_pthread.dylib         0x00007fff8bae4fc9 thread_start + 13
Process:         a.out [54575]
Path:            /Users/USER/Desktop/a.out
Identifier:      a.out
Version:         0
Code Type:       X86-64 (Native)
Parent Process:  bash [54534]
Responsible:     Terminal [33222]
User ID:         501

Date/Time:       2014-03-01 23:55:29.899 +0100
OS Version:      Mac OS X 10.9.2 (13C64)
Report Version:  11
Anonymous UUID:  9F6CC766-79FF-3090-9823-BD0B80A3AA2A

Sleep/Wake UUID: A2222B85-C3AB-431A-8355-49F316E8C6DE

Crashed Thread:  6

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000

VM Regions Near 0:
--> 
    __TEXT                 0000000101fbe000-0000000101fbf000 [    4K] r-x/rwx SM=COW  /Users/USER/Desktop/*.out

Thread 0:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff92afea3a __semwait_signal + 10
1   libsystem_pthread.dylib         0x00007fff8bae47f3 pthread_join + 433
2   org.sfml-dev.sfml-system        0x0000000101fded46 sf::Thread::wait() + 22
3   a.out                           0x0000000101fbecff main + 463
4   libdyld.dylib                   0x00007fff8997b5fd start + 1

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib          0x00007fff92aff662 kevent64 + 10
1   libdispatch.dylib               0x00007fff96a6243d _dispatch_mgr_invoke + 239
2   libdispatch.dylib               0x00007fff96a62152 _dispatch_mgr_thread + 52

Thread 2:
0   libsystem_kernel.dylib          0x00007fff92afee6a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8bae1f08 _pthread_wqthread + 330
2   libsystem_pthread.dylib         0x00007fff8bae4fb9 start_wqthread + 13

Thread 3:
0   libsystem_kernel.dylib          0x00007fff92afee6a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8bae1f08 _pthread_wqthread + 330
2   libsystem_pthread.dylib         0x00007fff8bae4fb9 start_wqthread + 13

Thread 4:: com.apple.audio.IOThread.client
0   libsystem_kernel.dylib          0x00007fff92afaa1a mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff92af9d18 mach_msg + 64
2   com.apple.audio.CoreAudio       0x00007fff96aaf918 HALB_MachPort::SendMessageWithReply(unsigned int, unsigned int, unsigned int, unsigned int, mach_msg_header_t*, bool, unsigned int) + 98
3   com.apple.audio.CoreAudio       0x00007fff96aaf8a6 HALB_MachPort::SendSimpleMessageWithSimpleReply(unsigned int, unsigned int, int, int&, bool, unsigned int) + 42
4   com.apple.audio.CoreAudio       0x00007fff96aae02e HALC_ProxyIOContext::IOWorkLoop() + 950
5   com.apple.audio.CoreAudio       0x00007fff96aadbcd HALC_ProxyIOContext::IOThreadEntry(void*) + 97
6   com.apple.audio.CoreAudio       0x00007fff96aada8d HALB_IOThread::Entry(void*) + 75
7   libsystem_pthread.dylib         0x00007fff8bae0899 _pthread_body + 138
8   libsystem_pthread.dylib         0x00007fff8bae072a _pthread_start + 137
9   libsystem_pthread.dylib         0x00007fff8bae4fc9 thread_start + 13

Thread 5:
0   libsystem_kernel.dylib          0x00007fff92aff9f2 read + 10
1   com.mega-nerd.sndfile           0x00000001020996b9 psf_fread + 202
2   com.mega-nerd.sndfile           0x000000010209af67 float32_be_write + 1305
3   com.mega-nerd.sndfile           0x00000001020613bb sf_read_short + 498
4   org.sfml-dev.sfml-audio         0x0000000101fc4715 sf::Music::onGetData(sf::SoundStream::Chunk&) + 69
5   org.sfml-dev.sfml-audio         0x0000000101fc9bc4 sf::SoundStream::fillAndPushBuffer(unsigned int) + 36
6   org.sfml-dev.sfml-audio         0x0000000101fc93aa sf::SoundStream::streamData() + 58
7   org.sfml-dev.sfml-system        0x0000000101fdf59a sf::priv::ThreadImpl::entryPoint(void*) + 26
8   libsystem_pthread.dylib         0x00007fff8bae0899 _pthread_body + 138
9   libsystem_pthread.dylib         0x00007fff8bae072a _pthread_start + 137
10  libsystem_pthread.dylib         0x00007fff8bae4fc9 thread_start + 13

Thread 6 Crashed:
0   com.apple.audio.OpenAL          0x0000000101fef975 alGenBuffers + 60
1   org.sfml-dev.sfml-audio         0x0000000101fc9396 sf::SoundStream::streamData() + 38
2   org.sfml-dev.sfml-system        0x0000000101fdf59a sf::priv::ThreadImpl::entryPoint(void*) + 26
3   libsystem_pthread.dylib         0x00007fff8bae0899 _pthread_body + 138
4   libsystem_pthread.dylib         0x00007fff8bae072a _pthread_start + 137
5   libsystem_pthread.dylib         0x00007fff8bae4fc9 thread_start + 13
@MarioLiebisch

This comment has been minimized.

Show comment
Hide comment
@MarioLiebisch

MarioLiebisch Mar 1, 2014

Member

OpenAL is supposed to be thread safe. You should also be able to play several sounds at once depending on your actual hardware. This might still be some bug in SFML or in the audio drivers.

Member

MarioLiebisch commented Mar 1, 2014

OpenAL is supposed to be thread safe. You should also be able to play several sounds at once depending on your actual hardware. This might still be some bug in SFML or in the audio drivers.

@Ceylo

This comment has been minimized.

Show comment
Hide comment
@Ceylo

Ceylo Mar 1, 2014

Contributor

Well, I would not be very surprised it was a bug in Apple's OpenAL implementation…
How do you know that OpenAL is supposed to be thread safe?

Contributor

Ceylo commented Mar 1, 2014

Well, I would not be very surprised it was a bug in Apple's OpenAL implementation…
How do you know that OpenAL is supposed to be thread safe?

@MarioLiebisch

This comment has been minimized.

Show comment
Hide comment
@MarioLiebisch

MarioLiebisch Mar 2, 2014

Member

It's a spec requirement, e.g. discussed here.

Member

MarioLiebisch commented Mar 2, 2014

It's a spec requirement, e.g. discussed here.

@Ceylo

This comment has been minimized.

Show comment
Hide comment
@Ceylo

Ceylo Mar 2, 2014

Contributor

The second comment in the discussion shows an issue that could actually be this thread's one though.

Contributor

Ceylo commented Mar 2, 2014

The second comment in the discussion shows an issue that could actually be this thread's one though.

Ceylo added a commit to Yalir/sfeMovie that referenced this issue Mar 2, 2014

@Sonkun

This comment has been minimized.

Show comment
Hide comment
@Sonkun

Sonkun Apr 21, 2014

Member

I can't reproduce this issue on Windows with the development version of SFML. Has anyone tried on Linux ?

Member

Sonkun commented Apr 21, 2014

I can't reproduce this issue on Windows with the development version of SFML. Has anyone tried on Linux ?

@mantognini

This comment has been minimized.

Show comment
Hide comment
@mantognini

mantognini Apr 21, 2014

Member

It still crashes on Mac with HEAD.

Member

mantognini commented Apr 21, 2014

It still crashes on Mac with HEAD.

@Sonkun

This comment has been minimized.

Show comment
Hide comment
@Sonkun

Sonkun Apr 21, 2014

Member

If it turns out to be a bug in Mac OS X implementation of OpenAL maybe we could still use a sf::Mutex to prevent this crash from happening (using pre-processor conditions)

Is it possible to reduce the minimal code which produces this bug ? Because I don't have access to Mac OS X before 28th of April and I'd like to analyze the implementation.

Member

Sonkun commented Apr 21, 2014

If it turns out to be a bug in Mac OS X implementation of OpenAL maybe we could still use a sf::Mutex to prevent this crash from happening (using pre-processor conditions)

Is it possible to reduce the minimal code which produces this bug ? Because I don't have access to Mac OS X before 28th of April and I'd like to analyze the implementation.

@mantognini mantognini added bug labels May 14, 2014

@binary1248 binary1248 added the OS X label May 19, 2014

@LaurentGomila LaurentGomila added confirmed and removed unassigned labels May 20, 2014

@mantognini mantognini added this to the 2.x milestone May 22, 2014

@Bromeon Bromeon added the s:accepted label Jun 6, 2014

@binary1248

This comment has been minimized.

Show comment
Hide comment
@binary1248

binary1248 Aug 20, 2014

Member

Any updates on this? If people with access to OS X machines could provide some information on where the crash occurs and what is/isn't thread safe, it would help in writing a fix for this.

Member

binary1248 commented Aug 20, 2014

Any updates on this? If people with access to OS X machines could provide some information on where the crash occurs and what is/isn't thread safe, it would help in writing a fix for this.

@mantognini

This comment has been minimized.

Show comment
Hide comment
@mantognini

mantognini Aug 20, 2014

Member

I'll try to have a look beginning of Sept. if no one has done it. Ping me if I forget to get back to you. ;-)

Member

mantognini commented Aug 20, 2014

I'll try to have a look beginning of Sept. if no one has done it. Ping me if I forget to get back to you. ;-)

@eXpl0it3r

This comment has been minimized.

Show comment
Hide comment
@eXpl0it3r

eXpl0it3r Oct 2, 2014

Member

PING 😄

Member

eXpl0it3r commented Oct 2, 2014

PING 😄

@mantognini

This comment has been minimized.

Show comment
Hide comment
@mantognini

mantognini Oct 2, 2014

Member

I meant beginning September 2015! JK

More seriously, I'll try to investigate on it soon.

Member

mantognini commented Oct 2, 2014

I meant beginning September 2015! JK

More seriously, I'll try to investigate on it soon.

@eXpl0it3r eXpl0it3r removed this from the 2.x milestone Nov 13, 2014

@Ceylo Ceylo removed this from the 2.x milestone Nov 13, 2014

@Ceylo Ceylo referenced this issue Dec 25, 2014

Closed

Seeking in the movie #6

24 of 24 tasks complete
@Ceylo

This comment has been minimized.

Show comment
Hide comment
@Ceylo

Ceylo Jan 31, 2015

Contributor

Pong ! :-°

Contributor

Ceylo commented Jan 31, 2015

Pong ! :-°

@mantognini

This comment has been minimized.

Show comment
Hide comment
@mantognini

mantognini Feb 1, 2015

Member

Sorry, my firewall blocks ICMP requests... 😛

More seriously, I've no idea where to add synchronisation point efficiently. Do you?

We could try openal-soft with brew to see if it's specific to Apple's implementation or not.

Member

mantognini commented Feb 1, 2015

Sorry, my firewall blocks ICMP requests... 😛

More seriously, I've no idea where to add synchronisation point efficiently. Do you?

We could try openal-soft with brew to see if it's specific to Apple's implementation or not.

@Ceylo

This comment has been minimized.

Show comment
Hide comment
@Ceylo

Ceylo Feb 2, 2015

Contributor

Well I have not investigated at all so I don't know about the synchronization points. And if you're talking of adding locked scopes, unless you also flush the OpenAL command queue (is that possible?) to make it synchronous I don't think it would help.

As for Homebrew's binaries I did not try yet :)

Contributor

Ceylo commented Feb 2, 2015

Well I have not investigated at all so I don't know about the synchronization points. And if you're talking of adding locked scopes, unless you also flush the OpenAL command queue (is that possible?) to make it synchronous I don't think it would help.

As for Homebrew's binaries I did not try yet :)

@mantognini

This comment has been minimized.

Show comment
Hide comment
@mantognini

mantognini Feb 2, 2015

Member

Then I guess I'll have to dig into the documentation.. don't know when I'll have enough time to get into it. :-/

In the meantime, if you can try openal soft, that be great. :-)

Member

mantognini commented Feb 2, 2015

Then I guess I'll have to dig into the documentation.. don't know when I'll have enough time to get into it. :-/

In the meantime, if you can try openal soft, that be great. :-)

@Ceylo

This comment has been minimized.

Show comment
Hide comment
@Ceylo

Ceylo Mar 13, 2015

Contributor

openal-soft from Homebrew confirmed not to crash. By the way the system's OpenAL crashes even with only one sf::Music used in the sample code…

Contributor

Ceylo commented Mar 13, 2015

openal-soft from Homebrew confirmed not to crash. By the way the system's OpenAL crashes even with only one sf::Music used in the sample code…

@Ceylo

This comment has been minimized.

Show comment
Hide comment
@Ceylo

Ceylo Mar 13, 2015

Contributor

Imho providing the extra dependency looks to be the best option at the moment. And yep I'll gladly come up with a pull request as soon as possible :)

Is the build script somewhere on the repo (ie. should it be updated?) or is it only a gist?

Contributor

Ceylo commented Mar 13, 2015

Imho providing the extra dependency looks to be the best option at the moment. And yep I'll gladly come up with a pull request as soon as possible :)

Is the build script somewhere on the repo (ie. should it be updated?) or is it only a gist?

@mantognini

This comment has been minimized.

Show comment
Hide comment
@mantognini

mantognini Mar 13, 2015

Member

Awesome!

Is the build script somewhere on the repo (ie. should it be updated?) or is it only a gist?

No, it's only a gist. I usually simply put the link to the gist in the related commit but that's it.

Member

mantognini commented Mar 13, 2015

Awesome!

Is the build script somewhere on the repo (ie. should it be updated?) or is it only a gist?

No, it's only a gist. I usually simply put the link to the gist in the related commit but that's it.

@Ceylo

This comment has been minimized.

Show comment
Hide comment
@Ceylo

Ceylo Mar 13, 2015

Contributor

Ok, shouldn't take too much time to get binaries ready, I guess I just have to steal Homebrew's formula :-°

Contributor

Ceylo commented Mar 13, 2015

Ok, shouldn't take too much time to get binaries ready, I guess I just have to steal Homebrew's formula :-°

@Ceylo

This comment has been minimized.

Show comment
Hide comment
@Ceylo

Ceylo Mar 13, 2015

Contributor

By the way why doesn't your script build both 32 and 64 binaries at once? From what I know it's possible to specify both architectures in one compilation command and it'll produce fat object files/binaries.

Contributor

Ceylo commented Mar 13, 2015

By the way why doesn't your script build both 32 and 64 binaries at once? From what I know it's possible to specify both architectures in one compilation command and it'll produce fat object files/binaries.

@mantognini

This comment has been minimized.

Show comment
Hide comment
@mantognini

mantognini Mar 14, 2015

Member

I remember that for at least one specific library it didn't work to compile both arch at once so I kept the same schema for all libraries. But if you succeed in one go that cool. :)

Member

mantognini commented Mar 14, 2015

I remember that for at least one specific library it didn't work to compile both arch at once so I kept the same schema for all libraries. But if you succeed in one go that cool. :)

@Ceylo

This comment has been minimized.

Show comment
Hide comment
@Ceylo

Ceylo Mar 14, 2015

Contributor

Hmmmm ok I'll start the easy way :)

Contributor

Ceylo commented Mar 14, 2015

Hmmmm ok I'll start the easy way :)

@Ceylo

This comment has been minimized.

Show comment
Hide comment
@Ceylo

Ceylo Mar 14, 2015

Contributor

I've generated the framework which gives the following:

Website for sources download:

http://kcat.strangesoft.net/openal.html#download

CMake options:

-DCMAKE_OSX_ARCHITECTURES="i386;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.7" -DCMAKE_OSX_SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk" -DCMAKE_BUILD_TYPE="RelWithDebInfo"

Typical compile command executed by make:

/usr/bin/cc  -DAL_ALEXT_PROTOTYPES -DAL_BUILD_LIBRARY -D_GNU_SOURCE=1 -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -Dopenal_EXPORTS -std=c99  -g -O2 -D_DEBUG -arch i386 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -fPIC -I/Users/ceylo/al/openal-soft-1.16.0/include -I/Users/ceylo/al/build/i386 -I/Users/ceylo/al/openal-soft-1.16.0/OpenAL32/Include -I/Users/ceylo/al/openal-soft-1.16.0/Alc    -Winline -Wall -Wextra -fPIC -fvisibility=hidden -pthread -o CMakeFiles/openal.dir/Alc/backends/coreaudio.c.o   -c /Users/ceylo/al/openal-soft-1.16.0/Alc/backends/coreaudio.c

Final link command executed by make:

/usr/bin/cc  -std=c99  -g -O2 -D_DEBUG -arch i386 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -dynamiclib -Wl,-headerpad_max_install_names   -compatibility_version 1.0.0 -current_version 1.16.0 -o libopenal.1.16.0.dylib -install_name /Users/ceylo/al/build/i386/libopenal.1.dylib CMakeFiles/openal.dir/OpenAL32/alAuxEffectSlot.c.o CMakeFiles/openal.dir/OpenAL32/alBuffer.c.o CMakeFiles/openal.dir/OpenAL32/alEffect.c.o CMakeFiles/openal.dir/OpenAL32/alError.c.o CMakeFiles/openal.dir/OpenAL32/alExtension.c.o CMakeFiles/openal.dir/OpenAL32/alFilter.c.o CMakeFiles/openal.dir/OpenAL32/alFontsound.c.o CMakeFiles/openal.dir/OpenAL32/alListener.c.o CMakeFiles/openal.dir/OpenAL32/alMidi.c.o CMakeFiles/openal.dir/OpenAL32/alPreset.c.o CMakeFiles/openal.dir/OpenAL32/alSoundfont.c.o CMakeFiles/openal.dir/OpenAL32/alSource.c.o CMakeFiles/openal.dir/OpenAL32/alState.c.o CMakeFiles/openal.dir/OpenAL32/alThunk.c.o CMakeFiles/openal.dir/OpenAL32/sample_cvt.c.o CMakeFiles/openal.dir/Alc/ALc.c.o CMakeFiles/openal.dir/Alc/ALu.c.o CMakeFiles/openal.dir/Alc/alcConfig.c.o CMakeFiles/openal.dir/Alc/alcRing.c.o CMakeFiles/openal.dir/Alc/bs2b.c.o CMakeFiles/openal.dir/Alc/effects/autowah.c.o CMakeFiles/openal.dir/Alc/effects/chorus.c.o CMakeFiles/openal.dir/Alc/effects/compressor.c.o CMakeFiles/openal.dir/Alc/effects/dedicated.c.o CMakeFiles/openal.dir/Alc/effects/distortion.c.o CMakeFiles/openal.dir/Alc/effects/echo.c.o CMakeFiles/openal.dir/Alc/effects/equalizer.c.o CMakeFiles/openal.dir/Alc/effects/flanger.c.o CMakeFiles/openal.dir/Alc/effects/modulator.c.o CMakeFiles/openal.dir/Alc/effects/null.c.o CMakeFiles/openal.dir/Alc/effects/reverb.c.o CMakeFiles/openal.dir/Alc/helpers.c.o CMakeFiles/openal.dir/Alc/hrtf.c.o CMakeFiles/openal.dir/Alc/panning.c.o CMakeFiles/openal.dir/Alc/mixer.c.o CMakeFiles/openal.dir/Alc/mixer_c.c.o CMakeFiles/openal.dir/Alc/mixer_sse.c.o CMakeFiles/openal.dir/Alc/mixer_sse2.c.o CMakeFiles/openal.dir/Alc/mixer_sse41.c.o CMakeFiles/openal.dir/Alc/midi/base.c.o CMakeFiles/openal.dir/Alc/midi/sf2load.c.o CMakeFiles/openal.dir/Alc/midi/dummy.c.o CMakeFiles/openal.dir/Alc/midi/fluidsynth.c.o CMakeFiles/openal.dir/Alc/midi/soft.c.o CMakeFiles/openal.dir/Alc/backends/base.c.o CMakeFiles/openal.dir/Alc/backends/loopback.c.o CMakeFiles/openal.dir/Alc/backends/null.c.o CMakeFiles/openal.dir/Alc/backends/coreaudio.c.o CMakeFiles/openal.dir/Alc/backends/wave.c.o libcommon.a -framework AudioToolbox -framework ApplicationServices -framework AudioUnit -framework CoreAudio -lpthread -ldl -lm -pthread

File on generated framework:

libopenal: Mach-O universal binary with 2 architectures
libopenal (for architecture i386):  Mach-O dynamically linked shared library i386
libopenal (for architecture x86_64):    Mach-O 64-bit dynamically linked shared library x86_64

Otool on generated framework:

libopenal:
    @rpath/../Frameworks/libopenal.framework/Versions/A/libopenal (compatibility version 1.0.0, current version 1.16.0)
    /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 41.0.0)
    /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 53.0.0)

Now what I'm wondering… should the framework be named openal, openal-soft or left as is (libopenal) ?

Contributor

Ceylo commented Mar 14, 2015

I've generated the framework which gives the following:

Website for sources download:

http://kcat.strangesoft.net/openal.html#download

CMake options:

-DCMAKE_OSX_ARCHITECTURES="i386;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.7" -DCMAKE_OSX_SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk" -DCMAKE_BUILD_TYPE="RelWithDebInfo"

Typical compile command executed by make:

/usr/bin/cc  -DAL_ALEXT_PROTOTYPES -DAL_BUILD_LIBRARY -D_GNU_SOURCE=1 -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -Dopenal_EXPORTS -std=c99  -g -O2 -D_DEBUG -arch i386 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -fPIC -I/Users/ceylo/al/openal-soft-1.16.0/include -I/Users/ceylo/al/build/i386 -I/Users/ceylo/al/openal-soft-1.16.0/OpenAL32/Include -I/Users/ceylo/al/openal-soft-1.16.0/Alc    -Winline -Wall -Wextra -fPIC -fvisibility=hidden -pthread -o CMakeFiles/openal.dir/Alc/backends/coreaudio.c.o   -c /Users/ceylo/al/openal-soft-1.16.0/Alc/backends/coreaudio.c

Final link command executed by make:

/usr/bin/cc  -std=c99  -g -O2 -D_DEBUG -arch i386 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -dynamiclib -Wl,-headerpad_max_install_names   -compatibility_version 1.0.0 -current_version 1.16.0 -o libopenal.1.16.0.dylib -install_name /Users/ceylo/al/build/i386/libopenal.1.dylib CMakeFiles/openal.dir/OpenAL32/alAuxEffectSlot.c.o CMakeFiles/openal.dir/OpenAL32/alBuffer.c.o CMakeFiles/openal.dir/OpenAL32/alEffect.c.o CMakeFiles/openal.dir/OpenAL32/alError.c.o CMakeFiles/openal.dir/OpenAL32/alExtension.c.o CMakeFiles/openal.dir/OpenAL32/alFilter.c.o CMakeFiles/openal.dir/OpenAL32/alFontsound.c.o CMakeFiles/openal.dir/OpenAL32/alListener.c.o CMakeFiles/openal.dir/OpenAL32/alMidi.c.o CMakeFiles/openal.dir/OpenAL32/alPreset.c.o CMakeFiles/openal.dir/OpenAL32/alSoundfont.c.o CMakeFiles/openal.dir/OpenAL32/alSource.c.o CMakeFiles/openal.dir/OpenAL32/alState.c.o CMakeFiles/openal.dir/OpenAL32/alThunk.c.o CMakeFiles/openal.dir/OpenAL32/sample_cvt.c.o CMakeFiles/openal.dir/Alc/ALc.c.o CMakeFiles/openal.dir/Alc/ALu.c.o CMakeFiles/openal.dir/Alc/alcConfig.c.o CMakeFiles/openal.dir/Alc/alcRing.c.o CMakeFiles/openal.dir/Alc/bs2b.c.o CMakeFiles/openal.dir/Alc/effects/autowah.c.o CMakeFiles/openal.dir/Alc/effects/chorus.c.o CMakeFiles/openal.dir/Alc/effects/compressor.c.o CMakeFiles/openal.dir/Alc/effects/dedicated.c.o CMakeFiles/openal.dir/Alc/effects/distortion.c.o CMakeFiles/openal.dir/Alc/effects/echo.c.o CMakeFiles/openal.dir/Alc/effects/equalizer.c.o CMakeFiles/openal.dir/Alc/effects/flanger.c.o CMakeFiles/openal.dir/Alc/effects/modulator.c.o CMakeFiles/openal.dir/Alc/effects/null.c.o CMakeFiles/openal.dir/Alc/effects/reverb.c.o CMakeFiles/openal.dir/Alc/helpers.c.o CMakeFiles/openal.dir/Alc/hrtf.c.o CMakeFiles/openal.dir/Alc/panning.c.o CMakeFiles/openal.dir/Alc/mixer.c.o CMakeFiles/openal.dir/Alc/mixer_c.c.o CMakeFiles/openal.dir/Alc/mixer_sse.c.o CMakeFiles/openal.dir/Alc/mixer_sse2.c.o CMakeFiles/openal.dir/Alc/mixer_sse41.c.o CMakeFiles/openal.dir/Alc/midi/base.c.o CMakeFiles/openal.dir/Alc/midi/sf2load.c.o CMakeFiles/openal.dir/Alc/midi/dummy.c.o CMakeFiles/openal.dir/Alc/midi/fluidsynth.c.o CMakeFiles/openal.dir/Alc/midi/soft.c.o CMakeFiles/openal.dir/Alc/backends/base.c.o CMakeFiles/openal.dir/Alc/backends/loopback.c.o CMakeFiles/openal.dir/Alc/backends/null.c.o CMakeFiles/openal.dir/Alc/backends/coreaudio.c.o CMakeFiles/openal.dir/Alc/backends/wave.c.o libcommon.a -framework AudioToolbox -framework ApplicationServices -framework AudioUnit -framework CoreAudio -lpthread -ldl -lm -pthread

File on generated framework:

libopenal: Mach-O universal binary with 2 architectures
libopenal (for architecture i386):  Mach-O dynamically linked shared library i386
libopenal (for architecture x86_64):    Mach-O 64-bit dynamically linked shared library x86_64

Otool on generated framework:

libopenal:
    @rpath/../Frameworks/libopenal.framework/Versions/A/libopenal (compatibility version 1.0.0, current version 1.16.0)
    /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 41.0.0)
    /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 53.0.0)

Now what I'm wondering… should the framework be named openal, openal-soft or left as is (libopenal) ?

@Ceylo

This comment has been minimized.

Show comment
Hide comment
@Ceylo

Ceylo Mar 14, 2015

Contributor

And here are the commands I used:

[ ceylo ~/al/install/i386/framework ] echo '<?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
> <plist version="1.0">
> <dict>
>     <key>CFBundleDevelopmentRegion</key>
>     <string>English</string>
>     <key>CFBundleExecutable</key>
>     <string>@@LIB@@</string>
>     <key>CFBundleIdentifier</key>
>     <string>org.sfml-dev.@@LIB@@</string>
>     <key>CFBundleInfoDictionaryVersion</key>
>     <string>6.0</string>
>     <key>CFBundlePackageType</key>
>     <string>FMWK</string>
>     <key>CFBundleSignature</key>
>     <string>????</string>
>     <key>CFBundleVersion</key>
>     <string>1.0</string>
> </dict>
> </plist>' > Info.plist.in
[ ceylo ~/al/install/i386/framework ] ls ../lib
libopenal.1.16.0.dylib  libopenal.1.dylib   libopenal.dylib     pkgconfig
[ ceylo ~/al/install/i386/framework ] cp ../lib/libopenal.1.16.0.dylib libopenal.dylib
[ ceylo ~/al/install/i386/framework ] ls -l
total 1984
-rw-r--r--  1 ceylo  staff      643 14 mar 10:55 Info.plist.in
-rwxr-xr-x  1 ceylo  staff  1008744 14 mar 10:57 libopenal.dylib
[ ceylo ~/al/install/i386/framework ] f=$(echo *.dylib)
[ ceylo ~/al/install/i386/framework ] echo $f
libopenal.dylib
[ ceylo ~/al/install/i386/framework ] lib=$(basename $f .dylib)
[ ceylo ~/al/install/i386/framework ] echo $lib
libopenal
[ ceylo ~/al/install/i386/framework ] rm -rf rm -fr "$lib.framework"
[ ceylo ~/al/install/i386/framework ] rm -fr "$lib.framework"
[ ceylo ~/al/install/i386/framework ] mkdir -p "$lib.framework/Versions/A/Resources/"
[ ceylo ~/al/install/i386/framework ] cp "$f" "$lib.framework/Versions/A/$lib"
[ ceylo ~/al/install/i386/framework ] sed -e "s#@@LIB@@#$lib#" "Info.plist.in" > "$lib.framework/Versions/A/Resources/Info.plist"
[ ceylo ~/al/install/i386/framework ] pushd "$lib.framework/Versions"
~/al/install/i386/framework/libopenal.framework/Versions ~/al/install/i386/framework
[ ceylo ~/al/install/i386/framework/libopenal.framework/Versions ] ln -s "A" "Current"
[ ceylo ~/al/install/i386/framework/libopenal.framework/Versions ] cd ..
[ ceylo ~/al/install/i386/framework/libopenal.framework ] ln -s "Versions/Current/Resources" "Resources"
[ ceylo ~/al/install/i386/framework/libopenal.framework ] ln -s "Versions/Current/$lib"
[ ceylo ~/al/install/i386/framework/libopenal.framework ] popd
~/al/install/i386/framework
[ ceylo ~/al/install/i386/framework ] f=$(echo *.framework)
[ ceylo ~/al/install/i386/framework ] echo $f
libopenal.framework
[ ceylo ~/al/install/i386/framework ] lib=$(echo $f | sed -e 's#\(.*\)\.framework#\1#')
[ ceylo ~/al/install/i386/framework ] echo $lib
libopenal
[ ceylo ~/al/install/i386/framework ] install_name_tool -id "@rpath/../Frameworks/$lib.framework/Versions/A/$lib" "$lib.framework/Versions/A/$lib"
[ ceylo ~/al/install/i386/framework ] echo $f
libopenal.framework
[ ceylo ~/al/install/i386/framework ] otool -L "$f/$lib"
libopenal.framework/libopenal:
    @rpath/../Frameworks/libopenal.framework/Versions/A/libopenal (compatibility version 1.0.0, current version 1.16.0)
    /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 41.0.0)
    /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 53.0.0)

Basically it's just what you used in the gist after the binaries are created, without the stuff for the dependencies on ogg, vorbis, etc.

Contributor

Ceylo commented Mar 14, 2015

And here are the commands I used:

[ ceylo ~/al/install/i386/framework ] echo '<?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
> <plist version="1.0">
> <dict>
>     <key>CFBundleDevelopmentRegion</key>
>     <string>English</string>
>     <key>CFBundleExecutable</key>
>     <string>@@LIB@@</string>
>     <key>CFBundleIdentifier</key>
>     <string>org.sfml-dev.@@LIB@@</string>
>     <key>CFBundleInfoDictionaryVersion</key>
>     <string>6.0</string>
>     <key>CFBundlePackageType</key>
>     <string>FMWK</string>
>     <key>CFBundleSignature</key>
>     <string>????</string>
>     <key>CFBundleVersion</key>
>     <string>1.0</string>
> </dict>
> </plist>' > Info.plist.in
[ ceylo ~/al/install/i386/framework ] ls ../lib
libopenal.1.16.0.dylib  libopenal.1.dylib   libopenal.dylib     pkgconfig
[ ceylo ~/al/install/i386/framework ] cp ../lib/libopenal.1.16.0.dylib libopenal.dylib
[ ceylo ~/al/install/i386/framework ] ls -l
total 1984
-rw-r--r--  1 ceylo  staff      643 14 mar 10:55 Info.plist.in
-rwxr-xr-x  1 ceylo  staff  1008744 14 mar 10:57 libopenal.dylib
[ ceylo ~/al/install/i386/framework ] f=$(echo *.dylib)
[ ceylo ~/al/install/i386/framework ] echo $f
libopenal.dylib
[ ceylo ~/al/install/i386/framework ] lib=$(basename $f .dylib)
[ ceylo ~/al/install/i386/framework ] echo $lib
libopenal
[ ceylo ~/al/install/i386/framework ] rm -rf rm -fr "$lib.framework"
[ ceylo ~/al/install/i386/framework ] rm -fr "$lib.framework"
[ ceylo ~/al/install/i386/framework ] mkdir -p "$lib.framework/Versions/A/Resources/"
[ ceylo ~/al/install/i386/framework ] cp "$f" "$lib.framework/Versions/A/$lib"
[ ceylo ~/al/install/i386/framework ] sed -e "s#@@LIB@@#$lib#" "Info.plist.in" > "$lib.framework/Versions/A/Resources/Info.plist"
[ ceylo ~/al/install/i386/framework ] pushd "$lib.framework/Versions"
~/al/install/i386/framework/libopenal.framework/Versions ~/al/install/i386/framework
[ ceylo ~/al/install/i386/framework/libopenal.framework/Versions ] ln -s "A" "Current"
[ ceylo ~/al/install/i386/framework/libopenal.framework/Versions ] cd ..
[ ceylo ~/al/install/i386/framework/libopenal.framework ] ln -s "Versions/Current/Resources" "Resources"
[ ceylo ~/al/install/i386/framework/libopenal.framework ] ln -s "Versions/Current/$lib"
[ ceylo ~/al/install/i386/framework/libopenal.framework ] popd
~/al/install/i386/framework
[ ceylo ~/al/install/i386/framework ] f=$(echo *.framework)
[ ceylo ~/al/install/i386/framework ] echo $f
libopenal.framework
[ ceylo ~/al/install/i386/framework ] lib=$(echo $f | sed -e 's#\(.*\)\.framework#\1#')
[ ceylo ~/al/install/i386/framework ] echo $lib
libopenal
[ ceylo ~/al/install/i386/framework ] install_name_tool -id "@rpath/../Frameworks/$lib.framework/Versions/A/$lib" "$lib.framework/Versions/A/$lib"
[ ceylo ~/al/install/i386/framework ] echo $f
libopenal.framework
[ ceylo ~/al/install/i386/framework ] otool -L "$f/$lib"
libopenal.framework/libopenal:
    @rpath/../Frameworks/libopenal.framework/Versions/A/libopenal (compatibility version 1.0.0, current version 1.16.0)
    /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 41.0.0)
    /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 53.0.0)

Basically it's just what you used in the gist after the binaries are created, without the stuff for the dependencies on ogg, vorbis, etc.

@mantognini

This comment has been minimized.

Show comment
Hide comment
@mantognini

mantognini Mar 14, 2015

Member

Nice!

Now what I'm wondering… should the framework be named openal, openal-soft or left as is (libopenal) ?

I think it should be openal and @rpath/../Frameworks/openal.framework/Versions/A/openal (no prefix lib).

Member

mantognini commented Mar 14, 2015

Nice!

Now what I'm wondering… should the framework be named openal, openal-soft or left as is (libopenal) ?

I think it should be openal and @rpath/../Frameworks/openal.framework/Versions/A/openal (no prefix lib).

@Ceylo

This comment has been minimized.

Show comment
Hide comment
@Ceylo

Ceylo Mar 14, 2015

Contributor

Ok going to fix that

Contributor

Ceylo commented Mar 14, 2015

Ok going to fix that

@Ceylo

This comment has been minimized.

Show comment
Hide comment
@Ceylo

Ceylo Mar 14, 2015

Contributor

Now the question is how to let SFML on OS X link against the custom openal and install it too. I guess that's what we want?

For now I saw it's referenced in src/SFML/Audio/CMakeLists.txt
And it looks like it's the FindOpenAL.cmake provided by CMake that is being used. So I guess the extlib path should come first in the search paths?

Contributor

Ceylo commented Mar 14, 2015

Now the question is how to let SFML on OS X link against the custom openal and install it too. I guess that's what we want?

For now I saw it's referenced in src/SFML/Audio/CMakeLists.txt
And it looks like it's the FindOpenAL.cmake provided by CMake that is being used. So I guess the extlib path should come first in the search paths?

@mantognini

This comment has been minimized.

Show comment
Hide comment
@mantognini

mantognini Mar 14, 2015

Member

Yes, that's what we want indeed. I think if the lib is in extlib it will take precedence on the system ones. But that should be checked...

Member

mantognini commented Mar 14, 2015

Yes, that's what we want indeed. I think if the lib is in extlib it will take precedence on the system ones. But that should be checked...

@Ceylo

This comment has been minimized.

Show comment
Hide comment
@Ceylo

Ceylo Mar 14, 2015

Contributor

Ok checking, I don't know if the name "openal" instead of the system's "OpenAL" will make a difference for the FindOpenAL.cmake script

Contributor

Ceylo commented Mar 14, 2015

Ok checking, I don't know if the name "openal" instead of the system's "OpenAL" will make a difference for the FindOpenAL.cmake script

@Ceylo

This comment has been minimized.

Show comment
Hide comment
@Ceylo

Ceylo Mar 14, 2015

Contributor

During CMake config step if chooses "OpenAL.framework" from extlibs (although it's named "openal.framework there…). However when linking sfml-audio I see "-framework OpenAL" and during the test program run, in the open files in Activity Monitor for the test process I can see /Library/Frameworks/OpenAL.framework/Versions/A/openal

So I guess there is some mess with lower/uppercase :D Maybe it'd be better to just use the standard OpenAL case here.

Apart from this weirdness can you check that my changes at https://github.com/Ceylo/SFML/tree/bugfix/541_osx_openal_threadsafety do work not only for me? :-°

Contributor

Ceylo commented Mar 14, 2015

During CMake config step if chooses "OpenAL.framework" from extlibs (although it's named "openal.framework there…). However when linking sfml-audio I see "-framework OpenAL" and during the test program run, in the open files in Activity Monitor for the test process I can see /Library/Frameworks/OpenAL.framework/Versions/A/openal

So I guess there is some mess with lower/uppercase :D Maybe it'd be better to just use the standard OpenAL case here.

Apart from this weirdness can you check that my changes at https://github.com/Ceylo/SFML/tree/bugfix/541_osx_openal_threadsafety do work not only for me? :-°

@mantognini

This comment has been minimized.

Show comment
Hide comment
@mantognini

mantognini Mar 15, 2015

Member

Maybe it'd be better to just use the standard OpenAL case here.

Yes, you're probably right.

I'll test it probably tomorrow. But could you create the PR so that it's easier for me to test? Much appreciated. :-)

Member

mantognini commented Mar 15, 2015

Maybe it'd be better to just use the standard OpenAL case here.

Yes, you're probably right.

I'll test it probably tomorrow. But could you create the PR so that it's easier for me to test? Much appreciated. :-)

@mantognini

This comment has been minimized.

Show comment
Hide comment
@mantognini

mantognini Mar 16, 2015

Member

Maybe it's only due to my case sensitive file system but cmake find OpenAL in the OS X SDK. So I guess it's indeed safer to follow the classical name convention and rename it OpenAL.framework/OpenAL.

Member

mantognini commented Mar 16, 2015

Maybe it's only due to my case sensitive file system but cmake find OpenAL in the OS X SDK. So I guess it's indeed safer to follow the classical name convention and rename it OpenAL.framework/OpenAL.

@Ceylo

This comment has been minimized.

Show comment
Hide comment
@Ceylo

Ceylo Mar 16, 2015

Contributor
Contributor

Ceylo commented Mar 16, 2015

@Ceylo

This comment has been minimized.

Show comment
Hide comment
@Ceylo

Ceylo Mar 16, 2015

Contributor

I have opened #831
I'm not sure if I forgot any point. Locally it's working nicely and allows me to have the OpenAL crashes fixed when seeking with sfeMovie :D

About what was done:

  • added universal binary of OpenAL-soft 1.16 built against SDK 10.7 with 10.7 as min OS X version
  • added install rule for this framework
  • nothing changed about the CMake "find" stuff because it looks in SFML's extlibs first, which is where OpenAL.framework has been added

Is there anything missing?
@mantognini can you do a small check before merging as I have a case insensitive filesystem?

Contributor

Ceylo commented Mar 16, 2015

I have opened #831
I'm not sure if I forgot any point. Locally it's working nicely and allows me to have the OpenAL crashes fixed when seeking with sfeMovie :D

About what was done:

  • added universal binary of OpenAL-soft 1.16 built against SDK 10.7 with 10.7 as min OS X version
  • added install rule for this framework
  • nothing changed about the CMake "find" stuff because it looks in SFML's extlibs first, which is where OpenAL.framework has been added

Is there anything missing?
@mantognini can you do a small check before merging as I have a case insensitive filesystem?

@mantognini

This comment has been minimized.

Show comment
Hide comment
@mantognini

mantognini Mar 17, 2015

Member

Is there anything missing?

No, I don't believe so.

@mantognini can you do a small check before merging as I have a case insensitive filesystem?

Of course, yes.

Member

mantognini commented Mar 17, 2015

Is there anything missing?

No, I don't believe so.

@mantognini can you do a small check before merging as I have a case insensitive filesystem?

Of course, yes.

@mantognini mantognini added this to the 2.3 milestone Mar 17, 2015

@mantognini

This comment has been minimized.

Show comment
Hide comment
@mantognini

mantognini Mar 17, 2015

Member

Superseded by #831.

Member

mantognini commented Mar 17, 2015

Superseded by #831.

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