Git Product home page Git Product logo

aiyprojects-raspbian's People

Contributors

ameer1234567890 avatar atvrager avatar axilleas avatar cyrilloo avatar divx118 avatar dmitriykovalev avatar domanchi avatar drferg avatar drigz avatar drsdavidsoft avatar dylandignan avatar enetor avatar ensonic avatar hehgoog avatar iblancasa avatar jtg-google avatar jthomaschewski avatar ktinkerer avatar mbrooksx avatar michael-kernel-sanders avatar petermalkin avatar proppy avatar rkkautsar avatar scottamain avatar t1m0thyj avatar timonvo avatar weiranzhao avatar ywongau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aiyprojects-raspbian's Issues

change default sound volume

Each time when I start the service, I found that the sound volume setting has been reset again and a bit loud. Anyway I can set a default sound volume except by voice command each time?

passing parameters

Is there a way to pass the voice-recognizer parameters? Basically I want bypass the mic and feed it text instead of speech. This might sound vague but I can be more specific if need. I just want the recognizer to take text as well as speech.

Instructions to run on a headless raspbian

It'd be great to have a walkthrough to get this working on a base headless raspbian image.

Even with a walkthrough, right now it requires several tweaks to work on a minimal raspbian.
This is an incomplete list of the issues I've found:

  • install.sh is missing even tho it's referenced in check_audio.py
  • sound test cannot find the file to play (because it doesn't exist)
  • install.sh doesn't install dkms, even tho it's missing
  • check_audio.py cannot play an existing file, even tho aplay filepath.wav can play back on the speaker bundled

Travis tests do not use install-deps.sh

Because the travis tests do not setup a virtualenv, it means dependencies need to be installed explicitly. For example phue which could lead to future version issues.

The .travis.yml should be adapted to setup a virtualenv and use that for the tests, thus keeping dependency management in one place.

'AssistantSpeechRequest' error

I keep getting the following error after a task has finished performing

Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "src/main.py", line 286, in _recognize
if self.recognizer.dialog_follow_on:
AttributeError: 'AssistantSpeechRequest' object has no attribute 'dialog_follow_on'

It does it after any task but namely after i added the bbc radio stations addition found in the raspberry pi forum and i cant see why, i succesfully added the hotword, google play and youtube additions without any problems but now this has happened. Any recommendations how i can go about fixing it?

Openbox Syntax Error

Some people have seen this error on first boot:

One or more XML syntax errors were found while parsing the Openbox configuration files. See stdout for more information. The last error seen was in file "/home/pi/.config/openbox/lxde-pi-rc.xml" line 1, with message: Document is empty

It can typically be resolved by reflashing the card.

One reporter said they booted initially without a monitor connected (maybe related, maybe a coincidence). The issue might be upstream (see this forum post). As far as I'm aware lxde-pi-rc.xml is the same in our image as in the upstream image.

"pi" actions are not interrupted

I recommend removing the "pi" prefix from the Actions, that was added under #30. Or, pick a different prefix.

How about "computer"?
How about making it configurable? We call ours "spee", so "spee power off" would work pretty well.


Per PR #30 , the new "power off" and "reboot" commands were prefixed with "pi":

"pi power off"
"pi reboot"

Unfortunately, our Voice Kit cannot interrupt "pi" most of the time. Cases in point:

5 year old daughter: "pi power off"
May 27 06:38:36 spee python3[550]: {'text': 'hey power off'}

me saying "pi power off"
May 27 06:38:51 spee python3[550]: {'text': 'hi power off'}

spouse saying "pi power off"
May 27 06:39:52 spee python3[550]: {'text': 'say power off'}

Only after about a dozen times, was "Pi power off" detected by me saying it.

Also, if you actually say commands like "hey power off", the assistant responds with "Sorry, Power commands are not yet supported."

^- this would indicate that the SDK may support power commands in the future itself through some API. Something to keep an eye out for.

Is rpi-update required?

In the file https://github.com/google/aiyprojects-raspbian/blob/master/HACKING.md, you use the sudo rpi-update line. It's current Raspberry Pi practice not to use this unless you REALLY need it as it can bring in a non-working kernel (i.e. the latest bleeding edge version, which is not guaranteed to work).

My thoughts are that it is not actually required once you have done the apt-get update/upgrade cycle.

James
Raspberry Pi Foundation (Trading)

errors in pinout documentation

I couldn't find a contact on the main site, so posting this here...

there are a number of errors in the documentation of the header breakouts at:
https://aiyprojects.withgoogle.com/voice/#makers-guide-4-1--connecting-additional-sensors

in the sensors.png pic itself, MISO should correspond to bcm10 (or possibly it should be MOSI, depends on board routing, don't have one to check - but either way, one of these 2 is incorrect).

also in the detailed pinout below, under SPI, there is a mix of physical and bcm notations. It should be 10, 9, 11, 8, 7 , not 10, 9, 11, 24, 26.

I hope you can pass on this report to whoever is responsible for the aiyprojects.withgoogle.com site.

cheers,
HAL

TTS - en-GB voice is not as robotic as the default - perhaps change the default?

I don't know if you wonderful people have tried using en-GB for TTS language.

After updating my box with the latest merge I picked up the default config - the default TTS voice is much harsher and robotic than the voice you get with en-GB - which is almost as good as a BBC news reader.

Perhaps you should change the default to en-GB or investigate why it is so much better than the default.

Please try it. I may be biased

Doesn't work with usb sound cards - audio-output config is ignored

I tried 3 USB sound cards they all have the same problem

It died when it spoke, because most USB sound cards don't have a hardware mixer, they can't play mono nor be used by multiple applications at the same time

[2017-07-15 11:23:37,411] INFO:main:Playing 15.3237 seconds of audio...
aplay: set_params:1233: Sample format non available
Available formats:
- FLOAT_LE
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "src/main.py", line 374, in _recognize
self._handle_result(self.recognizer.do_request())
File "src/main.py", line 392, in _handle_result
self._play_assistant_response(result.response_audio)
File "src/main.py", line 404, in _play_assistant_response
sample_rate=sample_rate_hz)
File "/home/pi/voice-recognizer-raspi/src/aiy/_drivers/_player.py", line 52, in play_bytes
aplay.stdin.write(audio_bytes)
BrokenPipeError: [Errno 32] Broken pipe

The solution is creating a dmix virtual sound card called dmixed then use -D plug:dmixed for aplay
However main.py doesn't pass its configuration to _player.py so I am hard coding output_device for the time being

I can create a proper PR in a couple of weeks

spurious triggering - hotword

The AIY box when setup for hotword triggering is reacting to spurious phrases/sounds/background noise.

I now have my AIY setup to trigger using hotword. Like most people I don't spend my day watching it's pulsing LED but I have been assuming that it is only triggered at my behest.

However today I switched on the trigger sound facility - using a wav file already on the pi. So my config looks like this

trigger = ok-google
trigger-sound = /usr/share/scratch/Media/Sounds/Electronic/Fairydust.wav

A couple of times today I have just been sitting watching tennis on the TV and the AIY has suddenly triggered and the wav file has been played. An example from the journal - it was just sitting there and I didn't trigger it by using either Ok Google or Hey Google

Jun 26 19:59:24 raspberrypi python3[522]: [2017-06-26 19:59:24,082] INFO:main:ready...
Jun 26 20:14:38 raspberrypi python3[522]: [2017-06-26 20:14:38,053] INFO:root:ON_CONVERSATION_TURN_STARTED
Jun 26 20:14:38 raspberrypi python3[522]: [2017-06-26 20:14:38,054] INFO:main:listening...
Jun 26 20:14:48 raspberrypi python3[522]: [2017-06-26 20:14:48,069] INFO:root:ON_END_OF_UTTERANCE
Jun 26 20:14:48 raspberrypi python3[522]: [2017-06-26 20:14:48,071] INFO:main:thinking...
Jun 26 20:14:48 raspberrypi python3[522]: [2017-06-26 20:14:48,333] INFO:root:ON_RECOGNIZING_SPEECH_FINISHED:
Jun 26 20:14:48 raspberrypi python3[522]: {'text': "that's pretty old and hasn't for love and it difficult for Everything Jewish results"}
Jun 26 20:14:49 raspberrypi python3[522]: [2017-06-26 20:14:49,765] INFO:root:ON_CONVERSATION_TURN_TIMEOUT
Jun 26 20:14:49 raspberrypi python3[522]: [2017-06-26 20:14:49,766] INFO:root:ON_CONVERSATION_TURN_FINISHED:
Jun 26 20:14:49 raspberrypi python3[522]: {'with_follow_on_turn': False}
Jun 26 20:14:49 raspberrypi python3[522]: [2017-06-26 20:14:49,768] INFO:main:ready...

The context of the tennis match certainly didn't involve anything that could be construed as either Ok Google or Hey Google. I can understand that the phrase that's pretty old and hasn't for love and it difficult for Everything Jewish results does contain a couple of words that are tennis related.

A while later it triggered again - whilst I was watching a TV program that was playing some music. Here is the journal
Jun 26 21:23:44 raspberrypi python3[522]: [2017-06-26 21:23:44,280] INFO:main:ready...
Jun 26 22:10:17 raspberrypi python3[522]: [2017-06-26 22:10:17,197] INFO:root:ON_CONVERSATION_TURN_STARTED
Jun 26 22:10:17 raspberrypi python3[522]: [2017-06-26 22:10:17,198] INFO:main:listening...
Jun 26 22:10:21 raspberrypi python3[522]: [2017-06-26 22:10:21,468] INFO:root:ON_END_OF_UTTERANCE
Jun 26 22:10:21 raspberrypi python3[522]: [2017-06-26 22:10:21,470] INFO:main:thinking...
Jun 26 22:10:21 raspberrypi python3[522]: [2017-06-26 22:10:21,603] INFO:root:ON_RECOGNIZING_SPEECH_FINISHED:
Jun 26 22:10:21 raspberrypi python3[522]: {'text': 'music'}
Jun 26 22:10:22 raspberrypi python3[522]: [2017-06-26 22:10:22,497] INFO:root:ON_CONVERSATION_TURN_TIMEOUT
Jun 26 22:10:22 raspberrypi python3[522]: [2017-06-26 22:10:22,498] INFO:root:ON_CONVERSATION_TURN_FINISHED:
Jun 26 22:10:22 raspberrypi python3[522]: {'with_follow_on_turn': False}
Jun 26 22:10:22 raspberrypi python3[522]: [2017-06-26 22:10:22,505] INFO:main:ready...

Interesting that It interpreted the "noise" as "music"

If I need to raise this issue in the assistant sdk repository please advise so.

Ok Google - SDK upgrade - Here is the latest news - but there isn't any news

I've updated to a Pi 3 this morning and I've set the trigger to ok-google. It works exceedingly well.
BUT
Normally I say good morning and it responds by saying hello, tells me the time and weather and what my commute is to get home and tells me to have a nice day

Now I have upgraded to the new version of the google assistant SDK i get the same response except after telling me about my commute and saying have a nice day - it says here is the latest news and then stops - it doesn't tell me any news and the journal shows it is waiting to be triggered.

That seems like a fault/bug to me.

Switching back to button triggering gets rid of the spurious "here is the latest news" - looks like two different versions of the google assistant gets used depending upon trigger type.

As we say in Britain - there is a rabbit off somewhere.

install-deps.sh assumes that the user is `pi`

It would be better to look at the owner of the voice-recognizer-raspi directory to figure this out.

TBD: should the services also guess the appropriate user name? I'd say not, since edits there are unlikely to be committed by accident.

ValueError: list.remove(x): x not in list in audio.py

Looks like endpointer_cb was fired more than it should have in main.py

Jun 03 08:55:20 raspberrypi python3[548]: return self._handle_response_stream(response_stream)
Jun 03 08:55:20 raspberrypi python3[548]: File "/home/pi/voice-recognizer-raspi/src/speech.py", line 206, in _handle_response_stream
Jun 03 08:55:20 raspberrypi python3[548]: self._end_audio_request()
Jun 03 08:55:20 raspberrypi python3[548]: File "/home/pi/voice-recognizer-raspi/src/speech.py", line 201, in _end_audio_request
Jun 03 08:55:20 raspberrypi python3[548]: self._endpointer_cb()
Jun 03 08:55:20 raspberrypi python3[548]: File "src/main.py", line 366, in endpointer_cb
Jun 03 08:55:20 raspberrypi python3[548]: self.recorder.del_processor(self.recognizer)
Jun 03 08:55:20 raspberrypi python3[548]: File "/home/pi/voice-recognizer-raspi/src/audio.py", line 77, in del_processor
Jun 03 08:55:20 raspberrypi python3[548]: self._processors.remove(processor)
Jun 03 08:55:20 raspberrypi python3[548]: ValueError: list.remove(x): x not in list

How to update - some easy guidance for newcomers

Many of the people who have obtained the AIY are newcomers and will not be familiar with the wonderful world of Git. The article in MagPi regarding how to put the AIY kit together was very detailed and did a great job of holding peoples hands.

The next hurdle for newcomers will be updating the software - Would it be possible to provide some guidance regrading how to:

  1. Save any changes people have made to action.py
  2. How to pull the updates

Configuring LED signals?

What is the syntax for modifying the configuration file in ~/voice-recognizer-raspi/config/status-led.ini.default?? I need to turn off the "device ready" blinking, before my wife stabs me.

Google Assistant SDK / GRPC - click module not installed.

Hi, I've been updating my AIY using the now famous instructions at http://eduncan911.com/stem/embedded/aiy-google-assistant-upgrades-may-2017.html

Everything is going swimmingly well - loving using OK Google as the activation method.

However in /home/pi/assistant-sdk-python/google-assistant-sdk/googlesamples/assistant/grpc there is a file "pushtotalk.py" if I do python pushtotalk.py I get a failure

 Traceback (most recent call last):
  File "pushtotalk.py", line 21, in <module>
  import click
  ImportError: No module named 'click'

There is a requirements.txt file in that folder and sure enough click==6.7 is a requirement

Shouldn't this module (and any others needed by the assistant SDK) be in the /home/pi/voice-recognizer-raspi/scripts install-deps.sh (that me and hopefully everyone else is running when there are updates).

I started installing the modules in the start dev terminal window and then typing
python3 /home/pi/assistant-sdk-python/google-assistant-sdk/googlesamples/assistant/grpc/pushtotalk.py

but I decided to chicken out when after installing a few modules I got ERROR:root:Error loading credentials: [Errno 2] No such file or directory: '/home/pi/.config/google-oauthlib-tool/credentials.json'
ERROR:root:Run google-oauthlib-tool to initialize new OAuth 2.0 credentials.

pip install --upgrade google-assistant-sdk broke main.py

Hi,

I have performed pip install --upgrade google-assistant-sdk to get the latest SDK for hotword support etc...

However main.py will not run anymore.

file src/main.py line 26, in
from googlesamples.assistant import auth_helpers
ImportError: cannot import name 'auth_helpers'

Thanks.

Pete

Setting language = en-GB not working

Following the merging of #101 and whatever else was changed as a result of implementing that seems to have broken the language setting in the /home/pi/.config/voice-recognizer.ini file.

Changing it from en-US to en-GB has no audible effect. The voice remains US based. The en-GB voice is markedly different (it is excellent and sounds like a BBC newsreader)

Microphone clips in loud environments

The current configuration applies a 30dB gain to the microphone input (with the route plugin in /etc/asound.conf). This is so that if you record speech in a quiet environment, you can hear it clearly in the recorded file. This is useful for testing the audio, although it doesn't appear to affect close-range speech recognition (we've not done much long-range testing).

The mic gain causes clipping when the voice recognizer is used in loud environments. This makes speech recognition work much worse, because the user has to speak very loudly into the mic, which the voice recognizer can't understand.

A workaround is to edit /etc/asound.conf, and change both 30.0 values in the micboost section to 10.0 or lower (but not below 1.0).

Changing the mic boost to 10.0 (20dB) may be the right long-term fix, although check_audio.py will need to be adjusted to apply another 10dB gain (or perhaps to normalize the volume?) to ensure audible output in quiet environments.

check_audio.py refers to install.sh

It should probably tell you to upgrade the kernel as in HACKING.md, or maybe even have an option to run with a non-Voice-HAT audio configuration.

Feature request: change adding user's own commands in src/action.py to separate plugin py files

Right now if an user wants to add their own commands to src/action.py they need to add their code to that file.

The problem is as corrections happen upstream it makes it harder to make sense of all the code in src/action.py

I propose to having a folder ~/voice-recognizer-raspi/src/plugins

Then each user can make their own commands or download commands made by others and place in ~/voice-recognizer-raspi/src/plugins

Then somehow ~/voice-recognizer-raspi/src/action.py needs to be changed to integrate the plugins on each start or restart. i.e. sudo systemctl restart voice-recognizer.service

Instructions to use your own Audio Input and Output with provided OS image

I am trying to use this project using my own bluetooth speaker / USB microphone. When running src/main.py from a termainal I am able to get things working after simply changing Pulseaudio sources to use my mic and my speaker. When voice-recoginzer runs as a daemon, it does not properly detect the 'default' alsa device the same way when I run aplay or arecord. I have gotten the mic to work by passing in the HW device with the -I flag, but I am unable to get my bluetooth speaker to work when voice-recognizer is running as a daemon. aplay -l only shows the Voice HAT as an audio output device.

It would be great if there were some instructions on how to BYO - mic / speaker using the provided OS image.

Adding Google AIY to DietPi

I have spent most of the day trying to add the Google Assistant AIY code to DietPi and have had limited success. I have been able to write an installation entry for DietPi, which is working up until the point that the script and /or service are started. It gets all the way through the installation and OAUTH stuff, but then fails because of audio issues and also button failure.

The pre-configured .iso image works flawlessly on my MagPi AOI kit.

If I start it up with python3 src/main.py, I get the following errors:

(env) root@AIY:/mnt/dietpi_userdata/voice-recognizer-raspi# python3 src/main.py
[2017-07-10 00:45:43,780] WARNING:main:File /tmp/status-led specified for --led-fifo does not exist.
[2017-07-10 00:45:43,792] INFO:audio:started recording
[2017-07-10 00:45:43,798] INFO:main:ready...
Press the button on GPIO 23 then speak, or press Ctrl+C to quit...
ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave
arecord: main:722: audio open error: No such file or directory
[2017-07-10 00:45:43,804] ERROR:audio:Microphone recorder died unexpectedly, aborting...

root@AIY:/mnt/dietpi_userdata/voice-recognizer-raspi# python3 checkpoints/check_audio.py
Failed to find the voiceHAT soundcard. Refer to HACKING.md for how to
setup the voiceHAT driver: https://git.io/v99yK
Press Enter to close...

It seems that the drivers either did not install or configure properly, in order to get the Voice Hat working...

Am I missing something? Perhaps I am lacking some dependencies, or something.

Please look at this GitHub issue for further details.

Follow-on queries not supported.

To reproduce, ask "What can you do?" Assistant will ask if you want more suggestions. Say "Yes", and assistant will respond that it does not understand. Also affects the trivia quiz mode.

Attempting the same with googlesamples-assistant also fails. It does understand follow-on queries but crashes as soon as it starts playing the response to one:

(google-assistant-sdk) al@al-desktop:~/aiyprojects-raspbian/src$ googlesamples-assistant
INFO:root:Connecting to embeddedassistant.googleapis.com
Press Enter to send a new request...
INFO:root:Recording audio request.
INFO:root:End of audio request detected
INFO:root:Transcript of user request: "what can you do".
INFO:root:Playing assistant response.
INFO:root:Expecting follow-on query from user.
INFO:root:Finished playing assistant response.
INFO:root:Recording audio request.
INFO:root:End of audio request detected
INFO:root:Transcript of user request: "yes".
INFO:root:Playing assistant response.
INFO:root:Expecting follow-on query from user.
Traceback (most recent call last):
  File "/home/al/google-assistant-sdk/bin/googlesamples-assistant", line 11, in <module>
    sys.exit(main())
  File "/home/al/google-assistant-sdk/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/al/google-assistant-sdk/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/al/google-assistant-sdk/lib/python3.5/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/al/google-assistant-sdk/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/al/google-assistant-sdk/lib/python3.5/site-packages/googlesamples/assistant/__main__.py", line 234, in main
    grpc_deadline):
  File "/home/al/google-assistant-sdk/lib/python3.5/site-packages/grpc/_channel.py", line 363, in __next__
    return self._next()
  File "/home/al/google-assistant-sdk/lib/python3.5/site-packages/grpc/_channel.py", line 346, in _next
    raise self
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with (StatusCode.UNAVAILABLE, Failed parsing HTTP/2)>

Multiple triggers

Hi, One of the principal use cases of the AIY kit is to play music - including music stashed in google play servers. Some people have even soldered on another DAC/AMP so they can listen in stereo.

However if you use hotword triggering - once your playback is above a certain volume level you end up being unable to reliably trigger the assistant to ask for the volume to be lowered or move to the next track etc (various people including me have implemented actions to control our favourite music players). The microphone/software can't hear the ok google trigger phrase.

I noticed in http://eduncan911.com/stem/embedded/aiy-google-assistant-upgrades-may-2017.html made a comment that currently the code only supports one trigger.

Any ideas how the catch 22 can be resolved - if it can be resolved? I am guessing that being able to trigger by another means - such as GPIO that lowers the volume/mutes the volume is an obvious beginning.

Oh I am aware of - don't play your music so loud :-) Thank You in advance

Timers and alarms don't work with GPIO/clap triggers

Hi, So now we have successfully managed to update our cardboard friend - thanks to the wonderful guidance yourselves provided - we have what seems to be another problem/issue.

In eduncan911's blog it was mentioned that the timer functionality was included in the new assistant SDK .
So we have found that
IF you setup your trigger to be ok-google - and ask the assistant to set a timer - the assistant will indeed set a timer and after the elapsed time it will tinkle away until you say ok-google stop.
HOWEVER
IF you leave that trigger at the default - which of course is our beloved pi GPIO - the timer functionality does not work - oh nooooooooooooooo
I have an awful feeling THAT (even if you have an PI 2/3 and hence you can use the new SDK) you are only using that new SDK (and its new functionality such as the timer) if you setup to use the hotword trigger.
I have an even worse feeling that whilst the new SDK knows about hotword triggering - it is clueless about GPIO.
Some people are going to want to be able to trigger via GPIO and be able to set a timer and whatever else the google-assistant is able to do down the road. Given the new SDK is only available for the PI it seems inconceivable it isn't usable with GPIO which is fundamental to the PI's being.

I've made some assumptions and may be barking up the wrong tree again. Look forward to hearing from you

Check Audio script fails.

Following the latest round of merges involving audio please note that the Check Audio script fails. This is the traceback

Playing a test sound...
Traceback (most recent call last):
  File "/home/pi/voice-recognizer-raspi/checkpoints/check_audio.py", line 198, in <module>
    main()
  File "/home/pi/voice-recognizer-raspi/checkpoints/check_audio.py", line 191, in main
    do_checks()
  File "/home/pi/voice-recognizer-raspi/checkpoints/check_audio.py", line 172, in do_checks
    if not check_speaker_works():
  File "/home/pi/voice-recognizer-raspi/checkpoints/check_audio.py", line 130, in check_speaker_works
    play_wav(TEST_SOUND_PATH)
  File "/home/pi/voice-recognizer-raspi/checkpoints/check_audio.py", line 77, in play_wav
    stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
  File "/usr/lib/python3.4/subprocess.py", line 561, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['python3', '/home/pi/voice-recognizer-raspi/src/aiy/audio.py', 'play', '/usr/share/sounds/alsa/Front_Center.wav']' returned non-zero exit status 1
Press Enter to close...

I tried the script immediately before updating my install and it worked perfectly.

Google Home app

Is the AIY meant to work with the Google Home app?
Some responses end in 'Check your Google Home app for more.' or the like.

LED not lighting up - installed on own raspberry build

Hi there,

I have setup as per HACKING.MD and the LED button doesn't light up, nor does voice recognizer start from systemctl on boot up.

If I start from main.py - the console says: info:audio:started recording but doesn't actually appear to be accepting any commands and LED still does not light up.

If I insert the card with the AIY image already loaded it works fine, LED lights up and everything works as expected.

Are there some steps missing ?

What can I do to troubleshoot ?

Unable to run scripts on startup

I have set up a wake word using snowboy. But when i tried to start the script on boot it does not seem to do anything. Following are the things that i tried.

  1. setup crontab.
  2. included the script in rc.local
  3. tried adding it in init.d
    But all these seem to do nothing.
    Any help is appreciable. TIA

Improve TTS voice

In the Raspberry.org AIY forum we have been discussing the TTS voice and how to improve it
The thread is https://www.raspberrypi.org/forums/viewtopic.php?f=114&t=188515

A significant improvement is changing tts.py from
try:
subprocess.call(['pico2wave', '--lang', lang, '-w', raw_wav, words])
subprocess.call(['play', raw_wav, '--no-show-progress', '--guard'])
finally:
os.unlink(raw_wav)

to
try:
words = '<volume level='60'><pitch level='133'>' + words + ''
subprocess.call(['pico2wave', '--lang', lang, '-w', raw_wav, words])
subprocess.call(['play', raw_wav, '--no-show-progress', '--guard'])
finally:
os.unlink(raw_wav)

simple_command don't seem to work

In action.py there are a number of simple_command.
For example

simple_command('alexa', _("We've been friends since we were both starter projects"))

If I say Alexa I don't get the response shown above.

Memory Leak error

Occasionally, once a week or more frequently, when we say, Hey Google, she responds instantly with:

Sorry, something went wrong. Please try again in a few seconds.

And many other variants similar to this to "retry" in a few seconds.

Reviewing the journal log, I found this:

Jun 25 09:22:43 spee python3[13710]: [2017-06-25 09:22:43,596] INFO:root:ON_CONVERSATION_TURN_STARTED
Jun 25 09:22:43 spee python3[13710]: [2017-06-25 09:22:43,597] INFO:main:listening...
Jun 25 09:22:43 spee python3[13710]: E0625 09:22:43.971572259   15218 network_status_tracker.c:48] Memory leaked as all network endpoints were not shut down
Jun 25 09:22:43 spee python3[13710]: [13710:15218:ERROR:speech_processing_task.cc(646)] Detected communication error: Downstream closed prematurely.
Jun 25 09:22:43 spee python3[13710]: [13710:15218:ERROR:assistant_output_handler.cc(589)] Failed with a general speech recognition error
Jun 25 09:22:43 spee python3[13710]: [2017-06-25 09:22:43,973] INFO:root:ON_ASSISTANT_ERROR:
Jun 25 09:22:43 spee python3[13710]: {'is_fatal': False}
Jun 25 09:22:43 spee python3[13710]: [2017-06-25 09:22:43,974] INFO:root:ON_RESPONDING_STARTED:
Jun 25 09:22:43 spee python3[13710]: {'is_error_response': True}
Jun 25 09:22:43 spee kernel: voicehat-codec voicehat-codec: Enabling audio amp...
Jun 25 09:22:47 spee python3[13710]: [2017-06-25 09:22:47,821] INFO:root:ON_RESPONDING_FINISHED
Jun 25 09:22:47 spee python3[13710]: [2017-06-25 09:22:47,822] INFO:root:ON_CONVERSATION_TURN_FINISHED:
Jun 25 09:22:47 spee python3[13710]: {'with_follow_on_turn': False}
Jun 25 09:22:47 spee kernel: voicehat-codec voicehat-codec: Disabling audio amp...
Jun 25 09:22:47 spee python3[13710]: [2017-06-25 09:22:47,823] INFO:main:ready...

Do note that the speech that comes back is the Google-streamed or "Real" Assistant SDK voice - not the cheap-robot-sounding local commands version of the voice. So it is reaching the SDK.

You can also see in the error log that the stacktrace includes the C files - there aren't any C files in this AIY Projects repo.

Most likely an issue with the SDK. I'll cross-post the issue over there.

main.py crashes when config file is not present

If you run src/main.py without a config file, you get this error:

File "src/main.py", line 149, in main
  os.path.expanduser(args.assistant_secrets))
File ..., in expanduser
  if not path.startswith(tilde):
AttributeError: 'NoneType' object has no attribute 'startswith'

What should we do in this case? Should we have a default in the code, or should we tell the user to install the default config file?

No voice-recognizer.pid file when running main.py

Following the HACKING.md file up to these steps:

cd ~/voice-recognizer-raspi
source env/bin/activate
python3 src/main.py

This is the traceback I get.

Traceback (most recent call last):
  File "src/main.py", line 302, in <module>
    main()
  File "src/main.py", line 139, in main
    create_pid_file(args.pid_file)
  File "src/main.py", line 105, in create_pid_file
    with open(file_name, 'w') as pid_file:
FileNotFoundError: [Errno 2] No such file or directory: '/run/user/1000/voice-recognizer.pid'

enable actions via config file

We're gettting PRs for actions like:

  • shutdown and reboot commands: #30
  • hue lights: #33

Some of the actions need parameters (hue) and some actions are potentially dangerous, so that not everyone wants them. It would be nice to have a way to enable/disable them and also pass options for them. We would then split action.py into files under action/*.py and load them as enabled in the config file. Ideally we pass each plugin its config section to the constructor.

We can't keep using configargparse since that has no section support.
We would switch to ConfigParser to read the config. Then we can see the command-line arg defaults with the config file (so that the command line args can override config value). Unforunately the ConfigParser API does not allow to pass a section object around to constrain reading it. Maybe we just read the section on behalf of the plugin and pass it as a dict?

Bulb flashing

Hi,

Really great kit! I'm already having fun with it.

How can I stop the bulb flashing all the time when it's waiting for a button press? The guide says I can do this "by modifying the configuration file in ~/voice-recognizer-raspi/config/status-led.ini.default", but I can't see how to make this work.

Thanks for your help,
Peter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.