festival can't do text-to-speech (Linux: can't open /dev/dsp)

  • Done
  • quality assurance status badge
Details
2 participants
  • Luis Felipe
  • Tobias Geerinckx-Rice
Owner
unassigned
Submitted by
Luis Felipe
Severity
normal

Debbugs page

Luis Felipe wrote 3 years ago
(name . bug-guix@gnu.org)(address . bug-guix@gnu.org)
XtRRmyjG-w4_zUEm7baH0MPkwwNXDEiAu6N37lh7XpOlID1-KC-kMcjpyDtebtK3vEdfyRDRQN5-e6s4hZ5qNnh2JuU7xixnOnqxxGb6NcA=@protonmail.com
STEPS TO REPRODUCE

1. guix shell festival
2. echo Hello speech | festival --tts

EXPECTED RESULT

You can hear festival utters "Hello speech".

UNEXPECTED RESULT

There is no speech, and the following error is printed:

Linux: can't open /dev/dsp

ADDITIONAL INFORMATION

Using flite, a synthesizer based on festival, just works. Also, following the steps in Debian produce the expected result.

SYSTEM INFORMATION

OS: Guix System f52719dfad7b7d3beb2b1211b6846196f3590823 x86_64

Kernel: 5.13.15-gnu1



---
Luis Felipe López Acevedo
Attachment: signature.asc
Tobias Geerinckx-Rice wrote 3 years ago
(name . Luis Felipe)(address . luis.felipe.la@protonmail.com)
878rwxc0kk.fsf@nckx
Luis Felipe,

Luis Felipe via Bug reports for GNU Guix 写道:
Toggle quote (6 lines)
> UNEXPECTED RESULT
>
> There is no speech, and the following error is printed:
>
> Linux: can't open /dev/dsp

Attached is a patch that makes Festival work with Linux (ALSA) by
default… but it's a bit odd that we'd've been shipping a ‘broken’
Festival from day 0?

(TIL that our default Linux-Libre configurations enable legacy OSS
emulation so this could probably be made to work with the right
modprobes. Still, this should not be required without good
reason, and plenty of OSS-free kernels exist.)

I'd like to hear from existing Festival/Guix users if any actually
do.

Until then, you can easily hack around it:

$ cat <<EOF > ~/.festivalrc
(Parameter.set 'Audio_Method 'Audio_Command)
(Parameter.set 'Audio_Command
"aplay -q -c 1 -t raw -f s16 -r \$SR \$FILE")
EOF
$ echo sup | festival --tts

From [0] of all places. aplay is part of alsa-utils.

Kind regards,

T G-R

[0]:
From 75c12a0838f4355c99ae3ee7f2bf8809be988f9f Mon Sep 17 00:00:00 2001
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Mon, 6 Dec 2021 14:25:08 +0100
Subject: [PATCH] gnu: festival: Support ALSA output.

* gnu/packages/speech.scm (festival)[arguments]: Add "LINUXAUDIO=alsa"
to #:make-flags.
[inputs]: Add alsa-lib.
---
gnu/packages/speech.scm | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Toggle diff (26 lines)
diff --git a/gnu/packages/speech.scm b/gnu/packages/speech.scm
index cbc46b32b4..bb1a7b8187 100644
--- a/gnu/packages/speech.scm
+++ b/gnu/packages/speech.scm
@@ -347,7 +347,8 @@ (define-public festival
"/bin/rm")
(string-append "ECHO_N="
(assoc-ref %build-inputs "coreutils")
- "/bin/printf \"%s\""))
+ "/bin/printf \"%s\"")
+ "LINUXAUDIO=alsa")
#:parallel-build? #f ; not supported
#:modules ((guix build gnu-build-system)
(guix build utils)
@@ -505,7 +506,8 @@ (define-public festival
(add-before 'configure 'bootstrap
(lambda _ (invoke "autoreconf" "-vif"))))))
(inputs
- `(("ncurses" ,ncurses)))
+ `(("alsa-lib" ,alsa-lib)
+ ("ncurses" ,ncurses)))
(native-inputs
`(("autoconf" ,autoconf)
("automake" ,automake)
--
2.34.0
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCYa4TGw0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15Fb0A/RtkmIP3zkq4D4KaABJYPLCb+us1vWsZpl2jKbCj
ORbLAP9KoO0m940ahG6/rOkrKzhJhKkSU2+YnEk6dFkAb+QPCA==
=evz8
-----END PGP SIGNATURE-----

Tobias Geerinckx-Rice wrote 3 years ago
Re: festival can't do text-to-speech (Linux: can't open /dev/dsp)
(address . 52321-done@debbugs.gnu.org)
87wnk6tq3h.fsf@nckx
Pushed as 13f769c165c06b97472f61902d491c8910e86f8b.

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCYbl3og0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15FDMBAJb7nHLa5+zDz1qLcM6NhtjtimsXXEM/9VsMAsdz
aKSPAQDpBbHmBZQ4U7HNtxb+JcqVp5u2E5gXABjzXeijrWjfCQ==
=ERDI
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 52321@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 52321
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help