Commit graph

278 commits

Author SHA1 Message Date
Alexander Epaneshnikov
d1f7e2384b espeak: do not call espeak_Cancel() while holding queue_guard
When a flush is requested, the espeak thread called stop_speech() ->
espeak_Cancel() with queue_guard held.  espeak_Cancel() waits for
espeak-ng's internal say thread to acknowledge the cancellation, and
that thread can be blocked indefinitely inside a blocking ALSA call
(snd_pcm_writei/snd_pcm_drain on a wedged device, as seen with EBUSY
errors).  In that case queue_guard was held forever, which in turn:

- blocked the signal thread on pthread_mutex_lock(), so SIGINT/SIGTERM
  appeared to be ignored and only SIGKILL could end the process;
- left the softsynth thread stuck in request_espeak_stop(), so
  /dev/softsynth was no longer drained, speakup's kernel buffer filled
  up, and console output (e.g. dmesg) stalled.

Release queue_guard around the espeak_Cancel() call.  This is safe
because the only queue producer, the softsynth thread, is blocked
waiting for stop_acknowledged for as long as stop_requested is set, so
the queue cannot be mutated concurrently.

Helps: https://github.com/linux-speakup/espeakup/issues/45
Helps: https://github.com/linux-speakup/espeakup/issues/62

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-29 10:29:36 +02:00
Copilot
dc1f1b9efa
Fix deprecated Meson setup command warning in README (#61)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: alex19EP <4889846+alex19EP@users.noreply.github.com>
2025-08-22 14:12:32 +03:00
Samuel Thibault
fa848f509e set_punctuation: Fix punctuation levels values
They do not actually follow the espeak values (and have no reason to,
anyway).
2025-05-29 01:00:18 +03:00
Samuel Thibault
98dc103749 queue_process_entry: Avoid leaving error uninitialized
CMD_PAUSE was not actually setting error to EE_OK, and the default case,
even if it is not supposed to happen, should set error to something sane.
2025-05-29 00:59:51 +03:00
Alexander Epaneshnikov
d7c06a6f9f
meson: switch from deprecated functions (#49) 2022-03-11 14:51:28 +01:00
Samuel Thibault
108c28ae08 Throttle on EE_BUFFER_FULL errors
When espeak returns EE_BUFFER_FULL we should just wait a bit before
retrying. Also, we don't want to lose the current entry. We however want
to wake up as soon as possible on stop request.
2022-03-03 05:53:04 +03:00
Brandon McGinty
78e561fae9 use correct case for --pid-file option
This permits --pid-file to be specified.
The getopt_long option was looking for a lowercase p,
and the pid-file option used an uppercase P.
This meant that pid-file was never settable.
2022-02-14 16:14:23 +03:00
Samuel Thibault
c99bfb8e45 Request systemd to protect espeakup from OOM
Otherwise it might get killed on memory pressure.
2022-02-10 18:37:23 -06:00
Samuel Thibault
ca234f2122 Request systemd to prioritize espeakup
So speech doesn't get choppy on a loaded system.

As suggested by Nick Gawronski.

This fixes #46.
2022-02-10 18:30:08 -06:00
Samuel Thibault
316e4fc51d softsynth: on error, be clear we are talking about /dev/softsynth 2021-08-21 16:30:32 +03:00
William Hubbs
e858481c0a use dupeString in command line processing 2021-07-07 22:16:25 -05:00
William Hubbs
8f18ad7f88 add dupeString wrapper function
This function calls strdup and exits on failure.
2021-07-07 22:16:25 -05:00
William Hubbs
b7282c1a90 use systemd modprobe service for speakup_soft 2021-07-03 23:37:00 +03:00
William Hubbs
f077d0c042 format build files consistently 2021-07-03 03:53:58 +03:00
Christopher Brannon
3794e8e74b Update my email address in the docs. 2021-06-20 15:58:20 +03:00
Alexander Epaneshnikov
569e9f5b0e
bump version v0.90 2021-06-19 10:26:15 +03:00
Alexander Epaneshnikov
c50e4eb088
remove command line from README (#33)
now when we have man documentation in markdown, no need to store the same
information in two places.
2021-06-19 10:05:57 +03:00
Alexander Epaneshnikov
e13ceb3cce edit by hand
more formatting improvements
2021-06-19 01:57:49 -05:00
Alexander Epaneshnikov
c528913ad9 format code 2021-06-19 01:57:49 -05:00
Alexander Epaneshnikov
dd2dcb68bf use clang-format for code styling 2021-06-19 01:57:49 -05:00
Alexander Epaneshnikov
ca1d6b42e2 generate man page from markdown
Use ronn to convert markdown to a man page
This simplifies maintaining the documentation.

This fixes #31.
2021-06-19 01:34:18 -05:00
Alexander Epaneshnikov
0c09fe5449
switch to meson (#30)
switch to a meson-based build system
2021-06-18 21:53:04 -05:00
William Hubbs
30ef2145e7 remove TODO
This file is no longer needed since we have an official bug tracker.
2021-06-15 09:19:43 +03:00
William Hubbs
2d8d2c55c0 rename autostart directory to services 2021-06-15 09:19:18 +03:00
Alexander Epaneshnikov
c69d98cde6 clean makefile
get rid of unnecessary targets. add warning options.
2021-06-15 06:08:50 +03:00
Alexander Epaneshnikov
2f3d171863 update issue url 2021-06-15 06:08:50 +03:00
Alexander Epaneshnikov
512a958dad remove changelog
we can do better than that.
2021-06-15 06:08:50 +03:00
Alexander Epaneshnikov
335d748a63 new src structure
to make it more understandable and convenient for further improvements.
2021-06-15 06:08:50 +03:00
Alexander Epaneshnikov
3fb775cc33 load speakup_soft kernel module 2021-06-14 22:14:47 +03:00
Alexander Epaneshnikov
6689948a8a add espeakup manual in unit file 2021-06-14 22:14:47 +03:00
Alexander Epaneshnikov
b5c1aef849 add systemd unit 2021-06-14 22:14:47 +03:00
Alexander Epaneshnikov
201ae667ee
link with espeak-ng by default (#25) 2021-06-14 20:45:53 +02:00
William Hubbs
a464461f0e convert README to markdown 2021-06-14 21:12:33 +03:00
William Hubbs
9ccabf55b6 update README
- Remove the unnecessary references to tarballs since this is now a
  standard github project.

- Point people to the bug tracker for filing bugs.
2021-06-14 21:12:33 +03:00
Samuel Thibault
ee05f278f2 Add support for indexing 2021-06-14 20:47:04 +03:00
Alexander Epaneshnikov
70ae4dece7 enlaarge voice buf
this will fix #9
2021-06-14 20:41:42 +03:00
Samuel Thibault
171bb517a0 Let espeak choose the buffer size
The default is already quite small, and choosing a too small one may
lead to broken speech.

Fixes #13
2021-06-14 20:37:53 +03:00
Alexander Epaneshnikov
7159441731
Merge pull request #19 from sthibaul/alsa-volume
Support setting ALSA volume in addition to espeak volume
2021-06-14 20:09:19 +03:00
Alexander Epaneshnikov
7cfba0878b
Merge pull request #18 from sthibaul/range
Support pitch range configuration
2021-06-14 20:01:52 +03:00
Alexander Epaneshnikov
1c3285d249
Merge pull request #15 from sthibaul/pause
pass '\n' to espeak too for e.g. proper pause
2021-06-14 19:53:15 +03:00
Samuel Thibault
53665b8eab Support setting ALSA volume in addition to espeak volume
This allows to make sure to reach the maximum volume permitted by the
hardware. This makes the default volume (5) set ALSA volume to 80%, like
the default ALSA scripts do.

This is not enabled by default, since users will probably want to use a
mixer to fine-tune their volume. But for e.g. installation images, this
allows to spare the use of a mixer and just use the speakup volume
control.
2020-04-29 02:48:39 +02:00
Samuel Thibault
a9657bbb2b Support pitch range configuration
This allows to let users choose expressiveness of their synth.
2020-04-25 21:47:00 +02:00
Samuel Thibault
1e31008091 pass '\n' to espeak too for e.g. proper pause 2019-08-18 20:30:45 +02:00
Samuel Thibault
e69d61b2d8 signal: Add missing mutex_lock/unlock around the while loop
This fixes #12.
2018-07-11 16:32:42 -05:00
Samuel Thibault
5f01999726 Make empty voice name select the default voice
See http://bugs.debian.org/872194
This fixes #11.
2018-07-11 16:14:52 -05:00
Samuel Thibault
5339da3144 Support audio pauses
When the Linux console is e.g. switched to a graphical VT, the kernel
emits \x01P to notify that it is not able to read the screen any more,
and the software synthesis can thus release the audio card, for other
screen readers to take over.

This implements it by adding a paused_espeak variable that tracks
whether we have suspended espeak.  When more text comes, we can simply
reinitialize espeak.

This fixes #10.
2018-07-11 16:02:44 -05:00
Samuel Thibault
a5b655ddb0 fix speaking spaces
Espeak doesn't speak spaces unless it is specifically told to do so.
2017-03-14 21:56:31 -05:00
Samuel Thibault
b7fe3af320 add unicode variant of /dev/softsynth 2017-03-14 21:52:14 -05:00
William Hubbs
e21b746eb9 version 0.81 2017-03-14 21:45:26 -05:00
William Hubbs
e55f16b7fd Update ChangeLog v0.80 2016-07-25 10:25:09 -05:00