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: Mon, 29 Nov 2021 09:50:12 +0800

Hi Samuel,

Thank you for your help and advice!

Here is my module code: https://github.com/hgneng/speechd/blob/master/src/modules/ekho.cpp

Here is the output of `nm sd_ekho | grep module`.

$ nm sd_ekho|grep module
0000000000263220 T module_add_config_option
00000000003ec338 B module_audio_id
00000000002632d0 T module_audio_init
00000000003ec360 b module_audio_pars
0000000000262000 T module_audio_set
0000000000260fd0 T module_audio_set_server
0000000000260ac0 t module_audio_set_through_server
00000000002629e0 T module_child_dp_close
00000000002629c0 T module_child_dp_init
0000000000262ae0 T module_child_dp_read
0000000000262a00 T module_child_dp_write
00000000002606b0 T module_close
0000000000261910 T module_config
00000000003ec2a0 B module_dc_options
0000000000262330 T module_debug
0000000000262470 T module_get_message_part
00000000003ec280 B module_index_mark
000000000025ffc0 T module_init
0000000000209bb0 t module_init.cold
000000000025fc60 T module_list_voices
000000000025fb70 T module_load
00000000002622a0 T module_loglevel_set
0000000000262430 T module_loop
00000000002634f0 T module_marks_add
0000000000263570 T module_marks_clear
00000000002634c0 T module_marks_init
00000000002639e0 T module_marks_stop
00000000003ec290 B module_name
00000000003ec298 B module_num_dc_options
00000000002629a0 T module_parent_dp_close
0000000000262980 T module_parent_dp_init
0000000000262b90 T module_parent_dp_read
0000000000262a70 T module_parent_dp_write
0000000000261a20 t module_parent_dp_write.part.0
0000000000262ef0 T module_parent_wait_continue
0000000000262c40 T module_parent_wfork
0000000000260680 T module_pause
0000000000261020 T module_process
0000000000260790 T module_readline
0000000000263160 T module_recode_to_iso
0000000000261860 T module_report_event_begin
0000000000261880 T module_report_event_end
00000000002618c0 T module_report_event_pause
00000000002618a0 T module_report_event_stop
00000000002618e0 T module_report_icon
0000000000261830 T module_report_index_mark
0000000000260b00 T module_send
0000000000261cb0 T module_set
00000000003ec26c b module_should_stop
0000000000262fa0 T module_sigblockall
0000000000263090 T module_sigblockusr
0000000000263030 T module_sigunblockusr
                 w module_speak
0000000000261000 T module_speak_error
0000000000260fe0 T module_speak_ok
0000000000264790 T module_speak_queue_add_audio
0000000000264710 T module_speak_queue_add_end
00000000002648d0 T module_speak_queue_add_mark
0000000000264950 T module_speak_queue_add_sound_icon
0000000000264660 T module_speak_queue_before_play
00000000002645e0 T module_speak_queue_before_synth
0000000000260620 T module_speak_queue_cancel
00000000002649e0 T module_speak_queue_flush
0000000000264bb0 T module_speak_queue_free
00000000002644f0 T module_speak_queue_init
0000000000264ac0 T module_speak_queue_pause
0000000000264a20 T module_speak_queue_stop
00000000002649d0 T module_speak_queue_stop_requested
0000000000264b00 T module_speak_queue_terminate
                 w module_speak_sync
00000000003ec240 B module_stdout_mutex
0000000000260650 T module_stop
00000000002635e0 T module_strip_head_silence
0000000000262940 T module_strip_punctuation_default
0000000000262660 T module_strip_punctuation_some
0000000000263710 T module_strip_silence
0000000000262710 T module_strip_ssml
0000000000263680 T module_strip_tail_silence
00000000002630f0 T module_terminate_thread
0000000000263470 T module_tts_output
0000000000263730 T module_tts_output_marks
00000000002615b0 T module_tts_output_server
00000000002600c0 T _Z12module_speakPcm14SPDMessageType
0000000000209bc5 t _Z12module_speakPcm14SPDMessageType.cold

Here is the complete output of /var/log/speech-dispatcher/ekho.log:

$ cat ekho.log
 Mon Nov 29 09:27:00 2021 [785442]: Configuration (pre) has been read from "/home/hgneng/.config/speech-dispatcher/modules/ekho.conf"

 Mon Nov 29 09:27:00 2021 [785489]: module_init
current dir: /home/hgneng/ekho/speechd-api
EKHO_DATA_PATH: /usr/local/share/ekho-data
EkhoImpl::init
 Mon Nov 29 09:27:00 2021 [786295]: speak_queue Creating new thread for stop or pause.
 Mon Nov 29 09:27:00 2021 [786371]: speak_queue Creating new thread for playback.
 Mon Nov 29 09:27:00 2021 [786557]: Opening audio output system
 Mon Nov 29 09:27:00 2021 [787956]: Opening audio output system
 Mon Nov 29 09:27:00 2021 [790591]: speak_queue Playback thread starting.......
 Mon Nov 29 09:27:00 2021 [790669]: speak_queue Stop or pause thread starting.......
 Mon Nov 29 09:27:00 2021 [794087]: Using pulse audio output method

Here is the header part of /var/log/speech-dispatcher/ekho.log in 0.10.0.rc2 which works fine:

 Mon Apr 27 14:55:43 2020 [564303]: Configuration (pre) has been read from "/home/hgneng/.config/speech-dispatcher/modules/ekho.conf"
 
 Mon Apr 27 14:55:43 2020 [564342]: module_init
current dir: /home/hgneng
EKHO_DATA_PATH: /usr/local/share/ekho-data
EkhoImpl::init
 Mon Apr 27 14:55:43 2020 [566930]: speak_queue Creating new thread for stop or pause.
 Mon Apr 27 14:55:43 2020 [566998]: speak_queue Creating new thread for playback.
 Mon Apr 27 14:55:43 2020 [567112]: CMD: <AUDIO
>
 Mon Apr 27 14:55:43 2020 [567185]: Opening audio output system
 Mon Apr 27 14:55:43 2020 [567358]: speak_queue Playback thread starting.......
 Mon Apr 27 14:55:43 2020 [567399]: speak_queue Stop or pause thread starting.......
 Mon Apr 27 14:55:43 2020 [581063]: Using pulse audio output method
 Mon Apr 27 14:55:43 2020 [581167]: CMD: <LOGLEVEL
>
 Mon Apr 27 14:55:43 2020 [993147]: CMD: <SET
>
 Mon Apr 27 14:55:43 2020 [995286]: CMD: <SPEAK
>
 Mon Apr 27 14:55:43 2020 [996142]: module_speak(<speak>i-bus reader 已启动</speak>, 37, 0)

Comparing with the two ekho.log, I find that there are 2 lines of in the new version:
 Mon Nov 29 09:27:00 2021 [787956]: Opening audio output system

Is it the problem where locates?

Cameron

Samuel Thibault <samuel.thibault@ens-lyon.org> 于2021年11月28日周日 下午11:18写道:
Cameron Wong, le ven. 26 nov. 2021 08:37:06 +0800, a ecrit:
> #0  0x0000000000000000 in ?? ()
> #1  0x00005631f1a13e13 in cmd_speak (fd=fd@entry=0, msgtype=msgtype@entry=
> SPD_MSGTYPE_TEXT) at module_process.c:266
>
> I will try to rewrite my module based on skeleton*.c examples.

You'd very most probably just meet exactly the same issue with
module_speak_sync. Really, let's just fix the bugs, not circumvent them
and get bitten again by them later on.

Samuel

reply via email to

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