fossasia / susi_linux

Hardware for SUSI AI https://susi.ai
Apache License 2.0
1.61k stars 149 forks source link

Provide instructions to make Amazon Alexa Echo like device using Susi AI #12

Closed betterclever closed 7 years ago

betterclever commented 7 years ago

The Susi AI prototype is capable of running on any linux system. We must provide instructions along with hardware requirements to make your own Amazon Echo like device running Susi AI.

betterclever commented 7 years ago

Update : I have setup most parts of the System on Arch Linux ARM. Having some problems setting up Microphone input. Working on it. Once complete, the compressed microSD image can be distributed as is (most probably) so that users don't have to go through hassle of installation of dependencies.

betterclever commented 7 years ago

Update: After a lot of fiddling around with stuff, Microphone input is working with Alsa for Hotword Detection but there are some problems with Speech Recognition library while taking input (must be due to alsa, yet to find cause).

Logs:

Expression 'ret' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1735
Expression 'AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir, &self->pcm )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1902
Expression 'PaAlsaStreamComponent_Initialize( &self->capture, alsaApi, inParams, StreamDirection_In, NULL != callback )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2166
Expression 'PaAlsaStream_Initialize( stream, alsaHostApi, inputParameters, outputParameters, sampleRate, framesPerBuffer, callback, streamFlags, userData )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2835
Traceback (most recent call last):
  File "main.py", line 89, in <module>
    start_speech_recognition()
  File "main.py", line 35, in start_speech_recognition
    with m as source:
  File "/usr/lib/python3.6/site-packages/speech_recognition/__init__.py", line 140, in __enter__
    input=True,  # stream is an input stream
  File "/usr/lib/python3.6/site-packages/pyaudio.py", line 750, in open
    stream = Stream(self, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/pyaudio.py", line 441, in __init__
    self._stream = pa.open(**arguments)
OSError: [Errno -9985] Device unavailable

Hardware Being used:

betterclever commented 7 years ago

Update : I figured out problem was due to jack server. That was resolved, then I ran into a new problem of speech input getting hung in between. I was stuck on that, then I found this solution

Still, It is getting stuck. I am figuring that out. Will be done by tonight I suppose.

betterclever commented 7 years ago

Update: Audio input is working fine independently right now after following this. Stereo Mic must improve performance. I was testing with a Webcam Microphone and it has some noise issue (when fans are on). I am yet to get it to work together with hotword detection, since mic has only one channel.

I think. best approach will be audio producer, -> consumer as implemented in MyCroft AI. here

betterclever commented 7 years ago

Instructions were added to README.