Closed donburch888 closed 5 months ago
I have similar warnings on startup. HAOS 2024.5.5 Chime TTS v1.1.0-beta6
2024-05-25 12:29:59.675 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to import_module with args ('custom_components.chime_tts',) in /usr/src/homeassistant/homeassistant/loader.py, line 1046: ComponentProtocol, importlib.import_module(self.pkg_path) inside the event loop
2024-05-25 12:29:59.681 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=chime_tts, service=say>
2024-05-25 12:29:59.682 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=chime_tts, service=say_url>
2024-05-25 12:29:59.682 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=chime_tts, service=clear_cache>
2024-05-25 12:29:59.683 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/asyncio/base_events.py:1989: RuntimeWarning: coroutine 'ChimeTTSQueueManager.queue_processor' was never awaited
handle = None # Needed to break cycles when an exception occurs.
2024-05-25 12:29:59.701 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=chime_tts>
I have released a new version, v1.1.0-beta10, which should address the issue.
I don't know if this is related, but after updating HA version 2024.6 and updating Chime 1.1.0-beta10, I get errors every time I activate voice notification
Logger: homeassistant.util.loop
Zdroj: util/loop.py:84
První výskyt: 20:00:01 (18 výskyty)
Naposledy logováno: 21:00:05
Detected blocking call to open inside the event loop by custom integration 'chime_tts' at custom_components/chime_tts/helpers/filesystem.py, line 157: audio.export(audio_full_path, format="mp3") (offender: /usr/local/lib/python3.12/site-packages/pydub/audio_segment.py, line 962: with open(os.devnull, 'rb') as devnull:), please create a bug report at https://github.com/nimroddolev/chime_tts/issues Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/config/custom_components/chime_tts/queue_manager.py", line 38, in async_process_queue result = await asyncio.wait_for( File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut File "/config/custom_components/chime_tts/__init__.py", line 161, in async_say_execute return await async_prepare_media(hass, params, options, media_players_array, is_say_url, start_time) File "/config/custom_components/chime_tts/__init__.py", line 255, in async_prepare_media audio_dict = await async_get_playback_audio_path(params, options) File "/config/custom_components/chime_tts/__init__.py", line 695, in async_get_playback_audio_path output_audio = await async_process_segments(hass, File "/config/custom_components/chime_tts/__init__.py", line 916, in async_process_segments tts_audio = helpers.change_speed_of_audiosegment(tts_audio, segment_tts_speed, temp_folder) File "/config/custom_components/chime_tts/helpers/helpers.py", line 506, in change_speed_of_audiosegment return self.ffmpeg_convert_from_audio_segment(audio_segment=audio_segment, File "/config/custom_components/chime_tts/helpers/helpers.py", line 358, in ffmpeg_convert_from_audio_segment temp_audio_file = filesystem_helper.save_audio_to_folder(audio=audio_segment, File "/config/custom_components/chime_tts/helpers/filesystem.py", line 157, in save_audio_to_folder audio.export(audio_full_path, format="mp3")
Detected blocking call to open inside the event loop by custom integration 'chime_tts' at custom_components/chime_tts/helpers/helpers.py, line 374: ret_val = AudioSegment.from_file(str(converted_audio_file)) (offender: /usr/local/lib/python3.12/site-packages/pydub/utils.py, line 60: fd = open(fd, mode=mode)), please create a bug report at https://github.com/nimroddolev/chime_tts/issues Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/config/custom_components/chime_tts/queue_manager.py", line 38, in async_process_queue result = await asyncio.wait_for( File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut File "/config/custom_components/chime_tts/__init__.py", line 161, in async_say_execute return await async_prepare_media(hass, params, options, media_players_array, is_say_url, start_time) File "/config/custom_components/chime_tts/__init__.py", line 255, in async_prepare_media audio_dict = await async_get_playback_audio_path(params, options) File "/config/custom_components/chime_tts/__init__.py", line 695, in async_get_playback_audio_path output_audio = await async_process_segments(hass, File "/config/custom_components/chime_tts/__init__.py", line 916, in async_process_segments tts_audio = helpers.change_speed_of_audiosegment(tts_audio, segment_tts_speed, temp_folder) File "/config/custom_components/chime_tts/helpers/helpers.py", line 506, in change_speed_of_audiosegment return self.ffmpeg_convert_from_audio_segment(audio_segment=audio_segment, File "/config/custom_components/chime_tts/helpers/helpers.py", line 374, in ffmpeg_convert_from_audio_segment ret_val = AudioSegment.from_file(str(converted_audio_file))
Detected blocking call to open inside the event loop by custom integration 'chime_tts' at custom_components/chime_tts/helpers/filesystem.py, line 144: audio.export(audio_full_path, format="mp3") (offender: /usr/local/lib/python3.12/site-packages/pydub/utils.py, line 60: fd = open(fd, mode=mode)), please create a bug report at https://github.com/nimroddolev/chime_tts/issues Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/config/custom_components/chime_tts/queue_manager.py", line 38, in async_process_queue result = await asyncio.wait_for( File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut File "/config/custom_components/chime_tts/__init__.py", line 161, in async_say_execute return await async_prepare_media(hass, params, options, media_players_array, is_say_url, start_time) File "/config/custom_components/chime_tts/__init__.py", line 255, in async_prepare_media audio_dict = await async_get_playback_audio_path(params, options) File "/config/custom_components/chime_tts/__init__.py", line 717, in async_get_playback_audio_path new_audio_file = filesystem_helper.save_audio_to_folder(output_audio, _data.get(initial_save_folder_key, None)) File "/config/custom_components/chime_tts/helpers/filesystem.py", line 144, in save_audio_to_folder audio.export(audio_full_path, format="mp3")
Detected blocking call to open inside the event loop by custom integration 'chime_tts' at custom_components/chime_tts/helpers/filesystem.py, line 144: audio.export(audio_full_path, format="mp3") (offender: /usr/local/lib/python3.12/site-packages/pydub/audio_segment.py, line 962: with open(os.devnull, 'rb') as devnull:), please create a bug report at https://github.com/nimroddolev/chime_tts/issues Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/config/custom_components/chime_tts/queue_manager.py", line 38, in async_process_queue result = await asyncio.wait_for( File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut File "/config/custom_components/chime_tts/__init__.py", line 161, in async_say_execute return await async_prepare_media(hass, params, options, media_players_array, is_say_url, start_time) File "/config/custom_components/chime_tts/__init__.py", line 255, in async_prepare_media audio_dict = await async_get_playback_audio_path(params, options) File "/config/custom_components/chime_tts/__init__.py", line 717, in async_get_playback_audio_path new_audio_file = filesystem_helper.save_audio_to_folder(output_audio, _data.get(initial_save_folder_key, None)) File "/config/custom_components/chime_tts/helpers/filesystem.py", line 144, in save_audio_to_folder audio.export(audio_full_path, format="mp3")
Detected blocking call to open inside the event loop by custom integration 'chime_tts' at custom_components/chime_tts/__init__.py, line 733: duration = len(AudioSegment.from_file(new_audio_file)) / 1000.0 (offender: /usr/local/lib/python3.12/site-packages/pydub/utils.py, line 60: fd = open(fd, mode=mode)), please create a bug report at https://github.com/nimroddolev/chime_tts/issues Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/config/custom_components/chime_tts/queue_manager.py", line 38, in async_process_queue result = await asyncio.wait_for( File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut File "/config/custom_components/chime_tts/__init__.py", line 161, in async_say_execute return await async_prepare_media(hass, params, options, media_players_array, is_say_url, start_time) File "/config/custom_components/chime_tts/__init__.py", line 255, in async_prepare_media audio_dict = await async_get_playback_audio_path(params, options) File "/config/custom_components/chime_tts/__init__.py", line 733, in async_get_playback_audio_path duration = len(AudioSegment.from_file(new_audio_file)) / 1000.0
Thank you @pepe59. I have found and fixed these issues and they'll be part of the next release. Do you experience any issues as a result of these warnings?
No there are no problems just these warnings in the HA log. Thank you for a great component works perfectly.
Thank you 🙏 I’m glad to hear it’s working well for you!
I just released another beta version, v1.1.0-beta11, which includes fixes for the cause of the warnings you shared.
I can confirm that the warning issue is fixed v1.1.0-beta11. Thanks
confirm working on 1.1.0-beta13
The fix has been included in the latest stable release, v1.1.0.
System Health details
System Information
Home Assistant Community Store
GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4882 Installed Version | 1.34.0 Stage | running Available Repositories | 1462 Downloaded Repositories | 15Home Assistant Cloud
logged_in | true -- | -- subscription_expiration | 3 June 2024 at 10:00 am relayer_connected | true relayer_region | ap-southeast-1 remote_enabled | true remote_connected | true alexa_enabled | false google_enabled | false remote_server | ap-southeast-1-1.ui.nabu.casa certificate_status | ready instance_id | 5ed6a2304786423a8e093715817678d7 can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | okHome Assistant Supervisor
host_os | Home Assistant OS 12.3 -- | -- update_channel | stable supervisor_version | supervisor-2024.05.1 agent_version | 1.6.0 docker_version | 25.0.5 disk_total | 62.3 GB disk_used | 33.8 GB healthy | true supported | true board | ova supervisor_api | ok version_api | ok installed_addons | File editor (5.8.0), Samba share (12.3.1), Terminal & SSH (9.14.0), Mosquitto broker (6.4.0), Node-RED (17.0.12), Rhasspy Assistant (2.5.11), openWakeWord (1.10.0), Whisper (2.0.0), Piper (1.5.0), ESPHome (2024.5.0), Music Assistant BETA (2.1.0b0)Dashboards
dashboards | 2 -- | -- resources | 8 views | 7 mode | storageRecorder
oldest_recorder_run | 9 May 2024 at 10:54 pm -- | -- current_recorder_run | 20 May 2024 at 9:47 am estimated_db_size | 426.37 MiB database_engine | sqlite database_version | 3.44.2Checklist
Describe the issue
I have noticed two errors on startup in the HA Core log which seem to come from chime.tts. I don't know if they are expected, or might be related to other issues I am experiencing (recently reported in separate issues by other users), so I am raising them separately.
To aid debugging I have done a reinstall, using the v1.1.0.beta6 and tried to turn debugging on (in configuration.yaml - not sure if successful).
Detected blocking call to import_module with args ('custom_components.chime_tts',) in /usr/src/homeassistant/homeassistant/loader.py, line 1041: ComponentProtocol, importlib.import_module(self.pkg_path) inside the event loop
/usr/local/lib/python3.12/asyncio/base_events.py:1989: RuntimeWarning: coroutine 'ChimeTTSQueueManager.queue_processor' was never awaited handle = None # Needed to break cycles when an exception occurs.
Reproduction steps
Debug logs
Diagnostics dump
where do I find the diagnostics dump ?