Manual CLI arecord works, but no words detected

Hello! I’m going to try to be as complete as possible with this post so apologies if it is long (I want to make sure you helpers out there know what I’ve tried).

The short version is: arecord works when I use it on the CLI (simple wav recording, same options as Rhasspy says it uses), but when I trigger a manual wake up in the Rhasspy web UI, nothing is detected (and not recorded?) usually with a TimeoutError. However, enabling Raven for a custom wake word I can record the word and play it back!

I’m stuck as to why nothing is recorded / detected in terms of commands when I directly wake up Rhasspy from the web UI.


Setup:

  • RasPi Zero WH with PiOS (full) running in CLI mode (no GUI), most recent updates applied
  • Python 3.7 (all libraries up to date)
  • Adafruit Voice Bonnet and seeed voicecard installed
  • Rhasspy 2.5.11 installed as Debian package (armel) with no errors

My steps:

  1. Start the pi, run arecord -r 16000 -f S16_LE -c 1 test.wav to test audio capture (and aplay to confirm it recorded)
  2. Run rhasspy (rhasspy -profile en 2>&1 rhasspy.log)
  3. Wait a long time for everything to start up (usually ~6 minutes)
  4. Go to the “Audio Recording” section to see / tweak the device as necessary
  5. Go to Rhasspy UI main page, click “Wake Up”, wait for beep, try saying “What time is it” (which is in my sentences)
  6. Watch the logs and see nothing detected, usually with a TimeoutError (see here for logs)

Things I’ve tried:

  • Searching this forum extensively (nothing has helped yet)
  • Turning it off and on again (rhasspy, the Pi, my brain)
  • Changing the audio devices in the “Audio Recording” section (any that say “working”, and also “hw:1” manually entered since that has worked from the CLI)
  • Switching to PyAudio (does not work, but maybe for different reasons?)
  • Switching to a manual entered command (no change)
  • Hitting the “Train” button (and letting that finish) then trying again (no change)
  • Using Raven to record a wake word to see that Rhasspy can in fact use arecord (this does work, I can record the word and play it back).

Log Files
I’ve added some log files to a git repo in case that helps anyone to help me. :slight_smile:

https://github.com/jakerella/voice-assistant

I think I have the same setup - though I swapped the Adafruit Voice Bonnet for a reSpeaker 2-mic (they are almost identical, but the Voice Bonnet has the button awfully close to the mic and LED making it difficult to design a case for it)

With all the “learning curves” I went through I tried to distil all I had learned; and provide a detailed tutorial of every aspect including:

  • installing the reSpeaker 2-mic HAT for RasPi
  • troubleshooting audio problems
  • configuring base machine
  • configuring Rhasspy on the satellite
  • adding HermesLedControl to flash the LEDs on the reSpeaker as a visual indicator
  • running Rhasspy on the satellite as a service (so it doesn’t need to be manually started every reboot)
  • Telling Rhasspy what commands to expect (setting up sentences)
  • setting up intents within Home Assistant
  • actioning those intents in Home Assistant

… and when I got to 30 pages I was wondering if I had bitten off more than I could chew :wink: Should I really be covering so much, and in so much detail ? Obviously I should split it in to manageable sections - but where ?

Also I’m a ‘first principles’ guy - I like to know why, and what the other options are; so maybe I was giving too much general info and background. Heck, the first 7 pages were introduction :wink:

And I have tried following too many tutorials (esp re linux topics) which are undated and out-of-date referring to options no longer in the software or replaced with different options, or give incomplete or ambiguous description of what to do, or assume additional software (which is often no longer available), etc. … so I try to include plenty of screen images so people can check that they are on track (or more quickly identify where my guide is out-of-date).

I ran out of steam, particularly when trying to anticipate all the troubleshooting that could be possible - given that I was learning it myself at the time. However I uploaded the file as donburch888/Add Rhasspy local voice control.docx at main at GitHub to help another user in the Error and microphone problems thread.

Anyway …

  1. did you use the Docker install method on your RasPi ? I though it would add an unnecessary layer in a dedicated voice assistant device - but others have it working by adding the appropriate open port (or something).

  2. I note in the rhasspy-config.json you posted that the microphone device: is “default”.
    Could you post output of “arecord -L”

  3. in Rhasspy’s UI > Settings > Audio Recording, please explicitly set to the appropriate device, preferably the “plughw:” prefix version. FYI, this is my settings:


    The UDP port links to the UDP port in the Wake section, providing a shortcut between mic and wakeword processor until wakeword is detected.

FYI, my own Rhasspy config is:

{
    "intent": {
        "system": "hermes"
    },
    "microphone": {
        "arecord": {
            "device": "plughw:CARD=seeed2micvoicec,DEV=0",
            "udp_audio_port": "12203"
        },
        "pyaudio": {
            "device": "0",
            "siteId": "sat-0",
            "udp_audio_port": "12203"
        },
        "system": "arecord"
    },
    "mqtt": {
        "enabled": "true",
        "host": "192.168.1.98",
        "password": "rhasspy",
        "port": "1883",
        "site_id": "sat-0",
        "username": "rhasspy"
    },
    "sounds": {
        "aplay": {
            "device": "plughw:CARD=seeed2micvoicec,DEV=0",
            "volume": "0.8"
        },
        "system": "aplay"
    },
    "speech_to_text": {
        "system": "hermes"
    },
    "text_to_speech": {
        "system": "hermes"
    },
    "wake": {
        "porcupine": {
            "keyword_path": "porcupine_raspberry-pi.ppn",
            "sensitivity": "0.3",
            "udp_audio": "12203"
        },
        "system": "porcupine"
    }
}