speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to migrate from module_speak to module_speak_sync?


From: Cameron Wong
Subject: Re: How to migrate from module_speak to module_speak_sync?
Date: Fri, 26 Nov 2021 08:37:06 +0800

I have fixed the "undefined symbol" issue. The solution is adding extern "C" when include module_utils_speak_queue.h.

Building is passed. However, my module crashed at the beginning.

Core was generated by `/usr/libexec/speech-dispatcher-modules/sd_ekho /home/hgneng/.config/speech-disp'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000000000 in ?? ()
[Current thread is 1 (Thread 0x7fc418d53800 (LWP 29871))]
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00005631f1a13e13 in cmd_speak (fd=fd@entry=0, msgtype=msgtype@entry=SPD_MSGTYPE_TEXT) at module_process.c:266
#2  0x00005631f1a141a1 in cmd_speak_text (fd=0) at module_process.c:279
#3  module_process (fd=fd@entry=0, block=block@entry=1) at module_process.c:502
#4  0x00005631f1a15442 in module_loop () at module_utils.c:247
#5  0x00005631f19be60e in main (argc=<optimized out>, argv=<optimized out>) at module_main.c:84

I will try to rewrite my module based on skeleton*.c examples.

Cameron

Cameron Wong <hgneng@gmail.com> 于2021年11月23日周二 上午10:07写道:
Hello Smuel,

Thank you for to update. Error of missing module_utils_speak_queue.h is fixed.

But there are still errors:

/bin/bash ../../libtool  --tag=CXX   --mode=link g++ -g -DESPEAK_NG_INCLUDE  -I../../../src -I../../../utfcpp/source -I../../../sonic -g -O2   -o sd_ekho sd_ekho-ekho.o module_main.o module_readline.o module_process.o module_config.o module_utils.o speak_queue.o ../../../libekho.a -lm -lsndfile -lpulse-simple -pthread -lpulse -pthread   ../../src/common/libcommon.la -dlopen ../audio/spd_pulse.la -dlopen ../audio/spd_alsa.la -dlopen ../audio/spd_oss.la -lespeak-ng  -ldotconf -lglib-2.0 -dlopen force -lc -lc -lltdl -lm
libtool: link: rm -f .libs/sd_ekho.nm .libs/sd_ekho.nmS .libs/sd_ekho.nmT
libtool: link: rm -f ".libs/sd_ekho.nmI"
libtool: link: (cd .libs && gcc -g -O2 -c -fno-builtin "sd_ekhoS.c")
libtool: link: rm -f ".libs/sd_ekhoS.c" ".libs/sd_ekho.nm" ".libs/sd_ekho.nmS" ".libs/sd_ekho.nmT" ".libs/sd_ekho.nmI"
libtool: link: g++ -g -DESPEAK_NG_INCLUDE -I../../../src -I../../../utfcpp/source -I../../../sonic -g -O2 -o sd_ekho sd_ekho-ekho.o module_main.o module_readline.o module_process.o module_config.o module_utils.o speak_queue.o -pthread -pthread .libs/sd_ekhoS.o -Wl,--export-dynamic  ../../../libekho.a -lsndfile -lpulse-simple -lpulse ../../src/common/.libs/libcommon.a -lespeak-ng -ldotconf -lglib-2.0 -lc -lltdl -lm -pthread
/usr/bin/ld: sd_ekho-ekho.o: in function `ekho_callback(short*, int, int, int, int, int)':
/home/hgneng/ekho/speechd-api/src/modules/ekho.cpp:159: undefined reference to `module_speak_queue_stop_requested()'
/usr/bin/ld: /home/hgneng/ekho/speechd-api/src/modules/ekho.cpp:163: undefined reference to `module_speak_queue_before_play()'
/usr/bin/ld: /home/hgneng/ekho/speechd-api/src/modules/ekho.cpp:176: undefined reference to `module_speak_queue_add_end()'
/usr/bin/ld: /home/hgneng/ekho/speechd-api/src/modules/ekho.cpp:173: undefined reference to `module_speak_queue_add_audio(AudioTrack const*, AudioFormat)'
/usr/bin/ld: sd_ekho-ekho.o: in function `module_init':
/home/hgneng/ekho/speechd-api/src/modules/ekho.cpp:87: undefined reference to `module_speak_queue_init(int, char**)'
/usr/bin/ld: sd_ekho-ekho.o: in function `module_speak(char*, unsigned long, SPDMessageType)':
/home/hgneng/ekho/speechd-api/src/modules/ekho.cpp:195: undefined reference to `module_speak_queue_before_synth()'
/usr/bin/ld: sd_ekho-ekho.o: in function `module_stop':
/home/hgneng/ekho/speechd-api/src/modules/ekho.cpp:239: undefined reference to `module_speak_queue_stop()'
/usr/bin/ld: sd_ekho-ekho.o: in function `module_pause':
/home/hgneng/ekho/speechd-api/src/modules/ekho.cpp:246: undefined reference to `module_speak_queue_pause()'
/usr/bin/ld: sd_ekho-ekho.o: in function `module_close':
/home/hgneng/ekho/speechd-api/src/modules/ekho.cpp:253: undefined reference to `module_speak_queue_terminate()'
/usr/bin/ld: /home/hgneng/ekho/speechd-api/src/modules/ekho.cpp:256: undefined reference to `module_speak_queue_free()'
/usr/bin/ld: speak_queue.o: in function `speak_queue_stop_or_pause':
/home/hgneng/ekho/speechd-api/src/modules/speak_queue.c:665: undefined reference to `module_speak_queue_cancel'
collect2: error: ld returned 1 exit status

I know module_utils_speak_queue.c is moved to src/common/speak_queue.c. So I make a symbol link from src/modules/speak_queue.c to src/common/speak_queue.c. However, I don't why it doesn't work. It still complains undefined references. Here is the Makefile part of my module:

EKHO_ROOT = ../../..
sd_ekho_SOURCES = ekho.cpp $(audio_SOURCES) $(common_SOURCES) speak_queue.c
sd_ekho_CXXFLAGS = -g -DESPEAK_NG_INCLUDE $(ESPEAK_NG_CFLAGS) -I$(EKHO_ROOT)/src -I$(EKHO_ROOT)/utfcpp/source -I$(EKHO_ROOT)/sonic
sd_ekho_LDADD = $(EKHO_ROOT)/libekho.a -lm -lsndfile \
        @LIB_PULSEAUDIO@  $(MP3LAME_LIBS) \
        $(top_builddir)/src/common/libcommon.la \
        $(audio_dlopen_modules) \
        $(ESPEAK_NG_LIBS) $(EXTRA_ESPEAK_LIBS) \
        $(common_LDADD)

Do you have any idea?

Cameron

Samuel Thibault <samuel.thibault@ens-lyon.org> 于2021年11月22日周一 上午4:34写道:
Hello,

Cameron Wong, le mer. 17 nov. 2021 09:18:55 +0800, a ecrit:
> I checkout speechd master HEAD, revert to my module code to that works on
> 0.10.0.rc2 and make. Here is the error:
>
> make[3]: Entering directory '/home/hgneng/ekho/speechd-api/src/modules'
>   CXX      sd_ekho-ekho.o
> ekho.cpp:27:10: fatal error: module_utils_speak_queue.h: No such file or
> directory
>    27 | #include "module_utils_speak_queue.h"
>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Ok. I have fixed this issue, could you try again?

Samuel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]