All Downloads are FREE. Search and download functionalities are using the official Maven repository.

doc.scripts.Narrator-multiplettsslaves.html Maven / Gradle / Ivy

The newest version!



	  
	Running speechgen2 using multiple TTS slaves
	



Running speechgen2 using multiple TTS slaves

Configuring multiple TTS slaves on a local system

Running multiple concurrent TTS slaves on a local system only requires a bit of tweaking in the se_tpb_speechgen2/tts/ttsbuilder.xml config file. Simply make sure there are several instances of the the <param name="command" value="..."/> element within the <tts> you which to run concurrently.

The TTS slave instances will receive one sentence to process at a time, and as a slave instance finishes processing a sentence it will receive the next request.

Configuring distributed TTS slaves

This section describes the solution in use at TPB for using distributed TTS slaves. Other solutions are possible, such as running a server on each of the slaves processing the requests from Daisy Pipeline.

Protocol for communicating with the slaves

All communication with the slaves is performed using STDIN and STDOUT.

Each slave reads a single sentence on STDIN and generates the corresponding wav audio. It then writes the length (in bytes) of the wav audio to STDOUT followed by the binary audio data itself. The process is repeated until it reads an empty line which causes the slave to exit.

The TTS adapter (the master) is responsible for sending the text sentences and receiving the wav audio data from the slaves.

Using SSH for passwordless login

In order to run the TTS slave programs on remote systems, the communication is tunneled through SSH. The SSH login must be passwordless in order to be able to run without human intervention.

A keypair needs to be generated without a passphrase on the private key. The public key is installed in ~/.ssh/authorized_keys on the slave machine(s).

A bash script starts an SSH agent and adds the private key before pipeline itself is executed. This way, Daisy Pipeline will be able to execute commands on the remote machine(s) without providing a password:

...
eval `ssh-agent -s`
ssh-add /path/to/private/key
java org.daisy.pipeline.ui.CommandLineUI [parameters...]
kill -KILL $SSH_AGENT_PID
...

Some SSH installations are picky about the file permissions on the private key. Make sure the owner of the file is the only one having read priveliges to it.

Sample ttsbuilder.xml config

In the ttsbuilder.xml config file, the command parameters executes the TTS slave programs on the remote machines using SSH:

<tts>
	<param name="command" value="ssh [email protected] tclsh current/narraFil2.tcl"/>
	<param name="command" value="ssh [email protected] tclsh current/narraFil2.tcl"/>
	<param name="command" value="ssh [email protected] tclsh current/narraFil2.tcl"/>
	<param name="command" value="ssh [email protected] tclsh current/narraFil2.tcl"/>
	<param name="class" value="se_tpb_speechgen2.tts.adapters.FilibusterTTS"/>
	<param name="timeout" value="1200000"/>
	...
</tts>

In this example, four TTS instances are run distributed over three systems with the third system running two TTS instances and the other systems running one TTS instance each. The optimal number of instances to run on each system depends on the amount of system resources needed by each instance. TPB are currently running 15 TTS instances distributed over three systems.





© 2015 - 2025 Weber Informatics LLC | Privacy Policy