Get Kodi running on Apple M1 Silicon with Windows for ARM
#1
Star 
There's no Kodi build for Apple Silicon however I have managed to get Kodi running via Windows for ARM on Parallels.

There's guides online how to setup Parallels and Windows for ARM online so I wont go into detail however the overview is:

1.) Install Parallels Technical Preview (Signup here to download: https://b2b.parallels.com/apple-silicon)
2.) Install Windows for ARM within Parallels (Obtain VHDX file by signing up at: from https://insider.windows.com/en-us/)
3.) Update Windows to latest beta test release from Insiders Program within Windows (Maybe not needed but it's what I have done)
4.) Download and install Kodii for x86 (32-Bit)...  64-Bit does not work at time of writing for me)
5.) I had mouse tracking issues (lag) which was improved (but not perfect) by turning off the Kodi system option "Use fullscreen window"

This setup is working fine for me and the speed is very impressive. Video is buttery smooth with the streams I have tried with it so far but admittedly Ii have done little testing so far. 

Full screen and windowed mode is supported and coherence mode within Parallels is also working so can have Kodi running as a window on my Mac desktop.

Just wanted to share this with you guys and hope that it helps some of you that want to run Kodi on Apple M1.
Reply
#2
does it not work via Rosetta 2?
Reply
#3
(2021-01-15, 13:26)kambala Wrote: does it not work via Rosetta 2?

Doh.. I read elsewhere that it didn't so just jumped in and tried on Windows...  Just tried using Rosetta 2 and it's working as well.

Oh well..  Windows is at least another way I guess to run Kodi on M1 (Not sure why you would want to if Mac version is working) but it was still a worthwhile exercise to see if and how well it ran using x86 emulation within a VM running on M1... Performance was very good which is pretty impressive really. Smile
Reply
#4
(2021-01-15, 13:26)kambala Wrote: does it not work via Rosetta 2?
 
It would still be preferable to build a native arm64 application. As soon as the devs release build instructions for Apple Silicon, I will be building Kodi for M1
Reply
#5
Definitely I would love to have a native build - Kodi is one of the few applications I am still waiting for with Apple Silicon.
Reply
#6
Ill be honest, dont hold your breath.

All dependencies except libSDL were ready months ago. I made the decision to not deal with libSDL, and to look to migrate to native windowing/input handling. OSX is the only kodi platform still using libSDL, and i believe it was an intention many years ago to drop it, with memphiz (and others) having done a lot of the work for v17, but never got merged.
Ive rebased that work (with changes as required) onto 19, ive added mouse and gamecontroller support for OSX, but havent completed keyboard.
Essentially i had kodi running in a very early wip state with the above, but have not done any testing further than proof of concept of working windowing. There will be many corner cases that most definitely wont be covered, and a great deal of cleanup of the code changes.

POC image: https://imgur.com/pEHoMLW


tldr theres lots to still complete as a major overhaul of the osx platform in kodi. apple silicon gave us the opportunity to commit to the decisions that need to be done for the betterment of the project.
Reply
#7
Well, the day has come. One can build and run kodi native on Apple Silicon

Image

If anyone wants to play with building for themselves, the following branch has all the outstanding PRs that make this possible. https://github.com/fuzzard/xbmc/tree/macosarm_actual

Im hoping to get everything merged into master over the next month or two

I will add, theres plenty of quirks/corner cases due to the windowing implementation. so dont expect perfection. My hope is at this point maybe some other members of the community with interest in the mac platform may want to help with the dev efforts going forward. Fingers crossed.
Reply
#8
@Fuzzard is there any updated guide on how to build this? I followed it and still having issues compiling it.
Reply
#9
What exactly are you having troubles with?
Reply
#10
Am trying this build for the first time today. It failed during the main app build with:

Code:
 /Users/rachel/src/kodi/xbmc/windowing/osx/WinEventsOSXImpl.mm:148:12: error: use of undeclared identifier 'XBMCK_CTRLF'
case XBMCK_CTRLF: // CMD-CTRL-f to toggle fullscreen
     ^

Sure enough it doesn't seem to be defined in XBMC_keysym.h along with the others.

I was following through the build notes here: https://github.com/fuzzard/xbmc/blob/mac...E.macOS.md but step 6 "Build Kodi" gets a bit tangled (each "alternative" is not self-contained). In my case I have the Xcode command line utilities installed (for Homebrew) but trying to make it work without installing the enormous full Xcode. So far it had been working and the error I hit doesn't seem related.

But this step:

Code:
make -C tools/depends/target/cmakebuildsys BUILD_DIR=$HOME/kodi-build GEN=Xcode APP_WINDOW_SYSTEM=native
fails because of the Xcode bit, so I tried, without, ie:

Code:
make -C tools/depends/target/cmakebuildsys BUILD_DIR=$HOME/kodi-build APP_WINDOW_SYSTEM=native
and proceeding with the "use make" instructions. (Without the APP_WINDOW_SYSTEM=native it fails of course because no SDL)

that is, make -C build

It happily built away for some time until it failed with the error reported at the top. The keyboard combo code just seems to be missing.

I tried just deleting that case XBMCK_CTRLF stanza from that switch statement and Kodi finished building, and it runs! It even plays video, through a Luna Display no less, but I didn't try that out in detail.

I had problems building the binary addons; a visualiser one I wasn't interested in failed, so I tried just building the pvr.hts add-on I actually wanted, but as it turns out the pvr addons seem to be the only ones that are missing, so I need to have another go at that.

(Because tbh I tend to use Kodi on the Mac mostly as an EPG browser and only secondarily to actually play stuff!)
Reply
#11
Should be there

https://github.com/xbmc/xbmc/blob/4a991c...ysym.h#L30

Its in the PR atm, though that PR hasnt been rebased in a while. Maybe if you did a rebase you lost it somewhere along the way.

I'll be honest ive done no testing with a commandline tools only build. In theory it should work, but i find Xcode far easier to debug with, so ive had no intention of doing a makefile build. You're in unchartered territory.

RE addons, again, ive not bothered to look at a full test build of every addon. I wouldnt expect there to be issues with most, but happy to look at any you come across with build issues.
Reply
#12
(2021-12-21, 23:16)Fuzzard Wrote: Should be there

https://github.com/xbmc/xbmc/blob/4a991c...ysym.h#L30

However, is not, in the macosarm_actual branch of your fork: https://github.com/fuzzard/xbmc/blob/mac...C_keysym.h 😀
Quote:Its in the PR atm, though that PR hasnt been rebased in a while. Maybe if you did a rebase you lost it somewhere along the way.

No rebases. I just git cloned your fork, checked out that branch, and started building, all today...
Quote:I'll be honest ive done no testing with a commandline tools only build. In theory it should work, but i find Xcode far easier to debug with, so ive had no intention of doing a makefile build. You're in unchartered territory.

RE addons, again, ive not bothered to look at a full test build of every addon. I wouldnt expect there to be issues with most, but happy to look at any you come across with build issues.

Mostly Xcode was taking an age to download and I got impatient. 😀 I'm letting it finish now, for my try-again in the next day or so.
Reply
#13
Use the PR branch. Anything else isn't up to date
Reply
#14
For those coming to this thread after me, and for those earlier who wanted updated build instructions; as of 22 Dec 2021, the PR in question appears to be #20200, which doesn't come up on a search for M1 or Apple Silicon, which makes some sense as it would be applicable to Intel too; as Fuzzard said earlier, it's M1 that's the motivation to finally get done what's been wanting doing for a while (dropping the SDL1 dependency), but Intel Macs should benefit too. The branch is fuzzard:osx_nativeSDL. At the time of posting this was at commit 4a991c7.

Notes while building... (I did finally get the full Xcode installed - it took a while! - so I'll be attempting to follow the instructions that use that.)

Following instructions here.

Building all the binary add ons fails, in step 5. It starts to go wrong when trying to build openssl, which it's doing apparently as a dependency of vfs.sftp. Many, many errors that look like it's trying to assemble x86-64 code (presumably without an x86-64 assembler). It starts like this:

Code:
[100%] Completed 'vfs.rar'
[100%] Built target vfs.rar
[ 33%] Built target zlib
[ 33%] Performing build step for 'openssl'
[ 12%] Performing build step for 'openssl'
crypto/aes/aesni-mb-x86_64.s:10:7: error: unknown token in expression
 movq %rsp,%rax
      ^
crypto/aes/aesni-mb-x86_64.s:10:7: error: invalid operand
 movq %rsp,%rax
      ^

and goes on in the same vein for a long time, but all essentialy the same errors, apparently with each line in assembler.

After that, the visualisation addons also fail, all in the same way, because glm fails:

Code:
make[9]: *** [crypto/aes/aesni-x86_64.o] Error 1
make[8]: *** [all] Error 2
make[7]: *** [openssl-prefix/src/openssl-stamp/openssl-build] Error 2
make[6]: *** [CMakeFiles/openssl.dir/all] Error 2
make[5]: *** [all] Error 2
make[4]: *** [build/openssl/src/openssl-stamp/openssl-build] Error 2
make[3]: *** [CMakeFiles/openssl.dir/all] Error 2
make[2]: *** [CMakeFiles/vfs.sftp.dir/rule] Error 2
make[1]: *** [vfs.sftp] Error 2
[  0%] Performing build step for 'glm'
[ 50%] Building CXX object glm/CMakeFiles/glm_static.dir/detail/glm.cpp.o
clang: error: argument unused during compilation: '-msse2' [-Werror,-Wunused-command-line-argument]
make[7]: *** [glm/CMakeFiles/glm_static.dir/detail/glm.cpp.o] Error 1
make[6]: *** [glm/CMakeFiles/glm_static.dir/all] Error 2
make[5]: *** [all] Error 2
make[4]: *** [build/glm/src/glm-stamp/glm-build] Error 2
make[3]: *** [CMakeFiles/glm.dir/all] Error 2
make[2]: *** [CMakeFiles/visualization.fishbmc.dir/rule] Error 2
make[1]: *** [visualization.fishbmc] Error 2
[  0%] Performing build step for 'glm'
[ 50%] Building CXX object glm/CMakeFiles/glm_static.dir/detail/glm.cpp.o
clang: error: argument unused during compilation: '-msse2' [-Werror,-Wunused-command-line-argument]

It does this for each of the visualisations, and then gives up.

(sse2 in aarch64? 😀 Something seems to have forgotten what it's compiling for...)

I tried just excluding those addons, using:

Code:
make -j$(getconf _NPROCESSORS_ONLN) -C tools/depends/target/binary-addons distclean
make -j$(getconf _NPROCESSORS_ONLN) -C tools/depends/target/binary-addons ADDONS="-vfs.sftp -visualization.*"

but that didn't work. It seemed to match those addons and then say they didn't exist:

Code:
[100%] Completed 'binary-addons'
[100%] Built target binary-addons
-- Exclusion list: vfs.sftp;visualization.*
-- Exact Match list:
-- Regex list:
-- Addon vfs.sftp matches exclusion rule -vfs.sftp
-- Addon visualization.fishbmc matches exclusion rule -visualization.*
-- Addon visualization.goom matches exclusion rule -visualization.*
-- Addon visualization.matrix matches exclusion rule -visualization.*
-- Addon visualization.milkdrop matches exclusion rule -visualization.*
-- Addon visualization.milkdrop2 matches exclusion rule -visualization.*
-- Addon visualization.pictureit matches exclusion rule -visualization.*
-- Addon visualization.projectm matches exclusion rule -visualization.*
-- Addon visualization.shadertoy matches exclusion rule -visualization.*
-- Addon visualization.spectrum matches exclusion rule -visualization.*
-- Addon visualization.starburst matches exclusion rule -visualization.*
-- Addon visualization.waveform matches exclusion rule -visualization.*
--
CMake Error at CMakeLists.txt:510 (message):
  -vfs.sftp;-visualization.* did not match any of the supported addons.  A
  list of supported addons can be viewed by building the 'supported_addons'
  target.  Addon definitions are loaded from ADDONS_DEFINITION_DIR
  (/Users/rachel/kodi/cmake/addons/addons).

So I tried just making the pvr ones using the example actually given, as it's just pvr.hts I actually want, but only building that yesterday didn't get me much joy:

Code:
make -j$(getconf _NPROCESSORS_ONLN) -C tools/depends/target/binary-addons distclean
make -j$(getconf _NPROCESSORS_ONLN) -C tools/depends/target/binary-addons ADDONS="pvr.*"

That build appeared to complete, so I went on to step 6...

You still need the APP_WINDOW_SYSTEM=native version of the initial command. I mention because the most recent commit to the branch looks like it makes that default, but... apparently not. So...

Code:
make -C tools/depends/target/cmakebuildsys BUILD_DIR=$HOME/kodi-build GEN=Xcode APP_WINDOW_SYSTEM=native

then open the project in Xcode, and wait for it to finish indexing... I'm trying to avoid installing Rosetta on this system, but until and unless I find a way to stop it, Xcode prompts me to do so every time it starts up, so I have to be careful to say "not now". Not sure yet if that's going to be a showstopper for building aarch64 Kodi. 😀 If so, I guess I'm back to the make way...

Xcode build *says* it succeeds, but it does so instantly, showing a couple of warnings. There's nothing to run. Trying xcodebuild... It at least has the decency to look like it's trying, but it fails too.

make, which at least worked yesterday...

Code:
rm -rf $HOME/kodi-build/*
make -j$(getconf _NPROCESSORS_ONLN) -C tools/depends/target/cmakebuildsys BUILD_DIR=$HOME/kodi-build APP_WINDOW_SYSTEM=native
make -j$(getconf _NPROCESSORS_ONLN) -C $HOME/kodi-build

It's building something, which is encouraging at least...


It builds... It runs, neatly in its own space (that always bugged me before). Videos play. Minor bugs: I managed to get it confused about what it thought its window was by hitting a couple of keys - accidentally, I just want it to sit in its fullscreen space. Page up/down don't seem to be working. (I have full-size keyboard). Haven't tried on a notched screen yet. (Still using an external one, albeit a real one right now, not luna.)

The PVR addons are still missing. All of them, the whole PVR clients section is just missing. Other addons like skins I appear to be able to download and run, but it looks like the binary addons - those I selected anyway - just didn't make their way into the build. for the most part everything else is working. Some minor bugs but I think I'd want to get those pvr addons showing up first before worrying about the rest.
Reply
#15
Happy New Year! Any new development updates? Do you think we will see a standalone Silicon app distribution?
Reply

Logout Mark Read Team Forum Stats Members Help
Get Kodi running on Apple M1 Silicon with Windows for ARM0