dictation-toolbox / Caster

Dragonfly-Based Voice Programming and Accessibility Toolkit
https://dictation-toolbox.github.io/Caster/
Other
340 stars 121 forks source link

Ubuntu install notes #849

Open kendonB opened 4 years ago

kendonB commented 4 years ago

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

I found that:

LexiconCode commented 4 years ago

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

kendonB commented 4 years ago

and sudo apt install wmctrl

kendonB commented 4 years ago

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

kendonB commented 4 years ago

and pip install pyscreenshot

kendonB commented 4 years ago

Need to adjust settings.py so that the setting

PYTHONW = "/usr/bin/python"

gets set as

PYTHONW = "/usr/bin/python3"
kendonB commented 4 years ago

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

LexiconCode commented 3 years ago

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

kendonB commented 3 years ago

@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 commented 3 years ago

Do you think that could be done programmatically?

kendonB commented 3 years ago

Likely possible

LexiconCode commented 3 years ago

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/).

2. 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

Digital-ecologist commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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.