Device registration is reported unregistered, while it is registered OR it core dumps
When trying the googlesamples-assistant-hotword bit, the assistant does not work at all. This is the result of the hotword command;
(env) root@Archibald:~# googlesamples-assistant-hotword --device-model-id ruby-pi-device
device_model_id: ruby-pi-device
device_id: D0C5CC7B221DCAF817F0AF2F0B5F9F52
This device is not registered. This means you will not be able to use
Device Actions or see your device in Assistant Settings. In order to
register this device follow instructions at:
https://developers.google.com/assistant/sdk/guides/library/python/embed/register-device
ON_MUTED_CHANGED:
{"is_muted": false}
ON_START_FINISHED
And this, if the project_id provided, when it segfaults;
(env) root@Archibald:~# googlesamples-assistant-hotword --device-model-id ruby-pi-device --project-id ruby-pi-ecf61
device_model_id: ruby-pi-device
device_id: D0C5CC7B221DCAF817F0AF2F0B5F9F52
Segmentation fault (core dumped)
Howevere, the devices, according to the tool, is registered:
(env) root@Archibald:~googlesamples-assistant-devicetool --project-id ruby-pi-ecf61 list --device
Device Instance ID: D0C5CC7B221DCAF817F0AF2F0B5F9F52
Nickname: Ruby Pi
Model: ruby-pi-device
Also, when it only complains, not segfaults, the assistant is not working, no input is gathered on the mic. When running the push-to-talk version, it does work, but it then uses an other device id;
(env) root@Archibald:~/googleassistant# googlesamples-assistant-pushtotalk --device-model-id ruby-pi-device --project-id ruby-pi-ecf61
INFO:root:Connecting to embeddedassistant.googleapis.com
INFO:root:Using device model ruby-pi-device and device id 3a3bfe3e-0eb3-11e9-add6-00163ebd7567
Press Enter to send a new request...
I've rebuild the entire system from scratch twice now. So I believe it's reproducible.
Yes same issue for me maybe there is an issue with Google Cloud. I hope someone will find the solution or at least try to help :)
Same issue here
Which version of the library are you using? 1.0.0 or 1.0.1?
I believe version 1.0.0, as it's in the pip list;
(env) root@Basil:/# pip list --format columns
Package Version
------------------------ ----------
asn1crypto 0.24.0
cachetools 3.0.0
certifi 2018.11.29
cffi 1.11.5
chardet 3.0.4
click 6.7
cryptography 2.4.2
enum34 1.1.6
futures 3.1.1
google-assistant-grpc 0.2.1
google-assistant-library 1.0.0
google-assistant-sdk 0.5.1
google-auth 1.6.2
google-auth-oauthlib 0.2.0
googleapis-common-protos 1.5.5
grpcio 1.17.1
idna 2.8
ipaddress 1.0.22
oauthlib 2.1.0
pathlib2 2.3.3
pip 18.1
pkg-resources 0.0.0
protobuf 3.6.1
pyasn1 0.4.5
pyasn1-modules 0.2.3
pycparser 2.19
pyOpenSSL 18.0.0
requests 2.21.0
requests-oauthlib 1.0.0
rsa 4.0
setuptools 40.6.3
six 1.12.0
sounddevice 0.3.12
tenacity 4.12.0
urllib3 1.24.1
wheel 0.32.3
However, no update is available it seems;
(env) root@Basil:/# pip install --upgrade google-assistant-library
Requirement already up-to-date: google-assistant-library in /env/lib/python3.5/site-packages (1.0.0)
Requirement already satisfied, skipping upgrade: enum34<2,>=1.1.6 in /env/lib/python3.5/site-packages (from google-assistant-library) (1.1.6)
Requirement already satisfied, skipping upgrade: pathlib2<3,>=2.3.0 in /env/lib/python3.5/site-packages (from google-assistant-library) (2.3.3)
Requirement already satisfied, skipping upgrade: requests<3,>=2.14.2 in /env/lib/python3.5/site-packages (from google-assistant-library) (2.21.0)
Requirement already satisfied, skipping upgrade: argparse<2,>=1.4.0 in /env/lib/python3.5/site-packages (from google-assistant-library) (1.4.0)
Requirement already satisfied, skipping upgrade: google-auth<2,>=1.0.1 in /env/lib/python3.5/site-packages (from google-assistant-library) (1.6.2)
Requirement already satisfied, skipping upgrade: six in /env/lib/python3.5/site-packages (from pathlib2<3,>=2.3.0->google-assistant-library) (1.12.0)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in /env/lib/python3.5/site-packages (from requests<3,>=2.14.2->google-assistant-library) (2018.11.29)
Requirement already satisfied, skipping upgrade: idna<2.9,>=2.5 in /env/lib/python3.5/site-packages (from requests<3,>=2.14.2->google-assistant-library) (2.8)
Requirement already satisfied, skipping upgrade: urllib3<1.25,>=1.21.1 in /env/lib/python3.5/site-packages (from requests<3,>=2.14.2->google-assistant-library) (1.24.1)
Requirement already satisfied, skipping upgrade: chardet<3.1.0,>=3.0.2 in /env/lib/python3.5/site-packages (from requests<3,>=2.14.2->google-assistant-library) (3.0.4)
Requirement already satisfied, skipping upgrade: pyasn1-modules>=0.2.1 in /env/lib/python3.5/site-packages (from google-auth<2,>=1.0.1->google-assistant-library) (0.2.3)
Requirement already satisfied, skipping upgrade: rsa>=3.1.4 in /env/lib/python3.5/site-packages (from google-auth<2,>=1.0.1->google-assistant-library) (4.0)
Requirement already satisfied, skipping upgrade: cachetools>=2.0.0 in /env/lib/python3.5/site-packages (from google-auth<2,>=1.0.1->google-assistant-library) (3.0.0)
Requirement already satisfied, skipping upgrade: pyasn1<0.5.0,>=0.4.1 in /env/lib/python3.5/site-packages (from pyasn1-modules>=0.2.1->google-auth<2,>=1.0.1->google-assistant-library) (0.4.5)
At least not from the default pip command.
Edit: quick search found that 1.0.1 is available, trying to install that now.
Trying to install 1.0.1 results in these;
> https://files.pythonhosted.org/packages/70/c0/632580998a1d483938fd27cc27bc96d87efd1b0966db374bbc14b8ebafae/google_assistant_library-1.0.1-py2.py3-none-manylinux2010_x86_64.whl#sha256=b7f705ec342dfb3ce9cece8272234601c8352d229b3043c62031fc4acc36456a (from https://pypi.org/simple/google-assistant-library/); it is not compatible with this Python
> Installed version (1.0.0) is most up-to-date (past versions: 0.0.3, 0.1.0, 0.1.1, 1.0.0)
>
While this is the install
(env) root@Basil:/# python --version
Python 3.5.2
Manually replacing the files in the install with those from https://files.pythonhosted.org/packages/70/c0/632580998a1d483938fd27cc27bc96d87efd1b0966db374bbc14b8ebafae/google_assistant_library-1.0.1-py2.py3-none-manylinux2010_x86_64.whl#sha256=b7f705ec342dfb3ce9cece8272234601c8352d229b3043c62031fc4acc36456a
Seems to have bypassed the issue. At least no core dumps.
Ok so I noticed something weird... Pushtotalk is working fine actually but hotword isn't, I still have this core dumped issue. I only want to use hotword not pushtotalk :(
Yes I have same issue when using googlesamples-assistant-hotword but have no problem when using google-assistant-demo.
Here is my detail issue : https://stackoverflow.com/a/54209321/1802624
Besides that using our own version of hotword.py is also have no problem : https://github.com/googlesamples/assistant-sdk-python/tree/master/google-assistant-sdk/googlesamples/assistant/library
(env) omprakash@omprakash:~$ googlesamples-assistant-hotword --project-id assistant-60d3a --device-model-id assistant-60d3a-assistant-6c4k5s Segmentation fault (core dumped) i am using the google-assistant-library version 1.0.1. but it can not resolve.
(env) omprakash@omprakash:~$ googlesamples-assistant-hotword --project-id assistant-60d3a --device-model-id assistant-60d3a-assistant-6c4k5s Segmentation fault (core dumped) i am using the google-assistant-library version 1.0.1. but it can not resolve.
@redopm try to clone the project from https://github.com/googlesamples/assistant-sdk-python and work directly with the hotword.py solving my issue.
Here you can download and modified the hotword.py file : https://github.com/googlesamples/assistant-sdk-python/tree/master/google-assistant-sdk/googlesamples/assistant/library
I am clone this directory but it cann't be resolve. i am cloning in my virtual environment created in python.
if i run this (env) omprakash@omprakash:~/env$ googlesamples-assistant-pushtotalk --project-id assistant-60d3a --device-model-id assistant-60d3a-assistant-6c4k5s INFO:root:Connecting to embeddedassistant.googleapis.com WARNING:root:Device config not found: [Errno 2] No such file or directory: '/home/omprakash/.config/googlesamples-assistant/device_config.json' INFO:root:Registering device ERROR:root:Failed to register device: { "error": { "code": 400, "message": "Could not create the device instance. Project_id from side channel and project_id from url do not match.", "status": "INVALID_ARGUMENT" } }
(env) omprakash@omprakash:~/env$ i found error
Did you already updated all the required packages?
env/bin/python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade google-assistant-library==1.0.0
python -m pip install --upgrade google-assistant-sdk[samples]==0.5.1
And did you try to execute with this way after clone the project and execute the hotword.py?
hotword.py --project-id assistant-60d3a --device-model-id assistant-60d3a-assistant-6c4k5s
When i run this i found error again (env) omprakash@omprakash:~/env/assistant-sdk-python/google-assistant-sdk/googlesamples/assistant/library$ python3 hotword.py --project-id assistant-60d3a --device-model-id assistant-60d3a-assistant-6c4k5s Fatal Python error: Segmentation fault
Current thread 0x00007f1bc8ff8740 (most recent call first):
File "/home/omprakash/env/lib/python3.6/site-packages/google/assistant/library/assistant.py", line 98 in init
File "hotword.py", line 130 in main
File "hotword.py", line 160 in
I had the same SEGV issue. It seems that string/buffer operaiton code needs to be fixed in libassistant_embedder.so which is not open source.
(env) ubuntu@bionic:~/work/google/assistant-sdk/project$ gdb env/bin/python3 (gdb) run env/bin/googlesamples-assistant-hotword --project-id XXX --device-model-id XXX --nickname XXX --query XXX Starting program: /home/ubuntu/work/google/assistant-sdk/project/env/bin/python3 env/bin/googlesamples-assistant-hotword --project-id XXX --device-model-id XXX --nickname XXX --query XXX [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault. __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:62 62 ../sysdeps/x86_64/multiarch/strlen-avx2.S: No such file or directory. (gdb) bt #0 __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:62 #1 0x00007ffff404454d in ?? () from /home/ubuntu/work/google/assistant-sdk/project/env/lib/python3.6/site-packages/google/assistant/library/libassistant_embedder.so #2 0x00007ffff4040253 in assistant_new () from /home/ubuntu/work/google/assistant-sdk/project/env/lib/python3.6/site-packages/google/assistant/library/libassistant_embedder.so #3 0x00007ffff626fdae in ffi_call_unix64 () from /usr/lib/x86_64-linux-gnu/libffi.so.6 #4 0x00007ffff626f71f in ffi_call () from /usr/lib/x86_64-linux-gnu/libffi.so.6 #5 0x00007ffff6483524 in _ctypes_callproc () from /usr/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so #6 0x00007ffff6483cb4 in ?? () from /usr/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so #7 0x00000000005a730c in _PyObject_FastCallKeywords () #8 0x0000000000503073 in ?? () #9 0x0000000000506859 in _PyEval_EvalFrameDefault () #10 0x0000000000501945 in _PyFunction_FastCallDict () #11 0x0000000000591461 in ?? () #12 0x000000000054b813 in ?? () #13 0x0000000000555421 in ?? () #14 0x00000000005a730c in _PyObject_FastCallKeywords () #15 0x0000000000503073 in ?? () #16 0x0000000000506859 in _PyEval_EvalFrameDefault () #17 0x0000000000502209 in ?? () #18 0x0000000000502f3d in ?? () #19 0x0000000000506859 in _PyEval_EvalFrameDefault () #20 0x0000000000504c28 in ?? () #21 0x0000000000506393 in PyEval_EvalCode () #22 0x0000000000634d52 in ?? () #23 0x0000000000634e0a in PyRun_FileExFlags () #24 0x00000000006385c8 in PyRun_SimpleFileExFlags () #25 0x000000000063915a in Py_Main () #26 0x00000000004a6f10 in main () (gdb)
(env) ubuntu@bionic:~/work/google/assistant-sdk/project$ pip list Package Version
cachetools 3.1.0 certifi 2019.3.9 cffi 1.12.2 chardet 3.0.4 click 6.7 enum34 1.1.6 futures 3.1.1 google-assistant-grpc 0.2.1 google-assistant-library 1.0.1 google-assistant-sdk 0.5.1 google-auth 1.6.3 google-auth-oauthlib 0.3.0 googleapis-common-protos 1.5.9 grpcio 1.20.0 idna 2.8 oauthlib 3.0.1 pathlib2 2.3.3 pip 19.0.3 pkg-resources 0.0.0 protobuf 3.7.1 pyasn1 0.4.5 pyasn1-modules 0.2.4 pycparser 2.19 requests 2.21.0 requests-oauthlib 1.2.0 rsa 4.0 setuptools 41.0.0 six 1.12.0 sounddevice 0.3.13 tenacity 4.12.0 urllib3 1.24.2 wheel 0.33.1
I have segmentation fault on orange pi zero too with ubuntu!
guys any update on this? I am running orange pi zero armbian but get segmentation fault
Hi,
I have some news about this issue.
First step is to update the hotword.py file, which adds the following:
#new code
import faulthandler
faulthandler.enable()
#existing code
try:
FileNotFoundError
except NameError:
FileNotFoundError = IOError
After that I was able to follow the issue up to assistant.py. Something wen wrong here, but by now I don't know what:
#line97
self._inst = c_void_p(
self._lib.assistant_new(
self._event_callback,
device_model_id.encode('ASCII')))
The error is about this:
device_model_id.encode('ASCII')))
Any ideas?
For what I can see, the commands use different technologies:
-
Google Assistant Library google-assistant-demo googlesamples-assistant-hotword
-
gRPC googlesamples-assistant-audiotest googlesamples-assistant-devicetool googlesamples-assistant-pushtotalk
Could it be possible that googlesamples-assistant-hotword hasn't been ported to gRPC, yet...?
Well, sometimes is better to hack what is working. So I modified googlesamples-assistant-pushtotalk to avoid to stop for an 'enter' to record.
In the file env/lib/python3.7/site-packages/googlesamples/assistant/grpc/pushtotalk.py you can comment the following lines:
#line456
# if wait_for_user_trigger:
# click.pause(info='Press Enter to send a new request...')
Now you have the assistant listening all the time. It's not the same, but it could work in some cases!
For those asking about this issue, seems this is a dead way.
As discussed on #356, #357 and #358, the use with the old library is deprecated and this affect to hotword.
The new Goggle Assistant Service works over gRPC and right now there a discussion on how to adapt the pushtotalk working feature to make something like hotword.
IMHO, this issue can be closed.
but is the solution in gRPC available yet?
The initial issue reported is solved.
The hotword recognition is not yet solved, but this is other issue. :)
check this post for workaround and clarification from google https://github.com/googlesamples/assistant-sdk-python/issues/356#issuecomment-545257177
So, as I said before, the hotword recognition is not yet solved and seems that have to be achieved with a 3rd party tool.
Is better to close this issue.
Long time ago I use https://github.com/Kitt-AI/snowboy to trigger push-to-talk (c++ ver) on Rasp pi zero. Look like it's the only working option right now.