rhasspy / webrtc-noise-gain

Tiny wrapper around webrtc-audio-processing for noise suppression/auto gain only
MIT License
10 stars 17 forks source link

unsupported system : freebsd #6

Closed ex1maragda closed 8 months ago

ex1maragda commented 9 months ago

when I try to install with "pip install webrtc-noise-gain" get the following error (Unsupported system: freebsd): Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [20 lines of output] Traceback (most recent call last): File "/usr/local/share/homeassistant/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in main() File "/usr/local/share/homeassistant/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/share/homeassistant/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-sdqfvtln/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-sdqfvtln/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires self.run_setup() File "/tmp/pip-build-env-sdqfvtln/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 507, in run_setup super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script) File "/tmp/pip-build-env-sdqfvtln/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in run_setup exec(code, locals()) File "", line 384, in ValueError: Unsupported system: freebsd [end of output]

LukaszMoskala commented 9 months ago

same problem here. Looks like error is thrown here: https://github.com/rhasspy/webrtc-noise-gain/blob/0b3bc23f5f33101df5b8f1970919500d8629b955/setup.py#L384

I'll try to patch it to threat freebsd the same way as linux and see what will happen.

LukaszMoskala commented 9 months ago

Just treating it as linux is not enough. So far pip doesn't complain, however both clang, gcc12 and gcc13 fail to build something that is required.

gcc13 complains about /usr/local/include/python3.11/pymacro.h:10:25: error: '_Static_assert' was not declared in this scope; did you mean 'static_assert'?

clang complains about

/tmp/pip-req-build-qixxzok2/webrtc-audio-processing/webrtc-audio-processing-1/rtc_base/platform_thread_types.cc:46:10: error: cast from pointer to smaller type 'rtc::PlatformThreadId' (aka 'int') loses information
        return reinterpret_cast<PlatformThreadId>(pthread_self());

I think the problem may be in webrtc-audio-processing library itself but hopefully someone who knows more than me will speak about that.

If someone wants to install it themselves, then I used pip3 install git+https://github.com/LukaszMoskala/webrtc-noise-gain.git or CC=gcc13 CXX=g++13 pip3 install git+https://github.com/LukaszMoskala/webrtc-noise-gain.git

amigan commented 9 months ago

https://github.com/rhasspy/webrtc-noise-gain/pull/7

LukaszMoskala commented 9 months ago

Just in time when I also fixed it (at least it builds, I don't know yet if it actually works).

I'll be trying whatever I did later tonight, but if someone wants to try my code, I just did pip3 install git+https://github.com/LukaszMoskala/webrtc-noise-gain.git and it worked. I don't know if homeassistant with this will actually start

amigan commented 9 months ago

HA starts with my patch. I am actually using the voice stuff, so I will test later and see if everything is in order.

amigan commented 9 months ago

It looks like voice assist isn't working, but I really don't think it is because of any of this. I see data going to whisper in a packet capture, but nothing happens after that.

LukaszMoskala commented 9 months ago

Looks like removing default_config: from configuration and including whatever it used to include manually, but skipping assist_pipeline should work as a workaround untill your patch is merged.

Also your patch installs correctly, however my homeassistant still does not start, due to unrelated (I belive) problems with numpy so I'm not able to test it now

ryanwinter commented 8 months ago

I believe the esphome plugin depends on the assist_pipeline so this will need to be disabled as well.

gdt commented 8 months ago

I'm seeing the same unsupported error with netbsd.

tuarrep commented 8 months ago

I can confirm that

  1. the package is installing with the patch.
  2. HA starts after manually installing that patch and without disabling any module.

I do not use voice stuff, so I cannot confirm it's effectively working on my side.

synesthesiam commented 8 months ago

PR has been merged. Let me know if the issue has been resolved.

gdt commented 8 months ago

I didn't notice this when I read the PR, but the meson patch adds dragonfly/freebsd/netbsd/openbsd (yay) but the setup.py only adds freebsd. I have a patch to fix setup.py to have all 4; see #11.

gdt commented 8 months ago

Also, does anyone understand what's going on with https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/ ? Looking at pull requests for OS support being open for years, It does not immediately appear healthy. It's really nice to see things getting merged here.

gdt commented 8 months ago

I realize there is still an open question as to whether the BSD support is 100% working, but coming here as a hass user I see the "hass fails to install on BSD" as really serious and "new feature for voice commands doesn't work" as much less so, in terms of urgency to resolve and not being so much of a regression.

Therefore I think it would be good to tag a release and ask HA upstream to merge a bump, so that 2023.11 will install ok. And yes, I realize that there is a likelihood of needing a new release and bump next month, but I think that' s ok; we won't run out of integers to label them with!

amigan commented 8 months ago

The home assistant maintainers are actively hostile to anyone not using their own Linux distribution, so good luck with that.

gdt commented 8 months ago

I know, but a release and bump is still fair with 'bug fixes' :-)

crees commented 8 months ago

Thankfully this is the first result in Google for "webrtc-noise-gain freebsd" which I think is the obvious thing to search. Thanks for the work done here :)

(I also don't care about the voice stuff :))

amigan commented 8 months ago

I have just verified that this patch and all voice functionality are working on FreeBSD in 2023.10.4.

synesthesiam commented 8 months ago

The home assistant maintainers are actively hostile to anyone not using their own Linux distribution, so good luck with that.

I don't know about your specific experience, but I believe it's largely an issue of limited human resources.

amigan commented 8 months ago

The home assistant maintainers are actively hostile to anyone not using their own Linux distribution, so good luck with that.

I don't know about your specific experience, but I believe it's largely an issue of limited human resources.

Thank you for closing. I just wanted to say that they refuse any and all patches that would help. I'm not expecting white glove support; FreeBSD users are very much a self-supporting bunch.

synesthesiam commented 8 months ago

Fair enough. I don't know anyone at Nabu Casa who uses FreeBSD as their daily driver. I have it indirectly via TrueNAS, but I'm also a little unusual within the team for running vanilla Debian 😄

precurse commented 7 months ago

Running Home Assistant in a jail, as opposed to a full fledged BHyve Linux instance, is so much more appealing to me. The fact upgrading to a newer version broke the Home Assistant mobile app for me is highly annoying.

Edit: Ahh, looks like they never cut a release since the freebsd patch was implemented -- so pip tries to install version 1.2.3 without the patch and fails. pip3 install git+https://github.com/rhasspy/webrtc-noise-gain.git seems to have done the trick.