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

Re: [SpeechIO-12] speechd v0.39



> Kyle:  I'd be one of the last people to discourage someone from doing what
> they thing is right in opensource.  But.. at this point, do you believe
> there is any reason why re-implimenting /dev/speech in a kernel module
> would be an improvement over the current implimentation ?  If so, go for
> it, of course, but I'd be curious to hear what you think.

Does the '>>' vs '>' fix the dropping lines problem?  i.e. the perl script
speechd doesn't have to close/re-open the fifo for every writer to the fifo?

The only other issues that we could control over a straight FIFO would be
for multiple writers -- a device can control the writers so that only 1 can
write at a time.  This would allow us to have the 1st writer write, while
all subsequent writers would block untill the 1st one has closed the fifo.
Under this paradigm, if a writer doesn't relinquish the fifo, the all the
others would remain blocked.

Another possibility would be to have the device driver break things by
newline, and multiplex the input that way -- i.e. multiple simultaneous 
writers could have the file open, but when they write to it, the writes
are managed atomicly using lines as the atoms.  So you'd get a mix of lines,
but never a hash/splitting of lines of text.  This also has issues with
a process writing text, and not the end of line causing all the others to
remain blocked.

The original issue I was attempting to solve was the close/re-open.  If
someone else does something like "echo 'my name is..' > /dev/speech" without
using catspeach, then wouldn't this close the FIFO and cause the same problem
we saw before?  i.e. we've only solved the loss of lines problem using '>>'
if everyone follows that convention? 

If I do the following:

[user@host dir]$ sudo mkfifo spk
[user@host dir]$ cat spk

(then, from another terminal)
[user@host dir]$ cat > spk
some text^M
^D
[user@host dir]$

the 'cat' in the first terminal exits.  This is the classic problem we've
seen before.  Even if I do a 'cat >> spk' in the second terminal, when I
send the EOF (CTRL+D), the first cat closes.  This is not the behavior we 
want?  Or am I missing something?

The device driver code shields the reading process from writers who close
the device.  The reader doens't receive the EOF when writers close the
device file.  This allows us to open the device file (for which we were
using a FIFO for before) and never close it, because now we don't need to.

Is this the kind of solution we were looking for?


(this is the end of my comments)

Somehow I feel that I might be missing something...

k

> Today's improvements in I/O make it a lot cleaner, in my opinion.
> 
> Those of you using esd, I'm sure have noticed that when several things are
> said in rapid sequence, the speech output overlaps.  Festival speaks over
> itself.  I'd guess that the creators of Festival assumed that it would
> always be outputting to a standard /dev/dsp device, which can only handle
> 1 sound at a time, so the sounds wait in line until it's available, and
> don't overlap.  
> 
> I tried to fix this problem.  I was hoping I'd be able to use the info
> that Festival returns across the TCP socket (as discovered by Michael).  
> I was certain that at least one of the bits of information would be
> returnd right after Festival finished speaking the text that had just been
> submitted to it.  Unfortunately, this does not seem to be the case. All
> the responces happen immediately after the text is submitted, long before
> it is finished being spoken.  So I can't have speechd wait till Festival's
> finished chewing till I feed it more text.  Anybody else have any ideas ?
> 
> 
> Gareth: you really gotta take a look at how the string substitution is
> implimented.  It's sweet.  It has very little to do with how you
> implemented it (just that both of us stored the data in a hash).  I would
> never have come up with this solution myself... at least not yet.  Abigail
> in #perl assisted me.
> 
> 
> Darxus
> v0.32 7162 Aug  7 18:18:18 EDT 1999
>  -e flag & $use_esd speechdrc variable, to use the Enlightened Sound
>  Daemon (esd)
> 
> Darxus
> v0.34 7226 Aug  7 18:46:13 EDT 1999
>  $daemonize redirects output to $logfile instead of /dev/null.
> 
> Darxus
> v0.35 7237 Aug  7 19:11:21 EDT 1999
>  Only open /dev/speech once (in speechd & catspeech).  Changed catspeech
>  to open /dev/speech for appending instead of overwriting.
> 
> Darxus
> v0.36 7438 Aug  7 22:05:31 EDT 1999
>  Display more of the interaction between speechd & festival.
> 
> Darxus
> v0.37 7622 Aug  7 23:59:12 EDT 1999
>  String substitution !!  (w/ a little help from ircspeak).  Ex:  "31337"
>  is converted to "eleet" before it's spoken.
> 
> Darxus
> v0.38 7623 Aug  8 00:18:12 EDT 1999
>  Fixed case-insensitivity of string substitution.
> 
> Darxus
> v0.39 7623 Aug  8 00:32:05 EDT 1999
>  Catch SIGHUP & reload /etc/speech.sub.
> 
> 
> __________________________________________________________________
> PGP fingerprint = 03 5B 9B A0 16 33 91 2F  A5 77 BC EE 43 71 98 D4
>             darxus@op.net / http://www.op.net/~darxus
>                          Far Beyond Reason
> 
> 
> 
------------------------------------------------------------------------------
"Perl combines all of the worst aspects of BASIC, C and line noise." 
    -- Keith Packard <keithp@ncd.com>
mortis@voicenet.com                            http://www.voicenet.com/~mortis
------------------------------------------------------------------------------