GithubHelp home page GithubHelp logo

Comments (7)

Kyborg2011 avatar Kyborg2011 commented on July 23, 2024

When I created a Debug build of projectm I have gotten such an error (when creating a projectm instance):

/Users/aroslavivanov/.ssh/dev/cadenza-music-player/gen-libs/projectm/src/libprojectM/ProjectM.cpp:215: void libprojectM::ProjectM::LoadIdlePreset(): assertion "m_activePreset" failed
Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 7659 (GLThread 624), pid 7463 (uceolab.cadenza)

Anyone can help me with that? I have seen in other issues that some devs already gotten such an error, but I do not see any solution about such problem...

from projectm.

rullinoiz avatar rullinoiz commented on July 23, 2024

i am also getting this issue, i included version 4.1.0 into my android app's build process and when running it also gives me this error, this happens when instantiating the ProjectM object

from projectm.

hack-s avatar hack-s commented on July 23, 2024

I have seen similar errors when calling projectm_create() without having an OpenGL context associated with the calling thread. Make sure that you are setting up OpenGL first (create a GL context and make it current to the thread) before calling the projectM APIs.

That's my first thought, since I don't see any OpenGL setup code in your snippet.
I never tried running it on Android, or an any other GLES device though.

from projectm.

kblaschke avatar kblaschke commented on July 23, 2024

I have seen similar errors when calling projectm_create() without having an OpenGL context associated with the calling thread.

That would also be my guess. Either no GL context at all (or none active), or not the correct GLES version used (projectM needs GLES 3 to work, with GLES 3.1 features enabled).

The reason for the abort and assertion regarding m_activePreset when rendering a frame then happens because projectM couldn't load the "idle" preset on startup due to the OpenGL issue.

We're working on better error handling and reporting in version 4.2, so when that one's done, you should be able to get proper error messages from the library if something fails, helping to find and fix the issue.

So check that the proper context is there. I'm not an Android dev, so this is something I found that may work: http://www.anandmuralidhar.com/blog/android/gles-context/
You can check if GLES 3.1 features are available like this I guess:

int[] vers = new int[2];
GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, vers, 0);
GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, vers, 1);
if (vers[0] > 3 || (vers[0] == 3 && vers[1] >= 1)) {
    // We have at least ES 3.1.
}

Then make sure that both creating projectM and the rendering call happen in the same thread, ensuring the GL context being active.

Please give feedback if that approach worked. We'll then add proper documentation for Android, so others won't run into the same trap.

from projectm.

Kyborg2011 avatar Kyborg2011 commented on July 23, 2024

I have seen similar errors when calling projectm_create() without having an OpenGL context associated with the calling thread.

That would also be my guess. Either no GL context at all (or none active), or not the correct GLES version used (projectM needs GLES 3 to work, with GLES 3.1 features enabled).

The reason for the abort and assertion regarding m_activePreset when rendering a frame then happens because projectM couldn't load the "idle" preset on startup due to the OpenGL issue.

We're working on better error handling and reporting in version 4.2, so when that one's done, you should be able to get proper error messages from the library if something fails, helping to find and fix the issue.

So check that the proper context is there. I'm not an Android dev, so this is something I found that may work: http://www.anandmuralidhar.com/blog/android/gles-context/ You can check if GLES 3.1 features are available like this I guess:

int[] vers = new int[2];
GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, vers, 0);
GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, vers, 1);
if (vers[0] > 3 || (vers[0] == 3 && vers[1] >= 1)) {
    // We have at least ES 3.1.
}

Then make sure that both creating projectM and the rendering call happen in the same thread, ensuring the GL context being active.

Please give feedback if that approach worked. We'll then add proper documentation for Android, so others won't run into the same trap.

No, guys, problem not in another thread... That's my code of a GLSurfaceView.Renderer:

class MilkdropVisualizationRenderer(
    private val playbackManager: PlaybackManager,
    val assetPath: String
) : GLSurfaceView.Renderer {
    override fun onSurfaceCreated(gl: GL10?, config: javax.microedition.khronos.egl.EGLConfig?) {
        Timber.tag("projectM").d("RenderWrapper onSurfaceCreated")

        val vers = IntArray(2)
        gl?.glGetIntegerv(GLES30.GL_MAJOR_VERSION, vers, 0)
        gl?.glGetIntegerv(GLES30.GL_MINOR_VERSION, vers, 1)
        Timber.d("GLES version: ${vers[0]}.${vers[1]}")

        val width: Int = Resources.getSystem().getDisplayMetrics().widthPixels
        val height: Int = Resources.getSystem().getDisplayMetrics().heightPixels
        playbackManager.initMilkdropVisualizer(assetPath)
        playbackManager.milkdropVisualizerSetWindow(width, height)
    }

    override fun onSurfaceChanged(gl: GL10?, width: Int, height: Int) {
        Timber.tag("projectM").d("RenderWrapper onSurfaceChanged")
        GLES32.glViewport(0, 0, width, height)
        playbackManager.milkdropVisualizerSetWindow(width, height)
    }

    override fun onDrawFrame(gl: GL10?) {
        Timber.tag("projectM").d("RenderWrapper RenderFrame")
        playbackManager.milkdropVisualizerRenderFrame()
    }
}

The thread is 100% the same! That's my logcat:

2024-07-13 00:30:35.449 15775-16420 projectM                xyz.luceolab.cadenza                 D  RenderWrapper onSurfaceCreated
2024-07-13 00:30:35.452 15775-16420 MilkdropVi...onRenderer xyz.luceolab.cadenza                 D  GLES version: 3.2
2024-07-13 00:30:35.454 15775-16420 projectM                xyz.luceolab.cadenza                 D  RenderWrapper onSurfaceChanged

You can see that GLES version is 3.2! And the thread is 16420. Than logcat of a projectM error:

2024-07-13 00:30:35.974 15775-16420 libc                    xyz.luceolab.cadenza                 A  /Users/aroslavivanov/.ssh/dev/cadenza-music-player/gen-libs/projectm/src/libprojectM/ProjectM.cpp:215: void libprojectM::ProjectM::LoadIdlePreset(): assertion "m_activePreset" failed
2024-07-13 00:30:36.110 15775-16420 libc                    xyz.luceolab.cadenza                 A  Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 16420 (GLThread 189), pid 15775 (uceolab.cadenza)

You can see that thread the same: 16420 (GLThread 189). And error unfortunately the same!

So, bug is somewhere else. I am not a pro in OpenGL ES (honestly , first time working close with it), so in any case I need a help from community...

from projectm.

Kyborg2011 avatar Kyborg2011 commented on July 23, 2024

By the way, even if I call "get gles version" from c++ code (the same function where I trying projectm_create) I have gotten the right result:

GLES version: OpenGL ES 3.2 v1.r38p1-01bet0-mbs2v41_0.8320a750c7c9e2666df3500d139b434f

The c++ code:

const char* version_str = (const char*)glGetString(GL_VERSION);
LOGD("GLES version: %s", version_str);

So, as GLES context working in my custom c++ code, so the problem 100% in projectM by itself!

from projectm.

Kyborg2011 avatar Kyborg2011 commented on July 23, 2024

I have tested current problem on emulator with API 35, arm64-8a. On emulator a projectm instance was created successfully, but there is an error on opengl_render_frame:

GLES version: 3.0
2024-07-13 15:44:54.796  6820-7163  cadenza                 xyz.luceolab.cadenza                 D  GLES version: OpenGL ES 3.0 (4.1 Metal - 88.1)
2024-07-13 15:44:54.845  6820-6902  EGL_emulation           xyz.luceolab.cadenza                 D  app_time_stats: avg=252.90ms min=11.20ms max=8008.60ms count=35
2024-07-13 15:44:54.850  6820-6820  ImageReader_JNI         xyz.luceolab.cadenza                 W  Unable to acquire a buffer item, very likely client tried to acquire more than maxImages buffers
2024-07-13 15:44:54.928  6820-6902  EGL_emulation           xyz.luceolab.cadenza                 D  app_time_stats: avg=9.40ms min=2.27ms max=68.82ms count=50
2024-07-13 15:44:54.976  6820-7163  cadenza                 xyz.luceolab.cadenza                 D  projectM init success!
2024-07-13 15:44:54.977  6820-7163  projectM                xyz.luceolab.cadenza                 D  RenderWrapper onSurfaceChanged
2024-07-13 15:44:54.977  6820-7163  projectM                xyz.luceolab.cadenza                 D  RenderWrapper RenderFrame
2024-07-13 15:44:54.977  6820-7163  cadenza                 xyz.luceolab.cadenza                 D  Before Render Frame!
2024-07-13 15:44:55.003  6820-6845  cadenza                 xyz.luceolab.cadenza                 D  projectM: samples added!
2024-07-13 15:44:55.091  6820-6845  cadenza                 xyz.luceolab.cadenza                 D  projectM: samples added!
2024-07-13 15:44:55.152  6820-7163  libc                    xyz.luceolab.cadenza                 A  Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1398 in tid 7163 (GLThread 328), pid 6820 (uceolab.cadenza)
2024-07-13 15:44:55.205  6820-6845  cadenza                 xyz.luceolab.cadenza                 D  projectM: samples added!
2024-07-13 15:44:55.275  6820-6845  cadenza                 xyz.luceolab.cadenza                 D  projectM: samples added!
2024-07-13 15:44:55.363  6820-6845  cadenza                 xyz.luceolab.cadenza                 D  projectM: samples added!
2024-07-13 15:44:55.455  6820-6845  cadenza                 xyz.luceolab.cadenza                 D  projectM: samples added!
2024-07-13 15:44:55.545  6820-6845  cadenza                 xyz.luceolab.cadenza                 D  projectM: samples added!
2024-07-13 15:44:55.636  6820-6845  cadenza                 xyz.luceolab.cadenza                 D  projectM: samples added!
2024-07-13 15:44:55.652  7172-7172  DEBUG                                                        A  Cmdline: xyz.luceolab.cadenza
2024-07-13 15:44:55.652  7172-7172  DEBUG                                                        A  pid: 6820, tid: 7163, name: GLThread 328  >>> xyz.luceolab.cadenza <<<
2024-07-13 15:44:55.652  7172-7172  DEBUG                                                        A        #00 pc 000000000019b2ec  /data/app/~~Ql2xH6Ji05WAr2OIy3jwCQ==/xyz.luceolab.cadenza-rkdLyXm5lyrPjqgnmkU9aw==/base.apk!libprojectM-4d.so (offset 0xd08000) (BuildId: 9974e8fc4ac06827f835761ca33d5d96f9b14b0e)
2024-07-13 15:44:55.652  7172-7172  DEBUG                                                        A        #01 pc 0000000000196bac  /data/app/~~Ql2xH6Ji05WAr2OIy3jwCQ==/xyz.luceolab.cadenza-rkdLyXm5lyrPjqgnmkU9aw==/base.apk!libprojectM-4d.so (offset 0xd08000) (BuildId: 9974e8fc4ac06827f835761ca33d5d96f9b14b0e)
2024-07-13 15:44:55.652  7172-7172  DEBUG                                                        A        #02 pc 000000000019a5b0  /data/app/~~Ql2xH6Ji05WAr2OIy3jwCQ==/xyz.luceolab.cadenza-rkdLyXm5lyrPjqgnmkU9aw==/base.apk!libprojectM-4d.so (offset 0xd08000) (projectm_opengl_render_frame+36) (BuildId: 9974e8fc4ac06827f835761ca33d5d96f9b14b0e)
2024-07-13 15:44:55.652  7172-7172  DEBUG                                                        A        #03 pc 00000000001b1c30  /data/app/~~Ql2xH6Ji05WAr2OIy3jwCQ==/xyz.luceolab.cadenza-rkdLyXm5lyrPjqgnmkU9aw==/base.apk!libaudio_engine.so (offset 0x3b68000) (cadenza::MilkDropVisualizer::RenderFrame()+24) (BuildId: e8f212d4af31a508aaff627a36f9171231416e58)
2024-07-13 15:44:55.652  7172-7172  DEBUG                                                        A        #04 pc 00000000001c35b0  /data/app/~~Ql2xH6Ji05WAr2OIy3jwCQ==/xyz.luceolab.cadenza-rkdLyXm5lyrPjqgnmkU9aw==/base.apk!libaudio_engine.so (offset 0x3b68000) (cadenza::SoxPlayerApp::MilkDropVisualizerRenderFrame()+104) (BuildId: e8f212d4af31a508aaff627a36f9171231416e58)
2024-07-13 15:44:55.652  7172-7172  DEBUG                                                        A        #05 pc 00000000001d1280  /data/app/~~Ql2xH6Ji05WAr2OIy3jwCQ==/xyz.luceolab.cadenza-rkdLyXm5lyrPjqgnmkU9aw==/base.apk!libaudio_engine.so (offset 0x3b68000) (MilkDropVisualizerRenderFrame(_JNIEnv*, _jobject*)+28) (BuildId: e8f212d4af31a508aaff627a36f9171231416e58)
2024-07-13 15:44:55.652  7172-7172  DEBUG                                                        A        #11 pc 000000000000ce64  <anonymous:73d68e6000> (xyz.luceolab.cadenza.player.PlaybackManager.milkdropVisualizerRenderFrame+0)
2024-07-13 15:44:55.652  7172-7172  DEBUG                                                        A        #16 pc 00000000000079d0  <anonymous:73d69f9000> (xyz.luceolab.cadenza.ui.components.playback.visualisation.Milk

from projectm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.