rhasspy / wyoming-satellite

Remote voice satellite using Wyoming protocol
MIT License
679 stars 99 forks source link

Installation error with 32bit OS (onxruntime) #64

Open bckthomas opened 9 months ago

bckthomas commented 9 months ago

Hi I use tutorial_2mic.md tutorial and I got an error when running this command : .venv/bin/pip3 install -f 'https://synesthesiam.github.io/prebuilt-apps/' -r requirements_vad.txt

ERROR: Could not find a version that satisfies the requirement onnxruntime<2,>=1.10.0 (from pysilero-vad) (from versions: none) ERROR: No matching distribution found for onnxruntime<2,>=1.10.0

How to fix this ? Thanks

llluis commented 9 months ago

What hardware you are using? What OS?

You should see

Collecting onnxruntime<2,>=1.10.0
  Downloading onnxruntime-1.16.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.7 MB)

if using a Pi Zero 2 with a 64bit OS.

Maybe you are on a 32bit OS? (yeah, I don't see a 32bit package for onnxruntime in PyPi...)

bckthomas commented 9 months ago

Yes, I use a Pi Zero 1 with 32bit OS I need to change my pi ? I can't install a 64bit OS on this pi

seppeel commented 9 months ago

No, but you have to use the 64bit version of the raspberry pi os. On 32bit the VAD (which uses onnxruntime) setup will fail.

edit: oh sorry, for some reason i didn't read your last sentence.

Right now you have to use another pi, yes. Maybe its possible to fix the onnxruntime dependency on 32 bit os. But i'm not sure, this issue already exists for at least months.

llluis commented 9 months ago

If VAD is the only requirement for a 64bit OS (and assuming the Pi Zero 1 has the compute power) it should be possible to run an always streaming satellite or do local wake word detection (which doesn’t seem to use this library), with some light modification in the code.

I’ll try to get a spare SD card to run a 32bit OS and test.

synesthesiam commented 9 months ago

Microsoft doesn't provide 32-bit builds of the onnx runtime for Python. And every time I finally get a build working, Python or onnx bumps a version number 😄

fschaal commented 9 months ago

I run into the same issue. Would be cool if this works so I can use some of my pi zero v1 for this.

bobslaede commented 9 months ago

+1
Would also love to be able to run on a Pi Zero W 1 :)

sohnvonoff commented 9 months ago

I had specially bought two Pi-ZeroW(1) with ReSpeak2-Mic, but now that doesn't work with the Wyoming Satellite because of 32-bit. A pity...

bobslaede commented 9 months ago

Me too in fact :) Not for this project though, but a happy coincidence. Will get a Zero 2. For now, I have it running on a Pi 4, but that is overkill for this project :)

synesthesiam commented 9 months ago

I had specially bought two Pi-ZeroW(1) with ReSpeak2-Mic, but now that doesn't work with the Wyoming Satellite because of 32-bit. A pity...

This is a solvable problem, so it will run in the future 👍

carkom commented 9 months ago

Any updates on this? I'd also love to use my v1 for this project.

latargere commented 8 months ago

Same here, I would love to be able to do wake word recognition on my pi zero 32bits. I have a bunch them that I like to reuse

marcopi commented 8 months ago

I'm also struggling with this.

I managed to install onnxruntime for armv7 (32 bit raspberry pi) and silero vad (thanks synesthesiam!)

wget https://github.com/synesthesiam/prebuilt-apps/releases/download/v1.0/onnxruntime-1.11.1-cp39-cp39-linux_armv7l.whl
pip install onnxruntime-1.11.1-cp39-cp39-linux_armv7l.whl
pip install 'pysilero-vad==1.0.0'

without any errors.... but when I launch wyoming-satellite (with audio input from gstreamer) the result is this:

(.venv) pi@rpi4-casa:/opt/wyoming-satellite-1.2.0_onnx $ script/run --name 'my satellite' --uri 'tcp://0.0.0.0:10700' --mic-command 'gst-launch-1.0 --quiet udpsrc port=5002 ! rawaudioparse use-sink-caps=false format=pcm pcm-format=s16le sample-rate=16000 num-channels=1 ! queue ! audioconvert ! audioresample ! fdsink fd=1 async=true' --snd-command 'aplay -r 22050 -c 1 -f S16_LE -t raw' --vad --debug
Install extras for silerovad
Traceback (most recent call last):
  File "/opt/wyoming-satellite-1.2.0_onnx/script/run", line 12, in <module>
    subprocess.check_call([context.env_exe, "-m", "wyoming_satellite"] + sys.argv[1:])
  File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/wyoming-satellite-1.2.0_onnx/.venv/bin/python3', '-m', 'wyoming_satellite', '--name', 'my satellite', '--uri', 'tcp://0.0.0.0:10700', '--mic-command', 'gst-launch-1.0 --quiet udpsrc port=5002 ! rawaudioparse use-sink-caps=false format=pcm pcm-format=s16le sample-rate=16000 num-channels=1 ! queue ! audioconvert ! audioresample ! fdsink fd=1 async=true', '--snd-command', 'aplay -r 22050 -c 1 -f S16_LE -t raw', '--vad', '--debug']' returned non-zero exit status 1.

This is my python modules list:

(.venv) pi@rpi4-casa:/opt/wyoming-satellite-1.2.0_onnx $ pip list
Package           Version
----------------- --------------
async-timeout     4.0.3
flatbuffers       20181003210633
ifaddr            0.2.0
numpy             1.25.2
onnxruntime       1.11.1
pip               24.0
pkg_resources     0.0.0
protobuf          4.25.3
pyring-buffer     1.0.0
pysilero-vad      1.0.0
setuptools        69.1.1
webrtc-noise-gain 1.2.3
wheel             0.42.0
wyoming           1.5.3
zeroconf          0.88.0

Is there something I can try to make it work?

marcopi commented 8 months ago

I find the culprit...

I had to copy the onnx model file to the root directory of the installation.

cp -r .venv/lib/python3.9/site-packages/pysilero_vad/models .

Now it's time to play with it!

carkom commented 8 months ago

I find the culprit...

I had to copy the onnx model file to the root directory of the installation.

cp -r .venv/lib/python3.9/site-packages/pysilero_vad/models .

Now it's time to play with it!

What Pi Zero are you using? The armv7 install doesn't work on my Pi Zero v1.3 which is an armv6 CPU.

marcopi commented 8 months ago

What Pi Zero are you using? The armv7 install doesn't work on my Pi Zero v1.3 which is an armv6 CPU.

I'm using a Raspberry pi 4 with 32 bit os. Sorry for not stating clearly.

carkom commented 8 months ago

Okay thanks. This is still an issue for armv6 cpus.

latargere commented 7 months ago

I've tested with my zero w by installing just the requirements.txt and it does work since I'm using porcupine for local wake word detection. No vad is required in my case. I also tried with audio enhancement but it was crashing when launching with the 2 options to enhance (--mic-auto-gain and --mic-noise-suppression). I recompiled the lib directly on the pi and replace it with this command (I've attached the file): .venv/bin/pip3 install --upgrade --force-reinstall webrtc_noise_gain-1.2.3-cp39-cp39-linux_armv6l.whl

And I was able to reuse the command for audio enhancements. Hope it could help ;)

webrtc_noise_gain-1.2.3-cp39-cp39-linux_armv6l.whl.zip

Kkeling commented 6 months ago

I am only performing the steps as scripted in the instructions and I am receiving this error. Are there steps I need to have performed outside the build instructions. Purchased hardware as recommended in links. Appreciate any help as I am a novice on this platform. Thx in advance.

markist commented 5 months ago

So i guess the way forward is not using armv6 hardware?

danielholm commented 4 months ago

I just skipped the part of the installation regarding requirements for vad. Ie. Removing that file/row from the compile part of the tutorial. Then want on with the rest. Now i have a Pi Zero 1 running as satellite.

$ uname -rm 5.15.56+ armv6l

EricInMi commented 4 months ago

I just skipped the part of the installation regarding requirements for vad. Ie. Removing that file/row from the compile part of the tutorial. Then want on with the rest. Now i have a Pi Zero 1 running as satellite.

I did the same with a 32bit raspberry pi 3b+ and was able to run the wyoming-satellite with no errors, however it will not respond to a wakeword. did you have this problem and did you solve it?

Joldiges commented 3 months ago

So i guess the way forward is not using armv6 hardware?

I wouldn't give up hope.

As far as I see it, most "issues" are just missing official support and binaries (such as the onnxruntime wheel).

I think the path forward is someone needs to keep some CI/CD pipelines open. I'm currently 93% done compiling a onnxruntime wheel for the ArmV6 architecture via Docker. If I successfully get this built, then I'll have a starting point for continuous building. With CCache, builds should take less than 10 hours 😉 after the first build. image

Once everything is done, perhaps we can release a stable-ish docker image to run on the RasPi 0w. My understanding is the cpu overhead is negligible anyways. This would stop misc updates from breaking people's satellites until there is a stable image update. 🤷‍♂️

danielholm commented 2 months ago

I just skipped the part of the installation regarding requirements for vad. Ie. Removing that file/row from the compile part of the tutorial. Then want on with the rest. Now i have a Pi Zero 1 running as satellite.

I did the same with a 32bit raspberry pi 3b+ and was able to run the wyoming-satellite with no errors, however it will not respond to a wakeword. did you have this problem and did you solve it?

Excuse my late reply. I did not have that problem. After install, with the Vad row redacted, I simply configured the satellite in Home Assistant, with what assistant and such, and it worked.

.venv/bin/pip3 install -f 'https://synesthesiam.github.io/prebuilt-apps/' -r requirements.txt -r requirements_audio_enhancement.txt

Joldiges commented 2 months ago

I've resolved the dependencies with VAD

I built with docker as armv6l

FROM balenalib/raspberry-pi-debian-python:3.11.2
numpy==1.25.2
ONNXRUNTIME_VERSION="1.16.3"
CMAKE_VERSION="3.30.2"

onnx compile with...
./build.sh --config MinSizeRel --clean --update --build --build_shared_lib --enable_pybind --build_wheel --parallel $(nproc) --compile_no_warning_as_error --allow_running_as_root

Building, i exported the onnxruntime wheel and installed on the raspi 0 (and zeroconf to save time)

Notes:

After finishing everything, I'm thinking of testing running docker on the Raspi 0w. I anticipate the overhead is negligible enough and therefore our environment can be stable.

Edit: MircroCenter changed the RasPi 0W to be one-per-customer. Given it's the same price as the 02W now, I don't intend to provide any continuous releases.

DChupris commented 1 month ago

Is there any update on availability for 32 bit OS? Thanks

Joldiges commented 1 month ago

Is there any update on availability for 32 bit OS? Thanks

I built some wheels and stored them here for 32bit arm (v6); assuming that's what you're wanting. If not, lmk.

https://github.com/Joldiges/Wyoming-ARMv6-Deps