Commit c3f1f03
committed
feat(linux)!: use experimental renderer by default
This commit introduces an experimental offscreen renderer for Linux
that decouples video rendering from UI rendering to improve UI
responsiveness. The new renderer is enabled by default on Linux and
can be toggled via the MPVQC_LINUX_EXPERIMENTAL_RENDERER environment
variable.
Updated Video Rendering:
- Windows:
unchanged - mpvQC uses winId/HWND embedding as before
- Linux:
Offscreen renderer (experimental) by default. Set
MPVQC_LINUX_EXPERIMENTAL_RENDERER=false to use the old renderer
Technical Differences:
- Legacy renderer: Renders directly into the UI's framebuffer, blocking
the UI thread during video rendering operations. This constrains the
entire UI to the video's framerate.
- Offscreen renderer: Uses two framebuffers and renders video frames in
a dedicated background thread. Qt Quick blits the latest completed
frame whenever a new video frame is ready:
mpv → _render_fbo → _display_fbo → Qt Quick's FBO → screen
Background thread:
_render_fbo → _display_fbo: pointer swap after mpv completes rendering
UI thread:
_display_fbo → Qt Quick's FBO: blit when new frame signal arrives
This allows the UI to remain responsive at the display's refresh rate
while video frames render independently in the background at the
content's native framerate.
Audio Delay Compensation:
The offscreen renderer presents video frames as they become available
rather than being tightly coupled to the display's vsync. This can
cause audio desynchronization as video frame presentation timing
differs from the legacy renderer.
To address this, mpvQC now automatically adjusts the audio delay based
on the current monitor's refresh rate. The delay is calculated as the
frame time (1 / refresh_rate) rounded to millisecond precision. The
adjustment updates dynamically when the window moves to a different
monitor or when the refresh rate changes.
Breaking Change:
Users upgrading from previous versions of mpvQC on Linux must update
their mpv settings via Options -> Edit mpv.conf:
- When using the NEW offscreen renderer (default):
Remove any video-timing-offset configuration. The new renderer handles
timing automatically through audio delay compensation based on the
monitor's refresh rate.
- When using the OLD legacy renderer
(MPVQC_LINUX_EXPERIMENTAL_RENDERER=false):
Keep or add video-timing-offset=0.016 (or adjust based on your
monitor's refresh rate). The legacy renderer requires this setting
for proper synchronization.1 parent ca41beb commit c3f1f03
File tree
10 files changed
+485
-14
lines changed- data/config
- docs
- mpvqc
- services
- host_integration
- views
- test/services/player
10 files changed
+485
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | 8 | | |
13 | 9 | | |
14 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
9 | 16 | | |
10 | 17 | | |
11 | 18 | | |
| |||
28 | 35 | | |
29 | 36 | | |
30 | 37 | | |
| 38 | + | |
31 | 39 | | |
32 | 40 | | |
33 | 41 | | |
34 | 42 | | |
| 43 | + | |
35 | 44 | | |
36 | 45 | | |
37 | 46 | | |
38 | 47 | | |
39 | 48 | | |
40 | 49 | | |
41 | | - | |
| 50 | + | |
42 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
43 | 60 | | |
44 | 61 | | |
45 | 62 | | |
| |||
48 | 65 | | |
49 | 66 | | |
50 | 67 | | |
51 | | - | |
52 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
53 | 83 | | |
54 | 84 | | |
55 | 85 | | |
| |||
67 | 97 | | |
68 | 98 | | |
69 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
70 | 106 | | |
71 | 107 | | |
72 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
109 | 114 | | |
110 | 115 | | |
111 | 116 | | |
| |||
115 | 120 | | |
116 | 121 | | |
117 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
118 | 128 | | |
119 | 129 | | |
120 | 130 | | |
| |||
173 | 183 | | |
174 | 184 | | |
175 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
176 | 194 | | |
177 | 195 | | |
178 | 196 | | |
| |||
230 | 248 | | |
231 | 249 | | |
232 | 250 | | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
233 | 262 | | |
234 | 263 | | |
235 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
26 | 33 | | |
27 | 34 | | |
28 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
7 | 23 | | |
0 commit comments