Open prairiesnpr opened 5 months ago
Worked on this more last night, overriding the architecture in setup.py to armv7 allows the compile to complete. Home Assistant now starts, but since I don't use voice, I don't know if it's actually functional beyond allowing the import.
So the workaround is to set the machine to "armv7" but the Python 3.12.1 platform.machine() call returns "aarch64" on the RPi4 using Raspbian based on Debian 11 Bullseye:
Python 3.12.1 (main, Jan 27 2024, 15:54:44) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.machine()
'aarch64'
When webrtc-noise-gain is compiled by overriding the machine in setup.py
machine="armv7" # platform.machine().lower()
I installed the wheel from the dist folder like this into the homeassistant's venv:
pip install webrtc-noise-gain/dist/webrtc_noise_gain-1.2.3-cp312-cp312-linux_armv7l.whl
Based on the description above, this was how I applied the workaround to my pi (for homeassistant use)
. yourvenvpath/bin/activate
pip download webrtc-noise-gain
tar xfz ./webrtc_noise_gain-1.2.3.tar.gz
sed -i 's/machine = platform.machine().lower()/machine="armv7"/' webrtc_noise_gain-1.2.3/setup.py
pip install ./webrtc_noise_gain-1.2.3
I have an armv7 processor but build fails using python 3.12.3. Platform.machine() gives "armv7l". Building on Alpine 3.20.
It's also possible to set have_neon
to False
in setup.py
(line 360) and disable Neon some more in webrtc-audio-processing/webrtc-audio-processing-1/third_party/pffft/src/pffft.c
on line 154. Just make the #elif
fail somehow and it'll compile :slightly_smiling_face:
Not sure what's wise though, with regard to performance: disable Neon or downgrade to 32 bits with ARMv7. :man_shrugging:
Build fails on rpi4 with Raspbian 64bit bookworm and python3.12.1, with
/usr/lib/gcc/arm-linux-gnueabihf/12/include/arm_neon.h:6940:1: error: inlining failed in call to ‘always_inline’ ‘float32x4_t vmovq_n_f32(float32_t)’: target specific option mismatch
If you could point me in the right direction, I'd appreciate it.Followed build instructions from readme.
Build attempt