-
Notifications
You must be signed in to change notification settings - Fork 1
First version of Naomi Docker image #1
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
base: main
Are you sure you want to change the base?
Conversation
…i-arch support (AMD64, ARMv7 & ARM64)
|
Okay, @TuxSeb was able to help me get this working. Here is the command line I used: The file layout within the container is somewhat different from the way we normally install Naomi due to docker assuming people don't need home directories. The default login for this image is "naomi" rather than "root" which is good, but the Naomi folder is /Naomi rather than /home/naomi/Naomi. This is fine, just something to be aware of. I'm hoping to eventually install the default Naomi files somewhere like /opt or even in the python virtual environment through a pip install command. The configuration files, though, have moved from ~/.config/naomi to just /config. This requires updating any paths in the profile.yml file (/config/configs/profile.yml) from the /home//.config/naomi location to the /config location - the location of the pocketsphinx hmm dir, for example. In the command above, we are connecting an existing directory on the host machine (~/.config/docker-naomi/) to the /config directory in the docker image. This is good in that you would be able to upgrade or delete your docker image without losing your configuration. You can also use your host machine's text editors to edit the profile.yml file and the plugin files that are installed in the /config directory, which will probably be handy for plugin developers. Unfortunately, when you install NPE plugins into the config directory, they often need to install additional system and python packages via apt and pip respectively. So if you have installed plugins and then upgrade your naomi image, you will need to reinstall most of the plugins you installed before, just to make sure the requirements are installed. There might be a way to do this automatically, but I'm not sure how to tell Naomi that this is it's first run when it's using an old profile.yml file. Fortunately, it does seem like installing packages in a container affects the underlying image, so once you have installed your plugins they should stay installed until you delete the image. The "-v /run/user/1000/pipewire-0:/tmp/pipewire-0" part is connecting the pipewire server running on the host machine to the pipewire client running in the container. This does mean that you have to be running pipewire. Since the latest stable version of Debian supports pipewire, I think this can be made a requirement, and should be made a requirement for the standard Naomi install, replacing the pulseaudio apt package. In the above command, "run" is a command for creating a new container from the tuxseb/naomi-test:latest image. This can either be an image available locally or it will be downloaded from hub.docker.com. The -it means to start an interactive terminal and run the sh command. If you leave the "/bin/bash" command off the end, the container automatically runs "python Naomi.py". This program will go ahead and start Naomi, but right now it will get stuck if it needs any information from you as far as setting up plugins. That's why I don't use the -d (detach) option. Once Naomi is set up, it should run fine in the background, but it really expects to interact with the user through the command line right now. If Naomi breaks or you have to use control-C to stop the program, then the whole container will stop running, and you'll need to start it again with a command like "docker container start naomi-docker". To get a new command line, you can then do "docker exec -it naomi-docker /bin/bash". The reason to use "/bin/bash" rather than just "sh" as I have seen in some tutorials is because you will get a much more functional command line where you can use your cursor keys. |
|
I have not tried connecting a completely empty directory on the host to the /config directory on the client. I've been starting with existing configuration folders which has been causing some difficulties for me because of the changes in pathing and because I use the "VOSK STT" plugin for my active engine. |
|
I created an empty directory in my ~/naomi-docker folder, and then tried the following command line: Here I am using the empty config directory and also allowing the container to run its default command. Naomi appears to be running in debug mode. This causes a lot of extra information to be printed to the screen. It makes sense to run Naomi in debug mode the first time, since that is when errors are most likely to pop up, but it is time to clean up a lot of the info messages. I'll create an issue for this in the main Naomi repository. |
|
I'm getting an error message Since part of the purpose of having the config file on the host rather than in the container is to be able to upgrade the Naomi image without losing your configuration, it would make sense to also use the host machine-id file, although the hash is a combination of the machine-id, hostid, and hashes extracted from the blkid command, so it's going to change when you change the image. We need to decide what we want to do there. I'm thinking we probably want to only use the machine-id from the host and not use the hostid or blkid information when encrypting profile variables. To pass the machine-id from the host machine, I think we can just add another |
|
I got to the end of the install, and got an error about PhonetisaurusG2P: This appears to be because the "pip install phonetisaurus" command is actually working, so it does not have to use one of the downloaded packages from https://github.com/rhasspy/phonetisaurus-pypi/releases/download. Unfortunately, it does not then attempt to re-load the .g2p.PhonetisaurusG2P object. Finally, the wrong path appears to be being passed to the model for some reason. The path should be /config/pocketsphinx/standard/{locale}/ but the locale is not being appended to the end. Normally, this value would be read from the pocketsphinx/hmm_dir variable in the profile.yml file, but for some reason I don't have this value in my profile. This only happens when I am using an empty /config directory so everything has to be built. I am creating an issue in the main Naomi repository. |
|
@TuxSeb if you could add phonetisaurus to the pip modules that are pre-installed in this image, that would be helpful also. I think the reason it's not listed in python_requirements.txt is because it wasn't available for some platforms directly through pip. |
|
I created a pull request (NaomiProject/Naomi#411) to address the issues with Pocketsphinx hmm dir paths and phonetisaurus. |
|
The mpdcontrol plugin is not working. Getting the error message "Plugin mpdcontrol skipped! (Reason: Connection failed)". I think this is because installing mpd does not also activate the server in systemd anymore, so the connection to localhost:6600 is not available. I also have always had to switch mpd from alsa to pulseaudio because the alsa driver would lock down the sound card and Naomi would be unable to use it to speak anymore. That's why there is an option to try to keep Naomi from speaking while music is playing. Using pipewire should also work, but I don't think I've had to do that yet. |
|
I have my local pipewire using an echo cancelled source (https://docs.pipewire.org/page_module_echo_cancel.html), but it doesn't seem to be working within the container. Naomi hears itself talking a lot more often in the container than when I'm running Naomi directly on my desktop. I'll have to play around some to figure out what's actually happening there. It's possible that the pipewire client in the container has to create its own echo cancelled source. |
With audio (input/output) using Pipewire & multi-arch support (AMD64, ARMv7 & ARM64)
Notes: