project-spiel / libspiel

Speech synthesis client library
https://project-spiel.org/libspiel
GNU Lesser General Public License v2.1
39 stars 4 forks source link

assertion failed: (object == G_OBJECT (sRegistry)) when no session bus #55

Open otrocodigo opened 4 months ago

otrocodigo commented 4 months ago

Compile and install libspiel and libspeechprovider on Fedora Linux 39.

Create a simple C program, which compiles but fails to execute.

...
#include <spiel/spiel.h>
#include <spiel/spiel-speaker.h>

gint main(gint argc, gchar **argv) {
  GError *error = NULL;
  SpielSpeaker *speaker;
  GListModel * providers;
  speaker = spiel_speaker_new_sync(NULL, &error);

  if (error)
    g_error("Error: %s\n", error->message);

  return EXIT_SUCCESS;
}
ERROR:../libspiel/spiel-registry.c:436:spiel_registry_finalize: assertion failed: (object == G_OBJECT (sRegistry))
Bail out! ERROR:../libspiel/spiel-registry.c:436:spiel_registry_finalize: assertion failed: (object == G_OBJECT (sRegistry))
Aborted

I don't know if I am failing in the implementation because I can't find a C program to use as a reference. I would appreciate the help.

eeejay commented 4 months ago

That is very strange. I don't know why the registry would be destroyed at that stage. FYI, there is a command line C program in utils/spiel.c for your reference, along with a few C tests. Any luck with those?

eeejay commented 4 months ago

I tried your program locally and it worked alright.

andyholmes commented 4 months ago

Worked okay for me too, although I guess it's possible a compiler might be doing something funky (I used gcc-14.0.1).

My wild guess it that the G_OBJECT () cast might be failing, since it's already chained up and that causes the assertion failure. If that's true, maybe the cast failure isn't printed before the program aborts?

otrocodigo commented 4 months ago

@eeejay @andyholmes My oversight: I was working inside a container, which does not have access to X11 and dbus.

I tested using 'toolbox' and it works.

Sorry for the inconvenience.

andyholmes commented 4 months ago

@eeejay I guess in that case, it's probably that if the registry fails initialization, when the "temporary" object is finalized it has not been assigned to sRegistry?

eeejay commented 4 months ago

I think we should keep this open because the error message is useless and it should be better than that.

otrocodigo commented 4 months ago

@eeejay Is there a channel to ask questions about the project? For example, I would like if you can indicate a folder with the onnx models for 'piper'.

eeejay commented 4 months ago

gnome:#a11y on matrix works for now

otrocodigo commented 4 months ago

gnome:#a11y on matrix works for now

Thank you. I already joined.