Commit Graph
10 Commits
Author SHA1 Message Date
Samuel Thibault c523856d4a Fix testsuite with /bin/sh being bash
With bash, echo "a\nb" will not interpret \n, while with dash, echo will
interpret \n. bash's echo would need -e, but dash does not know that
option and just prints it.

We can however just put \n litteraly in the script, both bash and dash
will understand it.
2020-02-19 08:40:49 +02:00
Samuel Thibault 171e8a4e09 Fix testsuite with /bin/sh being bash
With bash, echo "a\nb" will not interpret \n, while with dash, echo will
interpret \n. bash's echo would need -e, but dash does not know that
option and just prints it.

We can however just put \n litteraly in the script, both bash and dash
will understand it.
2020-01-04 15:27:49 +01:00
Samuel Thibault 03ec605432 Use $(CURDIR) instead of $(PWD) 2019-12-03 22:59:06 +01:00
Samuel Thibault d3ecd919e4 Factorize mbrola build rule 2019-12-03 22:58:31 +01:00
Samuel Thibault 665b9929df Make sure to ship ucd/ucd.h 2019-12-03 19:53:00 +00:00
Samuel Thibault 0328b8ed06 autogen: make shippable copies instead of most-probably-broken symlinks 2019-12-03 20:06:32 +01:00
Samuel Thibault 04a8a619b6 Fix termination test in event processing
e13b602 ("Avoid using pthread_cancel") introduced a bogus termination test,
this fixes it.

Fixes #572
2018-12-19 15:54:21 +01:00
Samuel Thibault e13b602ce0 Avoid using pthread_cancel
If a thread is cancelled while it holds a mutex, other threads waiting for
the mutex will never be woken, even if destroying the mutex, thus
leading to a deadlock.

Better just make the thread loops have a proper exit case than risking
the tricky semantic of pthread_cancel.
2018-11-13 01:55:17 +01:00
Samuel Thibault d844a47804 Make it possible to restart speech even when audio open failed once
When notably the audio card is busy, we should report the issue to the
application, but still permit the application to retry submitting text
to synth, and eventually succeed to open it.

This change simply fixes the update of the out_samplerate variable to track
whether audio is open, and if not when text is submitted by the application,
try again to open it.
2018-05-03 21:27:02 +02:00
Samuel Thibault f75c5ccbe3 Fix out of bound access when buffer size is odd
Valgrind reports

==20307== Invalid write of size 1
==20307==    at 0x4E856FE: Wavegen.part.1 (wavegen.c:880)
==20307==    by 0x4E86682: Wavegen (wavegen.c:670)
==20307==    by 0x4E86682: Wavegen2 (wavegen.c:1235)
==20307==    by 0x4E86682: WavegenFill2 (wavegen.c:1317)
==20307==    by 0x4E86CA7: WavegenFill (wavegen.c:1398)
==20307==    by 0x4E7093F: Synthesize (speech.c:442)
==20307==    by 0x4E712E0: sync_espeak_Synth (speech.c:549)
==20307==    by 0x4E8A5C0: process_espeak_command (espeak_command.c:317)
==20307==    by 0x4E8B387: say_thread (fifo.c:333)
==20307==    by 0x50E85A9: start_thread (pthread_create.c:463)
==20307==    by 0x53F5CBE: clone (clone.S:95)
==20307==  Address 0xad5e1bd is 0 bytes after a block of size 2,205 alloc'd
==20307==    at 0x4C2CABF: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==20307==    by 0x4C2EE04: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==20307==    by 0x4E70CFC: espeak_ng_InitializeOutput (speech.c:286)
==20307==    by 0x4E6176E: espeak_Initialize (espeak_api.c:67)
==20307==    by 0x10A5D8: initialize_espeak (espeak.c:303)
==20307==    by 0x109D1D: main (espeakup.c:201)
==20307==

Indeed, the out_ptr >= out_end test is not enough: it only checks that
one byte can fit the buffer, while klatt and wavegen produce two bytes.
2018-05-03 21:04:53 +02:00