This guide documents the current practical route for NX-Cast media dependencies.
The project previously explored several paths, including upstream FFmpeg/mpv builds and full SwitchWave-style dependency builds. The current shortest working path is to reuse the wiliwili Switch media packages and build scripts.
The toolchain must provide:
- FFmpeg with network playback support.
libmpvwithhos-audio.libmpvrender support fordeko3d.- FFmpeg/mpv support for
nvtegrahardware decode when available. - One reproducible setup for local builds, Docker, and GitHub Actions.
Use the prebuilt wiliwili media packages first.
Only rebuild FFmpeg/mpv locally if:
- A prebuilt package version is wrong.
- You need to modify an FFmpeg patch.
- You need to modify mpv
deko3dorhos-audiobehavior. - You are debugging a lower-level media stack bug.
Do not start by manually building upstream FFmpeg/mpv or collecting unrelated SwitchWave dependencies. That path is slower and easier to break.
Characteristics:
- Easiest to install.
- Fixes network-video support compared with some plain devkitPro media packages.
- Does not provide the current release
deko3drender path.
Typical packages:
switch-ffmpeg-7.1-1-any.pkg.tar.zst
switch-libmpv-0.36.0-3-any.pkg.tar.zst
Characteristics:
- Current
NX-Castrelease path. - Provides
deko3drendering. - Provides
hos-audio. - Best fit for hardware decode work.
Typical packages:
libuam-f8c9eef01ffe06334d530393d636d69e2b52744b-1-any.pkg.tar.zst
switch-ffmpeg-7.1-1-any.pkg.tar.zst
switch-libmpv_deko3d-0.36.0-2-any.pkg.tar.zst
Prepare the devkitPro environment:
source /opt/devkitpro/switchvars.shInstall the current recommended deko3d package set:
base_url="https://github.com/xfangfang/wiliwili/releases/download/v0.1.0"
sudo dkp-pacman -U \
"$base_url/libuam-f8c9eef01ffe06334d530393d636d69e2b52744b-1-any.pkg.tar.zst" \
"$base_url/switch-ffmpeg-7.1-1-any.pkg.tar.zst" \
"$base_url/switch-libmpv_deko3d-0.36.0-2-any.pkg.tar.zst"Do not install switch-libmpv and switch-libmpv_deko3d at the same time. Use switch-libmpv_deko3d for the release path.
Header and library checks:
test -f /opt/devkitpro/portlibs/switch/include/mpv/client.h && echo "mpv headers ok"
test -f /opt/devkitpro/portlibs/switch/include/mpv/render_dk3d.h && echo "render_dk3d ok"
test -f /opt/devkitpro/portlibs/switch/lib/libmpv.a && echo "libmpv ok"
test -f /opt/devkitpro/portlibs/switch/include/libavutil/hwcontext_nvtegra.h && echo "nvtegra hwcontext ok"Static link check:
PKG_CONFIG_PATH=/opt/devkitpro/portlibs/switch/lib/pkgconfig pkg-config --static --libs mpvThe output should include -ldeko3d and -luam for the release path.
Symbol/string checks:
strings /opt/devkitpro/portlibs/switch/lib/libmpv.a | rg "deko3d|hos|nvtegra"
strings /opt/devkitpro/portlibs/switch/lib/libavcodec.a | rg "nvtegra|configuration|license"source /opt/devkitpro/switchvars.sh
make clean
make NXCAST_REQUIRE_LIBMPV=1 NXCAST_REQUIRE_DEKO3D=1 -j2
NXCAST_MIN_NRO_SIZE=5000000 ./scripts/package_release.shThe strict flags prevent accidentally producing a small mock/fallback NRO without the real media stack.
The repository Dockerfile installs the same prebuilt package set. GitHub Actions uses that Dockerfile for both continuous builds and tagged releases.
Local Docker release build:
./scripts/docker_build_release.shExpected outputs:
dist/NX-Cast.nro
dist/NX-Cast-sdmc.zip
If local and CI behavior differs, first check:
- Which
switch-libmpvpackage is installed. - Whether
pkg-config --static --libs mpvincludes-ldeko3d -luam. - Whether
render_dk3d.hexists. - Whether the generated NRO size is plausible.
Only use this path when prebuilt packages are not enough.
The useful references are the wiliwili-dev package scripts:
scripts/switch/ffmpeg/PKGBUILD
scripts/switch/mpv/PKGBUILD
scripts/switch/mpv_deko3d/PKGBUILD
scripts/build_switch_deko3d.sh
Expected package order:
- Build or install low-level dependencies such as
libuamwhen required. - Build
switch-ffmpeg. - Build
switch-libmpvorswitch-libmpv_deko3d. - Install the generated packages with
dkp-pacman -U. - Rebuild
NX-Castwith strict media requirements.
Do not mix a locally rebuilt FFmpeg with an incompatible prebuilt mpv package unless you know the ABI and package configuration match.
The application-side ideas to study from wiliwili are:
- Include
mpv/render_dk3d.h. - Initialize
mpv_deko3d_init_params. - Attach
MPV_RENDER_API_TYPE_DEKO3D. - Use
vo=libmpv. - Use
ao=hos. - Set
hwdecas a runtime mpv option rather than writing a decoder in the app.
For NX-Cast, the practical route remains:
- Install the
wiliwiliprebuiltdeko3dpackage set. - Build
NX-Castagainst the systemportlibs. - Verify
render_dk3d.h,libmpv.a, andhwcontext_nvtegra.h. - Use Docker when reproducing CI.
- Rebuild FFmpeg/mpv only when changing the media stack itself.