[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
dtusb module
From: |
Luke Yelavich |
Subject: |
dtusb module |
Date: |
Fri, 6 Mar 2015 10:40:19 +1100 |
On Fri, Mar 06, 2015 at 08:06:56AM AEDT, Klarich, Terry J. wrote:
> Here's the log info:
>
> Speech-dispatcher.log:
> [Wed Mar 4 17:26:03 2015 : 239741] speechd: Initializing output module
> dtusb with binary /usr/lib64/speech-dispatcher-modules/sd_dtusb and
> configuration /etc/speech-dispatcher/modules/dtusb.conf
> [Wed Mar 4 17:26:03 2015 : 239753] speechd: Output module is logging to
> file /var/log/speech-dispatcher/dtusb.log
> [Wed Mar 4 17:26:03 2015 : 240073] speechd: Module dtusb loaded.
> [Wed Mar 4 17:26:03 2015 : 240092] speechd: Trying to initialize dtusb.
> [Wed Mar 4 17:26:03 2015 : 240107] speechd: Command sent to output
> module: |INIT
> | (0)
>
> I know SD is waiting because if I configure speech.conf to load something
> after sd_dtusb, nothing happens.
>
> Dtusb.log:
> [root at oke11528 speech-dispatcher]# cat dtusb.log
> starting up
> Waiting for INIT
> recieved: INIT
> send: 299-STUSB: Initialized successfully
> Reading configuration file
> send: 299 dtusb version 0.1, ready
>
> At this point, dtusb is waiting for a command. SD has not acknowledged the
> 299 statements.
Ok, looking firstly at the server code, the pipe to the stdout descriptor of
the module is opened, and then the fd is switched to line buffering mode. The
INIT command is sent, which your module is receiving as you noted. The server
then reads stdout. It then waits in a while loop until it receives another line
of data from the module, the 299 status that you're module is sending.
Where things are being held up I am not sure. The server uses the dup() call to
duplicate the file descriptor into another variable, and opens it.with fdopen.
It then enters a while loop to retrieve another line of incoming data. This
while loop checks the validity of the data etc and acts appropriately. Since
you say the server is hanging, I don't think the server gets as far as the
while loop. I suspect its either looping in the fetching of a line of data, or
the duplication and opening the file descriptor.
In the shared module code for other modules, printf is used to send data,
whilst the same code shared between server and modules is used to fetch lines
of data.
Likely the easiest way to debug the goings on with your module is to add some
extradebugging messages to the server code, in src/server/module.c, in the
load_output_module method, around line 261 YOu could also add debugging
messages to src/common/spd_getline.c in the spd_getline method.
Hope this helps.
Luke
- dtusb module, Klarich , Terry J ., 2015/03/05
- dtusb module,
Luke Yelavich <=
- [External] Re: dtusb module, Klarich , Terry J ., 2015/03/06
- [External] Re: dtusb module, Trevor Saunders, 2015/03/15
- [External] Re: dtusb module, Klarich , Terry J ., 2015/03/16
- [External] Re: dtusb module, Trevor Saunders, 2015/03/16
- [External] Re: dtusb module, Luke Yelavich, 2015/03/17
- [External] Re: dtusb module, Luke Yelavich, 2015/03/17