Problem when archiving TVOS application

iOS, iPad, iPhone, tvOS specific usage questions
aauer
New Cone
New Cone
Posts: 4
Joined: 21 Sep 2016 10:28

Problem when archiving TVOS application

Postby aauer » 21 Sep 2016 11:09

Hello,

I have problems, when I try to archive an TVOS application. I downloaded the nightly build and added it into the project. Simulator and Device itself compiles fine, while when trying to archive it, following problem occurs:

Code: Select all

ld: bitcode bundle could not be generated because '/Users/aauer/Developer/test2/TVVLCKit.framework/TVVLCKit(VLCMediaPlayer.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any hint how to solve this issue?

Thanks a lot,
Alexander Auer

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: Problem when archiving TVOS application

Postby ssbmaccom » 03 Oct 2016 15:22

Hi,

same here.
You can potentially only solve the issue with building VLCKit yourself on your local machine. But this takes a while ;-)

@Felix, can you check for this?

MidnightCoder
Blank Cone
Blank Cone
Posts: 82
Joined: 08 Aug 2008 06:04

Re: Problem when archiving TVOS application

Postby MidnightCoder » 03 Oct 2016 21:12

You'll have to build VLCTvKit youself and turn on bitcode. If you have trouble doing this, I can send you the latest compiled but in the long term, knowing how to build on your own machine might be helpful.

aauer
New Cone
New Cone
Posts: 4
Joined: 21 Sep 2016 10:28

Re: Problem when archiving TVOS application

Postby aauer » 04 Oct 2016 15:12

I tried compiling it myself.
I'll lookup the exact error, but it stopped it always popped the error when trying to compile the simulator library.

@tommy382: It would be awesome if you could somehow send me the compiled one.

Thanks a lot

Edit: As said, here is the log:

Code: Select all

autoreconf: running: aclocal -I /Users/aauer/Developer/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/AppleTV-x86_64-apple-darwin11-x86_64/share/aclocal --force -I m4 configure: error: in `/Users/aauer/Developer/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/AppleTVSimulator-x86_64/libdvbpsi': configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details make: *** [.dvbpsi] Error 1 make: *** Waiting for unfinished jobs.... inflate.c:1507:61: warning: shifting a negative signed value is undefined [-Wshift-negative-value] if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16; ~~~ ^ 1 warning generated. autoreconf: configure.ac: tracing autoreconf: running: libtoolize --copy --force autoreconf: running: /Users/aauer/Developer/VLCKit/MobileVLCKit/ImportedSources/vlc/extras/tools/build/bin/autoconf --include=/Users/aauer/Developer/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/AppleTV-x86_64-apple-darwin11-x86_64/share/aclocal --force autoreconf: running: /Users/aauer/Developer/VLCKit/MobileVLCKit/ImportedSources/vlc/extras/tools/build/bin/autoheader --include=/Users/aauer/Developer/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/AppleTV-x86_64-apple-darwin11-x86_64/share/aclocal --force autoreconf: running: automake --add-missing --copy --force-missing lib/Headers.mk:22: warning: shell cat $(top_srcdir: non-POSIX variable name lib/Headers.mk:22: (probably a GNU make extension) doc/Makefile.am:26: 'lib/Headers.mk' included from here lib/Headers.mk:22: warning: shell cat $(top_srcdir: non-POSIX variable name lib/Headers.mk:22: (probably a GNU make extension) lib/Makefile.am:28: 'lib/Headers.mk' included from here test/Makefile.am:30: warning: '%'-style pattern rules are a GNU make extension autoreconf: Leaving directory `.' configure: error: in `/Users/aauer/Developer/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/AppleTVSimulator-x86_64/fribidi': configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details make: *** [.fribidi] Error 1
In addition, as you can see it seems the device library seems to compile, whereas the problems appear at the simulator:

Code: Select all

find . -name config.log ⏎ ./MobileVLCKit/ImportedSources/vlc/build-ios-AppleTVOS/arm64/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/ffmpeg/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/flac/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/freetype/builds/unix/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/fribidi/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/harfbuzz/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/libass/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/libdsm/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/libdvbpsi/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/libebml/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/libgcrypt/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/libgpg-error/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/libmatroska/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/libmodplug/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/libogg/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/libtasn1/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/libtheora/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/libvorbis/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/libvpx/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/libxml2/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/microdns/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/mpg123/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/nfs/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/openjpeg/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/opus/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/png/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/speex/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/speexdsp/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/ssh2/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/zvbi/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVSimulator-x86_64/fribidi/config.log ./MobileVLCKit/ImportedSources/vlc/contrib/AppleTVSimulator-x86_64/libdvbpsi/config.log ./MobileVLCKit/ImportedSources/vlc/extras/tools/autoconf/config.log ./MobileVLCKit/ImportedSources/vlc/extras/tools/automake/config.log ./MobileVLCKit/ImportedSources/vlc/extras/tools/libtool/config.log ./MobileVLCKit/ImportedSources/vlc/extras/tools/m4/config.log ./MobileVLCKit/ImportedSources/vlc/extras/tools/pkgconfig/config.log ./MobileVLCKit/ImportedSources/vlc/extras/tools/protobuf/config.log ./MobileVLCKit/ImportedSources/vlc/extras/tools/protobuf/gtest/config.log ./MobileVLCKit/ImportedSources/vlc/extras/tools/ragel/config.log ./MobileVLCKit/ImportedSources/vlc/extras/tools/yasm/config.log ~/D/VLCKit ❯❯❯

MidnightCoder
Blank Cone
Blank Cone
Posts: 82
Joined: 08 Aug 2008 06:04

Re: Problem when archiving TVOS application

Postby MidnightCoder » 04 Oct 2016 17:14

Are you trying to compile on Windows?

Here is the latest compiled version w/ Bitcode turned on:
https://drive.google.com/file/d/0B4jAjm ... sp=sharing

aauer
New Cone
New Cone
Posts: 4
Joined: 21 Sep 2016 10:28

Re: Problem when archiving TVOS application

Postby aauer » 04 Oct 2016 17:24

Nope, mac os sierra. Thanks a lot
-------
Update:

So I tried to use the the library you uploaded and still get the same error. I am probably linking it in wrong. It still gives me the same output as before.

Steps how I got to the result:
  • Opened complete new TVOS Project (in Swift)
  • Added following libraries to the project: Image
  • Added a Bridging Header:

    Code: Select all

    #import <TVVLCKit/TVVLCKit.h>
  • Added the following line into the ViewController:

    Code: Select all

    var media = VLCMediaPlayer()
    to see if it works with VLC
  • Compiled it for Simulator - worked
  • Swapped the Library for the Device - worked
  • Wanted to export the app -> same error message.
I hope someone could help me. Would be awesome

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: Problem when archiving TVOS application

Postby ssbmaccom » 05 Oct 2016 16:48

Have you used "Project -> Archive" to build libTVVLCKit.a in Xcode?
This has worked for me in the past but I anyway would prefer to use the nightlies in the future - I was about to switch my project towards that.

MidnightCoder
Blank Cone
Blank Cone
Posts: 82
Joined: 08 Aug 2008 06:04

Re: Problem when archiving TVOS application

Postby MidnightCoder » 06 Oct 2016 00:28

Looks like the framework I gave you didn't have bitcode turned on - my mistake. I'll take a look and get back to you.

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: Problem when archiving TVOS application

Postby ssbmaccom » 06 Oct 2016 00:29

OK... I got it.
Assuming you use "./buildMobileVLCKit.sh -tfb" to build the framework locally.

At the end xcodebuild is calling clang with the option "-fembed-bitcode-marker". But as VLCMedia.m gets compiled with a warning (deprecated use of..) maybe the bitcode is not written correctly.
Solution is to make sure xcodebuild passes "-fembed-bitcode" instead.

One "dirty" way to do this is adding one line into the buildMobileVLCKit.sh file.
Search for "xcodebuild" - you should end up at (currently) line 85 with

Code: Select all

xcodebuild -project "$1.xcodeproj" \ -target "$target" \ -sdk $PLATFORM$SDK \ -configuration ${CONFIGURATION} \ ARCHS="${architectures}" \ IPHONEOS_DEPLOYMENT_TARGET=${SDK_MIN} \ GCC_PREPROCESSOR_DEFINITIONS="$defs" \ > ${out}
Just add one line before the last one with "BITCODE_GENERATION_MODE=bitcode" and a backslash for continuation.
So the results should look like:

Code: Select all

xcodebuild -project "$1.xcodeproj" \ -target "$target" \ -sdk $PLATFORM$SDK \ -configuration ${CONFIGURATION} \ ARCHS="${architectures}" \ IPHONEOS_DEPLOYMENT_TARGET=${SDK_MIN} \ GCC_PREPROCESSOR_DEFINITIONS="$defs" \ BITCODE_GENERATION_MODE=bitcode \ > ${out}
Save the script and run it again (add -l option to prevent a rebuild of libVLC - would take too long).

The resulting framework can now also be used to Archive an App.
I may send Felix the patch for this, so hopefully the nightly will inherit this ;-)

MidnightCoder
Blank Cone
Blank Cone
Posts: 82
Joined: 08 Aug 2008 06:04

Re: Problem when archiving TVOS application

Postby MidnightCoder » 06 Oct 2016 03:47

I may send Felix the patch for this, so hopefully the nightly will inherit this ;-)
Please do, that would be helpful as I don't see any advantage of disabling bitcode?

MidnightCoder
Blank Cone
Blank Cone
Posts: 82
Joined: 08 Aug 2008 06:04

Re: Problem when archiving TVOS application

Postby MidnightCoder » 06 Oct 2016 03:48

I have recompiled w/ bitcode turned on and verified it can "archive" sucessfully.

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: Problem when archiving TVOS application

Postby ssbmaccom » 06 Oct 2016 16:08

I have sent the patch via mail directly to Felix, which is indeed not the "official" way to do that. But the official way does not work with my iCloud mail address.
But I am confident - esp. after your positive feedback - that the change will get merged.

At least it is not too much trouble to add it manually.

Anyone else have seen the artefacts with blend deinterlacer? Might be caused by the arm64 neon implementation - I consider to patch it back to use the Generic blender algo.

MidnightCoder
Blank Cone
Blank Cone
Posts: 82
Joined: 08 Aug 2008 06:04

Re: Problem when archiving TVOS application

Postby MidnightCoder » 06 Oct 2016 16:52

Anyone else have seen the artefacts with blend deinterlacer? Might be caused by the arm64 neon implementation - I consider to patch it back to use the Generic blender algo.
Is Blend the default deinterlace mode (after creating a new VLCMediaPlayer object)? Whatever the default mode was has issues (green bar as described in post #1) w/ mpeg2. I tried changing to "linear" and the problem was even worst. Either turning interlace off or set it to "yadif" made the green bar went away.

zabolotiny
New Cone
New Cone
Posts: 4
Joined: 07 Oct 2016 15:44

Re: Problem when archiving TVOS application

Postby zabolotiny » 07 Oct 2016 15:47

Hey Guys,
It is the second day has passed while i am fighting with compiling this lib for tvos with bitcode support. I have read great amount of posts and tried a lot of different approaches. Unfortunately i receive workings as a result of compilation process.
Would you be so kind to give me the link of compiled version for tvos with bitcode support please.

aauer
New Cone
New Cone
Posts: 4
Joined: 21 Sep 2016 10:28

Re: Problem when archiving TVOS application

Postby aauer » 08 Oct 2016 18:22

Hey,

short update from my side:

I can't compile TVVLCKit on my on on Sierra / XCode 8.0. This error always appears (https://code.videolan.org/videolan/VLCKit/issues/56) and it seems consistent with the other ppl posting in that issue.

Starting from that I modified the buildMobileVLCKit.sh to remove every reference to simulator related buildstep. After removing the simulator parts, I can compile through the project and load it into XCode, which makes the project archivable.

I hope that a fix get submitted. In the meantime, I just use two targets to use the nightly framework in development and the project for releases.

Hope that helps a bit,
Greetings, Alex

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: Problem when archiving TVOS application

Postby ssbmaccom » 09 Oct 2016 12:51

Hey Guys,
It is the second day has passed while i am fighting with compiling this lib for tvos with bitcode support. I have read great amount of posts and tried a lot of different approaches. Unfortunately i receive workings as a result of compilation process.
Would you be so kind to give me the link of compiled version for tvos with bitcode support please.
Have you tried the "patch" I shared above with adding BITCODE_GENERATION_MODE=bitcode to buildMobileVLCKit.sh?

It worked for me and it looks like it also worked for others.

Anyway - it is not yet part of the git repository - so you have to add it manually.

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: Problem when archiving TVOS application

Postby ssbmaccom » 09 Oct 2016 14:15

Is Blend the default deinterlace mode (after creating a new VLCMediaPlayer object)? Whatever the default mode was has issues (green bar as described in post #1) w/ mpeg2. I tried changing to "linear" and the problem was even worst. Either turning interlace off or set it to "yadif" made the green bar went away.
Yes, Blend is the default deinterlacer for non-progressive streams.
Due to a bug, progressive TS streams internally have wrong property for frame_rate_num and frame_rate_denom and are not detected as progressive. So Blend is by default also used for progressive streams. I already opened a ticket on trac about this issue - but so far no progress. The issue is reported months ago: https://trac.videolan.org/vlc/ticket/16422

About the deinterlace artefacts. It looks like the arm64_neon implementation of the merge function (in assembler) has an issue. I manually replaced it back with the Generic merge function and the artefacts have disappeared, but the performance is worse. An older ticket about this (for Android) is closed as solved, so I finally opened a new one: https://trac.videolan.org/vlc/ticket/17486
Lets see if there is progress on this one.

zabolotiny
New Cone
New Cone
Posts: 4
Joined: 07 Oct 2016 15:44

Re: Problem when archiving TVOS application

Postby zabolotiny » 13 Oct 2016 08:24

Hey,

short update from my side:

I can't compile TVVLCKit on my on on Sierra / XCode 8.0. This error always appears (https://code.videolan.org/videolan/VLCKit/issues/56) and it seems consistent with the other ppl posting in that issue.

Starting from that I modified the buildMobileVLCKit.sh to remove every reference to simulator related buildstep. After removing the simulator parts, I can compile through the project and load it into XCode, which makes the project archivable.

I hope that a fix get submitted. In the meantime, I just use two targets to use the nightly framework in development and the project for releases.

Hope that helps a bit,
Greetings, Alex
Alex, thanks for your answer.
Actually i had to install xcode 7.3 to compile the library. You are right with xcode it is not working in default.

Now i have the issue with green line in the right part of the screen as was mentioned by ssbmaccom. Any ideas hot to solve it?

Thanks in advance,
Yuriy

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: Problem when archiving TVOS application

Postby ssbmaccom » 13 Oct 2016 08:40

Temporarily you can circumvent the greenline issue by using a deinterlacer, that does not use the Merge Functions. Try several options. When it is a interlaced stream, try Yadif.
Other option is to manually change the deinterlacer functions and replace the call to the optimized assembler code with a call to the GenericMerge functions as descriped in the trac ticket I have created (link above).
You get rid of the green lines, but this comes with performance penalties.
Let's see if someone in the VLC team is able to solve that - my knowledge about ARM assembler and especially NEON code is too limited. Maybe I check, what clang gives as result with best code optimizations (I already compared clang output with the assembler implementation, but well... my neon knowledge is too poor).

BTW: as mentioned somewhere else - I use Xcode 8 on El Capitan and I have no issues to build TVVLCKit and after applying the other patch I can successfully build the static framework with full bitcode locally on my Mac.

zabolotiny
New Cone
New Cone
Posts: 4
Joined: 07 Oct 2016 15:44

Re: Problem when archiving TVOS application

Postby zabolotiny » 13 Oct 2016 08:50

Temporarily you can circumvent the greenline issue by using a deinterlacer, that does not use the Merge Functions. Try several options. When it is a interlaced stream, try Yadif.
Other option is to manually change the deinterlacer functions and replace the call to the optimized assembler code with a call to the GenericMerge functions as descriped in the trac ticket I have created (link above).
You get rid of the green lines, but this comes with performance penalties.
Let's see if someone in the VLC team is able to solve that - my knowledge about ARM assembler and especially NEON code is too limited. Maybe I check, what clang gives as result with best code optimizations (I already compared clang output with the assembler implementation, but well... my neon knowledge is too poor).

BTW: as mentioned somewhere else - I use Xcode 8 on El Capitan and I have no issues to build TVVLCKit and after applying the other patch I can successfully build the static framework with full bitcode locally on my Mac.
Ssbmaccom, Thanks for your answer. Yadif should help in my case.
The issue with xcode costed for me 2 days of continuous attempts. Maybe smth was wrong with my xcode, but after downgrading to xcode 7.3. all compiled successfully. I saw a lot of similar posts on the form and decided to share my experience.

Warmest regards,
Yuriy

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: Problem when archiving TVOS application

Postby ssbmaccom » 14 Oct 2016 09:35

That's fine of course...knowledge and experience sharing is basically a good idea ;-)

Also I saw, that there was a commit in VLC that should fix the greenline issue, but we need to wait, until Felix updated VLCKit to use a more recent commit of VLC.


Return to “VLC for iOS, iPadOS and Apple TV”

Who is online

Users browsing this forum: No registered users and 20 guests