home-assistant / plugin-audio

Pulseaudio implementation for Home Assistant
Apache License 2.0
24 stars 13 forks source link

PulseAudio can't start an try to restart every Minute #79

Open mschiegg opened 3 years ago

mschiegg commented 3 years ago

Problem

The hassio_audio container try to start every Minute and ends with a 500 Server Error

Additional Information

I don't use (and need) any Audio on the System. But i don't find a way to disable the Audio Container. I need a fix or a Workaround to disable it.

Type of installation

Home Assistant OS on a Raspberry PI 3b+
core-2021.5.5
supervisor-2021.04.3
OS 5.13

Log

21-05-31 07:38:35 WARNING (MainThread) [supervisor.misc.tasks] Watchdog found a problem with PulseAudio plugin!
21-05-31 07:38:35 INFO (MainThread) [supervisor.plugins.audio] Starting Audio plugin
21-05-31 07:38:35 INFO (SyncWorker_0) [supervisor.docker.interface] Cleaning hassio_audio application
21-05-31 07:38:41 ERROR (SyncWorker_0) [supervisor.docker] Can't start hassio_audio: 500 Server Error for http+docker://localhost/v1.40/containers/a9fada764718e9cc0e7f79ffa43eb86299a72af44698136861cb31494b551e51/start: Internal Server Error ("OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:326: applying cgroup configuration for process caused: failed to write "190000" to "/sys/fs/cgroup/cpu,cpuacct/docker/a9fada764718e9cc0e7f79ffa43eb86299a72af44698136861cb31494b551e51/cpu.rt_runtime_us": write /sys/fs/cgroup/cpu,cpuacct/docker/a9fada764718e9cc0e7f79ffa43eb86299a72af44698136861cb31494b551e51/cpu.rt_runtime_us: invalid argument: unknown")
21-05-31 07:38:41 ERROR (MainThread) [supervisor.plugins.audio] Can't start Audio plugin
21-05-31 07:38:41 ERROR (MainThread) [supervisor.misc.tasks] PulseAudio watchdog reanimation failed!
21-05-31 07:38:52 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-34767' coro=<Scheduler._run_task.<locals>._wrap_task() done, defined at /usr/src/supervisor/supervisor/misc/scheduler.py:58> exception=TypeError('an integer is required (got type str)')>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/misc/scheduler.py", line 62, in _wrap_task
    await task.coro_callback()
  File "/usr/src/supervisor/supervisor/misc/tasks.py", line 416, in _watchdog_addon_application
    if addon.in_progress or await addon.watchdog_application():
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 479, in watchdog_application
    return await self.sys_run_in_executor(check_port, self.ip_address, port)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/supervisor/supervisor/utils/__init__.py", line 43, in check_port
    result = sock.connect_ex((str(address), port))
TypeError: an integer is required (got type str)   

21-05-31 07:39:41 WARNING (MainThread) [supervisor.misc.tasks] Watchdog found a problem with PulseAudio plugin!
21-05-31 07:39:41 INFO (MainThread) [supervisor.plugins.audio] Starting Audio plugin
21-05-31 07:39:41 INFO (SyncWorker_2) [supervisor.docker.interface] Cleaning hassio_audio application
21-05-31 07:39:55 ERROR (SyncWorker_2) [supervisor.docker] Can't start hassio_audio: 500 Server Error for http+docker://localhost/v1.40/containers/78a04bcbeb58a1f5b3d8abcabf8d955b21f270322a9ada71812bf0998858c221/start: Internal Server Error ("OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:326: applying cgroup configuration for process caused: failed to write "190000" to "/sys/fs/cgroup/cpu,cpuacct/docker/78a04bcbeb58a1f5b3d8abcabf8d955b21f270322a9ada71812bf0998858c221/cpu.rt_runtime_us": write /sys/fs/cgroup/cpu,cpuacct/docker/78a04bcbeb58a1f5b3d8abcabf8d955b21f270322a9ada71812bf0998858c221/cpu.rt_runtime_us: invalid argument: unknown")
21-05-31 07:39:55 ERROR (MainThread) [supervisor.plugins.audio] Can't start Audio plugin
21-05-31 07:39:55 ERROR (MainThread) [supervisor.misc.tasks] PulseAudio watchdog reanimation failed!
21-05-31 07:40:52 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-34811' coro=<Scheduler._run_task.<locals>._wrap_task() done, defined at /usr/src/supervisor/supervisor/misc/scheduler.py:58> exception=TypeError('an integer is required (got type str)')>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/misc/scheduler.py", line 62, in _wrap_task
    await task.coro_callback()
  File "/usr/src/supervisor/supervisor/misc/tasks.py", line 416, in _watchdog_addon_application
    if addon.in_progress or await addon.watchdog_application():
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 479, in watchdog_application
    return await self.sys_run_in_executor(check_port, self.ip_address, port)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/supervisor/supervisor/utils/__init__.py", line 43, in check_port
    result = sock.connect_ex((str(address), port))
TypeError: an integer is required (got type str)
agners commented 3 years ago

This is likely caused by downgrading/upgrading which did not trigger a rebuild of the supervisor container. This issue will be fixed in future OS versions: https://github.com/home-assistant/operating-system/pull/1368

Probably the easiest way to trigger a rebuild of the Supervisor container is switching to the dev channel, update the supervisor and back to stable.