Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

camerad: fix tearing when hitting frame timeout #34514

Merged
merged 2 commits into from
Feb 1, 2025
Merged

camerad: fix tearing when hitting frame timeout #34514

merged 2 commits into from
Feb 1, 2025

Conversation

sshane
Copy link
Contributor

@sshane sshane commented Jan 31, 2025

Closes #34429

Small random timeout w/ ISP debayer enabled on ecam and dcam:

master:

PXL_20250131_234937241.1.mp4

This PR:

PXL_20250131_234840020.1.mp4

LOGE("failed to wait for sync: %d %d", ret, sync_wait.sync_obj);
}
buf.frame_metadata[i].timestamp_end_of_isp = (uint64_t)nanos_since_boot();
buf.frame_metadata[i].timestamp_eof = buf.frame_metadata[i].timestamp_sof + sensor->readout_time_ns;
if (dp) {
if (dp && ret == 0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

with a low timeout (rand() % 30 + 10), without this, you would still sometimes see occasional tearing due to using the incomplete frame, even if we cleared the request queue

@sshane sshane marked this pull request as ready for review February 1, 2025 00:31
@sshane sshane added the bugfix label Feb 1, 2025
@adeebshihadeh
Copy link
Contributor

Let's re-enable ISP once this is merged.

@sshane
Copy link
Contributor Author

sshane commented Feb 1, 2025

This is what it looks when waiting on the frame times out one singular time (yes, there's also a two frame diff of frameId and frameIdSensor without ISP debayer), everything recovers in ~10 frames, but ecam and dcam recover faster:

image

@sshane sshane merged commit e3d83b4 into master Feb 1, 2025
18 checks passed
@sshane sshane deleted the cam-tear branch February 1, 2025 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Forward video has tearing artifacts Jan 2025
2 participants