Friday

Friday, October 6, 2017

Still investigating the build issues on macOS, and turning the new laptop into a good development and test machine.

H264 accelerated rendering

I was surprised to see that I had accelerated rendering using playbin on macOS. So now I see no reason to not have it from spicy as well.

Asked how to make sure what the pipeline looked like. Victor suggested using GST_DEBUG=5 or using what was implemented in a commit he made last June.

The relevant part is:

% GST_DEBUG_DUMP_DOT_DIR=/tmp remote-viewer ...
% dot -Tpng -oimage.png spice-gtk-gst-pipeline-debug.dot

So with

GST_DEBUG=5 gst-launch-1.0 playbin uri=file:///Volumes/video/test.mp4

I have 16% utilization, and the log file contains messages like

Pixel format 0x7f809bf5bfc0 attr Accelerated Compute = 1
 update existing feature 0x7f809c0320e0 (vtenc_h264_hw)
Plugin 'applemedia' feature 'vtenc_h264_hw' typename : 'GstElementFactory'

I do not find a vtdec, though. And nothing of the same vein in the Linux log I get on a machine where I believe that decoding is done with hardware support. Well. No. Should be. Because looking at CPU utilization, it is not obvious at all.

Running on the Lenovo laptop, I have roughly 22% utilization while running spicy with an active screen (connecting to the same screen from macOS gives me 100% CPU utilization). The video is not much smoother than when running from macOS, though, so it's really a matter of saving battery life.

As soon as I start Tao3D in the VM, though, CPU utilization spikes to 125%. On Linux, it does not make much of a difference. I still have 25% of less CPU utilisation. Also, delay does not build up on Linux as it does on macOS. So the Linux solution appears to be quite usable.

Except that after 108 minutes running, the process is using 1.8G of memory. Uh oh.

Running Linux under VMware, the CPU usage for spicy also remains at a moderate 25%. Video is quite smooth, and there is no real difference when showing 3D animations vs. a movie.

macOS SPICE - Brew package

The documentation to create packages for Homebrew is quite good. In little time, I had a couple of Homebrew recipes:

  • For spice-protocol:
    class SpiceProtocol < Formula
      desc "Interface files for the SPICE remote display protocol"
      homepage "https://www.spice-space.org"
      url "https://www.spice-space.org/download/releases/spice-protocol-0.12.13.tar.bz2"
      sha256 "89ee11b202d2268e061788e6ace114e1ff18c7620ae64d1ca3aba252ee7c9933"

def install system "./configure", "--disable-silent-rules", "--prefix=#{prefix}" system "make", "install" end

test do # Once protocol files are installed, we should be able to run pkg-config system "pkg-config", "--version", "spice-protocol" end

end

  • For spice-gtk:
    class SpiceGtk < Formula
      desc "Client for the SPICE remote display protocol"
      homepage "https://www.spice-space.org"
      url "https://www.spice-space.org/download/gtk/spice-gtk-0.34.tar.bz2"
      sha256 "e9720e01165f8451c9f3f58ad50e3afb990993b81cc2db86b3661b7ac5b976ee"

depends_on "pkg-config" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "gettext" depends_on "intltool" depends_on "pixman" depends_on "gtk+3" depends_on "gstreamer" depends_on "gstreamermm" depends_on "libjpeg-turbo" depends_on "gst-plugins-good" depends_on "gst-plugins-bad" depends_on "gst-libav" depends_on "spice-protocol"

def install system "./configure", "--disable-silent-rules", "--prefix=#{prefix}" system "make", "install" # if this fails, try separate make/make install steps end test do system "make", "test" end

end

So far, so good. But for some reason, on geonosys, running gst-inspect-1.0 audioconvert hangs. On ptitpuce, it works OK and gives me a relatively lengthy output immediately.

Lenovo laptop setup

I'm really not very fond of that laptop keyboard, trackpad and screen, so I am trying to enable remote desktop. Yesterday, I came across this article suggesting that remote desktop for Wayland will soon be there. Sent an email to get some feedback today, because it does not seem that simple yet. But then, remote desktop to Xorg is not that simple either. Every single time, I have some trouble connecting. Here is what I do:

  • Switch to Xorg GNOME session

    * Go to "Settings" then "Sharing" and activate "Remote desktop" * Then (for Apple Screen Sharing) go to dconf-editor and disable mandatory encryption

But that never work until I stop the firewall. I don't know... If I activate Screen Sharing, shouldn't I also get the firewall deactivated on that port? Filed Red Hat Bugzilla 1499280, because that gets in my way every time. Everytime I have the same reaction, "I can't just switch the firewall off". And then I end up doing it.

Emacs ANSI colors on regions

Added the following to my keydefs.el:

(require 'ansi-color)

(defun ansi-color-buffer () (interactive) (ansi-color-apply-on-region (point-min) (point-max))) (defun ansi-color-region () (interactive) (ansi-color-apply-on-region (point) (mark)))