Difference between revisions of "MythSpeech"

From MythTV Official Wiki
Jump to: navigation, search
(Initial Creation)
 
(Added category.)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
MythSpeech will use speechd to vocalize the menu navigation.  This can assist with visually impaired people who want to enjoy mythtv.
+
MythTV for blind/visually impaired
  
This was posted by Helen on the mythtv-user group.
+
== Introduction ==
 +
Mythspeech is an answer to [http://www.gossamer-threads.com/lists/mythtv/users/524971 A Plea to the Programmers] made on the mythtv-users list in August, 2012. The first working iteration takes advantage of MythTV’s support for LCD displays. As a result, it is possible to provide a working solution that modifies one relatively small executable (mythlcdserver) that is included with MythTV. But building on MythTV’s support for LCD displays has its limitations, discussed later.
  
TODO: Add link to the post.
+
== Getting Started ==
 +
=== Requirements ===
 +
* Ubuntu 12.04 LTS or a distribution based on it, such as Mythbuntu 12.04. Both 32 bit and 64 bit flavours are supported by Mythspeech.
 +
* MythTV 0.25. Mythspeech has been tested with these versions from the MythTV Updates repository:
 +
** 2:0.25.2+fixes.20120922.0817eb2-0ubuntu0mythbuntu4
 +
** 2:0.25.3+fixes.20121202.57baf5b-0ubuntu0mythbuntu3
 +
** 2:0.25.3+fixes.20121206.0b60406-0ubuntu0mythbuntu3
  
You're quite right, I have been talking privately to Lee, also Monkey Pet, another developer interested in the topic. Since you've expressed interest, here's what's going on. I've been quietly following the posts on this topic and thinking and researching and tinkering, time permitting.
+
The above requirements assume you want to use the mythlcdserver executable provided in the mythspeech package. If you wish to use a different distribution or MythTV version, you will probably need to compile from source. For that reason, a patch file is included with the mythspeech package. The source is also available on github:
 +
[https://github.com/monkeypet/mythtv https://github.com/monkeypet/mythtv]
  
What I finally settled on was to modify mythlcdserver to talk to speech-dispatcher via its libspeechd library. You can read about it here:
+
How to compile from source is not covered here.
  
http://devel.freebsoft.org/speechd
+
=== Download Mythspeech ===
It is what Ubuntu 12.04's screen reader, Orca, uses.
+
If you are using the 64 bit flavour of Ubuntu, download:
 +
[http://www.hbuus.com/~buus/mythspeech-0.4.tgz http://www.hbuus.com/~buus/mythspeech-0.4.tgz]
  
I had first tried to do something with the work done by NCAM (National Center for Accessible Media), which can be found here:
+
If you are using the 32 bit flavour of Ubuntu, download:
http://ncam.wgbh.org/invent_build/analog/speech-solutions-for-next-generation-media-centers/technical-notes-on-talking-myt
+
[http://www.hbuus.com/~buus/mythspeech-0.4-i386.tgz http://www.hbuus.com/~buus/mythspeech-0.4-i386.tgz]
  
But things have changed so much since that was done (on mythtv 0.21 in 2008) that I abandoned it. FWIW, I had actually managed to get it working on mythbuntu 10.04.
+
=== Extract Mythspeech ===
 +
Extract the file's contents with the command:
  
Next, I started looking at using Qt's approach, which would require implementing Qt accessibility classes. If this were done, mythfrontend would then talk to the Orca screen reader. I have confirmed that, at least one other QT application, vlc, can generate speech through Orca and speech-dispatcher. More info on Qt accessibility support can be found in these links:
+
$ tar xzf mythspeech-''version''.tgz
http://qt-project.org/doc/qt-4.8/accessible.html
+
http://blog.qt.digia.com/2011/08/23/accessibility-on-linux/
+
  
http://lists.qt-project.org/pipermail/interest/2012-March/001197.html
+
where ''version'' is either 0.4 (64 bit version) or 0.4-i386 (32 bit version).
VLC's pop up menus don't generate speech, but the regular menus do, if you:
+
- turn on the Orca screen reader.
+
- export QT_ACCESSIBILITY=1
+
- start vlc from the command line.
+
  
Just as I was about to launch into the "Qt approach", Monkey Pet wrote Lee, to which he replied on the mythtv-users list, which prompted new discussion from others, especially Anthony Goggins, who tossed out the idea of doing something with how mythtv talks to LCDd, which is part of the lcdproc package. I took a look at it, and was able to get it working pretty easily using LCDd's curses simulation. So I took a look at the code for mythlcdserver and realized it wouldn't be that hard to modify that program to do the speaking. And that's what I've done. It's working for me and Lee (with some gotchas, more on that later) on Ubuntu/Mythbuntu 12.04. Monkey Pet has also gotten it working, although I don't know with what distro.
+
This will create the directory, mythspeech-''version'', which will contain the following files:
  
I chose to use the speech-dispatcher approach, as opposed to what was done for NCAM, because I believe it's a cleaner approach and consistent with the direction Ubuntu is going in w.r.t accessibility.
+
; installspeech
 +
: A shell script that will install the non-source files in the desired locations.
 +
; mythlcdserver
 +
: The executable that does the speaking in response to messages from mythfrontend.
 +
; mythspeech
 +
: A shell script that starts up mythlcdserver and makes sure logging output is captured in the directory, $HOME/mythspeech. It also works around a potential race condition to make sure mythlcdserver doesn't start until mysql, the database server, is up and running.
 +
; mythspeech-''version''.patch
 +
: This is a patch file that can be applied to the mythtv source. It only touches files in mythtv/programs/mythlcdserver.
 +
; xprofile
 +
: Shell code that should be added to $HOME/.xprofile to make sure mythlcdserver is started when the computer is rebooted.
  
I don't think the work I've done should be the long term approach to adding accessibility to mythtv. There's a lot of info that isn't provided by mythfrontend to mythlcdserver, like program guide data and information about programs on live TV that mythfrontend shows if you just cursor up/down, but don't change the channel by pressing OK. Also, when I added the live TV support, I found it affected what happens when you watch a recording. It now tells you what you've just started to play, even though it just told you before you started playing it.
+
=== Install Dependencies ===
 +
If you are using the Mythbuntu 12.04 distribution, you need to install speech-dispatcher (it's pre-installed on Ubuntu 12.04):
  
I believe that, long term, accessibility for the blind/visually impaired should be based on Qt's support for accessibility. However, that will be more work and I wanted to get something working in 0.25, since that is what Lee and his wife are using. IMHO, what I'm doing is a short term hack, although I am trying to make it as functional as possible without having to touch anything other than mythlcdserver code.
+
$ sudo apt-get install speech-dispatcher
  
Lee and Monkey Pet have my first version. Since then I've added support for live TV and for mythmusic. Here's a link to the second version:
+
Test it with the command:
http://www.hbuus.com/~buus/mythspeech-0.2.tgz
+
  
 +
$ spd-say "Hello world"
  
Extract the file's contents with the command:
+
=== Install Mythspeech ===
tar xzf mythspeech-0.2.tgz
+
$ cd mythspeech-''version''
 +
$ ./installspeech
  
This will create the directory, mythspeech-0.2, which will contain the following files:
+
To start mythlcdserver, execute the command:
  
 +
$ $HOME/bin/mythspeech
  
installspeech: A shell script that will install the non-source files in the desired locations.
+
This will be done automatically on the next reboot. However, if you ever have a problem, you can always restart mythlcdserver by executing the above command.
  
mythlcdserver: The 64 bit executable for *buntu 12.04 that does the speaking in response to messages from mythfrontend. It should be installed in $HOME/bin. I provide the executable for Lee's sake so he doesn't have to set up a development environment and compile mythtv from source.
+
=== Configure Mythfrontend ===
 +
Once the above steps have been completed, you need to configure mythfrontend to talk to mythlcdserver.
  
 +
* From the main menu, navigate to '''Setup -> Appearance'''.
 +
* On the last page labeled '''LCD device display''', check '''Enable LCD device'''. This will make available a number of other settings specific to LCD display devices. You don't need to change them, they don't affect the speaking done by mythlcdserver.
 +
* Cursor down to '''Finish'''. This will save the setting and take you back to the main menu. If mythspeech successfully started mythlcdserver, and if speech-dispatcher is working properly, you should now hear ''MYTH MAIN Menu Media Library''. If not, it's time to check the log in $HOME/mythspeech.
  
mythspeech: A shell script that starts up mythlcdserver and makes sure logging output is captured in the directory, $HOME/mythspeech. It also works around a potential race condition to make sure mythlcdserver doesn't start until mysql, the database server, is up and running.
+
== Limitations ==
 +
There's a lot of information that isn't provided by mythfrontend to mythlcdserver, like program guide data and information about programs on live TV that mythfrontend shows if you just cursor up/down, but don't change the channel by pressing OK. Also, when I added the live TV support, I found it affected what happens when you watch a recording. It now tells you what you've just started to play, even though it just told you before you started playing it.
  
mythspeech-0.2.patch: This is a patch file that can be applied to the mythtv source. It only touches files in mythtv/programs/mythlcdserver.
+
== Development Notes ==
 +
I had first tried to do something with the work done by NCAM (National Center for Accessible Media), which can be found here:
 +
<br>
 +
[http://ncam.wgbh.org/invent_build/analog/speech-solutions-for-next-generation-media-centers/technical-notes-on-talking-myt http://ncam.wgbh.org/invent_build/analog/speech-solutions-for-next-generation-media-centers/technical-notes-on-talking-myt]
 +
<br>
 +
But things have changed so much since that was done (on mythtv 0.21 in 2008) that I abandoned it. FWIW, I had actually managed to get the original implementation working on mythbuntu 10.04.
  
 +
Next, I started looking at using Qt's approach, which would require implementing Qt accessibility classes. If this were done, mythfrontend would then talk to the Orca screen reader. I have confirmed that at least one other QT application, vlc, can generate speech through Orca and speech-dispatcher. More information on Qt accessibility can be found here:
 +
<br>
 +
[http://qt-project.org/doc/qt-4.8/accessible.html http://qt-project.org/doc/qt-4.8/accessible.html]
 +
<br>
 +
[http://blog.qt.digia.com/2011/08/23/accessibility-on-linux/ http://blog.qt.digia.com/2011/08/23/accessibility-on-linux/]
 +
<br>
 +
[http://lists.qt-project.org/pipermail/interest/2012-March/001197.html http://lists.qt-project.org/pipermail/interest/2012-March/001197.html]
  
xprofile: Shell code that should be added to $HOME/.xprofile to make sure mythlcdserver is started when the computer is rebooted.
+
VLC's pop up menus don't generate speech, but the regular menus do, if you:
 
+
* turn on the Orca screen reader.
To install:
+
* export QT_ACCESSIBILITY=1
 
+
* start vlc from the command line.
If running mythbuntu 12.04 (it's pre-installed on ubuntu 12.04):
+
sudo apt-get install speech-dispatcher
+
Test it with the command:
+
spd-say "Hello world"
+
 
+
If you want to compile the source:
+
sudo apt-get install libspeechd-dev
+
 
+
cd mythspeech-0.2
+
 
+
./installspeech
+
 
+
To start mythlcdserver, execute the command:
+
$HOME/bin/mythspeech
+
 
+
Once these steps are done, you need to configure mythfrontend to talk to mythlcdserver.
+
  
- From the main menu, navigate to Setup -> Appearance.
+
Just as I was about to launch into the "Qt approach", the email thread that kicked this off two months earlier (and which had been dormant) became active again. One person tossed out the idea of doing something with how mythtv supports LCD displays (see [[Mythlcdserver]]). I took a look at it, and was able to get the LCD feature working pretty easily using LCDproc’s support for curses simulation. So I took a look at the code for mythlcdserver and realized it wouldn't be that hard to modify that program to do the speaking.
  
- On the last page labeled "LCD device display" check "Enable LCD device". This will make available a number of other settings specific to LCD display devices. You don't need to change them, they don't affect the speaking done by mythlcdserver.
+
I modified mythlcdserver to talk to speech-dispatcher via its libspeechd library. You can read about it here:
 +
[http://devel.freebsoft.org/speechd http://devel.freebsoft.org/speechd]
 +
It is what Ubuntu 12.04's screen reader, Orca, uses. Monkey Pet has also compiled and tested it with MythTV 0.26.
  
- Cursor down to "Finish". This will save the setting and throw you back to the main menu. If mythspeech successfully started mythlcdserver, and if speech-dispatcher is working properly, you should now hear "MYTH MAIN Menu Media Library". If not, it's time to check the log in $HOME/mythspeech.
+
I chose to use the speech-dispatcher approach, as opposed to what was done for NCAM, because I believe it's a cleaner approach and consistent with the direction Ubuntu is going in with regard to accessibility.
  
Lee ran into a problem last night after going into mythmusic. We're in the process of troubleshooting it. I suspect it may have to do with his audio configuration. Speech-dispatcher is using his onboard audio device (I think via pulseaudio), while mythfrontend is using alsa and nvidia'a hdmi audio device. If that's the case, I may not be able to help him configure a stable audio configuration. I've been testing on my laptop with the built in speakers and haven't had any problems using the default audio configuration provided by either ubuntu or mythbuntu (I've got both installed).
+
== Future Direction ==
 +
I believe that, long term, accessibility for the blind/visually impaired should be based on Qt's support for accessibility. However, that will be more work and I wanted to get something working in 0.25, since that is the version the original plea was for. IMHO, what I'm doing is a short term hack, although I am trying to make it as functional as possible without having to touch anything other than mythlcdserver code. I also plan to support it through MythTV 0.26.
  
I welcome any feedback, as well as thoughts on the mythlcdserver approach vs Qt accessibility vs NCAM vs something I haven't thought of. Also, if anyone can help with Lee's audio configuration, I'm sure he'd welcome it.
+
I welcome any feedback, as well as thoughts on the mythlcdserver approach vs Qt accessibility vs NCAM vs something I haven't thought of.
  
Regards,
+
[[Category:Plugins]]
Helen
+

Latest revision as of 16:55, 31 December 2012

MythTV for blind/visually impaired

Introduction

Mythspeech is an answer to A Plea to the Programmers made on the mythtv-users list in August, 2012. The first working iteration takes advantage of MythTV’s support for LCD displays. As a result, it is possible to provide a working solution that modifies one relatively small executable (mythlcdserver) that is included with MythTV. But building on MythTV’s support for LCD displays has its limitations, discussed later.

Getting Started

Requirements

  • Ubuntu 12.04 LTS or a distribution based on it, such as Mythbuntu 12.04. Both 32 bit and 64 bit flavours are supported by Mythspeech.
  • MythTV 0.25. Mythspeech has been tested with these versions from the MythTV Updates repository:
    • 2:0.25.2+fixes.20120922.0817eb2-0ubuntu0mythbuntu4
    • 2:0.25.3+fixes.20121202.57baf5b-0ubuntu0mythbuntu3
    • 2:0.25.3+fixes.20121206.0b60406-0ubuntu0mythbuntu3

The above requirements assume you want to use the mythlcdserver executable provided in the mythspeech package. If you wish to use a different distribution or MythTV version, you will probably need to compile from source. For that reason, a patch file is included with the mythspeech package. The source is also available on github: https://github.com/monkeypet/mythtv

How to compile from source is not covered here.

Download Mythspeech

If you are using the 64 bit flavour of Ubuntu, download: http://www.hbuus.com/~buus/mythspeech-0.4.tgz

If you are using the 32 bit flavour of Ubuntu, download: http://www.hbuus.com/~buus/mythspeech-0.4-i386.tgz

Extract Mythspeech

Extract the file's contents with the command:

$ tar xzf mythspeech-version.tgz

where version is either 0.4 (64 bit version) or 0.4-i386 (32 bit version).

This will create the directory, mythspeech-version, which will contain the following files:

installspeech
A shell script that will install the non-source files in the desired locations.
mythlcdserver
The executable that does the speaking in response to messages from mythfrontend.
mythspeech
A shell script that starts up mythlcdserver and makes sure logging output is captured in the directory, $HOME/mythspeech. It also works around a potential race condition to make sure mythlcdserver doesn't start until mysql, the database server, is up and running.
mythspeech-version.patch
This is a patch file that can be applied to the mythtv source. It only touches files in mythtv/programs/mythlcdserver.
xprofile
Shell code that should be added to $HOME/.xprofile to make sure mythlcdserver is started when the computer is rebooted.

Install Dependencies

If you are using the Mythbuntu 12.04 distribution, you need to install speech-dispatcher (it's pre-installed on Ubuntu 12.04):

$ sudo apt-get install speech-dispatcher

Test it with the command:

$ spd-say "Hello world"

Install Mythspeech

$ cd mythspeech-version
$ ./installspeech

To start mythlcdserver, execute the command:

$ $HOME/bin/mythspeech

This will be done automatically on the next reboot. However, if you ever have a problem, you can always restart mythlcdserver by executing the above command.

Configure Mythfrontend

Once the above steps have been completed, you need to configure mythfrontend to talk to mythlcdserver.

  • From the main menu, navigate to Setup -> Appearance.
  • On the last page labeled LCD device display, check Enable LCD device. This will make available a number of other settings specific to LCD display devices. You don't need to change them, they don't affect the speaking done by mythlcdserver.
  • Cursor down to Finish. This will save the setting and take you back to the main menu. If mythspeech successfully started mythlcdserver, and if speech-dispatcher is working properly, you should now hear MYTH MAIN Menu Media Library. If not, it's time to check the log in $HOME/mythspeech.

Limitations

There's a lot of information that isn't provided by mythfrontend to mythlcdserver, like program guide data and information about programs on live TV that mythfrontend shows if you just cursor up/down, but don't change the channel by pressing OK. Also, when I added the live TV support, I found it affected what happens when you watch a recording. It now tells you what you've just started to play, even though it just told you before you started playing it.

Development Notes

I had first tried to do something with the work done by NCAM (National Center for Accessible Media), which can be found here:
http://ncam.wgbh.org/invent_build/analog/speech-solutions-for-next-generation-media-centers/technical-notes-on-talking-myt
But things have changed so much since that was done (on mythtv 0.21 in 2008) that I abandoned it. FWIW, I had actually managed to get the original implementation working on mythbuntu 10.04.

Next, I started looking at using Qt's approach, which would require implementing Qt accessibility classes. If this were done, mythfrontend would then talk to the Orca screen reader. I have confirmed that at least one other QT application, vlc, can generate speech through Orca and speech-dispatcher. More information on Qt accessibility can be found here:
http://qt-project.org/doc/qt-4.8/accessible.html
http://blog.qt.digia.com/2011/08/23/accessibility-on-linux/
http://lists.qt-project.org/pipermail/interest/2012-March/001197.html

VLC's pop up menus don't generate speech, but the regular menus do, if you:

  • turn on the Orca screen reader.
  • export QT_ACCESSIBILITY=1
  • start vlc from the command line.

Just as I was about to launch into the "Qt approach", the email thread that kicked this off two months earlier (and which had been dormant) became active again. One person tossed out the idea of doing something with how mythtv supports LCD displays (see Mythlcdserver). I took a look at it, and was able to get the LCD feature working pretty easily using LCDproc’s support for curses simulation. So I took a look at the code for mythlcdserver and realized it wouldn't be that hard to modify that program to do the speaking.

I modified mythlcdserver to talk to speech-dispatcher via its libspeechd library. You can read about it here: http://devel.freebsoft.org/speechd It is what Ubuntu 12.04's screen reader, Orca, uses. Monkey Pet has also compiled and tested it with MythTV 0.26.

I chose to use the speech-dispatcher approach, as opposed to what was done for NCAM, because I believe it's a cleaner approach and consistent with the direction Ubuntu is going in with regard to accessibility.

Future Direction

I believe that, long term, accessibility for the blind/visually impaired should be based on Qt's support for accessibility. However, that will be more work and I wanted to get something working in 0.25, since that is the version the original plea was for. IMHO, what I'm doing is a short term hack, although I am trying to make it as functional as possible without having to touch anything other than mythlcdserver code. I also plan to support it through MythTV 0.26.

I welcome any feedback, as well as thoughts on the mythlcdserver approach vs Qt accessibility vs NCAM vs something I haven't thought of.