Skip to content

Conversation

@hexbabe
Copy link
Member

@hexbabe hexbabe commented Nov 17, 2025

Tests on linux/arm64 (rpi5b)

  • Unplug replug
  • Reconfigure (new video_path and resolution)
  • find-webcams adding a new camera

In fact, this PR fixed an unreported linux bug too (unplug/replug is not working on linux/arm64 on the main branch).

Tests on darwin/arm64 (viam issued macbook air laptop)

  • Unplug replug
  • Reconfigure (new video_path and resolution)
  • find-webcams adding a new camera

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Nov 17, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Nov 17, 2025
@hexbabe hexbabe marked this pull request as ready for review November 25, 2025 15:37
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Dec 1, 2025
c.buffer.frame = nil
// Make a private copy of the previously published frame so consumers can continue to read it,
// then return the Reader-managed buffer before we kick off the next read. This avoids holding
// on to driver memory while still serving the last frame.
Copy link
Member Author

@hexbabe hexbabe Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introducing prevRelease fixes the hang. All other changes on this PR are to supplement it, to ensure best practices, and fix vulnerabilities in the code I saw along the way of fixing the hang.

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Dec 1, 2025
}

// Must lock the mutex before using this function.
func (buffer *WebcamBuffer) stopBuffer() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate how buffer is used to group together the actual buffer and the worker that fills it. I made a lot of changes to fix that naming and also deleted this helper function that is frankly a bit confusing.

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

Labels

safe to test This pull request is marked safe to test from a trusted zone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants