openassistant / oa-core

Open Assistant Core
http://openassistant.org
GNU General Public License v3.0
293 stars 77 forks source link

Unable to get started on Devuan #17

Closed minghia closed 5 years ago

minghia commented 5 years ago

Describe the bug The following occurs when I try to run openassistant on Devuan ascii: 2019-05-20 13:56:11,178] INFO MainThread [main.py::110]: Start Open Assistant [2019-05-20 13:56:11,178] INFO MainThread [main.py:init:18]: Initializing Open Assistant [2019-05-20 13:56:11,179] INFO MainThread [agent.py:_load_modules:33]: Loading Modules <- /home/avasile/src/oa-core/oa/modules [2019-05-20 13:56:11,179] INFO MainThread [util.py:load_module:60]: sound <- /home/avasile/src/oa-core/oa/modules/sound [2019-05-20 13:56:11,180] ERROR MainThread [agent.py:_load_modules:42]: Error loading sound: cannot import name 'queue' [2019-05-20 13:56:11,180] INFO MainThread [util.py:load_module:60]: voice <- /home/avasile/src/oa-core/oa/modules/voice [2019-05-20 13:56:11,182] ERROR MainThread [agent.py:_load_modules:42]: Error loading voice: cannot import name 'queue' [2019-05-20 13:56:11,182] INFO MainThread [util.py:load_module:60]: speech_recognition <- /home/avasile/src/oa-core/oa/modules/speech_recognition [2019-05-20 13:56:11,396] ERROR MainThread [agent.py:_load_modules:42]: Error loading speech_recognition: cannot import name 'queue' [2019-05-20 13:56:11,397] INFO MainThread [util.py:load_module:60]: ear <- /home/avasile/src/oa-core/oa/modules/ear [2019-05-20 13:56:11,572] INFO MainThread [util.py:load_module:60]: mind <- /home/avasile/src/oa-core/oa/modules/mind [2019-05-20 13:56:11,573] ERROR MainThread [agent.py:_load_modules:42]: Error loading mind: cannot import name 'queue' Traceback (most recent call last): File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.5/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/avasile/src/oa-core/oa/main.py", line 113, in config=args.config_file, File "/home/avasile/src/oa-core/oa/main.py", line 80, in start a = LoadAssistant(config=kwargs.get('config')) File "/home/avasile/src/oa-core/oa/main.py", line 54, in LoadAssistant a.parts[_in].output += [a.parts[_out]] File "/home/avasile/src/oa-core/oa/core/util.py", line 89, in getitem return getattr(self, key) AttributeError: 'Core' object has no attribute 'speech_recognition'

I start the command with python3 -m oa The python version is 3.5.3. The requirements.txt file was installed using pip3 install -r requirements.txt and that went smoothly once I resolved some of the missing dependencies on Devuan. In addition to your list of dependencies Devuan required libasound2-dev to be installed.

If your aren't aware Devuan is a derivative of Debian, without systemd.

To Reproduce python3 -m oa

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

joshuashort commented 5 years ago

Thanks, wasn't aware of Devuan.

Looks like some modules are failing to load because queue can't be found -- but that should be built in with Python3.5?

Does import queue work for you in the interpreter?

minghia commented 5 years ago

I'm not a Python expert but I tried: python3 import queue

and got no errors.

minghia commented 5 years ago

Okay I compiled Python 3.7.3 and it appears to working. However since I am running this on virtual machine, how do I specify a different alsa device to be used as the input and output audio device?

joshuashort commented 5 years ago

Nice! I wonder if it's something weird with importlib in 3.5.. there are plenty of strange environments.

The sound issue is a whole other thing.. you'll need the cooperation of your virtualization software and the guest/host. As far as OA goes, there aren't (currently) ways to do anything other than the 'default' automagic of playsound, pyttsx3, or sounddevice. I'm sure they're configurable.. but for now it's just using the system's default.

minghia commented 5 years ago

The biggest problem is that the default device for sounddevice is not the one that my virtual machine has set as its virtual soundcard. If I add device=0 in ear/init.py stream = sounddevice.Stream(device=0,samplerate=_config.get("sample_rate"), channels=_config.get("channels"), dtype='int16')

and I had to change the sample rate to 48000 for it to work but it is very flaky. If I try "boot mind", I see "boot" displayed or some other random word and enventually I see "STOP LISTENING". At this point is dead. I doubt Sphinx is having trouble with my Australian accent.

joshuashort commented 5 years ago

I've had trouble with some questionable microphones.. maybe try recording some audio and playing it back to make sure it sounds ok?

It's nothing worth releasing, but I've added some debug statements around ear to get some more visibility into when it's actually 'listening' and how it determines phrase boundaries. Just recently got an audio setup that works reliably.