OpenVoiceOS / ovos-buildroot

Open Voice Operating System - Buildroot edition is a minimalistic linux OS bringing the OVOS voice assistant to embbeded, low-spec headless and/or small (touch)screen devices.
Apache License 2.0
232 stars 36 forks source link

Listener: Setting the listener to precise fails #6

Closed j1nx closed 5 years ago

j1nx commented 6 years ago

Information

While I am still working on different core aspects of MycroftOS and the Mycroft A.I. software stack, I did observed a bug that prevents the system to use the precise wakeword mechanism.

I have not yet digged into this, however do have some ideas where to start looking. Creating this Issue to open get the bug out in the open. Perhaps one of you already knows exactly what is going on, saving me the trouble to hunt it down later on in time.

Bug description

When Mycroft is fully booted and loaded up. Start the Mycroft CLI and run the command;

This will download and extract the precise data binaries, however enabling it failes. Below the responsing snippet from the /var/log/mycroft/voice.log

20:52:52.169 - mycroft.client.speech.listener:run:335 - DEBUG - Config has changed, reloading... 20:52:52.675 - mycroft.client.speech.listener:create_wake_word_recognizer:243 - INFO - creating wake word engine 20:52:52.689 - mycroft.client.speech.hotword_factory:load_module:261 - INFO - Loading "hey mycroft" wake word via precise 20:52:52.704 - mycroft.configuration.config:load_local:109 - DEBUG - Configuration /.mycroft/mycroft.conf loaded 20:52:52.718 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): github.com:443 20:52:53.251 - urllib3.connectionpool - DEBUG - https://github.com:443 "GET /MycroftAI/precise-data/raw/dist/armv7l/latest HTTP/1.1" 302 141 20:52:53.269 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): raw.githubusercontent.com:443 20:52:53.446 - urllib3.connectionpool - DEBUG - https://raw.githubusercontent.com:443 "GET /MycroftAI/precise-data/dist/armv7l/latest HTTP/1.1" 200 111 20:52:56.605 - mycroft.client.speech.hotword_factory:<lambda>:175 - INFO - Updated precise model 20:52:56.873 - mycroft.client.speech.hotword_factory:initialize:281 - ERROR - Could not create hotword. Falling back to default. Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/mycroft/client/speech/hotword_factory.py", line 269, in initialize instance = clazz(hotword, config, lang=lang) File "/usr/lib/python3.6/site-packages/mycroft/client/speech/hotword_factory.py", line 152, in __init__ self.runner.start() File "/usr/lib/python3.6/site-packages/precise_runner/runner.py", line 159, in start self.engine.start() File "/usr/lib/python3.6/site-packages/precise_runner/runner.py", line 53, in start self.proc = Popen(self.exe_args, stdin=PIPE, stdout=PIPE) File "/usr/lib/python3.6/subprocess.py", line 709, in __init__ restore_signals, start_new_session) File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: '/root/.mycroft/precise/precise-engine/precise-engine': '/root/.mycroft/precise/precise-engine/precise-engine' 20:52:56.897 - mycroft.client.speech.hotword_factory:load_module:261 - INFO - Loading "hey mycroft" wake word via pocketsphinx 20:52:57.119 - mycroft.client.speech.listener:create_wakeup_recognizer:263 - INFO - creating stand up word engine 20:52:57.131 - mycroft.client.speech.hotword_factory:load_module:261 - INFO - Loading "wake up" wake word via pocketsphinx 20:52:57.359 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443 20:52:57.944 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/device/df2088fe-5ac9-4e9d-b042-81f23a1233a6 HTTP/1.1" 304 0 20:53:02.251 - mycroft.client.speech.hotword_factory:on_complete:211 - INFO - Precise download complete! 20:53:03.984 - mycroft.client.speech.listener:create_wake_word_recognizer:243 - INFO - creating wake word engine 20:53:03.995 - mycroft.client.speech.hotword_factory:load_module:261 - INFO - Loading "hey mycroft" wake word via precise 20:53:04.004 - mycroft.configuration.config:load_local:109 - DEBUG - Configuration /.mycroft/mycroft.conf loaded 20:53:04.017 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): github.com:443 20:53:04.459 - urllib3.connectionpool - DEBUG - https://github.com:443 "GET /MycroftAI/precise-data/raw/dist/armv7l/latest HTTP/1.1" 302 141 20:53:04.476 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): raw.githubusercontent.com:443 20:53:04.645 - urllib3.connectionpool - DEBUG - https://raw.githubusercontent.com:443 "GET /MycroftAI/precise-data/dist/armv7l/latest HTTP/1.1" 200 111 20:53:06.799 - mycroft.client.speech.hotword_factory:initialize:281 - ERROR - Could not create hotword. Falling back to default. Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/mycroft/client/speech/hotword_factory.py", line 269, in initialize instance = clazz(hotword, config, lang=lang) File "/usr/lib/python3.6/site-packages/mycroft/client/speech/hotword_factory.py", line 152, in __init__ self.runner.start() File "/usr/lib/python3.6/site-packages/precise_runner/runner.py", line 159, in start self.engine.start() File "/usr/lib/python3.6/site-packages/precise_runner/runner.py", line 53, in start self.proc = Popen(self.exe_args, stdin=PIPE, stdout=PIPE) File "/usr/lib/python3.6/subprocess.py", line 709, in __init__ restore_signals, start_new_session) File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: '/root/.mycroft/precise/precise-engine/precise-engine': '/root/.mycroft/precise/precise-engine/precise-engine' 20:53:06.811 - mycroft.client.speech.hotword_factory:load_module:261 - INFO - Loading "hey mycroft" wake word via pocketsphinx 20:53:07.029 - mycroft.client.speech.listener:create_wakeup_recognizer:263 - INFO - creating stand up word engine 20:53:07.038 - mycroft.client.speech.hotword_factory:load_module:261 - INFO - Loading "wake up" wake word via pocketsphinx

A quick look around shows that the downloading and extracting works;

`# cd /root/.mycroft/precise/

ls -la

total 50740 drwxr-xr-x 3 root root 4096 Nov 1 20:52 . drwx------ 6 root root 4096 Nov 1 20:52 .. -rw-rw-r-- 1 dbus dbus 26556 Mar 21 2018 hey-mycroft.pb -rw-rw-r-- 1 dbus dbus 132 Mar 21 2018 hey-mycroft.pb.params -rw-r--r-- 1 root root 11540 Nov 1 20:52 hey-mycroft.tar.gz drwxr-xr-x 5 dbus dbus 4096 Jun 25 19:05 precise-engine -rw-r--r-- 1 root root 51899731 Nov 1 20:52 precise-engine_0.2.0_armv7l.tar.gz`

`# cd precise-engine/

ls -la

total 134972 drwxr-xr-x 5 dbus dbus 4096 Jun 25 19:05 . drwxr-xr-x 3 root root 4096 Nov 1 20:52 .. -rwxr-xr-x 1 dbus dbus 15672 Jun 15 00:08 _bz2.so -rwxr-xr-x 1 dbus dbus 132644 Jun 15 00:08 _codecs_cn.so -rwxr-xr-x 1 dbus dbus 144948 Jun 15 00:07 _codecs_hk.so -rwxr-xr-x 1 dbus dbus 17964 Jun 15 00:07 _codecs_iso2022.so -rwxr-xr-x 1 dbus dbus 226856 Jun 15 00:07 _codecs_jp.so -rwxr-xr-x 1 dbus dbus 124448 Jun 15 00:07 _codecs_kr.so -rwxr-xr-x 1 dbus dbus 99872 Jun 15 00:07 _codecs_tw.so -rwxr-xr-x 1 dbus dbus 32008 Jun 15 00:10 _csv.so -rwxr-xr-x 1 dbus dbus 103340 Jun 15 00:08 _ctypes.so -rwxr-xr-x 1 dbus dbus 75036 Jun 15 00:08 _curses.so -rwxr-xr-x 1 dbus dbus 157524 Jun 15 00:08 _decimal.so -rwxr-xr-x 1 dbus dbus 23716 Jun 15 00:08 _hashlib.so -rwxr-xr-x 1 dbus dbus 44148 Jun 15 00:09 _json.so -rwxr-xr-x 1 dbus dbus 26648 Jun 15 00:08 _lzma.so -rwxr-xr-x 1 dbus dbus 32712 Jun 15 00:08 _multibytecodec.so -rwxr-xr-x 1 dbus dbus 14440 Jun 15 00:08 _multiprocessing.so -rwxr-xr-x 1 dbus dbus 5680 Jun 15 00:09 _opcode.so -rwxr-xr-x 1 dbus dbus 78932196 Jun 25 19:04 _pywrap_tensorflow_internal.so -rwxr-xr-x 1 dbus dbus 77224 Jun 15 00:07 _ssl.so -rwxr-xr-x 1 dbus dbus 41872 Jun 15 00:10 audioop.so -rw-r--r-- 1 dbus dbus 730332 Jun 25 19:00 base_library.zip -rwxr-xr-x 1 dbus dbus 71824 Jun 15 00:10 h5py._conv.so -rwxr-xr-x 1 dbus dbus 47724 Jun 15 00:10 h5py._errors.so -rwxr-xr-x 1 dbus dbus 133212 Jun 15 00:10 h5py._objects.so -rwxr-xr-x 1 dbus dbus 38828 Jun 15 00:10 h5py._proxy.so -rwxr-xr-x 1 dbus dbus 199868 Jun 15 00:10 h5py.defs.so -rwxr-xr-x 1 dbus dbus 99416 Jun 15 00:10 h5py.h5.so -rwxr-xr-x 1 dbus dbus 135976 Jun 15 00:10 h5py.h5a.so -rwxr-xr-x 1 dbus dbus 56088 Jun 15 00:09 h5py.h5ac.so -rwxr-xr-x 1 dbus dbus 123132 Jun 15 00:10 h5py.h5d.so -rwxr-xr-x 1 dbus dbus 73752 Jun 15 00:10 h5py.h5ds.so -rwxr-xr-x 1 dbus dbus 119824 Jun 15 00:10 h5py.h5f.so -rwxr-xr-x 1 dbus dbus 18796 Jun 15 00:10 h5py.h5fd.so -rwxr-xr-x 1 dbus dbus 173424 Jun 15 00:10 h5py.h5g.so -rwxr-xr-x 1 dbus dbus 53344 Jun 15 00:10 h5py.h5i.so -rwxr-xr-x 1 dbus dbus 105624 Jun 15 00:10 h5py.h5l.so -rwxr-xr-x 1 dbus dbus 103204 Jun 15 00:10 h5py.h5o.so -rwxr-xr-x 1 dbus dbus 368052 Jun 15 00:10 h5py.h5p.so -rwxr-xr-x 1 dbus dbus 54580 Jun 15 00:10 h5py.h5r.so -rwxr-xr-x 1 dbus dbus 119176 Jun 15 00:10 h5py.h5s.so -rwxr-xr-x 1 dbus dbus 512992 Jun 15 00:10 h5py.h5t.so -rwxr-xr-x 1 dbus dbus 36144 Jun 15 00:10 h5py.h5z.so -rwxr-xr-x 1 dbus dbus 43348 Jun 15 00:10 h5py.utils.so drwxr-xr-x 3 dbus dbus 4096 Jun 25 19:05 include drwxr-xr-x 3 dbus dbus 4096 Jun 25 19:05 lib drwxr-xr-x 2 dbus dbus 4096 Jun 25 19:05 lib2to3 -rwxr-xr-x 1 dbus dbus 66008 Jun 15 00:10 libbz2.so.1.0 -rwxr-xr-x 1 dbus dbus 1418540 Jun 15 00:10 libcrypto.so.1.0.0 -rwxr-xr-x 1 dbus dbus 136660 Jun 15 00:07 libexpat.so.1 -rwxr-xr-x 1 dbus dbus 30376 Jun 15 00:10 libffi.so.6 -rwxr-xr-x 1 dbus dbus 117520 Jun 15 00:07 libgcc_s.so.1 -rwxr-xr-x 1 dbus dbus 647200 Jun 15 00:10 libgfortran.so.3 -rwxr-xr-x 1 dbus dbus 2978844 Jun 15 00:10 libhdf5_serial.so.8 -rwxr-xr-x 1 dbus dbus 105048 Jun 15 00:10 libhdf5_serial_hl.so.8 -rwxr-xr-x 1 dbus dbus 5614860 Jun 15 00:10 liblapack.so.3 -rwxr-xr-x 1 dbus dbus 124592 Jun 15 00:10 liblzma.so.5 -rwxr-xr-x 1 dbus dbus 157916 Jun 15 00:10 libmpdec.so.2 -rwxr-xr-x 1 dbus dbus 178600 Jun 15 00:10 libncursesw.so.5 -rwxr-xr-x 1 dbus dbus 7896044 Jun 15 00:10 libopenblas.so.0 -rwxr-xr-x 1 dbus dbus 3753972 Jun 15 00:10 libpython3.4m.so.1.0 -rwxr-xr-x 1 dbus dbus 227624 Jun 15 00:10 libreadline.so.6 -rwxr-xr-x 1 dbus dbus 300868 Jun 15 00:10 libssl.so.1.0.0 -rwxr-xr-x 1 dbus dbus 809612 Jun 15 00:10 libstdc++.so.6 -rwxr-xr-x 1 dbus dbus 125348 Jun 15 00:10 libtinfo.so.5 -rwxr-xr-x 1 dbus dbus 91888 Jun 15 00:07 libz.so.1 -rwxr-xr-x 1 dbus dbus 19724 Jun 15 00:08 mmap.so -rwxr-xr-x 1 dbus dbus 1441020 Jun 15 00:08 numpy.core.multiarray.so -rwxr-xr-x 1 dbus dbus 85288 Jun 15 00:08 numpy.core.multiarray_tests.so -rwxr-xr-x 1 dbus dbus 639188 Jun 15 00:08 numpy.core.umath.so -rwxr-xr-x 1 dbus dbus 38472 Jun 15 00:08 numpy.fft.fftpack_lite.so -rwxr-xr-x 1 dbus dbus 109612 Jun 15 00:08 numpy.linalg._umath_linalg.so -rwxr-xr-x 1 dbus dbus 13948 Jun 15 00:08 numpy.linalg.lapack_lite.so -rwxr-xr-x 1 dbus dbus 927940 Jun 15 00:08 numpy.random.mtrand.so -rwxr-xr-x 1 dbus dbus 76296 Jun 15 00:10 parser.so -rwxr-xr-x 1 dbus dbus 10497492 Jun 25 19:03 precise-engine -rwxr-xr-x 1 dbus dbus 25568 Jun 15 00:08 readline.so -rwxr-xr-x 1 dbus dbus 10232 Jun 15 00:07 resource.so -rwxr-xr-x 1 dbus dbus 56980 Jun 15 00:09 scipy._lib._ccallback_c.so -rwxr-xr-x 1 dbus dbus 227112 Jun 15 00:08 scipy.fftpack._fftpack.so -rwxr-xr-x 1 dbus dbus 70192 Jun 15 00:08 scipy.fftpack.convolve.so -rwxr-xr-x 1 dbus dbus 71312 Jun 15 00:08 scipy.integrate._dop.so -rwxr-xr-x 1 dbus dbus 67824 Jun 15 00:08 scipy.integrate._odepack.so -rwxr-xr-x 1 dbus dbus 85164 Jun 15 00:08 scipy.integrate._quadpack.so -rwxr-xr-x 1 dbus dbus 79496 Jun 15 00:08 scipy.integrate.lsoda.so -rwxr-xr-x 1 dbus dbus 144840 Jun 15 00:08 scipy.integrate.vode.so -rwxr-xr-x 1 dbus dbus 232716 Jun 15 00:08 scipy.interpolate._bspl.so -rwxr-xr-x 1 dbus dbus 167500 Jun 15 00:08 scipy.interpolate._fitpack.so -rwxr-xr-x 1 dbus dbus 305508 Jun 15 00:08 scipy.interpolate._ppoly.so -rwxr-xr-x 1 dbus dbus 318636 Jun 15 00:08 scipy.interpolate.dfitpack.so -rwxr-xr-x 1 dbus dbus 329564 Jun 15 00:08 scipy.interpolate.interpnd.so -rwxr-xr-x 1 dbus dbus 33948 Jun 15 00:08 scipy.linalg._cblas.so -rwxr-xr-x 1 dbus dbus 53428 Jun 15 00:08 scipy.linalg._clapack.so -rwxr-xr-x 1 dbus dbus 297292 Jun 15 00:08 scipy.linalg._decomp_update.so -rwxr-xr-x 1 dbus dbus 502688 Jun 15 00:08 scipy.linalg._fblas.so -rwxr-xr-x 1 dbus dbus 1031880 Jun 15 00:08 scipy.linalg._flapack.so -rwxr-xr-x 1 dbus dbus 53508 Jun 15 00:08 scipy.linalg._flinalg.so -rwxr-xr-x 1 dbus dbus 213660 Jun 15 00:08 scipy.linalg._solve_toeplitz.so -rwxr-xr-x 1 dbus dbus 220528 Jun 15 00:08 scipy.linalg.cython_blas.so -rwxr-xr-x 1 dbus dbus 523752 Jun 15 00:08 scipy.linalg.cython_lapack.so -rwxr-xr-x 1 dbus dbus 96340 Jun 15 00:10 scipy.ndimage._nd_image.so -rwxr-xr-x 1 dbus dbus 295620 Jun 15 00:10 scipy.ndimage._ni_label.so -rwxr-xr-x 1 dbus dbus 85932 Jun 15 00:08 scipy.optimize._cobyla.so -rwxr-xr-x 1 dbus dbus 165908 Jun 15 00:08 scipy.optimize._group_columns.so -rwxr-xr-x 1 dbus dbus 93752 Jun 15 00:08 scipy.optimize._lbfgsb.so -rwxr-xr-x 1 dbus dbus 154036 Jun 15 00:08 scipy.optimize._lsq.givens_elimination.so -rwxr-xr-x 1 dbus dbus 78728 Jun 15 00:08 scipy.optimize._minpack.so -rwxr-xr-x 1 dbus dbus 32212 Jun 15 00:08 scipy.optimize._nnls.so -rwxr-xr-x 1 dbus dbus 73112 Jun 15 00:08 scipy.optimize._slsqp.so -rwxr-xr-x 1 dbus dbus 288872 Jun 15 00:08 scipy.optimize._trlib._trlib.so -rwxr-xr-x 1 dbus dbus 9764 Jun 15 00:08 scipy.optimize._zeros.so -rwxr-xr-x 1 dbus dbus 32400 Jun 15 00:08 scipy.optimize.minpack2.so -rwxr-xr-x 1 dbus dbus 26180 Jun 15 00:08 scipy.optimize.moduleTNC.so -rwxr-xr-x 1 dbus dbus 401196 Jun 15 00:08 scipy.sparse._csparsetools.so -rwxr-xr-x 1 dbus dbus 2497516 Jun 15 00:08 scipy.sparse._sparsetools.so -rwxr-xr-x 1 dbus dbus 172620 Jun 15 00:08 scipy.sparse.csgraph._min_spanning_tree.so -rwxr-xr-x 1 dbus dbus 298976 Jun 15 00:08 scipy.sparse.csgraph._reordering.so -rwxr-xr-x 1 dbus dbus 236044 Jun 15 00:08 scipy.sparse.csgraph._shortest_path.so -rwxr-xr-x 1 dbus dbus 146716 Jun 15 00:08 scipy.sparse.csgraph._tools.so -rwxr-xr-x 1 dbus dbus 131860 Jun 15 00:08 scipy.sparse.csgraph._traversal.so -rwxr-xr-x 1 dbus dbus 267368 Jun 15 00:08 scipy.sparse.linalg.dsolve._superlu.so -rwxr-xr-x 1 dbus dbus 468548 Jun 15 00:08 scipy.sparse.linalg.eigen.arpack._arpack.so -rwxr-xr-x 1 dbus dbus 185804 Jun 15 00:08 scipy.sparse.linalg.isolve._iterative.so -rwxr-xr-x 1 dbus dbus 64248 Jun 15 00:08 scipy.spatial._distance_wrap.so -rwxr-xr-x 1 dbus dbus 166052 Jun 15 00:08 scipy.spatial._hausdorff.so -rwxr-xr-x 1 dbus dbus 161884 Jun 15 00:08 scipy.spatial._voronoi.so -rwxr-xr-x 1 dbus dbus 539328 Jun 15 00:08 scipy.spatial.ckdtree.so -rwxr-xr-x 1 dbus dbus 845324 Jun 15 00:08 scipy.spatial.qhull.so -rwxr-xr-x 1 dbus dbus 26728 Jun 15 00:08 scipy.special._comb.so -rwxr-xr-x 1 dbus dbus 65984 Jun 15 00:08 scipy.special._ellip_harm_2.so -rwxr-xr-x 1 dbus dbus 1140324 Jun 15 00:08 scipy.special._ufuncs.so -rwxr-xr-x 1 dbus dbus 80704 Jun 15 00:08 scipy.special._ufuncs_cxx.so -rwxr-xr-x 1 dbus dbus 487024 Jun 15 00:08 scipy.special.specfun.so -rwxr-xr-x 1 dbus dbus 403564 Jun 15 00:10 scipy.stats._stats.so -rwxr-xr-x 1 dbus dbus 57932 Jun 15 00:10 scipy.stats.mvn.so -rwxr-xr-x 1 dbus dbus 36556 Jun 15 00:10 scipy.stats.statlib.so -rwxr-xr-x 1 dbus dbus 93808 Jun 25 19:05 tensorflow.python.framework.fast_tensor_util.so -rwxr-xr-x 1 dbus dbus 17964 Jun 15 00:08 termios.so`

It took the user:group ideas from the package which translate on our system to "dbus", but that should not be an issue as we do not have users and only root. Permission-wise root has rwx so ....

I already have a clue of what might be going on here, which is related to library linking as precise is being cross-compiled by Mycroft A.I. and presented as binary package. Binary packages are always "itchy" if it comes to crosscompiling.

# file precise-engine precise-engine: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=c6002b88aa2c780671b249dcc8f2f65ca746d35d, stripped

# file /lib/ld-linux-armhf.so.3 /lib/ld-linux-armhf.so.3: cannot open/lib/ld-linux-armhf.so.3' (No such file or directory)`

j1nx commented 6 years ago

Giving it some more thought, I am not a real fan of pulling in binaries. precise-engine should be cross-compiled from source during the building step and installed into staging and target.

Will investigate if we can create a mycroft-precise buildroot package as dependency from/for the mycroft package.

to be continued...

j1nx commented 5 years ago

Fixed by switching to glibc (#11)