Back to measurements

Friday, October 13, 2017

Returning to actual recorder measurements, having ruled out the recorder as a cause for the memory leak, I'm going to use it to investigate the source of the memory leak.

First measurement illustrates the difference in bandwidth required for various kinds of content (idle, animation, full-screen movie):

Linux performance

Running spicy on Linux, I get a rather interesting behavior. The Tao3D document I am using for testing is at the end of this page.

  1. If I run the blinking dot page ("Mostly Harmless"), then VNC and Spicy are in exact opposite phases, i.e. I see on VNC a dot when there is none on Spice and conversely. Off-by-one frame issue, known, but needs to be addressed.
  2. If I run with the recorder activated, there is a lot of enqueuing happening, the queue length goes all the way to 200-300, and that's when memory (unsuprisingly) starts ballooning.
  3. Coincidentally, there is a sudden drop in the delay, which goes to 0. So I think we may be scheduling frames out of order.

Notice how the delay begins at a "normal" 1600 to a much higher value, and then drops precipitously, at the time when the queue increases.

Performance test looks like this (no sound, Linux screen capture, but the video on macOS below may explain a bit what you see):

Updating server

Updated the server with the latest I could find from fziglio. As is, does not compile, but easy to fix. But then, with the resulting server, my spice-streaming-agent is no longer starting:

> ./spice-streaming-agent

spice-streaming-agent[2404]: UNKNOWN msg of type 5 spice-streaming-agent[2404]: BAD VERSION 0 (expected is 1) spice-streaming-agent[2404]: BAD VERSION 103 (expected is 1) spice-streaming-agent[2404]: BAD VERSION 111 (expected is 1) spice-streaming-agent[2404]: BAD VERSION 109 (expected is 1) spice-streaming-agent[2404]: read command from device FAILED -- read 3 expected 8 spice-streaming-agent[2404]: FAILED to read command

Ah, had forgotten to update the spice-protocol. But still not working.

macOS performance

Running spicy on macOS, I have tons of:

3197 990.152844] channel-display-gst.c:207:gst_schedule_frame_warning: Rendering too late by 62985 ms (ts: 1488567, mmtime: 1551552), dropping

Performance test issue and memory on macOS :

Tao3D test document

Here is the complete Tao3D document I'm using at this point:

import BlackAndWhiteThemes
import VLCAudioVideo
import Animate

theme "WhiteOnBlack"

picture_slide "Empty void of nothingness", false

picture_slide "Mostly Harmless", if seconds mod 2 = 0 then color "green" circle 0, 0, 20

picture_slide "Speed test", background_color "#125" box 0, 0, 800, 600, vertical_align 0.5 + 0.5 * sin time align 0.5 + 0.5 * sin (0.3 * time) text "Time: " & page_time * 1000 locally color_hsv 20 * time, 0.3, 1, 60% rotate_z 6 * page_time ellipse_sector 0, 0, 500, 500, 0, 60 * page_time mod 360

picture_slide "Clock", background_color_hsv time, 0.4, 0.6 locally color "darkblue" dots with 0..59 dots N -> locally rotate_z -6 * N translate_y 222 if N mod 5 = 0 then rectangle 10, 10 else circle 3 locally color "red" rotate_z -360 * time rectangle 0, 120, 2, 240 locally rotate_z -6 * seconds rectangle 0, 60, 5, 120 locally color "darkgrey" rotate_z -6 * minutes - 0.1 * seconds rectangle 0, 80, 8, 160 locally color "darkgrey" rotate_z -30 * hours - 0.5 * minutes rectangle 0, 60, 10, 120

picture_slide "Helvetica Clock", // Draw in white on a black background, rotate globally with the mouse background_color "black" color "white" light 0 light_position 300, 300, 1000 light_specular "white" light_ambient "pink"

rotate_x -120 * mouse_y / window_height rotate_y 120 * mouse_x / window_width // Font and text alignment font "Arial", 300 align 0.5 align_vertically 0.5 extrude_depth 180 // The size of the boxes used to show each digit once H := 1.1 * text_height "0" W := 1.1 * text_width "0" shader_program fragment_shader << void main() { vec4 color = gl_Color; color.a *= 1.0 - 8.0 * (gl_FragCoord.z - 0.5); gl_FragColor = color; } >> // The primary draw loop locally Index := 0 translate_x -2.5*W two_digits with hours, minutes, seconds // Overlay to highlight the current time blend_function "DST_COLOR", "ONE_MINUS_SRC_ALPHA" color_hsv 2 * time, 0.3, 0.5, 0.7 rectangle 0, 0, 6.5*W, H // Drawing two digits two_digits N:integer -> digit_column with N/10, N mod 10 // Drawing a single digit column digit_column N:integer -> locally adjust -N, currentY[Index] digit with 0..9 // Move to the next one translate_x W Index := Index+1 // Drawing a single digit in a text box digit N:integer -> text_box 0,0,2*W,2*H, render N step 1 // Vertical adjustment - Common case adjust TY:real, Y:real -> interpolate 0.1, TY, Y step Y // Vertical adjustment - Initialization case adjust TY:real, Other -> currentY[Index] := TY adjust TY, currentY[Index] step R -> translate_z -700 rotate_x 25 * R translate_z 700 // The variables we use H -> 15.0 W -> 15.0 Index -> 0 data currentY

picture_slide "Movie - World War Z", WWZ -> "/data/video/Movies/Christophe/World War Z (2013).mp4##input-repeat=-1" locally color "white" movie 0, 120, 200%, 200%, WWZ on "pageexit", movie_drop WWZ

picture_slide "Movie - Lucy", LUCY -> "/data/video/Movies/Christophe/Lucy (2014).mp4##input-repeat=-1" locally color "white" movie 0, 120, 200%, 200%, LUCY on "pageexit", movie_drop LUCY