Open moritzschaefer opened 4 years ago
I faced the same issue and got it working (again) by using the library and ppn files from https://github.com/Picovoice/porcupine instead of the ones shipped with Rhasspy 2.4.20.
My profile.json now contains:
{
"wake": {
"porcupine": {
"keyword_path": "<original-porcupine>/resources/keyword_files/raspberry-pi/porcupine_raspberry-pi.ppn",
"library_path": "<original-porcupine>/lib/raspberry-pi/cortex-a72/libpv_porcupine.so",
"model_path": "<original-porcupine>/lib/common/porcupine_params.pv"
},
"system": "porcupine"
}
}
See https://github.com/Picovoice/porcupine/blob/master/lib/README.md for the correct library file and https://github.com/Picovoice/porcupine/tree/master/resources/keyword_files/raspberry-pi for the keyword files available.
The files shipped with 2.4.20
are actually the ones from Picovoice/porcupine
:
@kroka Can you see any problem with the files linked in the default.json
file? The only thing I see is that we are not using the libpv_porcupine.so
from cortex-a72
which would be optimized for rpi 4.
cortex-a53 is tuned for 3 and 3 B+. cortex-a72 is tuned for 4.
@Tooa, I have a Raspberry Pi 4 (with Rhasspy 2.4.20) and the armv7l / aarch64
files linked in the defaults.json work for me. I've manually downloaded them. The default files (if I do not configure anything) shipped with Rhasspy lead to the error given in the initial post above.
Since working files are already listed in the defaults.json: does Rhasspy choose the wrong architecture in my case? Actually I do not exactly know what PPN file I have in .config/rhasspy/profiles/de/porcupine/
as a diff
shows a difference (binary) to the just downloaded x86_64
and armv7l/aarch64
file.
Thanks for reaching back.
I have a Raspberry Pi 4 (with Rhasspy 2.4.20) and the armv7l / aarch64 files linked in the defaults.json work for me.
From what I understand is that Rhasspy
downloads the files referenced in defaults.json
. I guess, something is broken with the automatic download then because the files work for you when downloaded by hand.
Looks like this function is responsible for the download of the entries from the defaults.json
file. The function does log a few things. Do you still have the log from the failing case i.e. the download of the suspicious wrong files?
Hi @Tooa,
I've triggered a fresh download via the API (POST "<rhasspy>/api/download-profile?delete=true
), but had to manually delete the Porcupine files as they have not been deleted by the delete
option:
May 22 12:47:29 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Deleting download cache at /home/pi/.config/rhasspy/profiles/de/download
May 22 12:47:29 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Using cached /home/pi/.config/rhasspy/profiles/de/porcupine/porcupine_params.pv for porcupine/porcupine_params.pv
May 22 12:47:29 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Using cached /home/pi/.config/rhasspy/profiles/de/porcupine/libpv_porcupine.so for porcupine/libpv_porcupine.so
May 22 12:47:29 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Using cached /home/pi/.config/rhasspy/profiles/de/porcupine/porcupine.ppn for porcupine/porcupine.ppn
But now I finally have the correct files:
May 22 13:08:25 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Deleting download cache at /home/pi/.config/rhasspy/profiles/de/download
May 22 13:08:25 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Downloading https://github.com/Picovoice/porcupine/raw/v1.7/lib/common/porcupine_params.pv to /home/pi/.config/rhasspy/profiles/de/porcupine/porcupine_params.pv
May 22 13:08:25 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Downloading https://github.com/Picovoice/porcupine/raw/v1.7/lib/raspberry-pi/cortex-a53/libpv_porcupine.so to /home/pi/.config/rhasspy/profiles/de/porcupine/libpv_porcupine.so
May 22 13:08:25 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Downloading https://github.com/Picovoice/porcupine/raw/v1.7/resources/keyword_files/raspberry-pi/porcupine_raspberry-pi.ppn to /home/pi/.config/rhasspy/profiles/de/porcupine/porcupine.ppn
May 22 13:08:26 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Downloaded /home/pi/.config/rhasspy/profiles/de/porcupine/libpv_porcupine.so
May 22 13:08:26 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Downloaded /home/pi/.config/rhasspy/profiles/de/porcupine/porcupine.ppn
May 22 13:08:27 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Downloaded /home/pi/.config/rhasspy/profiles/de/porcupine/porcupine_params.pv
It also detected the correct architecture armv7l
for my Pi via https://github.com/synesthesiam/rhasspy/blob/3c53cd0236a397a4069f84d12766e786cec3cb89/rhasspy/core.py#L550
I cannot exactly say why I had wrong files initially. It could be a leftover from my initial Rhasspy installation for which I used the Docker image. In the meanwhile I've switched to the plain Python venv.
@moritzschaefer how is it working for you? From my side we could close this issue.
Yes, we can also close from my side. I am at the moment fighting with Raspberry Pi4 and NixOS and would reopen if I encounter the same problem on the new system.
On Fri, 22 May 2020 at 14:22, kroka notifications@github.com wrote:
Hi @Tooa https://github.com/Tooa,
I've triggered a fresh download via the API (POST "
/api/download-profile?delete=true), but had to manually delete the Porcupine files as they have not been deleted by the delete option: May 22 12:47:29 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Deleting download cache at /home/pi/.config/rhasspy/profiles/de/download May 22 12:47:29 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Using cached /home/pi/.config/rhasspy/profiles/de/porcupine/porcupine_params.pv for porcupine/porcupine_params.pv May 22 12:47:29 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Using cached /home/pi/.config/rhasspy/profiles/de/porcupine/libpv_porcupine.so for porcupine/libpv_porcupine.so May 22 12:47:29 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Using cached /home/pi/.config/rhasspy/profiles/de/porcupine/porcupine.ppn for porcupine/porcupine.ppn
But now I finally have the correct files:
May 22 13:08:25 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Deleting download cache at /home/pi/.config/rhasspy/profiles/de/download May 22 13:08:25 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Downloading https://github.com/Picovoice/porcupine/raw/v1.7/lib/common/porcupine_params.pv to /home/pi/.config/rhasspy/profiles/de/porcupine/porcupine_params.pv May 22 13:08:25 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Downloading https://github.com/Picovoice/porcupine/raw/v1.7/lib/raspberry-pi/cortex-a53/libpv_porcupine.so to /home/pi/.config/rhasspy/profiles/de/porcupine/libpv_porcupine.so May 22 13:08:25 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Downloading https://github.com/Picovoice/porcupine/raw/v1.7/resources/keyword_files/raspberry-pi/porcupine_raspberry-pi.ppn to /home/pi/.config/rhasspy/profiles/de/porcupine/porcupine.ppn May 22 13:08:26 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Downloaded /home/pi/.config/rhasspy/profiles/de/porcupine/libpv_porcupine.so May 22 13:08:26 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Downloaded /home/pi/.config/rhasspy/profiles/de/porcupine/porcupine.ppn May 22 13:08:27 raspberrypi rhasspy[4296]: DEBUG:RhasspyCore:Downloaded /home/pi/.config/rhasspy/profiles/de/porcupine/porcupine_params.pv
It also detected the correct architecture armv7l for my Pi via https://github.com/synesthesiam/rhasspy/blob/3c53cd0236a397a4069f84d12766e786cec3cb89/rhasspy/core.py#L550
I cannot exactly say why I had wrong files initially. It could be a leftover from my initial Rhasspy installation for which I used the Docker image. In the meanwhile I've switched to the plain Python venv.
@moritzschaefer https://github.com/moritzschaefer how is it working for you? From my side we could close this issue.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/synesthesiam/rhasspy/issues/213#issuecomment-632664518, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUWXLCU6UP6J5FQVT3TBSDRSZVA3ANCNFSM4MQBUMTQ .
--
Moritz Schäfer
ETH Zurich Department of Biology
Otto-Stern-Weg 7
8093 Zürich, Switzerland
*moritz.schaefer@biol.ethz.ch moritz.schaefer@biol.ethz.ch* http://www.bsse.ethz.ch
On my RPi 3B+, I don't get Porcupine to work. This is my config:
Here is the error output of rhasspy:
Is there a way to get some debug output from porcupine directly?
Of note, snowboy works!