alphacep / vosk-api

Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node
Apache License 2.0
7.7k stars 1.08k forks source link

Jitsi (Jigasi) websocket error #1301

Open SkyTaurus opened 1 year ago

SkyTaurus commented 1 year ago

Small jigasi config

org.jitsi.jigasi.transcription.customService=org.jitsi.jigasi.transcription.VoskTranscriptionService
org.jitsi.jigasi.transcription.vosk.websocket_url=ws://172.17.0.22:2700
org.jitsi.jigasi.ENABLE_TRANSCRIPTION=true

org.jitsi.jigasi.transcription.SEND_JSON=true

org.jitsi.jigasi.transcription.SEND_TXT=true

When i try to call the service after some time i get an error (172.17.0.8 - jigasi ip)

sudo docker run -p 2700:2700 alphacep/kaldi-en:latest
LOG (VoskAPI:ReadDataFiles():model.cc:213) Decoding params beam=13 max-active=7000 lattice-beam=6
LOG (VoskAPI:ReadDataFiles():model.cc:216) Silence phones 1:2:3:4:5:11:12:13:14:15
LOG (VoskAPI:RemoveOrphanNodes():nnet-nnet.cc:948) Removed 0 orphan nodes.
LOG (VoskAPI:RemoveOrphanComponents():nnet-nnet.cc:847) Removing 0 orphan components.
LOG (VoskAPI:ReadDataFiles():model.cc:248) Loading i-vector extractor from /opt/vosk-model-en/model/ivector/final.ie
LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:183) Computing derived variables for iVector extractor
LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:204) Done.
LOG (VoskAPI:ReadDataFiles():model.cc:279) Loading HCLG from /opt/vosk-model-en/model/graph/HCLG.fst
LOG (VoskAPI:ReadDataFiles():model.cc:294) Loading words from /opt/vosk-model-en/model/graph/words.txt
LOG (VoskAPI:ReadDataFiles():model.cc:303) Loading winfo /opt/vosk-model-en/model/graph/phones/word_boundary.int
LOG (VoskAPI:ReadDataFiles():model.cc:310) Loading subtract G.fst model from /opt/vosk-model-en/model/rescore/G.fst
LOG (VoskAPI:ReadDataFiles():model.cc:312) Loading CARPA model from /opt/vosk-model-en/model/rescore/G.carpa
LOG (VoskAPI:ReadDataFiles():model.cc:318) Loading RNNLM model from /opt/vosk-model-en/model/rnnlm/final.raw
INFO:root:Connection from (‘172.17.0.8’, 57180)
INFO:root:Connection from (‘172.17.0.8’, 57182)
INFO:root:Connection from (‘172.17.0.8’, 57184)
INFO:root:Connection from (‘172.17.0.8’, 57186)
ERROR:websockets.server:Error in connection handler
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/websockets/protocol.py”, line 827, in transfer_data
message = await self.read_message()
File “/usr/lib/python3/dist-packages/websockets/protocol.py”, line 895, in read_message
frame = await self.read_data_frame(max_size=self.max_size)
File “/usr/lib/python3/dist-packages/websockets/protocol.py”, line 971, in read_data_frame
frame = await self.read_frame(max_size)
File “/usr/lib/python3/dist-packages/websockets/protocol.py”, line 1047, in read_frame
frame = await Frame.read(
File “/usr/lib/python3/dist-packages/websockets/framing.py”, line 105, in read
data = await reader(2)
File “/usr/lib/python3.9/asyncio/streams.py”, line 721, in readexactly
raise exceptions.IncompleteReadError(incomplete, n)
asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 2 expected bytes

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

Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/websockets/server.py”, line 191, in handler
await self.ws_handler(self, path)
File “/opt/vosk-server/websocket/./asr_server.py”, line 38, in recognize
message = await websocket.recv()
File “/usr/lib/python3/dist-packages/websockets/protocol.py”, line 509, in recv
await self.ensure_open()
File “/usr/lib/python3/dist-packages/websockets/protocol.py”, line 803, in ensure_open
raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
ERROR:websockets.server:Error in connection handler
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/websockets/protocol.py”, line 827, in transfer_data
message = await self.read_message()
File “/usr/lib/python3/dist-packages/websockets/protocol.py”, line 895, in read_message
frame = await self.read_data_frame(max_size=self.max_size)
File “/usr/lib/python3/dist-packages/websockets/protocol.py”, line 971, in read_data_frame
frame = await self.read_frame(max_size)
File “/usr/lib/python3/dist-packages/websockets/protocol.py”, line 1047, in read_frame
frame = await Frame.read(
File “/usr/lib/python3/dist-packages/websockets/framing.py”, line 105, in read
data = await reader(2)
File “/usr/lib/python3.9/asyncio/streams.py”, line 721, in readexactly
raise exceptions.IncompleteReadError(incomplete, n)
asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 2 expected bytes

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

Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/websockets/server.py”, line 191, in handler
await self.ws_handler(self, path)
File “/opt/vosk-server/websocket/./asr_server.py”, line 38, in recognize
message = await websocket.recv()
File “/usr/lib/python3/dist-packages/websockets/protocol.py”, line 509, in recv
await self.ensure_open()
File “/usr/lib/python3/dist-packages/websockets/protocol.py”, line 803, in ensure_open
raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
ERROR:websockets.server:Error in connection handler
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/websockets/protocol.py”, line 827, in transfer_data
message = await self.read_message()
File “/usr/lib/python3/dist-packages/websockets/protocol.py”, line 895, in read_message
frame = await self.read_data_frame(max_size=self.max_size)
File “/usr/lib/python3/dist-packages/websockets/protocol.py”, line 971, in read_data_frame
frame = await self.read_frame(max_size)
File “/usr/lib/python3/dist-packages/websockets/protocol.py”, line 1047, in read_frame
frame = await Frame.read(
File “/usr/lib/python3/dist-packages/websockets/framing.py”, line 105, in read
data = await reader(2)
File “/usr/lib/python3.9/asyncio/streams.py”, line 721, in readexactly
raise exceptions.IncompleteReadError(incomplete, n)
asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 2 expected bytes

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

There are no errors in the jigasi logs. If I try to run a test case from a Jigasi container, then it works correctly - i.e. the problem is not the network.`

git clone https://github.com/alphacep/vosk-api

cd vosk-api/python/example

python3 ./test_simple.py test.wav
nshmyrev commented 1 year ago

You need to search for errors on jigasi side, there must be something in the log

If I try to run a test case from a Jigasi container, then it works correctly - i.e. the problem is not the network.`

Jigasi uses websocket client, the commands you provided have no relation to that.