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

Upcoming projectM changes: Switching to a C-style API #59

Open
kblaschke opened this issue Aug 18, 2021 · 12 comments
Open

Upcoming projectM changes: Switching to a C-style API #59

kblaschke opened this issue Aug 18, 2021 · 12 comments

Comments

@kblaschke
Copy link

Hi,

I'm a new team member with projectM and currently working on making projectM more stable and easier to integrate and build.

One upcoming change is that projectM will only provide a C-style API in future releases by default. While this switch makes it feel a bit less "native" in C++ projects, it greatly improves portability and stability of the projectM shared library and also enables integrations in other languages that do not use C++ like Python for example.

You may want to follow development in issue projectM-visualizer/projectm#529 and update the Kodi plug-in in preparation for the next projectM release after the changes are stable and merged into master.

@notspiff
Copy link
Collaborator

thanks for the heads-up. i'll wait for everything to settle before doing the conversion. looks pretty straight forward.

@kblaschke
Copy link
Author

Will drop another message here when we've polished the API and are about to release.

If you have any suggestions/wishes, just let us know!

@AlwinEsch
Copy link
Member

Is very cool to see this changes, inform me after new release, also like @revmischa wrote on #62 that cmake comes is very good.

Thanks a lot to continue on the projectM library!

@kblaschke
Copy link
Author

kblaschke commented Jan 25, 2023

We're currently writing release notes for the first projectM 4.0 RC, which means the new C API is now completely implemented and working. Migration should be relatively easy.

Be aware that the playlist functionality is now implemented as a separate library. The new playlist library supports a few additional features like adding multiple preset directories and filtering the files.

Until we have set up a proper developer reference page on github.io, you can browse the Doxygen-generated API documentation on my website: https://codav.de/projectM-API/files.html

@kblaschke
Copy link
Author

Just giving a heads-up here, version 4.0 has been released a while ago with the new API and is in a usable state, so I'd recommend updating the Kodi plug-in accordingly as the release comes with a number of crash fixes as well.

I'm already working on a minor release 4.1, with no API changes but a nearly full rewrite of the renderer and expression parser, bringing preset compatibility up to a level that comes close to the original Milkdrop. Upgrading will be easy, as no code changes will be required downstream.

@kblaschke
Copy link
Author

@AlwinEsch The 4.1 release is now yet there, but getting closer. If there's not too much time on your hands to implement the required changes to update to the 4.x release branch, youay want to wait until we release an update of the Kodi plug-in once the 4.1 release is out. The 4.0 release already fixed many crash issues, but 4.1 will actually bring a huge improvement in the visuals.

If you can update the plug-in on short notice, e.g. to fix the crash issues quickly, there won't be any code changes required to update it later from 4.0 to 4.1, just replace the projectM library and release a new version of the plug-in.

Another side note for the upgrade: remember that the internal settings file stuff has been removed. All settings are now changed via API calls from the integrating application, which will make it easier for this plug-in to store the settings in a more "Kodi" way. Also, the core library no longer has a built-in playlist. If you still need this functionality, look at the now separate playlist library which is part of the project. You may now also manage preset playlists within the plug-in itself if you like.

@kblaschke
Copy link
Author

Just a small heads-up, projectM 4.1.1 is released.
It has some great improvements over the previous releases:

  • Almost perfect compatibility with Milkdrop 2 presets
  • Better performance
  • CMake-based build system, which better integrates with Kodi
  • A stable and clean C API, e.g. updating to future 4.x releases will be effortless
  • Fixed all known crash issues and memory leaks present in earlier versions

If you need any additional support regarding the update, just ask, the projectM team will gladly help!

@JungleJim42
Copy link

JungleJim42 commented Jul 16, 2024

Wow if anybody can update the kodi projectm visualisation with projectm 4.1.1 this would be very much appreciated! The Steam version is excellent (with the Cream of the crop presets), I wish I could get all these presets to 100% in Kodi. Thanks!

@kblaschke
Copy link
Author

Updated the addon to use projectM 4.x, as of now untested, but it builds on Linux:

https://github.com/kblaschke/visualization.projectm/tree/update-to-projectm-4

For Windows, it looks like Kodi uses ANGLE and projectM is patched to support this. We could add ANGLE support to libprojectM and add a build switch to select between GLEW and ANGLE.

@JungleJim42
Copy link

Wow thanks kblanche I will try this!

Updated the addon to use projectM 4.x, as of now untested, but it builds on Linux:

https://github.com/kblaschke/visualization.projectm/tree/update-to-projectm-4

@JungleJim42
Copy link

I can confirm it works on Linux. I built it on first try. I installed it easily in Kodi Nexus. I get many new working vizualisations and effects. Loading time is faster (the previous version had a "hang" of up to 5 seconds between music start and visualisation start).

With "Cream of the crop" presets, a minority of presets still seem not perfect (ex: white or black screen). There used to be around 1 in 5 problematic with version 3 of projectM now it is less than 1 in 25 - could be that they are bad visualisations or the fit with the music is not good. Many thanks kblanche!

Updated the addon to use projectM 4.x, as of now untested, but it builds on Linux:

@kblaschke
Copy link
Author

kblaschke commented Aug 7, 2024

Loading time is faster (the previous version had a "hang" of up to 5 seconds between music start and visualisation start).

This is due to some changes in the texture loading code, as previously, it loaded all textures upfront (including stuff in all preset dirs).

With "Cream of the crop" presets, a minority of presets still seem not perfect (ex: white or black screen). There used to be around 1 in 5 problematic with version 3 of projectM now it is less than 1 in 25 - could be that they are bad visualisations or the fit with the music is not good.

Many presets of this pack require the Milkdrop texture pack to be available, as they heavily depend on external textures. If those are missing, most of those presets just render black/white. Also, some presets in that pack don't even work in Milkdrop - not sure why they got picked by the original pack author.

For the final packaging, I'd also recommend to statically link projectM and the playlist library, so everything is contained in the addon .so/.dll. Due to code improvements, dynamic linking now works properly on all platforms though, so this is still an option and can be controlled via the CMake default BUILD_SHARED_LIBS flag when configuring the libprojectM build.

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

No branches or pull requests

4 participants