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

Port Mixxx to iOS #16

Open
40 of 49 tasks
fwcd opened this issue Sep 25, 2022 · 1 comment
Open
40 of 49 tasks

Port Mixxx to iOS #16

fwcd opened this issue Sep 25, 2022 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed port Porting Mixxx and vcpkg dependencies to a new platform

Comments

@fwcd
Copy link
Owner

fwcd commented Sep 25, 2022

Status

The ios-qt6 branch contains experimental forks of mixxx and vcpkg that support compiling Mixxx and its dependencies for iOS, i.e. for arm64-ios-release. Most changes to Mixxx have been upstreamed, vcpkg upstreaming is still in progress. iOS CI passes.

Screenshot Screenshot

Documentation and general stuff

  • Add instructions to README.md
  • Build dependencies and Mixxx for iOS in CI

Porting the dependencies to iOS

  • Fix the dependencies (running scripts/install-vcpkg-deps with the arguments given in the aforementioned instructions should pass)
    • Fix ffmpeg build by setting --disable-audiotoolbox
    • Skip libusb and hidapi for now
    • Add patched ports for iOS under vcpkg/overlay/ios
      • Fix mp3lame by setting --disable-frontend (otherwise the build would error with missing curses.h headers)
      • Fix portaudio by patching in an experimental iOS CoreAudio backend (source)
      • Fix portmidi by patching use of legacy Carbon APIs and unavailable CoreAudio APIs (e.g. by replacing the hosttime calls with the mach time APIs as suggested by this Q&A doc)
      • Disable rubberband due to licensing issues (GPL + App Store) and build issues
      • Patch Qt as needed (it builds but hasn't been tested yet)
        • Disable _debug suffix for libraries (not needed since we already place them in a /debug subfolder, additionally they cause the Mixxx build to fail as Qt5CoreConfig.cmake looks for unsuffixed libraries (e.g. libQt5Core.a instead of the actual libQt5Core_debug.a))
      • Update to Qt 6
        • Add gles3 feature to qtbase (otherwise the port is identical to upstream vcpkg)
        • Figure out the right combination of features (Notably opengl, gles2, gles3 and sql-sqlite, but not sql-psql)
      • Figure out if we can link Qt and all non-permissively/non-App Store-clause-licensed libraries dynamically or ideally exclude them/make them optional (this includes Rubberband, xwax, libkeyfinder and potentially others)
        • For libkeyfinder it might be worth asking the rightholders nicely for a relicensing under GPL + App Store clause, given how essential the library has become
      • Patch harfbuzz with iOS sdkroot
  • Support building a patched version of Qt 5 too (as an alternative to Qt 6)
    • Build Mixxx for iOS 12
  • Add support for targeting iOS simulator

Porting Mixxx to iOS

  • Successfully configure mixxx.xcodeproj with the cmake command in the README
  • Use QIOSIntegrationPlugin
  • Add option for disabling rubberband (RUBBERBAND)
    • Fix build issues (see CI logs, we probably want to test this extensively with the regular desktop macOS build)
    • Perhaps we can upstream this?
  • Figure out potential OpenGL build issues (on iOS we only have OpenGL ES)
  • Successfully build iOS target in generated Xcode project
  • Successfully run Mixxx on an actual iOS device
  • Fix missing precision qualifier in shader
  • Bundle skins for small screen sizes:
  • Successfully load a track from within the sandbox (i.e. Mixxx's documents directory, which the user can access via the files app, e.g. to import music or to export recordings)
  • Implement screen lock suspension for iOS
  • Disable tool tips on iOS
  • Default audio backend to patched PortAudio's "iOS Audio"
    • Figure out why we still don't get any sound when using speakers (headphones work, strangely)
  • Investigate how to read files within the iOS sandbox (especially user-picked ones, e.g. via QFileChooser in MixxxMainWindow::slotFileLoadSongPlayer, which is invoked by File > Load Track to Deck ...)
    • Perhaps "import" files by always copying them to the sandbox/documents folder when loading them to a deck?
      • This would probably be required anyway to (permanently) add them to the library
  • Investigate how much of the macOS sandboxing logic we can reuse
  • Set dragMode to scrolling on scrollable views (library, preferences etc.)
  • Make preferences (and other modals such as "about"?) full-screen
    • Ideally, these modals should probably be a sheet-presented view controllers, but it is unclear whether Qt supports this natively
  •  Use MediaPlayer (instead of iTunesLibrary) framework to access music library on iOS
    • Figure out how we can make the sandbox play these tracks (the same issue as for files outside the sandbox)
  • Tapping track in library brings up keyboard, even if the text field seems to be non-editable, it would be nice if we could find a fix or workaround for this

Packaging Mixxx for iOS

  • Bundle resources with iOS app
  • Update qResourcePath logic to handle iOS app bundles (which use a flatter file structure than macOS bundles)
  • Add iOS app icon (custom SVG, derived from the macOS icon without rounded corners + script for rendering it)
  • Add custom Info.plist (including the permission for users to access Mixxx's documents directory via the Files app)
  • Customize LaunchScreen to use Mixxx logo
  • Investigate why the IOS variable is not automatically set by CMake when setting CMAKE_SYSTEM_NAME to iOS
    • This variable is first set on the project call. We check the vcpkg triplet instead now and set CMAKE_SYSTEM_NAME automatically as needed.

Upstreaming the Mixxx patches

TBD:

  • Disable features (RUBBERBAND, HID, BATTERY, QTKEYCHAIN) for iOS in upstream CMakeLists and remove them from our README (and user presets as needed)
    • rubberband and qtkeychain-qt6 have been fixed, so we could investigate reenabling them
  • The LateNight Mini skin
    • Should be discussed on Zulip first, though a general purpose "small screen" skin would probably be useful for other use cases too (e.g. Raspberry Pis)

Upstreaming the vcpkg patches

to microsoft/vcpkg

to mixxxdj/vcpkg

TBD:

  • Upstream our updated vcpkg.json manifest
  • Figure out a solution to the SDKROOT workarounds

to upstream projects

TBD:

  • Find a way to get rid of the workaround of explicitly setting an SDKROOT for some ports

Ideas for future work

  • Investigate replacing the native (deprecated) OpenGL ES framework with ANGLE, which runs on top of Metal
  • Hot reloading for skins over the network
@fwcd fwcd added enhancement New feature or request help wanted Extra attention is needed labels Sep 25, 2022
@fwcd fwcd changed the title Investigate whether we can build Mixxx on iOS Investigate whether we can build Mixxx for iOS Sep 25, 2022
@fwcd fwcd pinned this issue Oct 20, 2022
@fwcd
Copy link
Owner Author

fwcd commented Sep 27, 2023

Some preliminary experiments on porting the Qt 6-based dependency stack can be found in the ios-qt6 branch.

Note: The Qt 6 cross-build always requires building for the host too.

State: It compiles and runs!

@fwcd fwcd unpinned this issue Oct 13, 2023
@fwcd fwcd pinned this issue Jan 27, 2024
@fwcd fwcd changed the title Investigate whether we can build Mixxx for iOS Port Mixxx to iOS Jan 27, 2024
@fwcd fwcd added the port Porting Mixxx and vcpkg dependencies to a new platform label Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed port Porting Mixxx and vcpkg dependencies to a new platform
Projects
None yet
Development

No branches or pull requests

1 participant