projectM-visualizer / projectm

projectM - Cross-platform Music Visualization Library. Open-source and Milkdrop-compatible.
https://discord.gg/mMrxAqaa3W
GNU Lesser General Public License v2.1
3.28k stars 371 forks source link

ProjectM/Kodi SIGABRT with Unknown Preset #409

Closed stevenswart closed 1 year ago

stevenswart commented 4 years ago

22nd of August 2020

I am reporting four separate issues I am experiencing with ProjectM. I started having problems when I installed the massive community preset pack available on the ProjectM GitHub home page. Previously, I was not experiencing any problems. It seems that there are certain presets in there that cause problems. In some cases, I was able to determine a few of these that were causing problems, and reproduce the errors. In other cases, I was not able to do so.

This is the third of these issues – an unknown preset that causes ProjectM to SIGABRT. I am not sure how to reproduce this problem; it was one of the crashes that came up while I was testing. The short way would be to install the community presets and run Kodi/ProjectM under a debugger until it happens, but I don’t know how you would then tell which preset causes the problem. The long way would be to test all of the community presets manually, one by one, until you reproduce the problem, but that would be exceeding painful. Nevertheless, I am reporting it here for the sake of completeness.

I did some fairly extensive investigations into these problems in June this year, and was able to get as far as discovering that there are four separate issues, according to backtraces that I obtained with GDB.

My use case is that I consider myself to be a Kodi power user. I use Kodi to play music on my media server most of the time that I am home. I have the ProjectM addon installed for Kodi, and I love it. I only use the ProjectM PulseAudio executable when, for example, I am streaming music via a browser. But I was able to determine that these problems originate in the ProjectM library itself, not within Kodi, and they seem to affect both Kodi with the ProjectM visualiser installed, as well as the ProjectM PulseAudio executable.

The problems fall into two classes, crashes (three problems found), and freezes/deadlocks (one problem found). As of this writing, with the latest available software, both these problems still exist.

I love the new presets I have installed, and even though I installed them over two months ago, I am still surprised by the occasional preset that I have never seen before. I have been collecting presets for a long time now, but some of the presets in the community pack are stunning!

Nevertheless, it is annoying when my music occasionally stops and I have to kill/restart Kodi and try to figure out where it was before it crashed. Most annoying when I am listening to DJ sets of an hour or longer!

Kodi reports that I now have 40585 presets installed, so, as you can imagine, it would be an extremely painful exercise for me to manually test every single preset individually and remove the ones that cause problems, certainly, I don’t have that kind of time to spend. Also, I imagine that all of these presets used to work at some point in the Milkdrop/ProjectM lifecycle, and ideally, this should be fixed inside the ProjectM library itself, or in cases where there is a bad preset that does not parse, the exception it causes should be handled, and ProjectM should simply move on to the next preset, possibly adding the faulty preset to some kind of banned list. That would be a far more robust way of handling the problem, to my mind.

Hardware:

My media server is based on an HP Proliant MicroServer, Gen10 (WW Entry BTO Model), specs here:

https://h20195.www2.hpe.com/v2/GetDocument.aspx?docname=a00008701enw&doctype=quickspecs&doclang=EN_US&searchquery=&cc=us&lc=en

Briefly, the hardware is as follows:

CPU: AMD Opteron(TM) X3216 APU - Dual-core, x86_64 Memory-Main Memory-phys_mem: 8053063680 Monitor: LG TV Network Cards: NC332i Adapter x2, RTL8192EE PCIe Wireless Network Adapter Graphics Card: ATI Radeon R5 Graphics Sound Card: Kabini HDMI/DP Audio (built into graphics card).

The hardware info as reported by YaST may be found here:

https://paste.kodi.tv/lilaqabiqe.kodi

Sample Xorg.0.log may be found here:

https://paste.kodi.tv/serijohada

I am experiencing this problem on OpenSUSE Tumbleweed, latest version, updated today (22nd of August 2020), with Kodi Leia 18.8, installed from the packman repo. (Tumbleweed is OpenSUSE’s rolling release.)

However, I don’t think this is a problem with either the hardware or the operating system.

Sample Kodi backtrace:

https://paste.kodi.tv/icesoyixac.kodi

Sample Kodi crashlog:

https://paste.kodi.tv/ujazivadar.kodi

kblaschke commented 2 years ago

Many crash issues were fixed during the last year or so, but we'll have to see if these affect your issue.

If you have the possibility to test a recent projectM build (using the SDL test UI), could you please check if the problematic presets still cause crashes? If the projectM library is the culprit, it should expose the same behaviour.

stevenswart commented 2 years ago

Good day, Kai!

Apologies, I only saw this comment today.

Unfortunately, I never identified the preset that was causing this problem. For the past while, I have not been using the community preset pack. I still very rarely have crashes. The reason I stopped using the community preset pack with Kodi is that I no longer have any way of knowing which presets cause the problems, and can no longer remove problem presets.

I reported this issue below, but so far have had no response from the Kodi developers:

https://forum.kodi.tv/showthread.php?tid=361638&pid=3025649#pid3025649

kblaschke commented 2 years ago

No problem. As we're nearing the 4.0 release, there's a good chance Kodi will also see an update for the plug-in, which not only will fix many crash bugs, but also have lots of rendering improvements. We're in touch with the Kodi plug-in dev, so that shouldn't take long as integrating projectM has become easier (and also more stable due to moving from a C++ to a plain C API).

kblaschke commented 1 year ago

The crashes are most probably fixed in current libprojectM's master. Only in the case that the OpenGL context is not properly configured for the render thread it may crash, but that would happen every time, not only for certain presets.

Since the issue affects an external project, I'd suggest to re-test the problems and if they still exist, opening a new issue in the Kodi projectM plug-in issue tracker. If the new projectM API is finished, we'll drop the plug-in authors a note so they can port the code to the new release, which should in every aspect work better than the old one.

If the problem persists after the 4.0 release and the updated Kodi plug-in, please feel free to create a new issue here (or reopen this one with new information).