Don't understand how to be heard by Rhasspy

I already post the exact message and also the whole log… why reinstalling the whole systeme? I can’t for now because I migrate my domoticz and for now I need it…

I installed this one : Raspberry Pi OS (32-bit) with desktop and recommended software

There is a general principle in problem solving: try to minimize the unknown variables in a system. This works quite well to reduce the chaos that computer problems regularly cause. You should try it.

Well, that’s probably the reason why you have PulseAudio, because the desktop uses it. Maybe search for PulseAudio issues on the forum for possible solutions.

My recommendation still stands. If you don’t need the desktop and recommended software, try reinstalling the Lite system. This greatly reduces the unknown variables and improves the chances of getting a working setup. If you do need the desktop, try to find something about Rhasspy and PulseAudio on the forum, maybe a solution is lurking somewhere.

I need a desktop because I acceed on rhasspy with vnc and also because I’m not confident with ssh thing etc…
As I said, I can’t reinstall it because I need to keep my domoticz.

It can be easier to just remove pulse audio no?

Well, I made a suggestion in my previous post: try searching the link there. There’s not anything else I can do to help if you need the desktop. I will let someone else take it from here. Feel free to get back to me when you can try the Raspberry Pi OS Lite reinstall at some point in time.

if the problem is pulse audio, there is no possibility to just remove it?

:+1: If you do not need PulseAudio (because it was installed with the default packages and you do not use it for something else) then disable it or better remove it completely.

A quick search on Google should give you some pointers on how to do this. I do not use desktop Linux OS so I cannot confirm that removing PulseAudio will not break stuffs (beware of dependencies)…

I find a tutorial to remove pulseaudio. how can I verify if pulseaudio isn’t on?

pgrep -a pulseaudio

This should return an empty output: this means PulseAudio is not running.

this return : 686 /usr/bin/pulseaudio --daemonize=no

to remove it i do :

echo "autospawn = no" > $HOME/.config/pulse/client.conf
pkill -f pulseaudio
ps aux | grep pulse

source : https://askubuntu.com/questions/489609/how-can-i-cleanly-remove-pulseaudio-in-ubuntu-14-04

PulseAudio should be disabled and should not spawn on reboot.

Can you reboot your host and check if the arecord -r 16000 -c 1 -f S16_LE test.wav command run inside the Rhasspy container (docker exec -it rhasspy bash) works now?

I try to stop rhasspy and start with the command you send me later… there might be another problem :

docker exec -it rhasspy bash
Error response from daemon: Container b09b5b583539f980abe48d0711e35b953be0b7dfce7a04bb37988a347b02cae9 is not running

You need to start your Rhasspy container first with: docker start rhasspy

oups, my bad

here is the result :

ALSA lib pulse.c:242:(pulse_connect) PulseAudio: Unable to connect: Connection refused

arecord: main:828: audio open error: Connection refused

Change the content of the file /etc/asound.conf (on your host, not in the container) to remove PulseAudio from it:

pcm.!default {
    type asym
    playback.pcm "playback"
    capture.pcm "capture"
}

pcm.playback {
    type plug
    slave.pcm "hw:CARD=Device"
}

pcm.capture {
    type plug
    slave.pcm "hw:CARD=Device"
}

ctl.!default {
        type hw
        card 3
}

Then reboot.

This should create a “playback” PCM and a “capture” PCM both plugged into your USB sound card that you will be able to select in Rhasspy UI.

PS: I’ve made the asound.conf above from memory and without testing it… No promises… :wink:

I’ve corrected a typo in the above config (should be “{” instead of “[”).

I try that and save (no reboot debian but just restart rhasspy) and I try to wake up rhasspy but nothing didn’t be record… on the log from rhasspy web interface, there is that :

[ERROR:2020-08-31 13:47:46,440] rhasspyserver_hermes:
Traceback (most recent call last):
File “/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/quart/app.py”, line 1821, in full_dispatch_request
result = await self.dispatch_request(request_context)
File “/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/quart/app.py”, line 1869, in dispatch_request
return await handler(**request_.view_args)
File “/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/main.py”, line 827, in api_listen_for_command
handle_captured(), messages, message_types
File “/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/init.py”, line 959, in publish_wait
result_awaitable, timeout=timeout_seconds
File “/usr/lib/python3.7/asyncio/tasks.py”, line 449, in wait_for
raise futures.TimeoutError()
concurrent.futures._base.TimeoutError
[DEBUG:2020-08-31 13:47:16,412] rhasspyserver_hermes: Publishing 180 bytes(s) to hermes/asr/startListening
[DEBUG:2020-08-31 13:47:16,411] rhasspyserver_hermes: -> AsrStartListening(site_id=‘default’, session_id=‘163c03e1-f716-4deb-98a3-fa29200969c4’, lang=None, stop_on_silence=True, send_audio_captured=True, wakeword_id=None, intent_filter=None)
[DEBUG:2020-08-31 13:47:16,408] rhasspyserver_hermes: Subscribed to hermes/error/asr
[DEBUG:2020-08-31 13:47:16,407] rhasspyserver_hermes: Waiting for transcription (session_id=163c03e1-f716-4deb-98a3-fa29200969c4)
[DEBUG:2020-08-31 13:47:14,941] rhasspyprofile.download: intent.system flair fsticuffs = False
[DEBUG:2020-08-31 13:47:14,941] rhasspyprofile.download: speech_to_text.kaldi.open_transcription True False = False
[DEBUG:2020-08-31 13:47:14,941] rhasspyprofile.download: speech_to_text.kaldi.mix_weight >0 0 = False
[DEBUG:2020-08-31 13:47:14,940] rhasspyprofile.download: speech_to_text.pocketsphinx.mix_weight >0 0 = False
[DEBUG:2020-08-31 13:47:14,940] rhasspyprofile.download: speech_to_text.pocketsphinx.open_transcription True False = False
[DEBUG:2020-08-31 13:47:14,939] rhasspyprofile.download: speech_to_text.system kaldi pocketsphinx = False
[DEBUG:2020-08-31 13:47:14,939] rhasspyprofile.download: Skipping acoustic_model/variances (/profiles/fr/acoustic_model/variances)
[DEBUG:2020-08-31 13:47:14,939] rhasspyprofile.download: Skipping acoustic_model/transition_matrices (/profiles/fr/acoustic_model/transition_matrices)
[DEBUG:2020-08-31 13:47:14,938] rhasspyprofile.download: Skipping acoustic_model/noisedict (/profiles/fr/acoustic_model/noisedict)
[DEBUG:2020-08-31 13:47:14,938] rhasspyprofile.download: Skipping acoustic_model/mixture_weights (/profiles/fr/acoustic_model/mixture_weights)
[DEBUG:2020-08-31 13:47:14,937] rhasspyprofile.download: Skipping acoustic_model/means (/profiles/fr/acoustic_model/means)
[DEBUG:2020-08-31 13:47:14,937] rhasspyprofile.download: Skipping acoustic_model/mdef (/profiles/fr/acoustic_model/mdef)
[DEBUG:2020-08-31 13:47:14,936] rhasspyprofile.download: Skipping acoustic_model/feature_transform (/profiles/fr/acoustic_model/feature_transform)
[DEBUG:2020-08-31 13:47:14,925] rhasspyprofile.download: Skipping acoustic_model/feat.params (/profiles/fr/acoustic_model/feat.params)
[DEBUG:2020-08-31 13:47:14,925] rhasspyprofile.download: Skipping g2p.fst (/profiles/fr/g2p.fst)
[DEBUG:2020-08-31 13:47:14,924] rhasspyprofile.download: Skipping base_dictionary.txt (/profiles/fr/base_dictionary.txt)
[DEBUG:2020-08-31 13:47:14,924] rhasspyprofile.download: speech_to_text.system pocketsphinx pocketsphinx = True
[INFO:2020-08-31 13:47:14,793] rhasspyserver_hermes: Started
[DEBUG:2020-08-31 13:47:14,792] rhasspyserver_hermes: Subscribed to hermes/asr/textCaptured
[DEBUG:2020-08-31 13:47:14,792] rhasspyserver_hermes: Subscribed to rhasspy/asr/default/default/audioCaptured
[DEBUG:2020-08-31 13:47:14,791] rhasspyserver_hermes: Subscribed to hermes/hotword/+/detected
[DEBUG:2020-08-31 13:47:14,791] rhasspyserver_hermes: Subscribed to hermes/intent/#
[DEBUG:2020-08-31 13:47:14,790] rhasspyserver_hermes: Subscribed to hermes/audioServer/default/audioSummary
[DEBUG:2020-08-31 13:47:14,790] rhasspyserver_hermes: Subscribed to hermes/nlu/intentNotRecognized
[DEBUG:2020-08-31 13:47:14,789] rhasspyserver_hermes: Subscribed to hermes/audioServer/default/audioSummary
[DEBUG:2020-08-31 13:47:14,789] rhasspyserver_hermes: Subscribed to rhasspy/asr/default/default/audioCaptured
[DEBUG:2020-08-31 13:47:14,789] rhasspyserver_hermes: Subscribed to hermes/nlu/intentNotRecognized
[DEBUG:2020-08-31 13:47:14,788] rhasspyserver_hermes: Subscribed to hermes/intent/#
[DEBUG:2020-08-31 13:47:14,788] rhasspyserver_hermes: Subscribed to hermes/asr/textCaptured
[DEBUG:2020-08-31 13:47:14,787] rhasspyserver_hermes: Subscribed to hermes/hotword/+/detected
[DEBUG:2020-08-31 13:47:14,786] rhasspyserver_hermes: Connected to MQTT broker
[DEBUG:2020-08-31 13:47:14,768] rhasspyserver_hermes: Connecting to localhost:12183 (retries: 2/10)
[ERROR:2020-08-31 13:47:13,765] rhasspyserver_hermes: mqtt connect
Traceback (most recent call last):
File “/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/init.py”, line 284, in start
self.client.connect(self.host, self.port)
File “/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/paho/mqtt/client.py”, line 937, in connect
return self.reconnect()
File “/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/paho/mqtt/client.py”, line 1071, in reconnect
sock = self._create_socket_connection()
File “/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/paho/mqtt/client.py”, line 3522, in _create_socket_connection
return socket.create_connection(addr, source_address=source, timeout=self._keepalive)
File “/usr/lib/python3.7/socket.py”, line 727, in create_connection
raise err
File “/usr/lib/python3.7/socket.py”, line 716, in create_connection
sock.connect(sa)
OSError: [Errno 99] Cannot assign requested address
[DEBUG:2020-08-31 13:47:13,762] rhasspyserver_hermes: Connecting to localhost:12183 (retries: 1/10)
[ERROR:2020-08-31 13:47:12,747] rhasspyserver_hermes: mqtt connect
Traceback (most recent call last):
File “/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/init.py”, line 284, in start
self.client.connect(self.host, self.port)
File “/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/paho/mqtt/client.py”, line 937, in connect
return self.reconnect()
File “/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/paho/mqtt/client.py”, line 1071, in reconnect
sock = self._create_socket_connection()
File “/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/paho/mqtt/client.py”, line 3522, in _create_socket_connection
return socket.create_connection(addr, source_address=source, timeout=self._keepalive)
File “/usr/lib/python3.7/socket.py”, line 727, in create_connection
raise err
File “/usr/lib/python3.7/socket.py”, line 716, in create_connection
sock.connect(sa)
OSError: [Errno 99] Cannot assign requested address
[DEBUG:2020-08-31 13:47:12,744] rhasspyserver_hermes: Connecting to localhost:12183 (retries: 0/10)
[DEBUG:2020-08-31 13:47:12,743] rhasspyserver_hermes: Starting core
[DEBUG:2020-08-31 13:47:12,736] rhasspyprofile.profile: Loading default profile settings from /usr/lib/rhasspy/rhasspy-profile/rhasspyprofile/profiles/defaults.json
[DEBUG:2020-08-31 13:47:12,734] rhasspyprofile.profile: Loading /profiles/fr/profile.json
[DEBUG:2020-08-31 13:47:12,730] rhasspyprofile.profile: Loading /usr/lib/rhasspy/rhasspy-profile/rhasspyprofile/profiles/fr/profile.json
[DEBUG:2020-08-31 13:47:12,675] rhasspyserver_hermes: Restarting Rhasspy

Before using Rhasspy, you need to make sure that Rhasspy container can access your sound card. Please do (inside AND outside the container):

arecord -Dcapture -r 16000 -c 1 -f S16_LE test.wav

I try outside, no problem.
I try inside, it seems to have no problem but I don’t know where it stock the file and I don’t know how to ask him to play it with command line…

But there is no error message

and after a test on rhasspy, it didn’t record :s

No error message is pretty good news :wink:

The test.wav file is saved in the current directory.

You can play it with:
aplay -Dplayback test.wav

If the playback is correct and outputs what you recorded then you simply select “playback” (audio out) and “capture” (audio in) in the Rhasspy UI. And everything should work.