alexylem / jarvis

Jarvis.sh is a simple configurable multi-lang assistant.
http://openjarvis.com
MIT License
810 stars 197 forks source link

EOFError with Snowboy #553

Open alexylem opened 7 years ago

alexylem commented 7 years ago
Jarvis: Waiting to hear 'Jarvis'
Alex: (listening...)
DEBUG: models=jarvis
INFO:snowboy:Ticks: [-1, -1, -1, -1]
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/pi/jarvis/stt_engines/snowboy/maindecoder_sox.py", line 76, in record_proc
    wav = wave.open(process.stdout, 'rb')
  File "/usr/lib/python2.7/wave.py", line 509, in open
    return Wave_read(f)
  File "/usr/lib/python2.7/wave.py", line 164, in __init__
    self.initfp(f)
  File "/usr/lib/python2.7/wave.py", line 129, in initfp
    self._file = Chunk(file, bigendian = 0)
  File "/usr/lib/python2.7/chunk.py", line 63, in __init__
    raise EOFError
EOFError
brummieb commented 7 years ago

Just noting that I've seen this error when running snowboy on a Pi with the Matrix Creator for the microphone; except that it's using snowboydecoder_arecord.py:

Listening... Press Ctrl+C to exit
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/pi/Downloads/snowboy-master/examples/Python/snowboydecoder_arecord.py", line 99, in record_proc
    wav = wave.open(process.stdout, 'rb')
  File "/usr/lib/python2.7/wave.py", line 509, in open
    return Wave_read(f)
  File "/usr/lib/python2.7/wave.py", line 164, in __init__
    self.initfp(f)
  File "/usr/lib/python2.7/wave.py", line 129, in initfp
    self._file = Chunk(file, bigendian = 0)
  File "/usr/lib/python2.7/chunk.py", line 63, in __init__
    raise EOFError
EOFError
sparkphp commented 6 years ago

Depuis aujourd'hui et à priori la récupération d'une mise à jour de Jarvis, l'exécution bloque dès la reconnaissance du hotword avec snowboy:

jarvis: Waiting to hear 'jarvis' philip: (listening...) DEBUG: models=jarvis INFO:snowboy:Ticks: [2, 20, 5, -1] Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 810, in bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 763, in run self.target(*self.args, **self.kwargs) File "/home/pi/jarvis/stt_engines/snowboy/maindecoder_sox.py", line 90, in record_proc wav = wave.open(process.stdout, 'rb') File "/usr/lib/python2.7/wave.py", line 509, in open return Wave_read(f) File "/usr/lib/python2.7/wave.py", line 164, in init__ self.initfp(f) File "/usr/lib/python2.7/wave.py", line 129, in initfp self._file = Chunk(file, bigendian = 0) File "/usr/lib/python2.7/chunk.py", line 63, in init__ raise EOFError EOFError

@alexylem j'ai vu que tu avais repéré ce soucis depuis déjà Avril dernier, sais-tu quelle en est la cause?

D'avance merci pour un retour.

BlkWolfLH commented 6 years ago

Greetings all. I was wondering if anything has been found to address this issue? It has recently shown up for myself where the project has been working great up till this point. I have taken my install back to original config and still have the same error.

I tested to see if the audio device was locked due to use and that was not the issue.

Upon further investigation I found that my home directory's .asoundrc file was reset to default. This resulted in producing an error when jarvis starts

"cat: /proc/asound/carde/id: No such file or directory"

Checking the file location I found I do not have any directory by the name "carde". Restoring a copy of my .asoundrc and pointing to the correct USB devices addressed this issue for me.

Hope it helps.

alex-randles commented 5 years ago

Hi,

I was having the same issue I fixed it by adding os.system("killall arecord") on below line 90 in snowboydecoder_arecord.py. I believe chunks coming in from a different arecord process are causing the error.

    def record_proc(self):
        os.system("killall arecord")
        CHUNK = 1024
        RECORD_RATE = 16000