I encountered an error about Sox when deploying seamless-streaming on Amazon's ec2 server.

#4
by lvfengchun - opened

[2023-12-13 01:28:09,333][ERROR][app_pubsub]: [app_pubsub] Caught exception in 'incoming_audio' event handler:

apply_effects_tensor requires sox extension which is not available. Please refer to the stacktrace above for how to resolve this.
Traceback (most recent call last):
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/torchaudio/_extension/utils.py", line 207, in wrapped
_init_sox()
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/torchaudio/_extension/utils.py", line 70, in _init_sox
_load_lib("libtorchaudio_sox")
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/torchaudio/_extension/utils.py", line 64, in _load_lib
torch.ops.load_library(path)
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/torch/_ops.py", line 852, in load_library
ctypes.CDLL(path)
File "/opt/conda/envs/smlss_server/lib/python3.8/ctypes/init.py", line 373, in init
self._handle = _dlopen(self._name, mode)
OSError: libsox.so: cannot open shared object file: No such file or directory

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/ec2-user/workspace/seamless_communication/demo/seamless-streaming/seamless_server/app_pubsub.py", line 171, in catch_exception_wrapper
return await func(*args, **kwargs)
File "/home/ec2-user/workspace/seamless_communication/demo/seamless-streaming/seamless_server/app_pubsub.py", line 745, in incoming_audio
member.transcoder.process_incoming_bytes(
File "/home/ec2-user/workspace/seamless_communication/demo/seamless-streaming/seamless_server/src/simuleval_transcoder.py", line 205, in process_incoming_bytes
segment, sr = self._preprocess_wav(incoming_bytes)
File "/home/ec2-user/workspace/seamless_communication/demo/seamless-streaming/seamless_server/src/simuleval_transcoder.py", line 290, in _preprocess_wav
segment, new_sample_rate = self.convert_waveform(
File "/home/ec2-user/workspace/seamless_communication/demo/seamless-streaming/seamless_server/src/simuleval_transcoder.py", line 265, in convert_waveform
converted, converted_sample_rate = ta_sox.apply_effects_tensor(
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/torchaudio/_extension/utils.py", line 209, in wrapped
raise RuntimeError(
RuntimeError: apply_effects_tensor requires sox extension which is not available. Please refer to the stacktrace above for how to resolve this.
Stack (most recent call last):
File "/opt/conda/envs/smlss_server/bin/uvicorn", line 8, in
sys.exit(main())
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/uvicorn/main.py", line 416, in main
run(
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/uvicorn/main.py", line 587, in run
server.run()
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/uvicorn/server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
File "/opt/conda/envs/smlss_server/lib/python3.8/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/socketio/asyncio_server.py", line 515, in _handle_event_internal
r = await server._trigger_event(data[0], namespace, sid, *data[1:])
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/socketio/asyncio_server.py", line 549, in _trigger_event
ret = await handler(*args)
File "/home/ec2-user/workspace/seamless_communication/demo/seamless-streaming/seamless_server/app_pubsub.py", line 174, in catch_exception_wrapper
logger.exception(message, stack_info=True)
2023-12-13 01:28:09,334 ERROR -- asyncio: Task exception was never retrieved
future: <Task finished name='Task-163' coro=<AsyncServer._handle_event_internal() done, defined at /opt/conda/envs/smlss_server/lib/python3.8/site-packages/socketio/asyncio_server.py:513> exception=RuntimeError('apply_effects_tensor requires sox extension which is not available. Please refer to the stacktrace above for how to resolve this.')>
Traceback (most recent call last):
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/torchaudio/_extension/utils.py", line 207, in wrapped
_init_sox()
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/torchaudio/_extension/utils.py", line 70, in _init_sox
_load_lib("libtorchaudio_sox")
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/torchaudio/_extension/utils.py", line 64, in _load_lib
torch.ops.load_library(path)
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/torch/_ops.py", line 852, in load_library
ctypes.CDLL(path)
File "/opt/conda/envs/smlss_server/lib/python3.8/ctypes/init.py", line 373, in init
self._handle = _dlopen(self._name, mode)
OSError: libsox.so: cannot open shared object file: No such file or directory

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/socketio/asyncio_server.py", line 515, in _handle_event_internal
r = await server._trigger_event(data[0], namespace, sid, *data[1:])
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/socketio/asyncio_server.py", line 549, in _trigger_event
ret = await handler(*args)
File "/home/ec2-user/workspace/seamless_communication/demo/seamless-streaming/seamless_server/app_pubsub.py", line 209, in catch_exception_wrapper
raise e
File "/home/ec2-user/workspace/seamless_communication/demo/seamless-streaming/seamless_server/app_pubsub.py", line 171, in catch_exception_wrapper
return await func(*args, **kwargs)
File "/home/ec2-user/workspace/seamless_communication/demo/seamless-streaming/seamless_server/app_pubsub.py", line 745, in incoming_audio
member.transcoder.process_incoming_bytes(
File "/home/ec2-user/workspace/seamless_communication/demo/seamless-streaming/seamless_server/src/simuleval_transcoder.py", line 205, in process_incoming_bytes
segment, sr = self._preprocess_wav(incoming_bytes)
File "/home/ec2-user/workspace/seamless_communication/demo/seamless-streaming/seamless_server/src/simuleval_transcoder.py", line 290, in _preprocess_wav
segment, new_sample_rate = self.convert_waveform(
File "/home/ec2-user/workspace/seamless_communication/demo/seamless-streaming/seamless_server/src/simuleval_transcoder.py", line 265, in convert_waveform
converted, converted_sample_rate = ta_sox.apply_effects_tensor(
File "/opt/conda/envs/smlss_server/lib/python3.8/site-packages/torchaudio/_extension/utils.py", line 209, in wrapped
raise RuntimeError(
RuntimeError: apply_effects_tensor requires sox extension which is not available. Please refer to the stacktrace above for how to resolve this.

have you solved it?

Sign up or log in to comment