Skip to content

Keep Xiaomi CS2 control notifications from stopping media - #2410

Draft
RuiFG wants to merge 1 commit into
AlexxIT:masterfrom
RuiFG:agent/fix-xiaomi-cs2-control-queue
Draft

Keep Xiaomi CS2 control notifications from stopping media#2410
RuiFG wants to merge 1 commit into
AlexxIT:masterfrom
RuiFG:agent/fix-xiaomi-cs2-control-queue

Conversation

@RuiFG

@RuiFG RuiFG commented Aug 8, 2026

Copy link
Copy Markdown

Summary

  • keep Xiaomi MISS/CS2 media running when unsolicited control notifications are not consumed after login
  • discard the oldest command notification when the bounded command queue is full
  • leave media queues strict so media corruption is not hidden

Root cause

The Xiaomi CS2 connection has a command channel with a bounded queue. After login, some cameras continue to send unsolicited control notifications, but there is no long-running command consumer. Once the queue fills, Push returns pop buffer is full, the worker exits, and the entire media connection restarts. This creates a repeatable multi-second video gap.

Validation

  • go test ./pkg/xiaomi/miss/cs2 ./pkg/xiaomi/miss
  • added coverage confirming media queues still fail when full and command queues retain the newest notification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant