Is livekit library not configured to run on window...
# ask-ai
c
Is livekit library not configured to run on windows?
t
Thanks for reaching out, Subham. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Absolutely! The LiveKit library is all set up to run smoothly on Windows. It supports a variety of SDKs and services on this platform, such as: • The LiveKit Unity SDK, which comes with a Windows x86_64 plugin (
livekit_ffi.dll
) for Win64 applications. • The LiveKit Node.js SDK, offering a prebuilt binary for Windows (
@livekit/rtc-node-win32-x64-msvc
). • The LiveKit Flutter quickstart guide also mentions Windows as a supported platform, with some development requirements like Visual Studio 2019. • LiveKit services like Ingress can run on Windows through Docker, using
host.docker.internal
to connect to local services. If you run into any specific challenges while using LiveKit on Windows, please don’t hesitate to reach out—I’m here to help you through it! Sources: Runtime/Plugins/ffi-windows-arm64/livekit_ffi.dll.meta | packages/livekit-rtc/npm/win32-x64-msvc/README.md | Flutter quickstart | LiveKit docs | Self-hosting the Ingress Service | LiveKit docs
c
Copy code
PS C:\Users\shriy\revspot_workspace\agent-starter-python> uv run python src/agent.py dev
2025-11-14 14:00:25,698 - DEBUG asyncio - Using proactor: IocpProactor
2025-11-14 14:00:25,705 - DEV  livekit.agents - Watching C:\Users\shriy\revspot_workspace\agent-starter-python\src
2025-11-14 14:00:28,371 - DEBUG asyncio - Using proactor: IocpProactor
2025-11-14 14:00:28,381 - INFO livekit.agents - starting worker {"version": "1.2.8", "rtc-version": "1.0.12"}
2025-11-14 14:00:28,381 - INFO livekit.agents - starting inference executor
2025-11-14 14:00:28,432 - INFO livekit.agents - initializing process {"pid": 54712, "inference": true}
2025-11-14 14:00:30,800 - DEBUG livekit.agents - initializing inference runner {"runner": "lk_end_of_utterance_multilingual", "pid": 54712, "inference": true}
2025-11-14 14:00:38,445 - INFO livekit.agents - killing process {"pid": 54712, "inference": true}
2025-11-14 14:00:38,447 - ERROR livekit.agents - worker failed
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2800.0_x64__qbz5n2kfra8p0\Lib\asyncio\tasks.py", line 520, in wait_for
    return await fut
           ^^^^^^^^^
  File "C:\Users\shriy\revspot_workspace\agent-starter-python\.venv\Lib\site-packages\livekit\agents\ipc\channel.py", line 47, in arecv_message
    return _read_message(await dplx.recv_bytes(), messages)
                         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\shriy\revspot_workspace\agent-starter-python\.venv\Lib\site-packages\livekit\agents\utils\aio\duplex_unix.py", line 35, in recv_bytes
    len_bytes = await self._reader.readexactly(4)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2800.0_x64__qbz5n2kfra8p0\Lib\asyncio\streams.py", line 752, in readexactly
    await self._wait_for_data('readexactly')
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2800.0_x64__qbz5n2kfra8p0\Lib\asyncio\streams.py", line 545, in _wait_for_data
    await self._waiter
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "C:\Users\shriy\revspot_workspace\agent-starter-python\.venv\Lib\site-packages\livekit\agents\cli\_run.py", line 79, in _worker_run
    await worker.run()
  File "C:\Users\shriy\revspot_workspace\agent-starter-python\.venv\Lib\site-packages\livekit\agents\worker.py", line 403, in run
    await self._inference_executor.initialize()
  File "C:\Users\shriy\revspot_workspace\agent-starter-python\.venv\Lib\site-packages\livekit\agents\ipc\supervised_proc.py", line 169, in initialize
    init_res = await asyncio.wait_for(
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2800.0_x64__qbz5n2kfra8p0\Lib\asyncio\tasks.py", line 519, in wait_for
    async with timeouts.timeout(timeout):
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2800.0_x64__qbz5n2kfra8p0\Lib\asyncio\timeouts.py", line 115, in __aexit__
    raise TimeoutError from exc_val
TimeoutError
2025-11-14 14:00:38,578 - ERROR livekit.agents - Error in _read_ipc_task
Traceback (most recent call last):
  File "C:\Users\shriy\revspot_workspace\agent-starter-python\.venv\Lib\site-packages\livekit\agents\utils\aio\duplex_unix.py", line 35, in recv_bytes
    len_bytes = await self._reader.readexactly(4)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2800.0_x64__qbz5n2kfra8p0\Lib\asyncio\streams.py", line 750, in readexactly
    raise exceptions.IncompleteReadError(incomplete, n)
asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 4 expected bytes
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "C:\Users\shriy\revspot_workspace\agent-starter-python\.venv\Lib\site-packages\livekit\agents\utils\log.py", line 16, in async_fn_logs
    return await fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\shriy\revspot_workspace\agent-starter-python\.venv\Lib\site-packages\livekit\agents\cli\watcher.py", line 120, in _read_ipc_task
    msg = await channel.arecv_message(self._pch, proto.IPC_MESSAGES)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\shriy\revspot_workspace\agent-starter-python\.venv\Lib\site-packages\livekit\agents\ipc\channel.py", line 47, in arecv_message
    return _read_message(await dplx.recv_bytes(), messages)
                         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\shriy\revspot_workspace\agent-starter-python\.venv\Lib\site-packages\livekit\agents\utils\aio\duplex_unix.py", line 43, in recv_bytes
    raise DuplexClosed() from e
livekit.agents.utils.aio.duplex_unix.DuplexClosed
t
It looks like the error logs are pointing to some challenges with task cancellation and timeouts in the LiveKit agent worker on Windows. Don’t worry, I’m here to help you work through this! Here are some steps that should guide you: 1. Handle Timeout Errors: It’s a good idea to wrap your async operations with
asyncio.wait_for
and handle
TimeoutError
smoothly. For instance:
Copy code
try:
    await asyncio.wait_for(some_operation(), timeout=10)
except asyncio.TimeoutError:
    # Handle timeout
except asyncio.CancelledError:
    # Clean up and exit gracefully
1. Graceful Task Cancellation: Wrapping long-running tasks in exception handlers helps make sure resources are cleaned up properly if a cancellation happens. 2. Windows-Specific Multiprocessing: On Windows, it’s often better to use thread-based execution (
JobExecutorType.THREAD
) to avoid multiprocessing hiccups. Another option is running your setup in WSL2 for better process isolation. 3. Signal Handling: Since Windows doesn’t support
add_signal_handler
, make sure your cleanup logic is self-contained and remember to call
worker.aclose()
manually when needed. 4. Verify Configuration: Double-check that your environment variables like
LIVEKIT_URL
,
LIVEKIT_API_KEY
, and
LIVEKIT_API_SECRET
are all set correctly. If you find the problem is still there after trying these, take a look at the logs for any specific details and confirm your network connection to the LiveKit server is solid. Please feel free to reach out if you’d like me to walk you through any of these steps or if you have more questions—I’m here to support you! Sources: livekit-rtc/livekit/rtc/participant.py | livekit-agents/livekit/agents/worker.py