drachtio / drachtio-freeswitch-modules

A collection of open-sourced freeswitch modules that I use in various drachtio applications
MIT License
171 stars 119 forks source link

undefined symbol: dg_transcribe_init** #116

Closed smrdoshi closed 1 year ago

smrdoshi commented 1 year ago

Hi,

We have compiled mod_deepgram_transcribe with FreeSWITCH 1.10 and 1.8 but when we try to load that module, we are getting below error:

freeswitch@ip-172-31-34-207> reload mod_deepgram_transcribe +OK Reloading XML -ERR unloading module [No such module!] -ERR loading module [module load file routine returned an error]

2023-06-02 12:31:01.011646 [CRIT] switch_loadable_module.c:1522 Error Loading module /usr/local/freeswitch/mod/mod_deepgram_transcribe.so /usr/local/freeswitch/mod/mod_deepgram_transcribe.so: undefined symbol: dg_transcribe_init freeswitch@ip-172-31-34-207>

Any help to fix this issue will be highly appreciable.

Thanks for the help in advance.

davehorton commented 1 year ago

Hmm, seems like a build problem of some kind. All I can do it point you to my working packer script that I use to build a freeswitch with my modules:

https://github.com/jambonz/jambonz-infrastructure/blob/main/packer/jambonz-feature-server/scripts/install_freeswitch.sh

smrdoshi commented 1 year ago

Thanks. I will try that.

smrdoshi commented 1 year ago

Hi @davehorton

I tried the installation script but that is giving same error. 2023-06-03 17:56:19.100278 [CRIT] switch_loadable_module.c:1785 Error Loading module /usr/local/freeswitch/mod/mod_deepgram_transcribe.so /usr/local/freeswitch/mod/mod_deepgram_transcribe.so: undefined symbol: dg_transcribe_init

I am using Debian 11. Does this installation script work for Deb 11?

Please let me know.

davehorton commented 1 year ago

Yes, Debian 11 is my preferred distribution.

The build error, whatever it is, is preventing the compiled module from locating a symbol that is in the mod_deepgram source code itself. This module has a dependency on libwebsockets (as you can see from the script) have you built that? What does the build output look like when mod_deepgram is building?

I use this packer script on a weekly basis to build freeswitch AMIs and it works reliably for me so I'm not quite sure what the problem could be

smrdoshi commented 1 year ago

Thanks, I just did reinstallation on fresh Debian 11 and it worked. Thanks for the help and fantastic work.

On another note, I see the below message in FS when connecting with the Deepgram module for transcription. 2023-06-05 07:44:55.567384 [ERR] dg_transcribe_glue.cpp:442 (3) dropping packets!

Is there any buffer or memory size that needs to be set?

davehorton commented 1 year ago

that error means that we packet buffer overflowed; i.e. the arrival rate of packets on the network (generally every 20ms) exceeded the rate at which we were able to send them out over the websocket for long enough that the buffer overflowed. Most often this is caused by the downstream server being slow to read so that we have to throttle sending, or the connection to the downstream server being slow (during which time we buffer packets), or the freeswitch itself slow possibly due to running on an undersized machine