-
-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pi freezes/crashes as soon as audio detected #622
Comments
I too have this issue. Newest Raspiant Stretch and Model B+. Using a USB Razer mic, and I get the exact same terminal output. This happens regardless of starting the service or via the demo command. Sometimes it gets past the jingle and says 'Hi', other times it cuts off during it. |
The problem is not all mics are compatible with the google assistant. In the asoundrc and asound.conf file, try changing the channels to 2 |
Just tried this, the problem still persists. It crashes before it even says "Hi". Also, interesting note, when it does crash it seems to leave the Pi running as the activity LED blinks every once in a while, but the ethernet connection is completely turned off, cutting off any SSH connections obviously. |
Manually start the assistant and post the output here. |
pi@raspberrypi:~$ /home/${USER}/env/bin/python -u /home/${USER}/GassistPi/src/p ushbutton.py --project-id rpiassistant-XXXXX --device-model-id rpiassistant-XXXXXXXXX Identical output to his, and it freezes right after with no more output. |
This could be related to a potential Mic compatibility issue as I have also tried running the Googlesample script, googlesamples-assistant-pushtotalk.py that is located at: /home/pi/env/bin. |
Tested with 3 different USB mics: Snowball iCE USB Microphone For each mic I tried changing the asoundrc and asound.conf file channels to 2. The suggestion over on googlesamples is that the PI1 CPU gets maxxed out trying to handle the input and output audio streams. TBH the technical detail is beyond me but its interesting that the pushtotalk.py script works (albeit with buffer underflow errors) yet the pushputton.py sample crashes the Pi as soon as the audio input stream is active. |
I tried installing and running the Googlesamples scripts, but I end up with no audio output or input. I think it's just the config files or whatever Pulseaudio is messing with ALSA cause my mic and speaker output work in AlexaPi. The 'audiotest' script doesnt record or play anything, and the 'pushtotalk' script gets to "Press enter to whatever" but upon pressing it just does nothing and displays that same line again after a couple seconds. |
@penbob3 Shame, was hoping you'd have the same output as me with pushtotalk.py. You said you installed the scripts? Did you not already have a copy of pushtotalk.py (actual filename of mine is googlesamples-assistant-pushtotalk.py) in /home/pi/env/bin? Of note though, it sounds like the Pi isn't crashing/freezing when you run it? I thought it wasn't doing anything when i first tried it but turns out it was just that the volume level for the device had been set really low. The Assistant itself has a volume control too and I found this was also set very low. After pressing Enter say "Set volume to max or 100%" to turn up to full volume. Sounds obvious but have you also checked the Alsamixer volume level for your playback device. Mine is at almost max and even then the output from pushtotalk.py was quite low. I assume you tried saying a command like "What is the time?" after you pressed enter? If I run mine, press enter and say nothing it does as you described, sits there for few seconds then outputs "Press Enter to send a request". This suggests that it is not detecting any audio in. Are you sure the gain setting on Alsamixer for your mic is turned up? Sorry for the basic questions but sometimes it is the simplest of things causing the problem. |
OK making progress. I have managed to stop
inserted this at the beginning of the code and stepped through the program to try and find where the crash was being caused. It appears that it might have something to with the hard coded pushbutton and indicator routines. I am running a headless Pi connected via VNC and have no additional hardware e.g push buttons or indicator lights connected. After noting where the program crashed I commented out the following lines of code:
With above changes made to
After the initial start up melody and "Hi" [startup.wav] there is no further output. Pressing the Enter key has no effect however when I press CTRL+C I hear what I think is the "listening" chime [fb.wav]. If I then speak a command (without pressing Enter or saying a hotword) the text of the command is presented in the terminal window and the assistant provides a verbal response. It is limited success though because (possibly related to stopbutton routine being disbled) the "listening" chime [fb.wav] repeats every few seconds so it is effectively always on. An additional downside is that I am unable to exit the program. As mentioned all keyboard entry including CTRL+C is just relayed to to the terminal window as text. The program can only be exited by closing the terminal. So it works but only sort of! Anybody know what might be causing the Pi to crash in the stoppushbutton and assistantindicator routines? |
#544 Also reports |
Stop button is controlled by a thread. In python you cannot exit or end a thread easily. If Wakeword is enabled, then pushbutton will not work. I have already mentioned that in #544 . The audio issues started after the Aug 9 commit in the SDK. googlesamples/assistant-sdk-python@d05f675 May be you can try to undo the change what they did. you can find your audiohelper file in the googlesamples folder within the environment. |
And adding to that, ENTER key is not the mode to trigger the pushbutton script of this project. Its only for the googlesamples file. If you disable wakeword, then pushbutton trigger will become active. |
@Colin1964 did you ever sort this issue out? I am having same problem with pushbutton.py etc. Running a pi zero w and 2 mic pi hat. Assistant starts working but and I can ask a few questions but then it would all of a sudden stop working until I reboot the pi. |
I too encountered the same issue, I am using pi0w with, The main thing is the assistant does like sharing the audio. (using "dmix" in asound.conf or .asoundrc") It needs to be dedicated. Use this following .asoundrc to override, change the hw ID and it should work. But the bad thing is you can't use any other tools like aplay or anything pcm.!default { |
I'm having a similar issue. I got the assistant installed, started up, and working fine, but it couldn't access youtube to play music, which is a big part of its intended function. I followed the steps to enable youtube and run on startup, they appeared to go fine, but when I rebooted I get the chime, a "hello", and then it crashes. I ran the line to manually start and it appears to do speech to text, but nothing else. Manual start results pasted below. Thanks in advance! pi@raspberrypi:~ $ aplay -l ON_MUTED_CHANGED: ON_MEDIA_STATE_IDLE ON_START_FINISHED ON_CONVERSATION_TURN_STARTED ON_END_OF_UTTERANCE ON_END_OF_UTTERANCE ON_RECOGNIZING_SPEECH_FINISHED: ON_RESPONDING_STARTED: |
Describe the bug:
Did you go through or search the issues section to check if your issue was already discussed (either currently open issues or closed issues).
Yes
2. Is the issue related to assistant installation ?
No
If answer to question 2 is Yes, then paste the contents of the terminal below.
If answer to question 2 is No, then proceed further.
3. Does the assistant service start normally?
Yes
4. Is the assistant service restarting automatically?
Yes/No - Not tested
If answer to question 4 is Yes, then paste the contents of the terminal below.
If answer to question 4 is No, then proceed further.
Manually start the assistant. For guidelines to start the assistant manually refer this
Paste the command below, that crashed the assistant
Paste the contents of the terminal below
Attach the log file. Log file can be found in /tmp directory. Remeber to copy your log file before shutting down or restarting the Pi.
No log file in /tmp
The text was updated successfully, but these errors were encountered: