Skip to content

Conversation

@deanlee
Copy link
Contributor

@deanlee deanlee commented Nov 24, 2021

use repaint to fix the frameskip when there are too many events in the queue (e.g. watch3)

@pd0wm
Copy link
Contributor

pd0wm commented Nov 24, 2021

Doesn't it make more sense to skip frames so we can keep up realtime?

@adeebshihadeh
Copy link
Contributor

What events are dominating the queue? Perhaps we're spamming the queue with nonsense timer events or something else?

@deanlee deanlee marked this pull request as draft November 24, 2021 22:35
@deanlee
Copy link
Contributor Author

deanlee commented Nov 25, 2021

We can easily implement an OffroadTimer like this if use singleton uistate #22789

OffroadTimer(QObject *parent) : QTimer(parent) {
  QObject::connect(uiState(), &UIState::offroadTransition, [=](bool offroad) {
    offroad ? start() : stop();
  });
}

@deanlee
Copy link
Contributor Author

deanlee commented Nov 25, 2021

What events are dominating the queue? Perhaps we're spamming the queue with nonsense timer events or something else?

At present, this drawing problem mainly affects watch3. it is caused by many update events from the three cameras.

@pd0wm
Copy link
Contributor

pd0wm commented Nov 26, 2021

It seems like the video is skipping back and forth sometimes, so something goes out of order. I assume that was introduced by the async copy? Should we hold off on copying new frames if an update is still pending?

I don't like forcing a repaint in the regular ui, but it's fine in watch3. Should we make it an argument for the constructor of CameraView?

@deanlee
Copy link
Contributor Author

deanlee commented Nov 26, 2021

Think we don't need this hack if use YUV vipc stream.

@pd0wm
Copy link
Contributor

pd0wm commented Nov 26, 2021

Can we ensure the texture is not being modified while Qt is actually drawing the ui? Even with YUV that might still be an issue, right?

@deanlee deanlee force-pushed the fix_frameskip branch 3 times, most recently from 6c77335 to b85afde Compare November 27, 2021 01:53
@deanlee
Copy link
Contributor Author

deanlee commented Nov 27, 2021

Fixed, synchronized the upload and render

@deanlee deanlee marked this pull request as ready for review November 27, 2021 03:46
@deanlee
Copy link
Contributor Author

deanlee commented Nov 27, 2021

Can we ensure the texture is not being modified while Qt is actually drawing the ui? Even with YUV that might still be an issue, right?

YUV #22905 does not has this synchronization issue. it uploads the latest frame in the gui thread.( since the performance looks good enough , I did not do asynchronous upload for it)

@pd0wm pd0wm merged commit 00db14a into commaai:master Nov 29, 2021
@deanlee deanlee deleted the fix_frameskip branch November 30, 2021 01:19
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.

3 participants