Sunday, May 25, 2014

Jasper for voice commands

I'm rapidly getting to the point that I need to have a simple remote control that I can use around the house.  I've thought about several possibilities, but I ran across Jasper <link> and that would be so cool.  A house that I can talk to.

On their site, they have a great video of the microphone setting a few meters away and the authors gleefully giving it commands and listening to the responses.  I could make a few of these and scatter them around the house to control things by voice; that would really be nice.  Very slick site and seemingly well documented.

So, looking at the directions, they have a pretty complex system that installs voice recognition and speech capabilities on the Pi.  I decided to try it out.  Since their image file is most likely configured differently than what I use, I decided to do the full installation ... DON'T DO THIS.  Their instructions leave a lot of tiny little things out, like what directory to be in when you do things, how long the various steps can take, how freaking big it is.  Y'know things like that.

After 26 hours of installs, updates, compiles (some of which failed) and a whole lot of head scratching, I just gave up.  I still wanted to try it out, so I downloaded their disk image and installed it on my Pi.  After spending quite a while messing around, I still couldn't get it to respond to a command or hear what it was saying; obviously there was something wrong with the audio setup.  The authors used ALSA (google it) so I started digging into it to see how to test the audio.  After changing the terminal interface on Putty several times, I discovered that my alsamixer settings were all set to the minimum.  After jacking up the input gain and the output volume, I managed to get sound into and out of Jasper.

Then the disappointments really began.  I couldn't recognize my voice most of the time, when it did manage to get it, it was mostly wrong.  "What is the meaning of life," one of the built in commands, would check my mail.  Interesting, but not what I expected.  It would do the time pretty well, but most everything else would cause an exception in the python script that was running.  Sometimes, it would fail so bad the Pi actually crashed.  Nothing has done that to me before.  Remember, this is a disk image, I didn't change anything; it failed right out of the box.  The voice synthesis was really, really hard to understand, and playing over and over again didn't seem to help.  My ears just weren't training to the odd sound.  Sort of like the Pi had a really bad cold and couldn't quite get the words out.

I didn't expect it to work like the movies, but c'mon, it should at least be as good as the videos they produced to show it off.  I even used the exact same microphone they show on their site and some really good powered speakers.  I can't blame the hardware at all.

So, I know there are a number of folk out there that installed this and got it to work.  There always are, but obviously, they didn't build it on their Pi, because that simply doesn't work, and not many people have days to waste compiling thousands of source files.  So, they must have used the image, but what the heck did they do to get it to understand them?  Similarly, how the heck did they understand what was being said by the software.  A series of beeps would have been better.

A few hours spent looking at various things on the web didn't reveal any secrets to make this work.  Instead, I found a significant number of people that hadn't been able to make it perform.  There didn't seem to be any solutions either.  There were a lot of, "I think," or "Maybe you can try," and "Have you tried;" but I discount most of those since they are simply guesses.  I didn't find anyone that was bragging about their success; that is very telling.  I'm not willing to dig into it because the vagaries of ALSA are daunting enough without having to delve into the secret and mysterious world of PocketSphinx (the recognition system they use).  I'm not interested in a new career.

I'm burning my original software back on the Pi's card right now so I can try something else.  For you folk out there that want to try it, I certainly hope you have better luck than I did.

1 comment:

  1. Bummer. As I read the title of your article I was hoping to find a clue as to why it failed in my installation. Thanks for the warning. Will wait a while until it improves.