2014-02-12, 14:56
(2014-02-12, 12:29)Memphiz Wrote: @linusyang - nice work ... we will discuss how to make use of your work after gotham release.
Thanks. However, there are many workarounds in my current forked version, which should be replaced with real solutions.
All changes can be found at my forked version. (https://github.com/linusyang/xbmc/tree/darwin-arm64)
But I thinks I should show the changes briefly to devs.
Here is the summary of them:
3rd-party libs (tools/depend)
- configure.in: allow use_cpu to accept arm64 (since I use --with-cpu to specify arm64); remove several unused cflags (e.g. mcpu, mfpu) (new clang just ignores them); add cflag "-Wno-error=implicit-function-declaration" (important, else clang will show bunch of errors when building)
- pcre: disable jit support (sadly current pcre doesn't support jit on arm64)
- openssl: change Makefile "-arch armv7" to "-arch $(CPU)"
- libmad: add "--disable-aso" when running configure
- libmpeg2: patch to fallback to c code instead of neon asm (neon asm on aarch64 is changed a bit, all 32-bit neon cannot directly run on arm64)
- mysql: add macro to detect arm64
- libffi: move to an experimental version for aarch64 support: https://github.com/zwaldowski/libffi-iOS...-ios-fixes
ffmpeg
- lib/ffmpeg: completely move to latest git version of ffmpeg with aarch64 support (of course patched with all xbmc customized patches)
(Yeah, I know I am a bit lazy. We can just backport the aarch64 part )
- gas-preprocessor.pl: move to working aarch64 compatible version: https://github.com/libav/gas-preprocessor
- configure.in (at XBMC root dir): do not hardcode use_cpu. set FFMPEG_EXTRACFLAGS to empty for arm64. (else gas-pp.pl will fail with wrong parsing of arguments. Maybe we can improve the argument detection of gas-pp.pl)
- lib/DllAvUtil.h: include "libavutil/frame.h". redefine AVCODEC_MAX_AUDIO_FRAME_SIZE since the macro is deprecated in new ffmpeg.
other changes
- disable all neon optimization code (all 32-bit neon cannot directly run on arm64, so we may need to rewrite this part.)
(some references: http://chromasoft.blogspot.com/2013/12/i...-code.html and http://www.linaro.org/documents/download...e729c0425d)
- add check routines of __arm64__ beside __arm__ macro for detecting arm64 build correctly.
- CoreAudioAEHALIOS.cpp: CRITICAL BUG HERE we need to check result of AudioUnitGetProperty to decide whether it is necessary to run AudioUnitSetProperty. Otherwise, CAUOutputDevice::EnableInputOuput() will always fail! (quick fix: change "if (hasio)" to "if (!ret && hasio)" and initialize "hasio = 0")
(I nearly gave up the arm64 port because of this bug before I could figure it out )
- XMemUtils.cpp: hardcode page size to 4096: http://stackoverflow.com/questions/21552...statistics
- DVDVideoCodecVideoToolBox.cpp: I removed the video clamp for arm64 devices and confirmed to be able to play 1080p videos smoothly. Maybe A7 chip is powerful enough
Hope this will be helpful to our devs.