Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mycroft: init at 0.9.19 [WIP] #36248

Closed
wants to merge 8 commits into from
Closed

Conversation

peterhoeg
Copy link
Member

@peterhoeg peterhoeg commented Mar 3, 2018

Motivation for this change

Well, who doesn't want AI on your NixOS machine?

This is VERY much WIP but let's get it out there as soon as possible.

What works:

  1. The services can be run manually or using the systemd services
  2. Everything comes up (and doesn't crash) when run inside a VM using nixos-rebuild build-vm.

But I don't actually know if it works, because there are a number of things that need to be fixed first:

  1. We need to handle how to run a pulseaudio instance when it's not running inside the user session
  2. All the python packages need to be separated out into their own packages
  3. Tests need to be enabled for the various packages (I just disabled them if they were causing problems)
  4. Mycroft itself has 2 failing tests - I haven't looked at all at why that isn't working
  5. The skill script (msm) is borked (and not in the right place)
  6. Need to figure out a way to have skills that are preloaded merged with skills dynamically installed - probably unionfs
  7. Enclouse daemon isn't working

Cc: @dotlambda @bjornfor

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@oxij
Copy link
Member

oxij commented Mar 3, 2018 via email

@peterhoeg
Copy link
Member Author

peterhoeg commented Mar 4, 2018 via email

@peterhoeg
Copy link
Member Author

Cc: @FRidh as main python guy around here


systemd = {
packages = with pkgs; [ mycroft ];
targets.mycroft.wantedBy = lib.mkIf cfg.applianceMode [ "multi-user.target" ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand it correctly, nothing is run if services.mycroft.enable = true. What's the purpose of having two "enable" options, then?

@peterhoeg
Copy link
Member Author

peterhoeg commented Mar 4, 2018 via email

@matthiasbeyer
Copy link
Contributor

matthiasbeyer commented Mar 19, 2018

Hi, I'm excited about this PR. I have some questions:

  • What does the mycroft-cli actually do? Does it run a mycroft instance, so am I able to use this for a first test of mycroft?
  • What STT engine is used by this package as default? I don't want any $bigCorp to listen, so does this use the mozilla speech recognition system on my own hardware without accessing the internet? If not, maybe this would be a nice idea as a package/service parameter/option.

I get (from mycroft-voice):

Exception in thread Thread-15:
Traceback (most recent call last):
  File "/nix/store/7b2z0vfbs9539ga4pxx5gmli47rz5y3n-python-2.7.14/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/nix/store/p3v2cbsczdhn494s4bq2j7a5hjn2g38p-mycroft-0.9.19/lib/python2.7/site-packages/mycroft/client/speech/listener.py", line 58, in run
    audio = self.recognizer.listen(source, self.emitter)
  File "/nix/store/p3v2cbsczdhn494s4bq2j7a5hjn2g38p-mycroft-0.9.19/lib/python2.7/site-packages/mycroft/client/speech/mic.py", line 537, in listen
    play_wav(file)
  File "/nix/store/p3v2cbsczdhn494s4bq2j7a5hjn2g38p-mycroft-0.9.19/lib/python2.7/site-packages/mycroft/util/__init__.py", line 86, in play_wav
    return subprocess.Popen(play_wav_cmd)
  File "/nix/store/7b2z0vfbs9539ga4pxx5gmli47rz5y3n-python-2.7.14/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/nix/store/7b2z0vfbs9539ga4pxx5gmli47rz5y3n-python-2.7.14/lib/python2.7/subprocess.py", line 1025, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

When saying Hey mycroft.


I also get

19:10:52.260 - __main__:download_skills:338 - ERROR - Unable to invoke Mycroft Skill Manager: /nix/store/p3v2cbsczdhn494s4bq2j7a5hjn2g38p-mycroft-0.9.19/msm/msm

from mycroft-skills.

(I started each mycroft module individually from the ./result directory, I did not install it in my system or rebuild my system with it).


I just noticed that mycroft created a directory with the name 1{HOME:- in my nixpkgs directory. That is propably a bug in the package.

@matthiasbeyer
Copy link
Contributor

Please cherry-pick f39e151659f from my fork of nixpkgs.

@matthiasbeyer
Copy link
Contributor

Please cherry-pick 4b14f3ebd28 as well.

@matthiasbeyer
Copy link
Contributor

Please cherry-pick b019aaa782a as well.

This works for me now. Mycroft cannot understand me, but it at least works.

@matthiasbeyer
Copy link
Contributor

matthiasbeyer commented Mar 19, 2018

Hm, the HOME variable setting is still bogus, but it works for me anyways. You propably should have a look at it again.


I pushed another change of the HOME variable thing in 20a71005ccf67dc4c7b519565e7cb61706630306

Propably not the right solution, though.

@peterhoeg
Copy link
Member Author

Thanks for trying things out. I had hoped to have it ready for 18.03 but I need to throw some time at it this weekend.

I pushed another change of the HOME variable thing in 20a7100

The escaping is wrong. Should be ''$. Anyway, I'll fix that.

@matthiasbeyer
Copy link
Contributor

Any updates on this?

@peterhoeg
Copy link
Member Author

Unfortunately not. And I know a lot has changed upstream as well.

@FRidh
Copy link
Member

FRidh commented Jan 6, 2019

Closing due to inactivity.

@timokau
Copy link
Member

timokau commented May 11, 2020

Related: #87621

@davidak davidak mentioned this pull request Mar 3, 2022
13 tasks
@peterhoeg peterhoeg deleted the p/mycroft branch April 4, 2024 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants