respeaker / respeaker_python_library

To build voice enabled objects/applications with Python and ReSpeaker
Apache License 2.0
149 stars 74 forks source link

Hanging on `data = self.detect_queue.get()` #18

Closed bennyboom38 closed 7 years ago

bennyboom38 commented 7 years ago

Hi,

I have an issue with the library: it detects my keyword as INFO:mic:Detected Jarvis is displayed but hangs on data = self.detect_queue.get(), file respeaker.py

Same code on @Oliv4945 Respeaker works. Do you have any idea ?

Thank you

Exception happened during processing of request from ('127.0.0.1', 44181)
Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.7/SocketServer.py", line 655, in __init__
    self.handle()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
    self.handle_one_request()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
    method()
  File "./stt_server.py", line 82, in do_GET
    handle_request (self, data)
  File "./stt_server.py", line 52, in handle_request
    detected = respeaker.hotword(hotword)
  File "./stt_server.py", line 26, in hotword
    if self.mic.wakeup(hotword):
  File "/usr/lib/python2.7/site-packages/respeaker-0.6.0-py2.7.egg/respeaker/microphone.py", line 177, in detect
    data = self.detect_queue.get()
  File "/usr/lib/python2.7/Queue.py", line 168, in get
    self.not_empty.wait()
  File "/usr/lib/python2.7/threading.py", line 340, in wait
    waiter.acquire()
  File "./stt_server.py", line 46, in clean_exit
    sys.exit(0)
SystemExit: 0
xiongyihui commented 7 years ago

It seems the error message shows Exception happened during processing of request from ('127.0.0.1', 44181). It's likely to be a network error.

Oliv4945 commented 7 years ago

Hi, we leaved the exception to show you the trace, but it was generated by interrupting the software. The real issue was hanging on getting the queue.

We found the issue: the first letter of jarvis in pocketsphinx dictionary was in upper case, while in lower case in Python code You can close the issue and maybe add it to the FAQ :-)

xiongyihui commented 7 years ago

A tip to debug is commenting the line https://github.com/respeaker/respeaker_python_library/blob/master/respeaker/microphone.py#L134

Then we can see the messages from pocketsphinx.

Oliv4945 commented 7 years ago

Nice to know, thank you

bennyboom38 commented 7 years ago

Thanks a lot, I close this issue