Comments (19)
I've managed to isolate one possible source of the error. We've got multiple libjpeg versions because we're linking a verion of opencv on ios and macos which is a static framework (yes, such a thing exists) and that framework contains the symbols for whatever version of libjpeg is in opencv.
I will work on a build of opencv which doesn't expose the libjpeg symbols.
from artoolkitx.
The last line points to the problem. Somehow an old version of libjpeg is being linked in, possibly even by Unity itself.
Are you able to test against Unity 2018.2?
from artoolkitx.
That's Unity causing the problem then? I would like to avoid upgrading the Unity version as best I can since that may cause other problems to the project.
Do you know if there is any way to manually replace the libjpeg?
from artoolkitx.
I've tried Unity2018.2.2 and Unity2017.4.8 but the same error.
from artoolkitx.
Thanks for testing. I was on it today too but for some reason I can't get arunityX plugin to work :(.
@philip-lamb might it be that our libjpeg inside artoolkitX repo is the wrong version? Don't know how to tell the version number. Unity is just pulling in that lib
from artoolkitx.
Thanks for your effort.
I tried replacing the libjpeg.a with one from old projects: ARTK 5.3, 5.4, 6, they all looked the same and throws the same error.
Maybe that was some thing else gone wrong.
I didn't mention before, I have rebuilt the libARX.a so that it could skip connecting the calibration server and print out the error message. I am not familiar with this compiling thing and simply do that by running the build.sh. Would the rebuild process affect the linked libraries, like some old version on my machine got dragged into the rebuilt libARX.a?
from artoolkitx.
from artoolkitx.
Tried that, but the same :(
I downloaded the arunityx repo this morning and followed the Quick start guide. (Since I don't have GitHub installed I downloaded a zip file. I can see that some folder was updated but that folder in the downloaded zip is empty, not sure if that's normal.)
Run the build.sh for ios and macos, made a new package with Unity2018.2.2f1, imported it to an empty project, in the Editor it threw many EntryPointNotFoundException so I didn't play it, replaced the libARX.a and export an Xcode project for iOS. It crashed again.
I've also removed the libjpeg.a from the "Linked Frameworks and Libraries" section to see if there would be any different. The app can still be built and run and threw the same error.
from artoolkitx.
from artoolkitx.
Hm, after building to Android and macOS I can finally build to iOS. Now lets see if I get your error
from artoolkitx.
I'm at the same stage now. What did you change in the code to get the jpeg error message you are sharing?
from artoolkitx.
Adding a breakpoint in XCode the line in question is here:
artoolkitx/Source/ARX/AR2/imageSet.c
Line 512 in 86693f8
from artoolkitx.
it's getting strange.
I wanted to do the whole rebuild from the start again, so I just re-download the artoolkitx repo.
In ARX/AR2/jpeg.c, uncomment line 147: (*cinfo->err->output_message) (cinfo);
to print out error message (the lib version mismatch error was print from this)
In ARX/ARVideo/cparamSearch.c, line 625, changed http://www.google.com
to https://www.google.com
, for some reason with http:// it hold up the app for several minutes.
Then build for ios and macos.
Then I put ARX.bundle to the Unity project. The Unity editor crashed when open SimepleNFTScence, but it was safe to open other scenes. This didn't happen before. If I switch back to the provided bundle, no crash.
There were errors like this when rebuilding the bundle, but build succeed anyway:
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: no LC_RPATH load command with path: /<path_to>/artoolkitx-master20180809/Source/build-macos/ARX/Release found in: /<path_to>/artoolkitx-master20180809/Source/../SDK/bin/artoolkitx_image_database2d (for architecture x86_64), required for specified option "-delete_rpath /<path_to>/artoolkitx-master20180809/Source/build-macos/ARX/Release"
from artoolkitx.
It ran into the arMalloc line because it failed here
artoolkitx/Source/ARX/AR2/imageSet.c
Line 116 in 86693f8
and fell back to the old v4.x iset format. Since the iset file is in fact a new one, it failed.
The ar2ReadJpegImage2
call lead to jpeg.c and fail here
artoolkitx/Source/ARX/AR2/jpeg.c
Line 180 in 86693f8
which gives
Wrong JPEG library version: library is 62, caller expects 80
from artoolkitx.
yes, figured that.
I've tried with another libjpeg but no success.
from artoolkitx.
After some more googling, I found a temp fix by adding -force_load $(PROJECT_DIR)/Libraries/Plugins/iOS/libjpeg.a
in Other Linker Flags. Forcing the code to use the libjpeg.a from ARToolkitX :)
This might be irrelevant.
I read somewhere that some old version of opencv framework might include old version of libjpeg. However I can't find any document about the libjpeg version to confirm that saying.
Anyway, I decided to try to build a custom opencv2.framework following https://github.com/artoolkitx/artoolkitx/wiki/Building-artoolkitX-prerequisites.
However the resulting framework did not support architecture arm64.
In additional, I also tried OpenCV 3.4.2 (libjpeg v62 again) and 2.4.13.6 (not support arm64) from https://opencv.org/releases.html.
from artoolkitx.
So basically the libjpeg from artoolkitX works but from somewhere it calls a wrong one on iOS
from artoolkitx.
I'm now convinced that it is opencv2.framework that caused the mismatch.
As ARToolkitX download the newest version from opencv.org, that version build with libjpeg-turbo which based on libjpeg 6b (ver. no. 62). I've tried to build from the opencv github repo and disable the use of libjpeg-turbo, the default built was with libjpeg 9 (ver. no. 90) and I got a new mismatch message accordingly.
Unfortunately I can't build one with libjpeg 8 to match
artoolkitx/Source/depends/ios/include/jpeglib.h
Lines 40 to 42 in f8f0666
Would you consider sharing your working opencv2.framework instead of downloading the live version?
========================================================================
Furthermore, now I have another problem.
The Unity Editor crash every time I put in my custom ARX.bundle for macos, only the official bundle is working. The "http://www.google.com" long waiting time is really bugging me, I need to wait for more than 5 minutes every time for the camera to run, even I stop the play it would still be blocking the Editor.
Should I open a new thread for this?
from artoolkitx.
I fear we don't have a working version with iOS and NFT on Unity3D I've run in the same issues. I can see that we have builds for all platforms except iOS. https://github.com/artoolkitx/opencv/releases
So I guess that is one thing we need to fix soonish.
from artoolkitx.
Related Issues (20)
- Help clarify the purpose/history behind ARToolkitX vs ARToolkit5 HOT 1
- How can I do it on mac?
- Automatic build system HOT 5
- Will support Apple chip compilation in the future? HOT 1
- Expose video source input list to ARX interface HOT 1
- 【Android】there is some shifting when i use filament to render model
- Bugged camera in android 12 HOT 1
- Build script fails under Ubuntu 22.04 HOT 7
- How to make artoolkit not use camera, but realize nft detection through external incoming frame data HOT 2
- I tried opening the sample app "2d tracking example" on Android 13, same problem. HOT 2
- Question: what is configuration? HOT 1
- Raspberry Pi install HOT 1
- External camera Android HOT 6
- AR2DTrackingExample Android demo cube render problem
- about Creating a multi-marker set HOT 1
- Different input size,like set Android resolution 480*360, but got cvMat 640*480 HOT 3
- Can't install on fedora 38
- building on fedora 38 fails HOT 5
- how to cancel camera auto-focus
- Whether the SDK supports it and whether the image and feature file are the same
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from artoolkitx.