Dolphin, the GameCube and Wii emulator - Forums

Full Version: _OSAtomicIncrement32Barrier missing on OSX 10.9.5
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
(08-31-2016, 03:22 AM)Mike4Real Wrote: [ -> ]Mimimi, I don't understand how to download a certain pull request from GitHub. There doesn't seem to be any way to do it from the page for the request. I think I have to go to the account that made the request and download from their page the one that is titled Dolphin? If I can figure out how to test it I will make an account and comment there if it worked.

If you want to download the source code, then yes, that's essentially how it works. But there are also compiled builds for Windows and OS X available for download. If you want the latest OS X build for PR 4150, it's http://dl.dolphin-emu.org/prs/pr-4150-dolphin-latest.dmg
(08-31-2016, 03:28 AM)JosJuice Wrote: [ -> ]If you want to download the source code, then yes, that's essentially how it works. But there are also compiled builds for Windows and OS X available for download. If you want the latest OS X build for PR 4150, it's http://dl.dolphin-emu.org/prs/pr-4150-dolphin-latest.dmg

Thanks, that helped me test that pull request, and it does not work on my computer for the record. It gives me the same error.

Doing this fixed the problem though:
(08-28-2016, 07:48 PM)randomaccount6723 Wrote: [ -> ]I found a way to make Dolphin 5.0 work on OS X 10.9.5. You just need to use a newer version of libusb (in Dolphin.app/Contents/Frameworks). I downloaded the source code for libusb (version 1.0.20) from their website and compiled it according to their instructions (in the INSTALL file). Note that you might have to use 'sudo make install' rather than just 'make install.'
Also, the final compiled library is found at usr/local/lib/libusb-1.0.0.dylib (even though it's actually version 1.0.20). I used the new dylib file to replace the one that came with Dolphin and it worked!

By doing this, I was able to get Dolphin 5.0-321 running on my computer. The file wound up in a slightly different location on my computer. If other people in this situation want a step by step tutorial to be able to use Dolphin 5 on OS X 10.9 Mavericks I will try to give you a small guide.

I went to https://sourceforge.net/projects/libusb/files/
Downloaded libusb-1.0.20.tar.bz2 (795.2 kB)
Unzipped it because its a compressed file, doing this gives you a folder
In that folder there are instructions how to install it on a text file called INSTALL
Opened Terminal and changed directory to this new libusb-1.0.20 I did this by dragging the folder over the terminal window
Typed ./configure into Terminal and waited for a bit
When it was finished I did make as the next terminal command
Lastly I did sudo make install and typed my computer's password
Next I had to go to /usr/local/usb on my computer to find the file it made, /usr is a hidden folder on OS X by default you can get there by opening a new Finder window and choosing "Go" from the top menubar, and then picking "Go to Folder" near the bottom of the drop down menu (you can also do this with the keyboard shortcut command+shift+G), a box will pop up, in there type /usr/local/lib
Inside of that folder there will be a file called libusb-1.0.0.dylib, copy it
Go to your Dolphin 5 application and right click on it, choose show package contents from the menu
Open the Contents folder and then the Frameworks folder
Paste the file into here, it will ask you if you want to replace the old one, choose yes since you want to replace the broken one
I can now use Dolphin 5

randomaccount6723 Wrote:If you're a dev and you're reading this, please fix the Dolphin 5.0 download to work on Mavericks. Some of have reasons to not want to upgrade.
I definitely agree with this. If it is a simple fix like just including the right libusb.dylib then it should be done instead of locking out an operating system because of this. I don't understand it fully but if it is just a simple file change, and doing that doesn't break anything else then it should be done.
The only reference to libusb-1.0.0.dylib that I can see in the source are a couple of files in the Xcode folder which were removed in 4.0-5480. Would re-adding the Xcode folder to the project make any difference?
(08-31-2016, 09:38 AM)Pringo Wrote: [ -> ]The only reference to libusb-1.0.0.dylib that I can see in the source are a couple of files in the Xcode folder which were removed in 4.0-5480. Would re-adding the Xcode folder to the project make any difference?

I am not sure, all I know is that when I downloaded libusb-1.0.20.tar.bz2 from their website, and used that file to replace the one that comes with Dolphin 5, it started to work. If I don't do that it crashes on startup saying this:

dyld: Symbol not found: _OSAtomicIncrement32Barrier
Referenced from: /Applications/Games/Dolphin.app/Contents/MacOS/./../Frameworks/libusb-1.0.0.dylib
Expected in: /usr/lib/libSystem.B.dylib

I'm not an expert on what the error means or what is really going on but I can help out by testing. Pringo, I saw your comment here: https://bugs.dolphin-emu.org/issues/9631
where you asked about what version this broke in. I am going to try to find out for you now.

As of right now I can tell you this, and I will update it as I test more versions:
4.0-7840 works
4.0-8674 works
4.0-9100 works
4.0-9154 works
4.0-9181 works
4.0-9187 works
4.0-9194 does not work
4.0-9207 does not work
4.0-9308 does not work
4.0-9508 does not work
5.0-321 does not work
5.0-424 does not work

I narrowed it down as best as I could using the list here: https://dolphin-emu.org/download/list/master/ This list goes from 4.0-9187 to 4.0-9189 (this version does not have an OS X download button so I couldn't test it. Then it goes from 4.0-9189 to 4.0-9194. The problem happens somewhere in here.

The description for these versions don't seem to be related to the problem but someone else who knows more should also check the details:
4.0-9187 mandir added (PR #3766 from orbea) [working]
4.0-9189 WXGUI: Fix disabled play button not fading (PR #3733 from EmptyChaos) [no OS X download button, didn't test]
4.0-9194 pch: Update Visual Studio version check (PR #3760 from lion cash) [does not work]
Okay so 4.0-9187 or 4.0-9189 was the last working version on 10.9? I am not sure what the issue is there but I will try to look into it.

Edit: Neither of those PRs seem to be the culprit as they don't touch OS X code. This might be due to some issue with the buildbot.
So is the buildbot also on GitHub then? Can it be fixed so it stops using the wrong file? I can test anything if needed.
Can any of you do their own builds of Dolphin? If so, please check out the given commit as shown on the download page (such as: "git checkout 12c393ed60a36f2e8fea34e9bf08a478c3534279" for 4.0-9187) and then run a build as described in the Readme.md file.
My most likely candiate would be 4.0-9194, but then again it doesn't really do anything to libusb. In case we did indeed upgrade the buildbot around that time, it might be an actual issue with compiling the build, not necessarily the source (as in: the included libusb might be the problem, not the Dolphin build itself).
(09-05-2016, 02:53 AM)Jack Frost Wrote: [ -> ]Can any of you do their own builds of Dolphin? If so, please check out the given commit as shown on the download page (such as: "git checkout 12c393ed60a36f2e8fea34e9bf08a478c3534279" for 4.0-9187) and then run a build as described in the Readme.md file.
My most likely candiate would be 4.0-9194, but then again it doesn't really do anything to libusb. In case we did indeed upgrade the buildbot around that time, it might be an actual issue with compiling the build, not necessarily the source (as in: the included libusb might be the problem, not the Dolphin build itself).

So, I think I could try to make a build of 4.0-9194 (the first one that doesn't work), but I'm not sure if that would be helpful. From my limited understanding of what is going on here, I think that if I built any of those versions that were not working previously on my own computer, I think they would just work if I made them. Since I updated the libusb library on my computer to libusb-1.0.20, I speculate that if I build a not working version, it would just use this libusb-1.0.20 working file and it would run properly. I do think that the issue is that the Dolphin application contains libusb-1.0 and not libusb-1.0.20.

Let me know if that makes sense or am I way off on this?
I was able to reproduce this problem using both libusb-1.0.20 and libusb-1.0. The libusb the macOS build pulls in from somewhere else on the system (which it has to, since CMake ignores the bundled version) is built without  -mmacosx-version-min=10.9 or lower, which means it doesn't have to be compatible with 10.9. This could happen because, e.g., Homebrew bottles libraries for each specific macOS version.

Technical context: Libusb uses the function OSAtomicIncrement32Barrier. In the OSAtomic.h header (well, on my system it's OSAtomicDeprecated.h, but same thing), OSAtomicIncrement32Barrier is defined as a normal function starting in macOS 10.10. However, in all versions before that, it's a static inline function proxying to OSAtomicAdd32Barrier. So when libusb is compiled for 10.10 or higher, it ends up with a reference to OSAtomicIncrement32Barrier, which doesn't exist on 10.9, but when it's compiled for 10.9 or lower, it ends up with a reference to OSAtomicAdd32Barrier, which is still supported on newer versions.

EDIT: Made a pull request to build libusb specifically for Dolphin instead of copying it in from the system, which should fix issues like this on macOS: https://github.com/dolphin-emu/dolphin/pull/4230
(09-20-2016, 11:44 AM)mchtly@gmail.com Wrote: [ -> ]I was able to reproduce this problem using both libusb-1.0.20 and libusb-1.0. The libusb the macOS build pulls in from somewhere else on the system (which it has to, since CMake ignores the bundled version) is built without  -mmacosx-version-min=10.9 or lower, which means it doesn't have to be compatible with 10.9. This could happen because, e.g., Homebrew bottles libraries for each specific macOS version.

Technical context: Libusb uses the function OSAtomicIncrement32Barrier. In the OSAtomic.h header (well, on my system it's OSAtomicDeprecated.h, but same thing), OSAtomicIncrement32Barrier is defined as a normal function starting in macOS 10.10. However, in all versions before that, it's a static inline function proxying to OSAtomicAdd32Barrier. So when libusb is compiled for 10.10 or higher, it ends up with a reference to OSAtomicIncrement32Barrier, which doesn't exist on 10.9, but when it's compiled for 10.9 or lower, it ends up with a reference to OSAtomicAdd32Barrier, which is still supported on newer versions.

EDIT: Made a pull request to build libusb specifically for Dolphin instead of copying it in from the system, which should fix issues like this on macOS: https://github.com/dolphin-emu/dolphin/pull/4230

Excellent job dude! You clearly understood everything that was going on here. I don't understand it all, but from what I gather some of the assumptions I was making were correct. Nicely done fixing it, I wouldn't have been able to do that. I wonder if your fix by building the library specifically for Dolphin will also help prevent future issues that could come up.
Pages: 1 2 3