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

Ubuntu install notes #849

Open
kendonB opened this issue Sep 16, 2020 · 16 comments
Open

Ubuntu install notes #849

kendonB opened this issue Sep 16, 2020 · 16 comments
Labels
Documentation Issues related to Documentation Installation Issues and questions related to installation of Castor/Dragonfly Linux OS Issues related to the Linux OS operating system

Comments

@kendonB
Copy link
Collaborator

kendonB commented Sep 16, 2020

Thought I'd start an issue documenting install issues for Ubuntu.

I found that:

  • I needed to make sure I wasn't using Anaconda python by commenting out adding Anaconda to the path in my .bashrc
  • I needed to run sudo apt install libgtk-3-dev before installing caster
@LexiconCode
Copy link
Member

LexiconCode commented Sep 16, 2020

perfect!

Here's what i have so far,
https://caster-lexiconcode.readthedocs.io/en/docs/readthedocs/Installation/Linux/Kaldi_Linux/

i'm thinking to drop brew altogether and move to Pipenv

Edit I need to update the link

@LexiconCode LexiconCode added Documentation Issues related to Documentation Installation Issues and questions related to installation of Castor/Dragonfly Linux OS Issues related to the Linux OS operating system labels Sep 16, 2020
@kendonB
Copy link
Collaborator Author

kendonB commented Sep 16, 2020

and sudo apt install wmctrl

@kendonB
Copy link
Collaborator Author

kendonB commented Sep 17, 2020

and sudo apt-get install python3-pil python3-pil.imagetk

@kendonB
Copy link
Collaborator Author

kendonB commented Sep 17, 2020

and pip install pyscreenshot

@kendonB
Copy link
Collaborator Author

kendonB commented Sep 28, 2020

Need to adjust settings.py so that the setting

PYTHONW = "/usr/bin/python"

gets set as

PYTHONW = "/usr/bin/python3"

@kendonB
Copy link
Collaborator Author

kendonB commented Sep 28, 2020

need to get it to automatically set the TERMINAL_PATH setting to gnome-terminal in settings.py

@LexiconCode
Copy link
Member

@kendonB did you find windows manager that was more resilient to the xdotool slow keys input bug?

@kendonB
Copy link
Collaborator Author

kendonB commented Nov 5, 2020

@LexiconCode no I did not. Every alternative I came across had some sort of flaw.

A consistent workaround is to switch the keyboard back to English US. Then the slow typing bug only occurs when typing special characters.

@LexiconCode
Copy link
Member

Do you think that could be done programmatically?

@kendonB
Copy link
Collaborator Author

kendonB commented Nov 7, 2020

Likely possible

@LexiconCode
Copy link
Member

LexiconCode commented Nov 11, 2020

Kaldi - Linux - Classic Install

Caster currently supports Kaldi on Linux - X11 only. Consider supporting the author daanzu if you use his engine full-time.

1. Linux Prep

  1.  Caster is depends on Dragonfly which requires [X Window System](https://en.wikipedia.org/wiki/X_Window_System) (X11). You may need to install the [xdotool](https://www.semicomplete.com/projects/xdotool/) program to support X11 for dragonfly's the `Key` and `Text` actions to work. To install `xdotool` from [terminal](https://vitux.com/four-ways-to-open-the-terminal-in-debian/).
  • sudo apt-get update

  • sudo apt-get install xdotool

  • echo $XDG_SESSION_TYPE

  1. Install portaudio headers to be order to be able to install/compile the sounddevice python package.
  • sudo apt install portaudio19-dev

  • You may also need to make your user account a member of the audio group to be able to access your microphone. Do this by running usermod -a -G audio account_name_here.

2. Python

  • First Check your python3 --version/python --version from terminal. Recommended Python 3.7.x-3.8.x 64bit

  • If need to install Python you can use Homebrew.

    • Python 3 - brew install python - Caster with Python 3 is in beta.
    • Install pip sudo apt install python3-pip if need.

    If python3 --version/python --version does not work. Add python to path from terminal.

  • export PATH="$PATH:/usr/local/bin/python"

2.1 Dependencies Prep

  1. Edit the url below to match your distro and gtk for wxPython. See IwxPython4

        python -m pip install -U \ -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/debian-10 \ wxPython

  1. sudo apt-get install python3-tk if needed

3 . Caster

  1. Download Caster from the master branch.

  2. Open up the zip file downloaded

  3. Copy the contents of Caster-master folder. You can put it anywhere, but it is common to use \home\Documents\Caster.

  4. Click Install_Caster_Kaldi.sh to install prerequisite dependencies and set up Kaldi.

4. Set up Kaldi Model

  1. Download your preferred Kaldi model at kaldi-active-grammar/releases

  2. Extract kaldi_model_< Model Type >.zip to \home\Documents\Caster

5. Launch for Kaldi for Classic Install.

  1. Go to \home\Documents\Caster
  2. Double-click on Run_Caster_Kaldi.sh

Update Caster

  1. Backup \home\Documents\Caster
  2. Delete \home\Documents\Caster
  3. Repeat Steps 1. - 4. within the Caster install section

Kaldi Customization


Troubleshooting Kaldi

  1. Text and keypresses are not being emulated when voice commands are recognized.

    Explanation:  You are most likely using Wayland instead of X11 in your Linux distribution. Dragonfly is only fully functional in an X11 session. Dragonfly's Input action classes, application contexts and the Window class will not be functional under Wayland. It is recommended that Wayland users switch to X11. We would like to support Wayland but there out some outstanding issues due to Wayland's design limitations.  

    Fix: Please refer to the guide above to Step 1 to install xdotool

Known Issues

  • Caster's Legion Mouse Grid is Windows OS only.

  • Linux Caster support is new. Some commands may not work as expected. Please open up an issue on Github. Include the following:

    • Application or Grammar Name

    • The exact command name as spoken

    • Steps to reproduce the issue.

@Digital-ecologist
Copy link

Hello. I've been attempting some practice installs in virtual machines. I tried to get clever with it, which I think has contributed to my limited success thus far. First I tried in an MX virtual machine. I thought this was clever, because MX has a tool where you can "create an iso for sharing" from an installed system, so I thought if I could get it going, there would be potential for creating an iso with everything already set up. Unfortunately, there seems to be an issue where an old version of evdev is integral to the system, and dragonfly2 clashes with that version of evdev. Also, setuptools wasn't installed on that system by default, so maybe that should be added to the Linux dependencies?

Then, I tried in an ubuntu mate vm. I thought this was clever, because I want to see how many of the unity rules were directly transferable to the mutiny layout. I know that through an error somewhere fairly early in the process, but I seem to of lost my notes on that one.

If I attempt another test install, I'm going to keep it real simple, and try with Linux Mint Paul Cinnamon VM. Might have time to give that a shot this weekend.

Hope this info is somewhat helpful.

@LexiconCode
Copy link
Member

Hello. I've been attempting some practice installs in virtual machines.

So another user has set up a Docker File. The advantage of Docker versus a VM is its lighter on resources.

https://github.com/kmdouglass/homelab/tree/master/speech-recognition

@Digital-ecologist
Copy link

Hello. I've been attempting some practice installs in virtual machines.

So another user has set up a Docker File. The advantage of Docker versus a VM is its lighter on resources.

https://github.com/kmdouglass/homelab/tree/master/speech-recognition

Thanks for the tip. I have just started to learn about docker. It's actually one of the things I'm using the Kaldi set up you helped me with for, because the online course I was looking at assumes you're on a Linux host.

@LexiconCode
Copy link
Member

Utilizing Docker there's possibly a limitation with utilizing mouse grids and other GUI components. Since I don't have the set up I can't comment on that experience.

@Digital-ecologist
Copy link

I did another practice install in a Linux Mint CInnamon VM. I don't actually intend to use the system in that VM. I was just doing it as a practice exercise for myself and to provide feedback on the installation process. This one was successful :-) I hope some of the information in the attached is helpful.

Install experience in Linux Mint cinnamon 20.1.

I tried to follow everything is written, starting from the top of the issue.

Here's where things started to differ for me.

When installing Python prerequisites, I was prompted to run the following command to add a specific folder to the system path.

export PATH="$PATH:/home/austin/.local/bin"

Secondly, my Install_Caster_Kaldi.sh file doesn't work as intended, although this is probably a consequence of my bad translation of it, from bat to SH.

My solution was to open a terminal in the Caster directory and run the command

pip3 install -r '/home/austin/Documents/Caster/requirements-mac-linux.txt'

I followed the rest of the instructions as written. Then, at the very end, I could get caster running using the terminal command LexiconCode provided me on my real system.

python3 -m dragonfly load _caster.py --engine kaldi --no-recobs-messages

from within the caster directory.

Weirdly, the system for creating desktop icons in cinnamon doesn't seem to let you specify a working directory. As a result, I couldn't create a desktop icon. If I lengthen the command to CD into the appropriate directory, I get a warning that the bash command has too many arguments, but the command won't execute outside of the Caster directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues related to Documentation Installation Issues and questions related to installation of Castor/Dragonfly Linux OS Issues related to the Linux OS operating system
Projects
None yet
Development

No branches or pull requests

3 participants