On Flutter Native with Windows, we have this weird...
# ask-ai
b
On Flutter Native with Windows, we have this weird issue, when there is no subscriber to some published track, it stops sending audio after a while and it doesn't recover it back when we get a subscriber for it, what's the reason?
t
Thanks for reaching out, Ahmet. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're seeing that when no one is subscribed your published audio stops and doesn't resume when a subscriber joins. I’m responding to that specific behavior in Flutter Native on Windows. Short answer • LiveKit does not automatically stop sending audio when there are no subscribers. Audio should continue publishing. • That means the most likely causes are publisher-side logic or a platform-specific lifecycle issue on the Flutter Windows client. What to check (quick steps) 1. Verify the track is still enabled on the publisher when no subscribers exist:
Copy code
print('Track enabled: ${localAudioTrack.isEnabled}');
If false, re-enable:
Copy code
localAudioTrack.setEnabled(true);
1. Search your code for any logic that mutes/disables the track on unsubscribe or when participant count drops (e.g.,
setEnabled(false)
,
muteTrack()
, or handlers on `trackUnsubscribed`/participant leave). Don’t tie track enablement to subscription state. 2. Keep the capture pipeline alive on Windows: ◦ Ensure the microphone capture isn’t suspended by the OS or by your app when no sinks exist. ◦ As a test, play the local published track back locally (echo loop) to confirm the pipeline stays active. 1. Inspect logs/events for state changes: ◦ Watch for
TrackMuted
/
TrackUnpublished
/ encoder shutdown messages and Room events like
TrackPublished
/
TrackSubscribed
. ◦ Confirm the publication still exists and
publication.subscribed
updates correctly when a subscriber joins. 1. Codec / encoder considerations: ◦ Audio should not be dynacast or paused by LiveKit. If you use DTX/low-bitrate settings, try disabling them while debugging. If you want, share: • A short code snippet of how you create/publish the audio track and any unsubscribe handlers. • Relevant console logs when the problem occurs. I can then point to the exact lines that may be disabling the track or suggest a small repro to isolate Windows-specific behavior. Would you like to share that? Sources: Bringing Zoom's end-to-end optimizations to WebRTC | Codecs and more | LiveKit docs | Subscribing to tracks | LiveKit docs | Managing Video Quality During Network Congestion | Flutter quickstart | LiveKit docs
b
No luck, none of these didn't help me out
t
Sorry that didn’t help — I know how frustrating that is. To diagnose this faster I need a few specific details and logs so I can pinpoint whether this is app logic, the Flutter Windows layer, or an SDK/platform bug. Please provide: • The code snippet that creates and publishes the audio track (publisher side). • Any code that runs on unsubscribe/participant-leave or that calls
setEnabled(false)
/
muteTrack()
/
stop()
on the track. • SDK and environment versions: ◦ LiveKit Flutter SDK version ◦ Flutter version (including channel: stable/beta/dev) ◦ Windows OS build • Exact sequence of events and reproduction steps (e.g., start publisher -> wait X minutes with 0 subscribers -> subscribe from client B -> audio missing). • Relevant console/log output from both publisher and subscriber around the time it stops and when a new subscriber joins (include Room/Track events). • Whether you can reproduce if you immediately play the published track locally (echo loop test). Send those and I’ll examine the code/logs and suggest targeted fixes or a minimal repro to isolate a Windows-specific issue.