1

I integrated the AVAnimator in my project to display video with transparent background. On the simulator everything works perfectly fine. I can see the video, the background really is transparent and I can hear the audio.

But when I try to build and run on the device I get following error:

Assertion failure in -[SegmentedMappedData mapSegment], /transparentVideoTest/AVAnimator/SegmentedMappedData.m:300
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'mmap result EINVAL'

I'm not so familiar with mmap.

Can anyone tell me what the reason could be, when the mapping works on simulator but not on device?

Amar
  • 13,202
  • 7
  • 53
  • 71
appsperimental
  • 297
  • 2
  • 8

1 Answers1

2

I had the same problem. I solved it by going into Build Settings and changing the allowed architecture to be $(ARCHS_STANDARD_32_BIT) (Try to match your project settings to those of an AVAnimator example project )

Benjamin Trent
  • 7,378
  • 3
  • 31
  • 41
javierx
  • 36
  • 3
  • javierx, nice find. Was the problem with 64 vs 32 ABI? I have not seen this issue myself and it might only show up with specific versions of xcode, but I am not positive about that. – MoDJ Aug 25 '14 at 04:02
  • I'm having the same issue even on the examples. Changing the allowed architecture as recommended here didn't help. It just spit out a bunch of link errors. @MoDJ: have you an example that runs on a device in iOS7 and built from Xcode 5.1.1? – Robert Nall Aug 29 '14 at 00:52
  • Okay, I did get this working. I had to change the architecture as javierx suggested and I _also_ found that I needed to add the following compiler flag to maxvid_decode_arm.s: `-no-integrated-as` (in Targets->Build Phases->Compile Sources). – Robert Nall Aug 29 '14 at 01:18
  • Yes, those flags are set in the examples. Also described here http://stackoverflow.com/questions/12779502/xcode4-5-assembler-fails-to-compile-files-that-xcode4-4-handled-perfectly/13025159#comment18493082_13025159 – MoDJ Aug 29 '14 at 06:19
  • Just an FYI, but this issue was recently addressed in the github source code so that one can build a fat binary that contains both 32 bit and 64 bit code and both will work properly. Note also that the -no-integrated-as flags and pre-ARC flags are no longer needed in the github version. – MoDJ Nov 11 '14 at 05:20