Rhasspy on Jetson Nano

I was able to install rhasspy on a Jetson Nano with no issues using docker.
I have a usb mic and currently using the default audio output thru the HDMI connection
I have setup /etc/asound.conf properly and I have been able to arecord and aplay a test.wav file
I have setup to: Use arecord directly (ALSA)

  1. Rhasspy is hearing me just fine and i can see the intents thru the web console, that part works great.
  2. I cant hear any output, but i see error msgs in the log when it tries to play any audio. It doesnt even play the sound effects. It seems to have a problem finding the audio files.
    there is no usr/share/rhasspy!
    dir: cannot access ‘/usr/share/rhasspy’: No such file or directory

Hopefully someone can decipher the log to point me towards a solution. I think that 95% is working properly. It is just this audio playback issue that is causing problems. Here is the log after asking pressing wake and asking “what time is it”:

[ERROR:103528164] APlayAudioPlayer: on_receive
Traceback (most recent call last):
File “/usr/share/rhasspy/rhasspy/actor.py”, line 175, in on_receive
self._state_method(message, sender)
File “/usr/share/rhasspy/rhasspy/audio_player.py”, line 67, in in_started
self.play_file(message.wav_path)
File “/usr/share/rhasspy/rhasspy/audio_player.py”, line 90, in play_file
subprocess.run(aplay_cmd, check=True)
File “/usr/lib/python3.6/subprocess.py”, line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ‘[‘aplay’, ‘-q’, ‘/usr/share/rhasspy/etc/wav/beep_error.wav’]’ returned non-zero exit status 1.
[DEBUG:103528146] DialogueManager: ready -> asleep
[DEBUG:103528145] InboxActor: -> stopped
[INFO:103528138] DialogueManager: Automatically listening for wake word
[DEBUG:103528115] DialogueManager: handling -> ready
[DEBUG:103528114] APlayAudioPlayer: [‘aplay’, ‘-q’, ‘/usr/share/rhasspy/etc/wav/beep_error.wav’]
[DEBUG:103528113] WebSocketObserver: {“text”: “time is it”, “intent”: {“name”: “”, “confidence”: 0}, “entities”: [], “raw_text”: “time is it”, “speech_confidence”: 0.013418784693119133, “wakeId”: “”, “siteId”: “default”, “slots”: {}}
[DEBUG:103528112] DialogueManager: recognizing -> handling
[DEBUG:103528111] DialogueManager: {‘text’: ‘time is it’, ‘intent’: {‘name’: ‘’, ‘confidence’: 0}, ‘entities’: [], ‘raw_text’: ‘time is it’, ‘speech_confidence’: 0.013418784693119133, ‘wakeId’: ‘’, ‘siteId’: ‘default’}
[ERROR:103528108] FsticuffsRecognizer: in_loaded
Traceback (most recent call last):
File “/usr/share/rhasspy/rhasspy/intent.py”, line 183, in in_loaded
assert recognitions, “No intent recognized”
AssertionError: No intent recognized
[DEBUG:103528106] DialogueManager: decoding -> recognizing
[DEBUG:103528105] DialogueManager: time is it (confidence=0.013418784693119133)
[DEBUG:103528103] PocketsphinxDecoder: time is it
[DEBUG:103528103] PocketsphinxDecoder: Transcription confidence: 0.013418784693119133
[DEBUG:103528084] PocketsphinxDecoder: Decoded WAV in 0.708348274230957 second(s)
[ERROR:103527455] APlayAudioPlayer: on_receive
Traceback (most recent call last):
File “/usr/share/rhasspy/rhasspy/actor.py”, line 175, in on_receive
self._state_method(message, sender)
File “/usr/share/rhasspy/rhasspy/audio_player.py”, line 67, in in_started
self.play_file(message.wav_path)
File “/usr/share/rhasspy/rhasspy/audio_player.py”, line 90, in play_file
subprocess.run(aplay_cmd, check=True)
File “/usr/lib/python3.6/subprocess.py”, line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ‘[‘aplay’, ‘-q’, ‘/usr/share/rhasspy/etc/wav/beep_lo.wav’]’ returned non-zero exit status 1.
[DEBUG:103527391] APlayAudioPlayer: [‘aplay’, ‘-q’, ‘/usr/share/rhasspy/etc/wav/beep_lo.wav’]

Which version of Rhasspy is this?

In the Settings page you see the path of these audio playback files, e.g.:

${RHASSPY_BASE_DIR}/etc/wav/beep_hi.wav

On my Rhasspy 2.5 Docker containers, the files are in /usr/lib/rhasspy-voltron/etc/wav, my Rhasspy 2.4 container has them in /usr/share/rhasspy/etc/wav/.

ver 2.4.19
${RHASSPY_BASE_DIR}/etc/wav/beep_lo.wav
/usr/lib/rhasspy-voltron/’: No such file or directory
‘/usr/share/rhasspy’: No such file or directory

docker container ls --all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bca166fcdf2c hello-world “/hello” 50 seconds ago Exited (0) 48 seconds ago elastic_goldstine
5e965b6e3c2e synesthesiam/rhasspy-server:latest “/run.sh --user-prof…” 29 hours ago Created eager_antonelli
7af5688b0ef6 synesthesiam/rhasspy-server:latest “/run.sh --user-prof…” 30 hours ago Up 29 hours 0.0.0.0:12101->12101/tcp practical_fermat

rick@rick-jetson:~$ docker container inspect synesthesiam/rhasspy-server:latest
[]
Error: No such container: synesthesiam/rhasspy-server:latest

Is this any help?
I am just now trying to learn docker, so most of my knowledge is at a very base level

I also tried to change the wake word wav file:
Wake WAV /home/rick/test.wav
aplay /home/rick/test.wav plays just fine
but when i press WAKE the log shows:

concurrent.futures._base.CancelledError
[WARNING:105966335] APlayAudioPlayer: Path does not exist: /home/rick/test.wav
[DEBUG:105966333] WebrtcvadCommandListener: loaded -> listening
[DEBUG:105966332] WebrtcvadCommandListener: Will timeout in 30 second(s)
[DEBUG:105966329] DialogueManager: asleep -> awake

This should be the path in the Docker container. You could copy the wav into your profile dir.

As shown in my last post, i tried to docker container inspect synesthesiam/rhasspy-server:latest
in the hope that it might show me where all this is being kept, but it returns no found. I have no idea where the files were installed. since neither /usr/lib/rhasspy-voltron/ or /usr/share/rhasspy exist!

can you post your exact docker command to start rhasspy?

I followed the instructions on https://rhasspy.readthedocs.io/en/latest/installation/ after that it autostarts on boot.
Also this is the only thing in my profile
cat ~/.config/rhasspy/profiles/en/profile.json
{
“microphone”: {
“arecord”: {
“device”: “default:CARD=U0x46d0x825”
},
“system”: “arecord”
},
“sounds”: {
“wake”: “/home/rick/test.wav”
}

Ok, do you see this line in the installation instructions?

-v "$HOME/.config/rhasspy/profiles:/profiles" \

This means that ~/.config/rhasspy/profiles/ on your local filesystem is mapped to /profiles/ in the filesystem of Rhasspy’s Docker container.

But Rhasspy doesn’t know about your local filesystem. so if you have /home/rick/test.wav in your profile, it can’t find this file, because the Docker container has a completely separate filesystem. You have to put the test.wav file somewhere in your ~/.config/rhasspy/profiles/en/ directory, and refer to it in terms of the container’s filesystem. So not /home/rick/test.wav or ~/.config/rhasspy/profiles/en/test.wav (if you have put it there), but /profiles/en/test.wav for instance.

Sorry for my lack of knowledge here but im missing something.

  1. there is no /profiles dir
    and i only changed this as a test.
  2. how do i find the value of ${RHASSPY_BASE_DIR} and why then arent my
    ${RHASSPY_BASE_DIR}/etc/wav/beep_lo.wav
    or
    ${RHASSPY_BASE_DIR}/etc/wav/beep_error.wav
    working? It seems to me that somehow ${RHASSPY_BASE_DIR} is pointing to the wrong place. If i try to echo it i get a blank line (im guessing that the system would not know this anyway?)
    Any idea how to find where docker put all of this?

There is. But in the container, not on your local filesystem. This is the mapping I referred to:

Your system The Docker container
~/.config/rhasspy/profiles/ /profiles/

These are the same directories, with the same content, they just have different paths in both systems.

I don’t know the answer to your second question.

I guess i will try to learn more about docker, but it may be easier to install it on my Jetson nano in a virtual environment, i understand that system. Also, this is the latest Ubuntu on the Jetson, but it seems so far, to be completely in sync with Raspbian. A side note, i am using Rhasspy on a robot along with Opencv and tensorflow to do facial recognition and image tracking for the robot, that is running it seems (without any real benchmarks ) like 25 fps. on the Jetson and about 2 fps on the Pi4, so Im guessing Rhasspy should perform much better on the Jetson!

Update:
Removed the docker image. Tried to install virtual env. Got this message:

Processing triggers for mime-support (3.60ubuntu1) …
Downloading dependencies
curl: (22) The requested URL returned error: 404 Not Found
Can’t download https://github.com/synesthesiam/rhasspy/releases/download/v2.0/rhasspy-tools_.tar.gz
rick@rick-jetson:~/rhasspy$ Downloading dependencies
-bash: Downloading: command not found
rick@rick-jetson:~/rhasspy$ curl: (22) The requested URL returned error: 404 Not Found
-bash: syntax error near unexpected token `22’
rick@rick-jetson:~/rhasspy$ Can’t download https://github.com/synesthesiam/rhasspy/releases/download/v2.0/rhasspy-tools_.tar.gz

Curious as to why it wants v2.0 vs v2.4?

I guess Rhasspy on a Jetson nano is a problem.

1 Like

so Im guessing Rhasspy should perform much better on the Jetson!

False :slight_smile:

Jetson nano has an optimized nvidia GPU for machine learning and deep learning with light models on embedded devices.
Moreover, the engines have to be compiled with gpu parameter. (tensorflow-gpu for example)
It’s useless for Rhasspy. Rhasspy is processed by CPU, not the GPU.
And i don’t think that kaldi was compiled to work with GPU.
So, no, rhasspy will not be more performant and efficient on nano than raspberry :slight_smile:

Ced

1 Like

I am new to rhasspy but I can’r help to wonder why you claim that there would be non improvement of performance on a jetson nano? On the deepspeech website, they even claim “quicker inference can be performed using a supported NVIDIA GPU on Linux”. And this usually means “GPU is new enough for the required CUDA version and has enough GPU memory”.

I am still in the process of getting an overview over the rhasspy codebase, but at least for deepspeech, it looks very easy to get support for the nano:

  1. Make sure cuda driver is installed (probably already the case on a fresh nano)
  2. Install nvidia-docker
  3. Replace deepspeech with deepspeech-gpu (or maybe deepspeech-tflite, haven’t examined) in the rhasspy-asr-deepspeech requirements file
  4. Make sure it downloads the right model (no idea yet where to do that)
  5. Rebuild the docker image (no idea how to do that yet)
  6. Profit

This is for deepspeech only and maybe not easily transferable to other speech-to-text systems.

But I think enabling GPU support should be a goal. On the flip side, I also think it will make things more complicated. Rhasspy is beautifully self-contained and dead simple to install as it is, and that would probably suffer from the added flexibility of GPU support.

I am thinking of buying a Jetson Nano. Does it work perfectly with Rhasspy?