Skip to content

Modernize the UWP app: projectM 4, CMake and CI - #7

Open
Coastrnaut wants to merge 26 commits into
projectM-visualizer:masterfrom
Coastrnaut:master
Open

Coastrnaut wants to merge 26 commits into
projectM-visualizer:masterfrom
Coastrnaut:master

Conversation

@Coastrnaut

@Coastrnaut Coastrnaut commented Nov 7, 2026 •

Copy link
Copy Markdown

This answers the README's call for help. The app builds against the current projectM, the project is generated by CMake, and GitHub Actions builds it. Along the way, the app is split into separate layers and gets a few new features.

design.md has the full detail: architecture, decisions, testing, licensing, history and the status of each part.

What changed

Build

  • projectM is a submodule (src/projectm) tracking upstream at eae22de4, the 4.2.0 development commit. The latest release, v4.1.8, doesn't have projectm_create_with_opengl_load_proc or the glad loader, and only allows OpenGL ES on Linux and Android.
  • CMake generates the project for UWP on the v142 toolset, with x64 and x86 presets. projectM builds from its own CMake, so its source list, generated headers and shaders no longer need maintaining here.
  • ANGLE (WindowsStoreOpenGL 0.777.79) is downloaded at configure time and pinned by SHA-256.
  • UWP fixes are applied from CMakeLists.txt, and the submodule itself isn't modified:
    • a LoadPackagedLibrary loader in place of DynamicLibrary_win32.cpp
    • a getenv shim
    • a corrected copy of GLProbe.cpp (see below)

App

  • Uses only the projectM C and playlist APIs, all from one Visualizer class.
  • EGL is moved into AngleSurface, behind an interface.
  • Audio goes through a lock-free ring buffer instead of calling projectM from the capture thread. This fixed four bugs:
    • samples were read after being released to the audio engine
    • capture could use a destroyed renderer during teardown
    • capture never reached the stopped state
    • surround audio was treated as stereo
  • New features:
    • persisted settings
    • favorites, and a favorites-only mode
    • preset import
    • microphone as an audio source
    • adjustable preset duration
    • suspend and resume handling
    • recovery from audio device changes
    • a diagnostics log, which names each preset as it starts, so a preset that fails to load shows up as missing
  • Fullscreen now fills the screen. ANGLE resizes its swap chain on the next present rather than on SizeChanged, so the app read the old size and drew a box inside a black border. It now checks the surface size every frame.
  • Platform-independent code is in projectM-UWP.Core, with unit tests.

CI runs the unit tests, builds Debug and Release for x64 and x86, and builds and validates an unsigned bundle.

Store screenshots are in store/screenshots: a fullscreen 2752×1966 PNG of each bundled preset that loads, plus the help overlay, about 154 MB in all. Drop that commit (4ce757e) if you'd rather not keep them in the repository.

Changes to be aware of

  • The app moves to a new Store product, projectM-visualizer (Store ID 9MVZC1D9Z7PX).
    • The package identity is coaster.projectM-visualizer, published by CN=D9ED5A20-CFEF-4A74-9651-3E6DDAF76CC5 (coaster). The display name is projectM-visualizer.
    • The EyeTune listing (9NDCVH0VCWJN, 13183Mancoast.EyeTune) can't take this as an update, and its users' saved data doesn't carry over.
    • The README explains how to build and upload a release.
  • ARM is removed. Current Windows SDKs have no ARM32 libraries, and the ANGLE package has no ARM64 libraries.
  • Builds are unsigned by default. Pass -DPROJECTM_UWP_PACKAGE_CERTIFICATE and -DPROJECTM_UWP_PACKAGE_THUMBPRINT to sign.
  • The README's clone URL points to my fork. It should be changed to this repository if this is merged.

A projectM bug worth fixing upstream

src/libprojectM/Renderer/Platform/GLProbe.cpp:73 declares GetStringiFn without the GL calling convention:

using GetStringiFn = const GLubyte* (*) (GLenum, GLuint);

On 32-bit Windows, GL functions are __stdcall, so each call corrupts the stack, and x86 Release builds fail their stack cookie check at startup. Declaring it with GLAD_API_PTR fixes it. The fix is in projectM-visualizer/projectm#1059. The local patch here stops applying automatically once that's merged.

Testing

Tested on Windows 11 with an NVIDIA RTX A6000, over a Remote Desktop session with a 32 Hz display.

Check Result
Unit tests, all four builds, bundle validation Pass, on GitHub Actions and a clean local clone
x64 and x86 rendering 32 fps, matching the display
Audio A test tone at amplitude 2600 was read at peak 2602, with no dropped frames
Keys, favorites, import, duration, settings across restart, resume Confirmed on x64
Fullscreen Fills a 2752×1966 display
Presets 28 of the 29 bundled presets load. martin - sparky caleidoscope.milk fails in projectM, most likely in its shader translation
Package identity, publisher and display name Match Partner Center's values, checked in the built bundle

Not tested: Xbox, signing with a real certificate, Store certification, microphone capture, and frame rate on a local display. The bundled presets also still need a redistribution audit, since none of the files carry license text.

Update project, filter, and script paths for the src/projectm submodule.
Remove the ARM configurations, which the installed Windows SDK cannot link.
Fix the app's library search path and Debug x86 output folder.
Ignore build output and .pfx files.
Move the projectm submodule from v3.1.12 to eae22de4 (4.2.0), keeping the
v142 toolset. Rework the Visual Studio projects around projectM's new source
layout, and port the app to the C and playlist APIs.

Add the UWP-specific pieces outside the submodule: a LoadPackagedLibrary
loader, a getenv shim, and checked-in CMake output with a script to refresh
it. Keep the EyeTune presets in this repo, since projectM no longer has any.
Build Debug and Release for x64 and x86 from a clean checkout, and upload an
unsigned Release bundle. Note the clone path limit and restore step in the
README.
Replace the hand-kept solution and projects with a CMake build that targets
UWP on the v142 toolset. projectM now builds from the unmodified submodule,
so the checked-in generated files and source list are gone. ANGLE is
downloaded at configure time and pinned by hash.

Builds are unsigned unless a certificate is configured. Add a script that
combines the x64 and x86 packages into a bundle, move CI to the CMake presets,
and replace the publish scripts.
GLProbe.cpp calls glGetStringi through a pointer without the GL calling
convention. On x86 GL functions are __stdcall, so each call corrupts the stack,
and Release builds fail their stack cookie check at startup.

Compile a corrected copy at configure time, leaving the submodule unmodified.
It falls back to the original file once projectM fixes the declaration.
Add EyeTune.Core, a platform-independent library with a bounded audio buffer,
settings and frame statistics, with unit tests in tests/. Move all projectM
calls into Visualizer and all EGL code into AngleSurface.

Capture now writes to the buffer, and the render thread feeds projectM. This
fixes reading samples after releasing them to the audio engine, a race between
capture and renderer teardown, and surround audio being treated as stereo.
Capture also reports Stopped now, which it never did, so it can restart.

Add persisted settings, favorites, preset import, a microphone source, preset
duration keys, suspend and resume handling, recovery from audio device changes,
and a diagnostics log in the app's local folder.
Rewrite the README for the current app, run the unit tests and validate the
bundle in CI, and remove the modernization plan.
Capture only retried when a device was lost, so a device that was briefly
missing at startup left the visuals silently ignoring sound. Retry any failure
a few times, then tell the user that no audio device is available.
The playlist reports escaped paths, so preset names appeared as EoS%20-%20...
in popups and in saved favorites. Decode them, including favorites saved by
earlier builds. Note confirmed results and known limits in the README.
Collect the architecture, decisions, platform feasibility, testing, licensing,
history and specification status in one file, and point the README at it.
Rename the app's folders, files, build targets, package identity, display name,
namespace and log file. The package identity is now 13183Mancoast.projectM-UWP,
so this is a separate app to Windows and the Store: the existing Store listing
can't take it as an update, and settings saved by EyeTune don't carry over.

The Store account's reserved names and a quoted commit subject keep EyeTune,
because they record what was registered and written.
Set the display name to projectM, which is reserved on the Store account, so
the title bar, Start menu and Store tile show it. The package identity stays
13183Mancoast.projectM-UWP. Bundle validation now checks the display name.
The app is published as a new Store product, so the package identity is
now 13183Mancoast.projectM-visualizer. The publisher is unchanged.
Partner Center assigned coaster.projectM-visualizer, published by
CN=D9ED5A20-CFEF-4A74-9651-3E6DDAF76CC5 (coaster), Store ID 9MVZC1D9Z7PX.
The Store association now points to that product, and bundle validation
checks the publisher as well as the identity name.
The Store only accepts a display name reserved for the product, and the
projectM-visualizer app has that name reserved.
The README links to the new Store listing and explains how to publish
to it: the identity Partner Center assigned, the release steps and the
certification kit. design.md records the move from the EyeTune listing,
the package family name and Store ID, and the upstream GLProbe fix.
ANGLE resizes its swap chain on the next present, not when SizeChanged
fires, so the size read in that handler was the old one. In fullscreen,
projectM kept rendering at the window's previous size, a box with a
black border. The surface size is now checked every frame, and projectM
is resized when it changes.
The diagnostics log now names every preset projectM switches to. The
playlist drops presets that fail to load without reporting them, so a
preset missing from the log is one that failed.
Fullscreen 2752x1966 screenshots of the 28 bundled presets that load,
taken with music playing, and one of the help overlay. presets.txt names
the preset in each, and contact-sheet.jpg shows them all. The 29th
preset, martin - sparky caleidoscope, fails to load in projectM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant