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

TTS errors on message return from chatgpt #134910

Open
Moltenkore opened this issue Jan 6, 2025 · 5 comments
Open

TTS errors on message return from chatgpt #134910

Moltenkore opened this issue Jan 6, 2025 · 5 comments

Comments

@Moltenkore
Copy link

Moltenkore commented Jan 6, 2025

The problem

I'm using nabu preview edition and If I ask something that requires a longer output from chatgpt like "how much does a pulsar weigh?". It doesn't give a response and errors out.

It misunderstands what I'm saying each time but there is a response from chatgpt in the logs just no TTS answer.

(I'm using local piper set to en_GB alba medium and whisper.)

What version of Home Assistant Core has the issue?

core-2025.1.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Debug log:

2025-01-06 17:28:09.093 DEBUG (MainThread) [homeassistant.components.openai_conversation] Prompt: [stripped because massive prompt, I can reattach if needed]
2025-01-06 17:28:09.093 DEBUG (MainThread) [homeassistant.components.openai_conversation] Tools:  [stripped too]
2025-01-06 17:28:10.414 DEBUG (MainThread) [homeassistant.components.openai_conversation] Response ChatCompletion(id='chatcmpl-anidofwhichihavenoideaifthisneedsstrippingbutwillanyway', choices=[Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content='It seems like your question is unclear. Are you asking about the distance to the North or South Pole, or something else? Please provide more details.', role='assistant', function_call=None, tool_calls=None, refusal=None))], created=1736184489, model='gpt-4o-mini-2024-07-18', object='chat.completion', service_tier=None, system_fingerprint='fp_0aa8d3e20b', usage=CompletionUsage(completion_tokens=32, prompt_tokens=2478, total_tokens=2510, prompt_tokens_details={'cached_tokens': 0, 'audio_tokens': 0}, completion_tokens_details={'reasoning_tokens': 0, 'audio_tokens': 0, 'accepted_prediction_tokens': 0, 'rejected_prediction_tokens': 0}))
2025-01-06 17:28:15.517 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback SpeechManager._async_get_tts_audio.<locals>.handle_error() at /usr/src/homeassistant/homeassistant/components/tts/__init__.py:844 (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run
    self._context.run(self._callback, *self._args)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 846, in handle_error
    if audio_task.exception():
       ~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 786, in get_tts_data
    extension, data = await engine_instance.internal_async_get_tts_audio(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        message, language, options
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 492, in internal_async_get_tts_audio
    return await self.async_get_tts_audio(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        message=message, language=language, options=options
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  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.13/site-packages/wyoming/client.py", line 25, in read_event
    return await async_read_event(self._reader)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/wyoming/event.py", line 79, in async_read_event
    json_line = await reader.readline()
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/asyncio/streams.py", line 562, in readline
    line = await self.readuntil(sep)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/asyncio/streams.py", line 677, in readuntil
    await self._wait_for_data('readuntil')
  File "/usr/local/lib/python3.13/asyncio/streams.py", line 539, in _wait_for_data
    await self._waiter
asyncio.exceptions.CancelledError

Piper logs:

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 114, 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

@home-assistant
Copy link

home-assistant bot commented Jan 6, 2025

Hey there @balloob, @synesthesiam, mind taking a look at this issue as it has been labeled with an integration (wyoming) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of wyoming can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign wyoming Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


wyoming documentation
wyoming source
(message by IssueLinks)

@mib1185
Copy link
Contributor

mib1185 commented Jan 6, 2025

please also check and provide the logs of the piper add-on

@Moltenkore
Copy link
Author

please also check and provide the logs of the piper add-on

The piper stack trace above is from the piper addon logs. It doesn't say much more than that though.

INFO:__main__:Ready
[17:52:13] INFO: Successfully send discovery information to Home Assistant.
s6-rc: info: service discovery successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
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 114, 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

@Moltenkore
Copy link
Author

On further testing the wav is generated as expected but the device gives up before the audio is sent back to it. If you get chatgpt to give you a long response and you're running on less powerful hardware, it takes a while for it all to process so I'm guessing it really needs to wait longer for a response.

DEBUG:wyoming_piper.handler:Synthesize(text='Once upon a time in a small village tucked between lush green hills, there lived a young girl named Lily. She was known throughout the village for her vibrant spirit and unending curiosity. Every day after completing her chores, she would set out on grand adventures, exploring the meadows and forests surrounding her home.\n\nOne bright morning, as the sun peeked over the horizon, Lily decided to wander deeper into the forest than ever before. She had heard tales of an enchanted grove that was said to be home to magical creatures. With a backpack filled with snacks and her trusty notebook, she ventured forth.\n\nAs she walked, the sunlight dappled through the leaves, creating a mosaic of light on the forest floor. The sweet scent of wildflowers', voice=SynthesizeVoice(name='en_GB-alba-medium', language=None, speaker=None))
DEBUG:wyoming_piper.handler:synthesize: raw_text=Once upon a time in a small village tucked between lush green hills, there lived a young girl named Lily. She was known throughout the village for her vibrant spirit and unending curiosity. Every day after completing her chores, she would set out on grand adventures, exploring the meadows and forests surrounding her home.
One bright morning, as the sun peeked over the horizon, Lily decided to wander deeper into the forest than ever before. She had heard tales of an enchanted grove that was said to be home to magical creatures. With a backpack filled with snacks and her trusty notebook, she ventured forth.
As she walked, the sunlight dappled through the leaves, creating a mosaic of light on the forest floor. The sweet scent of wildflowers, text='Once upon a time in a small village tucked between lush green hills, there lived a young girl named Lily. She was known throughout the village for her vibrant spirit and unending curiosity. Every day after completing her chores, she would set out on grand adventures, exploring the meadows and forests surrounding her home.  One bright morning, as the sun peeked over the horizon, Lily decided to wander deeper into the forest than ever before. She had heard tales of an enchanted grove that was said to be home to magical creatures. With a backpack filled with snacks and her trusty notebook, she ventured forth.  As she walked, the sunlight dappled through the leaves, creating a mosaic of light on the forest floor. The sweet scent of wildflowers.'
DEBUG:wyoming_piper.handler:input: {'text': 'Once upon a time in a small village tucked between lush green hills, there lived a young girl named Lily. She was known throughout the village for her vibrant spirit and unending curiosity. Every day after completing her chores, she would set out on grand adventures, exploring the meadows and forests surrounding her home.  One bright morning, as the sun peeked over the horizon, Lily decided to wander deeper into the forest than ever before. She had heard tales of an enchanted grove that was said to be home to magical creatures. With a backpack filled with snacks and her trusty notebook, she ventured forth.  As she walked, the sunlight dappled through the leaves, creating a mosaic of light on the forest floor. The sweet scent of wildflowers.'}
DEBUG:wyoming_piper.handler:Sent info
DEBUG:wyoming_piper.handler:/tmp/tmpusq7a73o/1736428141458160942.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 114, 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

@denzirali
Copy link

Hi folks, forgive me if this is not the correct way to comms this but I figured I'd add to this post as opposed start a new one. If there are Mods who want to move or delete this, please feel free. I have the same error as @Moltenkore and under similar circumstances: TTS works for shorter requests via ChatGPT api but fails for longer responses - via Voice PE.
System info: HAOS Core 2025.1.2 / Supervisor 2024.12.3 / OS 14.1
OS Hardware: Xeon 2125 two cores assigned with 16gb RAM (2666Mhz) in Proxmox environment.
Voice PE: Firmware: 25.1.0 (ESPHome 2024.12.2)
Assistant: GPT40Mini / 750max tokens / TopP 1 / Temp 1 / Voice: Northern Eng Male (Medium)

Info1: at time of below request, CPU usage via Proxmox at 20.3%.

Here is the debug log from Piper showing a failed request (apologies for length):
s6-rc: info: service legacy-services successfully started
DEBUG:wyoming_piper.handler:Sent info
DEBUG:wyoming_piper.handler:Sent info
DEBUG:wyoming_piper.handler:Synthesize(text='"Gone with the Wind" is a classic American film released in 1939, based on the novel by Margaret Mitchell. The film, set against the backdrop of the American South during the Civil War and Reconstruction era, follows the tumultuous life of Scarlett O'Hara, a determined and headstrong young woman who is in love with Ashley Wilkes, a man who is ultimately not destined to be with her.\n\n### Summary\nThe story opens on a plantation called Tara, where Scarlett lives a privileged life as the daughter of a wealthy plantation owner. She is initially infatuated with Ashley Wilkes, who is about to marry his cousin, Melanie Hamilton. Heartbroken but resolute, Scarlett vows to win Ashley's heart. As the Civil War breaks out, the lives of these characters become increasingly intertwined amid the chaos of war.\n\nScarlett's life takes dramatic turns as she faces the collapse of her way of life. After the war, she struggles to maintain her family's plantation and her social status. She marries several times, including Rhett Butler, a charming but roguish Confederate soldier who ultimately becomes the love of her life. However, Scarlett's selfishness and obsession with Ashley create strain in their marriage. The film culminates in tragedy, as Scarlett loses both Rhett and the vision she had for her life, leading to her realization that she must return to Tara and start anew.\n\n### Themes and Messaging\n1. Survival and Resilience: Scarlett embodies the theme of survival through her relentless determination and resourcefulness. Despite numerous setbacks, she continually adapts to her changing environment. This theme resonates throughout the film, illustrating the struggle for survival during and after the war.\n\n2. Love and Loss:', voice=SynthesizeVoice(name='en_GB-northern_english_male-medium', language=None, speaker=None))
DEBUG:wyoming_piper.handler:synthesize: raw_text="Gone with the Wind" is a classic American film released in 1939, based on the novel by Margaret Mitchell. The film, set against the backdrop of the American South during the Civil War and Reconstruction era, follows the tumultuous life of Scarlett O'Hara, a determined and headstrong young woman who is in love with Ashley Wilkes, a man who is ultimately not destined to be with her.

Summary

The story opens on a plantation called Tara, where Scarlett lives a privileged life as the daughter of a wealthy plantation owner. She is initially infatuated with Ashley Wilkes, who is about to marry his cousin, Melanie Hamilton. Heartbroken but resolute, Scarlett vows to win Ashley's heart. As the Civil War breaks out, the lives of these characters become increasingly intertwined amid the chaos of war.
Scarlett's life takes dramatic turns as she faces the collapse of her way of life. After the war, she struggles to maintain her family's plantation and her social status. She marries several times, including Rhett Butler, a charming but roguish Confederate soldier who ultimately becomes the love of her life. However, Scarlett's selfishness and obsession with Ashley create strain in their marriage. The film culminates in tragedy, as Scarlett loses both Rhett and the vision she had for her life, leading to her realization that she must return to Tara and start anew.

Themes and Messaging

  1. Survival and Resilience: Scarlett embodies the theme of survival through her relentless determination and resourcefulness. Despite numerous setbacks, she continually adapts to her changing environment. This theme resonates throughout the film, illustrating the struggle for survival during and after the war.
  2. Love and Loss:, text='"Gone with the Wind" is a classic American film released in 1939, based on the novel by Margaret Mitchell. The film, set against the backdrop of the American South during the Civil War and Reconstruction era, follows the tumultuous life of Scarlett O'Hara, a determined and headstrong young woman who is in love with Ashley Wilkes, a man who is ultimately not destined to be with her. ### Summary The story opens on a plantation called Tara, where Scarlett lives a privileged life as the daughter of a wealthy plantation owner. She is initially infatuated with Ashley Wilkes, who is about to marry his cousin, Melanie Hamilton. Heartbroken but resolute, Scarlett vows to win Ashley's heart. As the Civil War breaks out, the lives of these characters become increasingly intertwined amid the chaos of war. Scarlett's life takes dramatic turns as she faces the collapse of her way of life. After the war, she struggles to maintain her family's plantation and her social status. She marries several times, including Rhett Butler, a charming but roguish Confederate soldier who ultimately becomes the love of her life. However, Scarlett's selfishness and obsession with Ashley create strain in their marriage. The film culminates in tragedy, as Scarlett loses both Rhett and the vision she had for her life, leading to her realization that she must return to Tara and start anew. ### Themes and Messaging 1. Survival and Resilience: Scarlett embodies the theme of survival through her relentless determination and resourcefulness. Despite numerous setbacks, she continually adapts to her changing environment. This theme resonates throughout the film, illustrating the struggle for survival during and after the war. 2. Love and Loss:.'
    DEBUG:wyoming_piper.process:Stopping process for: en_US-lessac-medium
    DEBUG:wyoming_piper.process:Starting process for: en_GB-northern_english_male-medium (1/1)
    DEBUG:wyoming_piper.download:Checking /data/en_GB-northern_english_male-medium.onnx
    DEBUG:wyoming_piper.download:Checking /data/en_GB-northern_english_male-medium.onnx.json
    DEBUG:wyoming_piper.process:Starting piper process: /usr/share/piper/piper args=['--model', '/data/en_GB-northern_english_male-medium.onnx', '--config', '/data/en_GB-northern_english_male-medium.onnx.json', '--output_dir', '/tmp/tmpl6y37qe9', '--json-input', '--noise-scale', '0.667', '--length-scale', '1.0', '--noise-w', '0.333']
    DEBUG:wyoming_piper.handler:input: {'text': '"Gone with the Wind" is a classic American film released in 1939, based on the novel by Margaret Mitchell. The film, set against the backdrop of the American South during the Civil War and Reconstruction era, follows the tumultuous life of Scarlett O'Hara, a determined and headstrong young woman who is in love with Ashley Wilkes, a man who is ultimately not destined to be with her. ### Summary The story opens on a plantation called Tara, where Scarlett lives a privileged life as the daughter of a wealthy plantation owner. She is initially infatuated with Ashley Wilkes, who is about to marry his cousin, Melanie Hamilton. Heartbroken but resolute, Scarlett vows to win Ashley's heart. As the Civil War breaks out, the lives of these characters become increasingly intertwined amid the chaos of war. Scarlett's life takes dramatic turns as she faces the collapse of her way of life. After the war, she struggles to maintain her family's plantation and her social status. She marries several times, including Rhett Butler, a charming but roguish Confederate soldier who ultimately becomes the love of her life. However, Scarlett's selfishness and obsession with Ashley create strain in their marriage. The film culminates in tragedy, as Scarlett loses both Rhett and the vision she had for her life, leading to her realization that she must return to Tara and start anew. ### Themes and Messaging 1. Survival and Resilience: Scarlett embodies the theme of survival through her relentless determination and resourcefulness. Despite numerous setbacks, she continually adapts to her changing environment. This theme resonates throughout the film, illustrating the struggle for survival during and after the war. 2. Love and Loss:.'}
    DEBUG:wyoming_piper.handler:/tmp/tmpl6y37qe9/1736720177561117156.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 114, 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
    DEBUG:wyoming_piper.handler:Sent info
    DEBUG:wyoming_piper.handler:Sent info

End
NOTE 2: Unlike @Moltenkore , when I try to play the .wav from browser on port 8123, playback fails for this longer request but works for the shorter requests.
I did try and troubleshoot but I know naff all about code: e.g. found data.py within a Piper instance loaded into my Mac CLI:
_INFO_TIMEOUT = 1
_INFO_RETRY_WAIT = 2
_INFO_RETRIES = 3
...but couldn't find the same file to amend in the Proxmox containerised environment of my HAOS - sorry, skill shortage!

I hope this is useful and thanks to those who spend their time troubleshooting this stuff for free and to benefit the community. I appreciate that a Piper implementation for those who want a swift response to turning on a light may well have different requirements compared to those who want their voice PE to load in a novel in a .wav, and having an implementation that serves both purposes may be impossible!
Thanks and regards
D

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

No branches or pull requests

5 participants