jellyfin / jellyfin-server-macos

The menu bar app and package for Jellyfin Server on macOS.
https://jellyfin.org
Mozilla Public License 2.0
58 stars 15 forks source link

arm64 support #48

Closed iMonZ closed 1 month ago

iMonZ commented 2 years ago

Could you please add arm64 support for the server?

anthonylavado commented 2 years ago

I answered this question on Reddit in November 2021, but I'll post my response here:

So there’s three parts:

  1. The server, written in C# and built with .NET
  2. FFmpeg and FFprobe
  3. The macOS wrapper app

The server is usually built with the latest versions of .NET, and indeed this is .NET 6 as of 10.8. .NET 6 is the first version to offer Apple Silicon as an architecture option. While this isn’t in the build scripts yet, it can be added.

For FFmpeg and FFprobe, I’ll need to find a version of at least 4.3.2 or newer, with Apple Silicon support. While we do ship a custom version for Windows and Linux, we’ve been using “off the shelf” versions for macOS. Most of the fixes in the custom versions haven’t had an impact on the macOS server (typically Windows fixes, and a couple filter options on Linux). That said, when possible, we’ll automate that to have Intel and Apple Silicon builds, just to keep everything consistent. Right now, I still need to find Apple Silicon versions of these tools to begin with.

Third, the wrapper app. This is less than 100 lines of code in Swift 5 with a tiny bit of Obj-C sprinkled in. I’d just have to make sure it’s all compatible and enable universal builds in Xcode.

That said, there’s two more parts now that all the architecture is out of the way:

How do I package it all? This depends on how the builds differ with .NET. Then comes testing, as I only have Intel Macs at home.

To add on this with more updated context, we now use FFmpeg 4.4, and I have located an Apple Silicon version of it. I have not tinkered with a multi-build of the server, but it is possible to specify an arm64 build see here.

I have to tinker with that a bit and see if it is feasible to ship a universal binary, or if I will have to have two separate downloads. Thanks to Rosetta 2 at the moment, it may not be there for the first 10.8 release, but I'll have a closer look as we approach it.

iMonZ commented 2 years ago

I answered this question on Reddit in November 2021, but I'll post my response here:

So there’s three parts:

  1. The server, written in C# and built with .NET
  2. FFmpeg and FFprobe
  3. The macOS wrapper app

The server is usually built with the latest versions of .NET, and indeed this is .NET 6 as of 10.8. .NET 6 is the first version to offer Apple Silicon as an architecture option. While this isn’t in the build scripts yet, it can be added. For FFmpeg and FFprobe, I’ll need to find a version of at least 4.3.2 or newer, with Apple Silicon support. While we do ship a custom version for Windows and Linux, we’ve been using “off the shelf” versions for macOS. Most of the fixes in the custom versions haven’t had an impact on the macOS server (typically Windows fixes, and a couple filter options on Linux). That said, when possible, we’ll automate that to have Intel and Apple Silicon builds, just to keep everything consistent. Right now, I still need to find Apple Silicon versions of these tools to begin with. Third, the wrapper app. This is less than 100 lines of code in Swift 5 with a tiny bit of Obj-C sprinkled in. I’d just have to make sure it’s all compatible and enable universal builds in Xcode. That said, there’s two more parts now that all the architecture is out of the way: How do I package it all? This depends on how the builds differ with .NET. Then comes testing, as I only have Intel Macs at home.

To add on this with more updated context, we now use FFmpeg 4.4, and I have located an Apple Silicon version of it. I have not tinkered with a multi-build of the server, but it is possible to specify an arm64 build see here.

I have to tinker with that a bit and see if it is feasible to ship a universal binary, or if I will have to have two separate downloads. Thanks to Rosetta 2 at the moment, it may not be there for the first 10.8 release, but I'll have a closer look as we approach it.

Thanks you so much for your quick response. It would be great to add two separate versions at first. My problem is that I use this tool on my company MacBook and they have disabled Rosetta 2 for everyone :(

But I‘m exited to hear for updates

anthonylavado commented 2 years ago

Commenting just to save some links for myself:

http://www.osxexperts.net

https://github.com/ssut/ffmpeg-on-apple-silicon

https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/ffmpeg.rb

kalafalas commented 1 year ago

Is there a working version of Jellyfin server running without rosetta 2 in the wild yet? I would be using videotoolbox for my transcodes anyway so I'm not sure if ffmpeg is even needed (although I know very little about these things). Let me know if I can help in anyway!

anthonylavado commented 1 year ago

FFmpeg would be needed as we know how to invoke it, and it can call on VideoToolbox. Otherwise we'd be maintaining more code for no benefit.

There is an unstable version with the arm64 Apple target, but I do not recommend using unstable unless it's a test environment. It's generally for actively working on Jellyfin development and lots of things won't work correctly.

kalafalas commented 1 year ago

Thank you so much for the comment! I'm starting to understand more now, and what role ffmpeg is playing. Glad to hear it's being worked on!

amddeus commented 8 months ago

Is native apple silicon support planned for 10.9?🙏

anthonylavado commented 8 months ago

Is native apple silicon support planned for 10.9?🙏

Yes, we've had other structural issues that prevented it from being in 10.8, but 10.9 has it planned.

fabwa commented 6 months ago

+1 bump

vardecab commented 4 months ago

Hey guys :)

Is it known when the 10.9 release would be going live?

Getting some nasty CPU usage on M3 when Jellyfin is playing a movie. I tried to re-install ffmpeg so it's running natively but Jellyfin seems to be using its own version and that one is running via Rosetta.

image

Edit: Ok, a little bit of digging and I found this: https://github.com/jellyfin/jellyfin-ffmpeg/issues/339 + https://github.com/jellyfin/jellyfin/discussions/11051#discussioncomment-8562171

Mid-April: 10.9.0 stable release

Beta versions will be available sooner. Exciting!

anthonylavado commented 1 month ago

As we now provide an Apple Silicon/ARM64 build, I'll be closing this as complete.