Closed timaschew closed 4 years ago
~~Just restarted the raspberry. Two minutes after boot, the docker consumed the whole memory.
I guess the high CPU is because it starts using the swap file.~~
// edit the problem was a wrong device for the microphone!
Can you post your profiles? I'm not seeing this behavior at all. Thanks.
Sure.
{
"intent": {
"remote": {
"url": "http://192.168.178.21:12101/api/text-to-intent"
},
"system": "remote"
},
"microphone": {
"arecord": {
"device": "hw:CARD=Device,DEV=0"
},
"pyaudio": {
"device": "2"
},
"system": "arecord"
},
"sounds": {
"system": "dummy"
},
"speech_to_text": {
"remote": {
"url": "http://192.168.178.21:12101/api/speech-to-text"
},
"system": "remote"
},
"text_to_speech": {
"system": "dummy"
},
"wake": {
"system": "snowboy"
}
}
Maybe I know when there is a performance issue. I left rhasspy in the config of having the wrong device for the microphone: this was in the settings:
"microphone": {
"arecord": {
"device": "null"
},
"pyaudio": {
"device": "2"
},
"system": "arecord"
},
Now I switched to the proper soundcard and the memory usage is almost constant at 38%.
Ok, thank you. This must be related to the microphone recording a bunch of fake data very quickly when the device is wrong. I protect against empty data being returned, but maybe I need to rate limit it or something.
Okay, yes so it's my fault, sorry for the confusion.
Then let's go back to the original error. I've just successfully recorded a wav in the docker container with arecord -D hw:1,0 -d 5 -f cd test.wav -c 1
and I can play it and it's correct.
but and then I did with this command: arecord -q -r 16000 -f S16_LE -c 1 -t raw -D hw:CARD=Device,DEV=0 test.wav -d 5
and the result is this wav file which seems to be broken:
https://send.firefox.com/download/8ab4527d05737f61/#vLTPKDoKFgr4QmgQVYP_8A
I think it would be nice if the profile allows to control the whole record command (including all the args).
The -t raw
is what's making it seem broken. Wav files have a header normally, but Rhasspy already knows the format when recording. Change this to -t wav
on the command line.
You're right!
This works: arecord -r 16000 -f S16_LE -c 1 -t wav -d 3 -D hw:1,0 r16-fs16-twav.wav
I'm getting a warning that 16000 is not supported only 44100, but it still works.
Alright, so how this can be solved? Do you have a plan?
Ah, I think you've missed my point that the recognition never worked via the microphone directly via rhasspy. It always recognize a totally different sentence. But when I'm uploading the wave files to the webinterface it works perfectly.
Actually this time (I think I've tried it before with an untrained model) the recognized intent is an empty string. I tried it four times with different sentences but the response is always:
DEBUG:__main__:{"entities": [], "intent": {"confidence": 0, "name": ""}, "siteId": "default", "slots": {}, "speech_confidence": 1, "text": "", "time_sec": 0.0024182796478271484, "wakeId": ""}
// edit I've disabled microphone, that's the reason why the intent is empty. Still getting wrong sentences.
This issue got a bit messy, so I've created a new one: #144
First of all, thank you for this great project!
I have this soundcard and this microphone. I was using snowbow, google and wit.ai last year but now stopped due to privacy concers. And now I want to switch to Rhasspy :). The microphone is attached on my raspberry 3B.
I spent 3 days to figure out that the german profile leads to a performance issues (high memory and CPU) in both docker and virtual-env setup (the raspberry becomes unusable after some minutes and then crashes). Somehow it doesn't happen wit the english profile, but that's another story (and issue which I will create later).
I followed the tutorial for the client/server setup.
However the microphone automatic selection doesn't work. For neither PyAudio nor ASLA. When I try to record something (triggered via the webinterface) the recording in the logs looks like this:
Choosing PyAudio leads to this error:
BTW: when running rhasspy via virtualenv it even showed me one device in PyAudio which could be autoselected via the Test button, but recording was still not possible. There was also a (error) suffix after clicking on Test. When doing a recording afterwards the logs showing this:
Using ALSA gives this feedback:
But when trying to record it doesn't record anything and I even cannot stop the recording via the webinterface. The logs is showing just this, even when I click on Tap to stop recording.
I know that the correct device is hw:CARD=Device,DEV=0 even if rhasspy shows (no sound) after clicking on Test. So I've just selected it and finally recording via rhasspy webinterface started to work, but:
I saw this in the rhasspy logs:
When running this command in the host or in docker:
arecord -D hw:1,0 -d 5 -f cd test.wav -c 1
the file is fine and I was even able to upload it via the rhasspy webinterface and all my 4 different examples were recognized correctly. I almost gave it up with rhasspy but this proofs it's really working.But how can I fix it now?
Oh noo, I've just realized even with the english profile the raspberry becomes unusable after 2-4 hours. CPU is at 100% it shows me this on an attache monitor, but I cannot ssh or even do a ping.