rhasspy / webrtc-noise-gain

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

can't install on Alpine Linux 3.18 #9

Closed valantur closed 8 months ago

valantur commented 8 months ago

I'm running home-assistant on a low powered IoT board so to keep things light on the system I run HA Core under Alpine Linux. Since upgrading to 2023.10.1, my mobile app integration stopped working because it now needs this package and it won't compile on Alpine. Any chance you can fix it?

This is the last few lines of the output after running "pip3 install webrtc-noise-gain":

`gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DVERSION_INFO=1.2.3 -I/tmp/pip-install-rub8x7ms/webrtc-noise-gain_9599bea0c6f248afa520e2fd4a855ba1/webrtc-audio-processing -I/tmp/pip-install-rub8x7ms/webrtc-noise-gain_9599bea0c6f248afa520e2fd4a855ba1/webrtc-audio-processing/webrtc-audio-processing-1 -I/tmp/pip-install-rub8x7ms/webrtc-noise-gain_9599bea0c6f248afa520e2fd4a855ba1/webrtc-audio-processing/subprojects/abseil-cpp-20230125.1 -I/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/pybind11/include -I/usr/include/python3.11 -c -std=c++17 /tmp/pip-install-rub8x7ms/webrtc-noise-gain_9599bea0c6f248afa520e2fd4a855ba1/webrtc-audio-processing/webrtc-audio-processing-1/rtc_base/system/file_wrapper.cc -o build/temp.linux-x86_64-cpython-311/tmp/pip-install-rub8x7ms/webrtc-noise-gain_9599bea0c6f248afa520e2fd4a855ba1/webrtc-audio-processing/webrtc-audio-processing-1/rtc_base/system/file_wrapper.o -fvisibility=hidden -g0 -DWEBRTC_LIBRARY_IMPL -DWEBRTC_ENABLE_SYMBOL_EXPORT -DNDEBUG -DWEBRTC_APM_DEBUG_DUMP=0 -D_GNU_SOURCE -DWEBRTC_LINUX -DWEBRTC_THREAD_RR -DWEBRTC_POSIX -DWEBRTC_ARCH_LITTLE_ENDIAN -DWEBRTC_ARCH_X86_FAMILY -msse2 -DWEBRTC_ARCH_X86_64 -DWEBRTC_ARCH_64_BITS In file included from /tmp/pip-install-rub8x7ms/webrtc-noise-gain_9599bea0c6f248afa520e2fd4a855ba1/webrtc-audio-processing/webrtc-audio-processing-1/rtc_base/system/file_wrapper.cc:11: /tmp/pip-install-rub8x7ms/webrtc-noise-gain_9599bea0c6f248afa520e2fd4a855ba1/webrtc-audio-processing/webrtc-audio-processing-1/rtc_base/system/file_wrapper.h:86:21: error: 'int64_t' has not been declared 86 | bool SeekRelative(int64_t offset); | ^~~ /tmp/pip-install-rub8x7ms/webrtc-noise-gain_9599bea0c6f248afa520e2fd4a855ba1/webrtc-audio-processing/webrtc-audio-processing-1/rtc_base/system/file_wrapper.h:88:15: error: 'int64_t' has not been declared 88 | bool SeekTo(int64_t position); | ^~~ /tmp/pip-install-rub8x7ms/webrtc-noise-gain_9599bea0c6f248afa520e2fd4a855ba1/webrtc-audio-processing/webrtc-audio-processing-1/rtc_base/system/file_wrapper.cc:82:6: error: no declaration matches 'bool webrtc::FileWrapper::SeekRelative(int64_t)' 82 | bool FileWrapper::SeekRelative(int64_t offset) { | ^~~ /tmp/pip-install-rub8x7ms/webrtc-noise-gain_9599bea0c6f248afa520e2fd4a855ba1/webrtc-audio-processing/webrtc-audio-processing-1/rtc_base/system/file_wrapper.h:86:8: note: candidate is: 'bool webrtc::FileWrapper::SeekRelative(int)' 86 | bool SeekRelative(int64_t offset); | ^~~~ /tmp/pip-install-rub8x7ms/webrtc-noise-gain_9599bea0c6f248afa520e2fd4a855ba1/webrtc-audio-processing/webrtc-audio-processing-1/rtc_base/system/file_wrapper.h:31:7: note: 'class webrtc::FileWrapper' defined here 31 | class FileWrapper final { | ^~~ /tmp/pip-install-rub8x7ms/webrtc-noise-gain_9599bea0c6f248afa520e2fd4a855ba1/webrtc-audio-processing/webrtc-audio-processing-1/rtc_base/system/file_wrapper.cc:87:6: error: no declaration matches 'bool webrtc::FileWrapper::SeekTo(int64_t)' 87 | bool FileWrapper::SeekTo(int64_t position) { | ^~~ /tmp/pip-install-rub8x7ms/webrtc-noise-gain_9599bea0c6f248afa520e2fd4a855ba1/webrtc-audio-processing/webrtc-audio-processing-1/rtc_base/system/file_wrapper.h:88:8: note: candidate is: 'bool webrtc::FileWrapper::SeekTo(int)' 88 | bool SeekTo(int64_t position); | ^~ /tmp/pip-install-rub8x7ms/webrtc-noise-gain_9599bea0c6f248afa520e2fd4a855ba1/webrtc-audio-processing/webrtc-audio-processing-1/rtc_base/system/file_wrapper.h:31:7: note: 'class webrtc::FileWrapper' defined here 31 | class FileWrapper final { | ^~~ Traceback (most recent call last): File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/_distutils/unixccompiler.py", line 185, in _compile self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs) File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/_distutils/ccompiler.py", line 1041, in spawn spawn(cmd, dry_run=self.dry_run, **kwargs) File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/_distutils/spawn.py", line 70, in spawn raise DistutilsExecError( setuptools._distutils.errors.DistutilsExecError: command '/usr/bin/gcc' failed with exit code 1

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/usr/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/usr/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/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 434, in build_wheel
      return self._build_with_temp_dir(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 419, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/pip-build-env-fa_xff01/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-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in run_setup
      exec(code, locals())
    File "<string>", line 563, in <module>
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 989, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-fa_xff01/normal/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 364, in run
      self.run_command("build")
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 989, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 131, in run
      self.run_command(cmd_name)
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 989, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 88, in run
      _build_ext.run(self)
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
      self.build_extensions()
    File "<string>", line 511, in build_extensions
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/pybind11/setup_helpers.py", line 285, in build_extensions
      super().build_extensions()
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
      self._build_extensions_serial()
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
      self.build_extension(ext)
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 249, in build_extension
      _build_ext.build_extension(self, ext)
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 548, in build_extension
      objects = self.compiler.compile(
                ^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/_distutils/ccompiler.py", line 600, in compile
      self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
    File "<string>", line 498, in _compile
    File "/tmp/pip-build-env-fa_xff01/overlay/lib/python3.11/site-packages/setuptools/_distutils/unixccompiler.py", line 187, in _compile
      raise CompileError(msg)
  setuptools._distutils.errors.CompileError: command '/usr/bin/gcc' failed with exit code 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for webrtc-noise-gain Failed to build webrtc-noise-gain ERROR: Could not build wheels for webrtc-noise-gain, which is required to install pyproject.toml-based projects`

synesthesiam commented 8 months ago

PR has been merged. Please let me know if the issue is resolved.

valantur commented 8 months ago

how can I test this? pip install webrtc-noise-gain installs version 1.2.3, which I believe doesn't include this fix, correct?

valantur commented 8 months ago

It works, took me a few minutes to learn how to install it: pip install git+https://github.com/rhasspy/webrtc-noise-gain Thanks so much!