Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update FFmpeg libraries with LGPL versions and move out macOS dylibs to osx for arm64 support #5043

Merged
merged 8 commits into from
Feb 22, 2022

Conversation

nekodex
Copy link
Contributor

@nekodex nekodex commented Feb 18, 2022

This PR replaces the currently included FFmpeg libraries (of dubious origins) with ones explicitly built without --enable-gpl and --enable-nonfree flags to ensure LGPL compliance.

Build scripts are included for macOS, as building universal (x86_64+arm64) dylibs is kind of annoying.

Windows libraries were cross-compiled on linux using mingw-w64 (as this was easiest for me). I didn't bother creating scripts for that though, as I feel it wouldn't be super useful for Windows users (who would likely be the target for building dlls).

Testing:

  • macOS(x86_64)
  • macOS(arm64)
  • Windows(64-bit)
  • Windows(32-bit) (not tested but should be okay to leave until someone runs into a potential problem)
bass => 2.4.16.7 (unchanged)
bass_fx => 2.4.12.6 (unchanged)
bassmix => 2.4.11.2 (old: 2.4.11.1)

@frenzibyte frenzibyte changed the title Update FFmpeg libraries with LGPL versions Update FFmpeg libraries with LGPL versions and move out macOS dylibs to osx for arm64 support Feb 18, 2022
@peppy
Copy link
Member

peppy commented Feb 21, 2022

@nekodex how were you testing this one? i tried using the method @smoogipoo proposed and libbass seems to be missing:

[runtime] 2022-02-21 09:15:11 [error]: System.DllNotFoundException: Unable to load shared library 'bassmix' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libbassmix, 0x0001): tried: 'libbassmix' (no such file), '/usr/local/lib/libbassmix' (no such file), '/usr/lib/libbassmix' (no such file), '/Users/dean/Projects/osu-framework/osu.Framework.Tests/bin/Debug/net6.0/libbassmix' (no such file), '/usr/local/lib/libbassmix' (no such file), '/usr/lib/libbassmix' (no such file)
[runtime] 2022-02-21 09:15:11 [error]: at ManagedBass.Mix.BassMix.BASS_Mixer_GetVersion()
[runtime] 2022-02-21 09:15:11 [error]: at ManagedBass.Mix.BassMix.get_Version()
[runtime] 2022-02-21 09:15:11 [error]: at osu.Framework.Audio.AudioManager.setAudioDevice(Int32 deviceIndex) in /Users/dean/Projects/osu-framework/osu.Framework/Audio/AudioManager.cs:line 325
[runtime] 2022-02-21 09:15:11 [error]: at osu.Framework.Audio.AudioManager.setAudioDevice(String deviceName) in /Users/dean/Projects/osu-framework/osu.Framework/Audio/AudioManager.cs:line 295
[runtime] 2022-02-21 09:15:11 [error]: at osu.Framework.Audio.AudioManager.<onDevicesChanged>b__39_0() in /Users/dean/Projects/osu-framework/osu.Framework/Audio/AudioManager.cs:line 214

This branch:

Finder 2022-02-21 at 09 17 53

master:

Finder 2022-02-21 at 09 18 44

@peppy
Copy link
Member

peppy commented Feb 22, 2022

Turns out my nuget was somehow resolving an ancient 1.0.0 release no matter how i changed my nuget lookup order. Even after deleting global caches.

So I've just pushed this as a new version on nuget.org so we can move forward (https://www.nuget.org/packages/ppy.osu.Framework.NativeLibs/2022.222.0). Saves us doing two releases to get CI to build anyway.

@peppy
Copy link
Member

peppy commented Feb 22, 2022

Interestingly, with the new compiles nativelibs as a whole reduced from 63mb to 34mb, which is a pretty nice saving (likely due to the reduced footprint without the encoder portions being included).

I've pushed an update to the reference for the package that I've already published. I've tested on macOS and windows (x64 only). Should be enough to push forward with this change.

@peppy peppy enabled auto-merge February 22, 2022 08:26
@smoogipoo
Copy link
Contributor

smoogipoo commented Feb 22, 2022

Just going to note that this upgrades libbassmix only for macOS, according to my addition in the description. It seems to be a minor enough change that it's not mentioned in the changelog.

@peppy peppy merged commit 8500e2c into ppy:master Feb 22, 2022
@nekodex nekodex mentioned this pull request Feb 24, 2022
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants