saussact / openhab

Automatically exported from code.google.com/p/openhab
0 stars 0 forks source link

TTS doesn't work on Linux #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It outputs this error:

LINE UNAVAILABLE: Format is PCM_SIGNED 16000.0 Hz, 16 bit, mono, 2 bytes/frame, 
big-endian

It's a known Linux/Java sound bug. More info at: 
http://ondra.zizka.cz/stranky/programovani/java/misc/freetts-line-unavailable-cl
asscastexception-kevinvoicedirectory-error-opening-zipfile.texy

Original issue reported on code.google.com by mishoboss on 26 Jul 2011 at 7:23

GoogleCodeExporter commented 9 years ago
Any news on this issue?

Original comment by mishoboss on 29 Nov 2011 at 10:48

GoogleCodeExporter commented 9 years ago
I have solved it by adding the "speech.properties" file into the user home 
directory. The file contains one line:
FreeTTSSynthEngineCentral=com.sun.speech.freetts.jsapi.FreeTTSEngineCentral 

Original comment by florian....@gmail.com on 11 Feb 2012 at 5:30

GoogleCodeExporter commented 9 years ago
Thanks Florian!
Does it have to be in the user home directory or could we somehow put this file 
into the freetts bundle, so that the user does not have to bother about it?

Original comment by kai.openhab on 12 Feb 2012 at 5:25

GoogleCodeExporter commented 9 years ago
At the bottom of the page 
(http://freetts.sourceforge.net/docs/jsapi_setup.html) there's a note on it.
But now, I’m not sure if this really solves the problem. After removing the 
property file it still works. And I think you don't use the jsapi.

Original comment by florian....@gmail.com on 13 Feb 2012 at 12:36

GoogleCodeExporter commented 9 years ago
FreeTTS does not work for me under Ubuntu 12.04. It deadlocks during 
initialization. I get exactly the same as this:

http://stackoverflow.com/questions/5501394/freetts-no-audio-linux-ubuntu-no-erro
rs

This is not a openHAB issue but in my case, this blocks all threads invoking 
"say()" and openHAB doesn't come up correctly. My current workaround is to 
close (not load) "org.openhab.io.multimedia.tts.freetts" and thus not have TTS.

$ java -version
java version "1.7.0_03-icedtea"
OpenJDK Runtime Environment (IcedTea7 2.1) (7~u3-2.1-1ubuntu3)
OpenJDK 64-Bit Server VM (build 22.0-b10, mixed mode)

Daemon Thread [Thread-22] (Suspended)   
    Unsafe.park(boolean, long) line: not available [native method]  
    LockSupport.park(Object) line: 186  
    Semaphore$NonfairSync(AbstractQueuedSynchronizer).parkAndCheckInterrupt() line: 834 
    Semaphore$NonfairSync(AbstractQueuedSynchronizer).doAcquireSharedInterruptibly(int) line: 994   
    Semaphore$NonfairSync(AbstractQueuedSynchronizer).acquireSharedInterruptibly(int) line: 1303    
    Semaphore.acquire() line: 317   
    PulseAudioSourceDataLine(PulseAudioDataLine).connect(Stream, int) line: 274 
    PulseAudioSourceDataLine(PulseAudioDataLine).open(AudioFormat, int) line: 102   
    PulseAudioSourceDataLine.open(AudioFormat, int) line: 75    
    JavaStreamingAudioPlayer.openLine(AudioFormat) line: 198    
    JavaStreamingAudioPlayer.begin(int) line: 410   
    LPCResult.playWaveSamples(AudioPlayer, FreeTTSSpeakable, int) line: 505 
    LPCResult.playWave(AudioPlayer, Utterance) line: 403    
    AudioOutput.processUtterance(Utterance) line: 65    
    CMUDiphoneVoice(Voice).runProcessor(UtteranceProcessor, Utterance, BulkTimer) line: 595 
    CMUDiphoneVoice(Voice).outputUtterance(Utterance, BulkTimer) line: 536  
    Voice.access$200(Voice, Utterance, BulkTimer) line: 81  
    Voice$1.run() line: 496 
Daemon Thread [PulseAudio Eventloop Thread] (Suspended) 
    JavaStreamingAudioPlayer$JavaStreamLineListener.update(LineEvent) line: 648 
    PulseAudioSourceDataLine(PulseAudioLine).fireLineEvent(LineEvent) line: 76  
    PulseAudioDataLine$1.update() line: 175 
    Stream.stateCallback() line: 564    
    EventLoop.native_iterate(int) line: not available [native method]   
    EventLoop.run() line: 141   
    Thread.run() line: 722  

Original comment by cyril.ja...@gmail.com on 1 Apr 2012 at 8:28

GoogleCodeExporter commented 9 years ago
I've patched freetts.jar according to StackOverflow article, it works!

Original comment by m...@lightoze.net on 21 Nov 2012 at 4:22

Attachments:

GoogleCodeExporter commented 9 years ago
This is a patched source file, if somebody is interested.

Original comment by m...@lightoze.net on 21 Nov 2012 at 4:23

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks, I have included your patched jar in the product: 
http://code.google.com/p/openhab/source/detail?r=956d6fd4e6551f346852c5982468ee9
670e0dcbc

@Mihail: As you originally created the issue, would you be so kind to retest it 
and confirm that it works for you?

Original comment by kai.openhab on 24 Nov 2012 at 9:38

GoogleCodeExporter commented 9 years ago
I finally have some KNX devices and have started experimenting with them. I can 
also use openHAB in a "real" setup now. I will check this evening if the TTS 
works now under Ubuntu 12.10 and will report here.

Original comment by cyril.ja...@gmail.com on 29 Nov 2012 at 9:18

GoogleCodeExporter commented 9 years ago
Just tested the latest build (#318) and TTS is working as expected under Ubuntu 
12.10.

Original comment by cyril.ja...@gmail.com on 29 Nov 2012 at 9:52

GoogleCodeExporter commented 9 years ago
Great, thanks for testing!

Original comment by kai.openhab on 29 Nov 2012 at 9:57