Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Piper does not process a long messages #3836

Open
gribouk opened this issue Nov 25, 2024 · 0 comments
Open

Piper does not process a long messages #3836

gribouk opened this issue Nov 25, 2024 · 0 comments

Comments

@gribouk
Copy link

gribouk commented Nov 25, 2024

Describe the issue you are experiencing

Piper is run under HA OS as add-on, but it is being used by the HA on another machine running in a Docker.
If using outher TTS, works well without responce limitation. If using assist with piper TTS:
For short replies it outputs tts for the relevant responces well.
If the message is pretty long, the following error returned:

Error doing job: Exception in callback SpeechManager._async_get_tts_audio..handle_error(>) at /usr/src/homeassistant/homeassistant/components/tts/init.py:829 (None)
Traceback (most recent call last):
File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/usr/src/homeassistant/homeassistant/components/tts/init.py", line 831, in handle_error
if audio_task.exception():
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/tts/init.py", line 771, in get_tts_data
extension, data = await engine_instance.internal_async_get_tts_audio(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/tts/init.py", line 491, in internal_async_get_tts_audio
return await self.async_get_tts_audio(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/wyoming/tts.py", line 126, in async_get_tts_audio
event = await client.read_event()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/wyoming/client.py", line 25, in read_event
return await async_read_event(self._reader)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/wyoming/event.py", line 79, in async_read_event
json_line = await reader.readline()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/streams.py", line 568, in readline
line = await self.readuntil(sep)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/streams.py", line 660, in readuntil
await self._wait_for_data('readuntil')
File "/usr/local/lib/python3.12/asyncio/streams.py", line 545, in _wait_for_data
await self._waiter
asyncio.exceptions.CancelledError

What type of installation are you running?

Home Assistant OS

Which operating system are you running on?

Home Assistant Operating System

Which add-on are you reporting an issue with?

Piper

What is the version of the add-on?

1.5.2

Steps to reproduce the issue

  1. Ask for something which implies long responce, like weather for tomorrow
  2. Wait
  3. Read the error in the logs
    ...

System Health information

There are currently no repairs pending

Anything in the Supervisor logs that might be useful for us?

No response

Anything in the add-on logs that might be useful for us?

DEBUG:wyoming_piper.handler:Synthesize(text="Tomorrow's weather forecast includes:\nExpected temperature: zero degrees Celsius throughout the day\nRelative humidity: starting from ninety three percent in the morning, decreasing throughout the day\nAir pressure: gradually decreasing, starting at one thousand two point six hectopascals\nWind speed: expected to remain calm, around zero meters per second for most of the day\nLight precipitation expected in the evening.\n\nIf you need specific details for any time during the day, feel free to ask!", voice=SynthesizeVoice(name='en_US-libritts-high', language=None, speaker=None))
DEBUG:wyoming_piper.handler:synthesize: raw_text=Tomorrow's weather forecast includes:
Expected temperature: zero degrees Celsius throughout the day
Relative humidity: starting from ninety three percent in the morning, decreasing throughout the day
Air pressure: gradually decreasing, starting at one thousand two point six hectopascals
Wind speed: expected to remain calm, around zero meters per second for most of the day
Light precipitation expected in the evening.
If you need specific details for any time during the day, feel free to ask!, text='Tomorrow's weather forecast includes: Expected temperature: zero degrees Celsius throughout the day Relative humidity: starting from ninety three percent in the morning, decreasing throughout the day Air pressure: gradually decreasing, starting at one thousand two point six hectopascals Wind speed: expected to remain calm, around zero meters per second for most of the day Light precipitation expected in the evening.  If you need specific details for any time during the day, feel free to ask!'
DEBUG:wyoming_piper.handler:input: {'text': "Tomorrow's weather forecast includes: Expected temperature: zero degrees Celsius throughout the day Relative humidity: starting from ninety three percent in the morning, decreasing throughout the day Air pressure: gradually decreasing, starting at one thousand two point six hectopascals Wind speed: expected to remain calm, around zero meters per second for most of the day Light precipitation expected in the evening.  If you need specific details for any time during the day, feel free to ask!"}
DEBUG:wyoming_piper.handler:/tmp/tmpv4d0ywnl/1732548855002914313.wav
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='wyoming event handler' coro=<AsyncEventHandler.run() done, defined at /usr/local/lib/python3.11/dist-packages/wyoming/server.py:31> exception=BrokenPipeError(32, 'Broken pipe')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/wyoming_piper/handler.py", line 48, in handle_event
    return await self._handle_event(event)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/wyoming_piper/handler.py", line 132, in _handle_event
    await self.write_event(
  File "/usr/local/lib/python3.11/dist-packages/wyoming/server.py", line 29, in write_event
    await async_write_event(event, self.writer)
  File "/usr/local/lib/python3.11/dist-packages/wyoming/event.py", line 131, in async_write_event
    await writer.drain()
  File "/usr/lib/python3.11/asyncio/streams.py", line 378, in drain
    await self._protocol._drain_helper()
  File "/usr/lib/python3.11/asyncio/streams.py", line 167, in _drain_helper
    raise ConnectionResetError('Connection lost')
ConnectionResetError: Connection lost
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/wyoming/server.py", line 41, in run
    if not (await self.handle_event(event)):
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/wyoming_piper/handler.py", line 50, in handle_event
    await self.write_event(
  File "/usr/local/lib/python3.11/dist-packages/wyoming/server.py", line 29, in write_event
    await async_write_event(event, self.writer)
  File "/usr/local/lib/python3.11/dist-packages/wyoming/event.py", line 131, in async_write_event
    await writer.drain()
  File "/usr/lib/python3.11/asyncio/streams.py", line 366, in drain
    raise exc
  File "/usr/lib/python3.11/asyncio/selector_events.py", line 1057, in write
    n = self._sock.send(data)
        ^^^^^^^^^^^^^^^^^^^^^
BrokenPipeError: [Errno 32] Broken pipe

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant