kalliope-project / kalliope

Kalliope is a framework that will help you to create your own personal assistant.
https://kalliope-project.github.io/
GNU General Public License v3.0
1.72k stars 228 forks source link

Trigger not detected #353

Closed metal3d closed 7 years ago

metal3d commented 7 years ago

Hi, Currently I tried the french and english kit with fresh installed kalliope. I did it on Fedroa 26 on venv:

python3 -m venv Projects/kalliope
source Projects/kalliope/bin/activate
pip install kalliope

Everything seems to be right excepting libcblas.so that was not found. I find a way to get it:

dnf install gsl gsl-devel
ln -s /usr/lib64/libgslcblas.so ./libcblas.so

Then:

git clone french_kit or english_kit
cd french or english kit
LD_LIBRARY_PATH=.. kalliope start

And I see:

Starting event manager
2017-09-20 13:32:11,393 :: INFO :: Starting event manager
Events loaded
2017-09-20 13:32:11,408 :: INFO :: Events loaded
Starting Kalliope
2017-09-20 13:32:11,408 :: INFO :: Starting Kalliope
Press Ctrl+C for stopping
2017-09-20 13:32:11,408 :: INFO :: Press Ctrl+C for stopping
Starting REST API Listening port: 5000
2017-09-20 13:32:11,408 :: INFO :: Starting REST API Listening port: 5000
Waiting for trigger detection
2017-09-20 13:32:11,490 :: INFO :: Waiting for trigger detection

EDIT: With a debug:

LD_LIBRARY_PATH=.. kalliope start --debug
2017-09-20 13:39:16,090 :: DEBUG :: Logger ready
2017-09-20 13:39:16,090 :: DEBUG :: kalliope args: Namespace(action='start', brain_file=None, debug=True, git_url=None, neuron_name=None, run_order=None, run_synapse=None, stt_name=None, trigger_name=None, tts_name=None)
2017-09-20 13:39:16,090 :: DEBUG :: Try to load file from 1: /home/patachou/Projects/kaliope/kalliope_starter_fr/settings.yml
2017-09-20 13:39:16,090 :: DEBUG :: File found in /home/patachou/Projects/kaliope/kalliope_starter_fr/settings.yml
2017-09-20 13:39:16,090 :: DEBUG :: File path to load: /home/patachou/Projects/kaliope/kalliope_starter_fr/settings.yml 
2017-09-20 13:39:16,104 :: DEBUG :: File path to load: /home/patachou/Projects/kaliope/kalliope_starter_fr/settings.yml 
2017-09-20 13:39:16,118 :: DEBUG :: Default STT: google
2017-09-20 13:39:16,118 :: DEBUG :: Default TTS: pico2wave
2017-09-20 13:39:16,118 :: DEBUG :: Default Trigger name: snowboy
2017-09-20 13:39:16,118 :: DEBUG :: Default Player name: mplayer
2017-09-20 13:39:16,118 :: DEBUG :: Try to load file from 1: /home/patachou/Projects/kaliope/kalliope_starter_fr/trigger/dong.wav
2017-09-20 13:39:16,118 :: DEBUG :: File found in /home/patachou/Projects/kaliope/kalliope_starter_fr/trigger/dong.wav
2017-09-20 13:39:16,118 :: DEBUG :: Try to load file from 1: /home/patachou/Projects/kaliope/kalliope_starter_fr/sounds/dong.wav
2017-09-20 13:39:16,118 :: DEBUG :: Try to load file from 2: /etc/kalliope/sounds/dong.wav
2017-09-20 13:39:16,118 :: DEBUG :: Try to load file from 3: /home/patachou/Projects/kaliope/lib64/python3.6/site-packages/kalliope/sounds/dong.wav
2017-09-20 13:39:16,118 :: DEBUG :: File found in /home/patachou/Projects/kaliope/lib64/python3.6/site-packages/kalliope/sounds/dong.wav
2017-09-20 13:39:16,118 :: DEBUG :: Default synapse: default-synapse
2017-09-20 13:39:16,118 :: DEBUG :: Resource directory synapse: {'neuron': 'resources/neurons', 'stt': 'resources/stt', 'tts': 'resources/tts'}
2017-09-20 13:39:16,118 :: DEBUG :: Try to load file from 1: /home/patachou/Projects/kaliope/kalliope_starter_fr/global_variables/variables.yml
2017-09-20 13:39:16,118 :: DEBUG :: File found in /home/patachou/Projects/kaliope/kalliope_starter_fr/global_variables/variables.yml
2017-09-20 13:39:16,118 :: DEBUG :: File path to load: /home/patachou/Projects/kaliope/kalliope_starter_fr/global_variables/variables.yml 
2017-09-20 13:39:16,119 :: DEBUG :: [SettingsLoader] No Rpi config
2017-09-20 13:39:16,119 :: DEBUG :: Try to load file from 1: /home/patachou/Projects/kaliope/kalliope_starter_fr/brain.yml
2017-09-20 13:39:16,119 :: DEBUG :: File found in /home/patachou/Projects/kaliope/kalliope_starter_fr/brain.yml
2017-09-20 13:39:16,119 :: DEBUG :: File path to load: /home/patachou/Projects/kaliope/kalliope_starter_fr/brain.yml 
2017-09-20 13:39:16,131 :: DEBUG :: File path to load: /home/patachou/Projects/kaliope/kalliope_starter_fr/brain.yml 
2017-09-20 13:39:16,144 :: DEBUG :: Replacing variable {{name}} with  kalliope
Starting event manager
2017-09-20 13:39:16,144 :: INFO :: Starting event manager
Events loaded
2017-09-20 13:39:16,159 :: INFO :: Events loaded
Starting Kalliope
2017-09-20 13:39:16,159 :: INFO :: Starting Kalliope
Press Ctrl+C for stopping
2017-09-20 13:39:16,159 :: INFO :: Press Ctrl+C for stopping
Starting REST API Listening port: 5000
2017-09-20 13:39:16,159 :: INFO :: Starting REST API Listening port: 5000
2017-09-20 13:39:16,161 :: DEBUG :: PlayerLauncher: Start player mplayer with parameters: {}
2017-09-20 13:39:16,161 :: DEBUG :: [Utils]-> get_dynamic_class_instantiation : package path : kalliope.players.mplayer.mplayer
2017-09-20 13:39:16,163 :: DEBUG :: [Mplayer.__init__] instance
2017-09-20 13:39:16,163 :: DEBUG :: [Mplayer.__init__] args : {} 
2017-09-20 13:39:16,164 :: DEBUG :: [MainController] Entering state: starting_trigger
2017-09-20 13:39:16,164 :: DEBUG :: TriggerLauncher: Start trigger snowboy with parameters: {'pmdl_file': 'trigger/kalliope-FR-20samples.pmdl', 'callback': <bound method MainController.trigger_callback of <kalliope.core.MainController.MainController object at 0x7fb97fc0abe0>>}
2017-09-20 13:39:16,164 :: DEBUG :: [Utils]-> get_dynamic_class_instantiation : package path : kalliope.trigger.snowboy.snowboy
2017-09-20 13:39:16,206 :: DEBUG :: Try to load file from 1: /home/patachou/Projects/kaliope/kalliope_starter_fr/trigger/kalliope-FR-20samples.pmdl
2017-09-20 13:39:16,206 :: DEBUG :: File found in /home/patachou/Projects/kaliope/kalliope_starter_fr/trigger/kalliope-FR-20samples.pmdl
2017-09-20 13:39:16,247 :: DEBUG :: [MainController] Entering state: playing_ready_sound
2017-09-20 13:39:16,247 :: DEBUG :: [MainController] Entering state: waiting_for_trigger_callback
Waiting for trigger detection
2017-09-20 13:39:16,247 :: INFO :: Waiting for trigger detection
2017-09-20 13:39:16,248 :: DEBUG :: detecting...

I checked on pulseaudi that my webcam mic is listening, I see level indictor working (and I tried to recod my voice, it's ok)

But, whatever in english or french, the hotword (kallope) doesn't trigger something...

Any way to debug ? log ?

Is the libcblas ok if I've taken it from gsl package ?

Sispheor commented 7 years ago

Hi, First, Fedora is not officially supported.

About the trigger, you can get the list of snowboy model we have created for kalliope here. Then you can select the one you prefer and improve the model with your own voice on Snowboy website and then place the new generated file in your settings.

metal3d commented 7 years ago

I understand that Fedora is not officially supported... But if I can help...

On snowboy page: "This hotword needs 1960 before it can be made universal for everyone" so I created my own and downloaded. Replaced the sample by my own in kalliope_starter_fr, cd in that dir and retried.

I also tried with "--gui" to check if my voice can be reconized, and so on... and nothing happends...

Maybe the install procedure is not complete ? I followed the install page + quickstart

Sispheor commented 7 years ago

No. On snowboy, when you want a model, you need to improve it first. So, if you want the french one, you go here, improve the model and then download it.

Sispheor commented 7 years ago

Also, you can come on the Gitter chat if you need direct assistance.

ghost commented 7 years ago

Can you check again by modifying the sensitivity parameter within settings.yml, choose some different values than 0.5 and restart kalliope.

metal3d commented 7 years ago

@Sispheor hooo ok, so my voice was an improvment :) I didn't know, sorry, so I will retry (I delete my own) And yes, I will go to Gitter as soon as I reinstalled the entire project (a few minutes)

@1account yes, I will try right now, just a minute to reinstall

Thanks to you

metal3d commented 7 years ago

Ok... so... on my laptop, it seems to be ok with the default french model (after 4 times saying "kalliope") Now, the problem is that pico2wave is not installed (and it's way complicated to install it on Fedora). I will find a way... After having found how, I can provide you a "doc" for Fedora (for testing)

metal3d commented 7 years ago

Right... it seems to be ok. I only have a weird behaviour now... When Kallope answers "Je n'ai pas compris" (meaning, "I didn't understand") I only hear "Je". And actually, for the entire reponses, Kallope only says the first word. Maybe should I open an new issue ?

Sispheor commented 7 years ago

Yes you can open an issue. I will ask you your OS. You will answer fedora. I will close the issue :)

Sispheor commented 7 years ago

To be honest I think it will be complicated to deploy Kalliope on Fedora. I tried myself a couple time ago without any success because of missing packages. I could have build them manually but it would have been painful then to maintain.

From my point of view, solutions you have are:

For the two last point, If you make a clean doc, don't hesitate to PR it to the project. If you have any question or need assistance I let you come on Gitter.

I close the issue.

metal3d commented 7 years ago

Please, don't take my following message as aggressive:

It works on Fedora... And the problem is not "Fedora", there the problem is only that the french sentence is not completly spoken (only the first word) so that I'm sure that is not an OS problem, but a bug... That bug can be specific to python 3 for example. Why your project is only for Ubuntu, which package, which technology, which software are you using that other distribution doesn't have ?

To be honnest, I don't understand why so many project want to manage "Ubuntu" and not "Linux in general". Ubuntu, Fedora, Arch, Debian, and so on... we all are using the same OS.

What kind of difference can appear ? => only packages names. For example, to use PicoTTS, I had to install it in another way that "apt", that's all.

On my project, I never say to other user that the problem comes from its distribution, I try to check how to be compatible as largelly as possible. Sometimes, because my user is using Ubuntu, that reveals a bug that I didn't find, so I fix this.

If you want me to use on Raspberry (I've got 2 Rpi) I'm using other distribution than Raspbian for example, so the problem will remain the same... I'm pretty sure that the bug I'm speaking about is a real bug that can be fixed for everyone.

If you will close my issue only because I'm not on Ubuntu, so I will not open it.

Note: I wanted to test and adapt Kalliope to connect it on a AI that we are developping at work (opensource too), but right now I wonder...

metal3d commented 7 years ago

To be honest I think it will be complicated to deploy Kalliope on Fedora.

No, that was relativally easy.

Sispheor commented 7 years ago

You can see the list of need package in the install doc of Ubuntu or Debian. You can try to "convert" package name if their exist.

I totally agree with what you say and I would be happy to propose something available for all Linux system. For us, spending time on the subject was not a principal objective , as our main target is Rpi and Raspbian.

I close the issue because, so far, like I said it's out of scope. But, the community, and myself are available to chat and help you of course.

The bug you are mentioning seems to be related to Pico. Because if Kalliope start playing the file, that means we are not anymore in the kalliope code at this time.

You can give a try to another mic / speacker just to be sure you have the same behavior.

You can as well try to generate manually an audio with Pico, to check if you have the same behavior out of Kalliope.

pico2wave -l fr-FR -w test.wav "ceci est un test"
play test.wav
metal3d commented 7 years ago

I found the problem for the "one word", a simple error on the script that override pico2wave call. So no problem actually.

I didn't speak about closing this issue, I was telling that for the next issue after the https://github.com/kalliope-project/kalliope/issues/353#issuecomment-330979530 telling that it will be closed "because I'm using Fedora" that is not IMHO very... nice...

Sispheor commented 7 years ago

Yes, I closed it because the tittle deals with a non working trigger, Actually, the trigger work perfectly for distro we support as expected.

Now, the "Fedora support" is another subject.

metal3d commented 7 years ago

lol, we are not speaking about the same message. I'm talking about:

Yes you can open an issue. I will ask you your OS. You will answer fedora. I will close the issue :)

That issue was about the "only one word from pico2wave", a second issue that I wanted to create and that you will close only because I'm on Fedora.

Sispheor commented 7 years ago

Yes, of course. Because, like the trigger, Pico is working perfectly on our supported distro. So, if you open an issue for a problem related to your env, which is not supported, you are on your own.

metal3d commented 7 years ago

One more time, sorry, but I don't agree.

Trying to answer other user from other distros can resolve and enhance your software. For example my issue #355 reveal a problem that can appear later on Ubuntu. Maybe one day packager will change the path, or not maintain it, and another pico2wave package will install it on /opt.

Or more, if we need to check upgraded version, other implementation (some nice projects are picoTTS compatible but are using other names), so you are blocking next tries, help, and enhancements.

I don't say that you must support every distro, or answer them, but let them open so that other people can help Fedora, Slackware or whatever the distro users.

Keep in mind that Python, picoTTS, and so on are not Ubuntu specific. And it's a pitty to close the door to other people that want to help for better code (because hardcoded paths are not the way to go for example and we can find better way to link libcblas file too...)

This is the same remark that is made to Google for example, who frequently forget that Ubuntu is only one of the large variety of Linux distro... (and not the better by the way...) - so we prefer a .tar.gz where we can make some variation instead of a .deb with strange lib names when we decide to unpack them.

So, if you close my next issues only because I'm on Fedora, you will break my effort to help to be opened to others, and I will really not make more efforts on that project (and not propose it to my Work)

Sispheor commented 7 years ago

Then, propose a PR will all changes needed to support Fedora and stop opening issues that are only concerned by this env. You can spend your all day opening issue for Fedora, because we don't support it.

You are free to send us a PR with all update needed to support Fedora if you want. We'll try it and validate it. We don't close the door. I invited you to chat on gitter if you need help.

metal3d commented 7 years ago

You can spend your all day opening issue for Fedora, because we don't support it.

"You" maybe not, but others readers can do it, so don't close them.