diff --git a/Dockerfile b/Dockerfile index a9e73699558b8..ebd802374ebda 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,7 @@ RUN virtualization/Docker/setup_docker_prereqs # Install hass component dependencies COPY requirements_all.txt requirements_all.txt RUN pip3 install --no-cache-dir -r requirements_all.txt && \ - pip3 install --no-cache-dir mysqlclient psycopg2 uvloop==0.12.2 cchardet cython tensorflow + pip3 install --no-cache-dir mysqlclient psycopg2 cchardet cython tensorflow # Copy source COPY . . diff --git a/homeassistant/components/stream/__init__.py b/homeassistant/components/stream/__init__.py index 4fd3e71a48b5f..50cc1d8169d6e 100644 --- a/homeassistant/components/stream/__init__.py +++ b/homeassistant/components/stream/__init__.py @@ -4,6 +4,11 @@ import voluptuous as vol +try: + import uvloop +except ImportError: + uvloop = None + from homeassistant.auth.util import generate_secret import homeassistant.helpers.config_validation as cv from homeassistant.const import EVENT_HOMEASSISTANT_STOP, CONF_FILENAME @@ -38,7 +43,7 @@ vol.Optional(CONF_LOOKBACK, default=0): int, } ) - +DATA_UVLOOP_WARN = "stream_uvloop_warn" # Set log level to error for libav logging.getLogger("libav").setLevel(logging.ERROR) @@ -49,6 +54,21 @@ def request_stream(hass, stream_source, *, fmt="hls", keepalive=False, options=N if DOMAIN not in hass.config.components: raise HomeAssistantError("Stream integration is not set up.") + if DATA_UVLOOP_WARN not in hass.data: + hass.data[DATA_UVLOOP_WARN] = True + # Warn about https://github.com/home-assistant/home-assistant/issues/22999 + if ( + uvloop is not None + and isinstance(hass.loop, uvloop.Loop) + and ( + "shell_command" in hass.config.components + or "ffmpeg" in hass.config.components + ) + ): + _LOGGER.warning( + "You are using UVLoop with stream and shell_command. This is known to cause issues. Please uninstall uvloop." + ) + if options is None: options = {} diff --git a/virtualization/Docker/Dockerfile.dev b/virtualization/Docker/Dockerfile.dev index 260a29cb3d09e..2e98c53cdf1b4 100644 --- a/virtualization/Docker/Dockerfile.dev +++ b/virtualization/Docker/Dockerfile.dev @@ -28,7 +28,7 @@ RUN virtualization/Docker/setup_docker_prereqs COPY requirements_all.txt requirements_all.txt RUN pip3 install --no-cache-dir -r requirements_all.txt && \ - pip3 install --no-cache-dir mysqlclient psycopg2 uvloop==0.12.2 cchardet cython + pip3 install --no-cache-dir mysqlclient psycopg2 cchardet cython # BEGIN: Development additions