virt-viewer does not recognise SPICE protocol

Bug #1753068 reported by Jernej Jakob
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Raspbian
New
Undecided
Unassigned

Bug Description

Remote-viewer from package virt-viewer 5.0-1 on Raspbian stretch doesn't work with spice:// connection URL, throws error 'Unsupported graphic type: spice'. Version 1.0 on jessie also has the same error.
It seems that it's compiled without spice-gtk because even manually installing spice-client-gtk makes no difference.

On debian ( https://packages.debian.org/stretch/virt-viewer )
it has dependencies:

dep: libspice-client-glib-2.0-8 (>= 0.33)
    GObject for communicating with Spice servers (runtime library)

dep: libspice-client-gtk-3.0-5 (>= 0.32)
    GTK3 widget for SPICE clients (runtime library)

virt-viewer on Raspbian doesn't have these dependencies.

Looking at build logs ( https://buildd.raspbian.org/status/fetch.php?pkg=virt-viewer&arch=armhf&ver=5.0-1&stamp=1482066062 ):
WARNING: unrecognized options: --disable-maintainer-mode, --with-gtk

For debian: https://buildd.debian.org/status/fetch.php?pkg=virt-viewer&arch=armhf&ver=5.0-1&stamp=1481142989&raw=0

Both have Build-Depends on libspice-client-gtk-... but only the Debian configure script checks for it:

checking for SPICE_GTK... yes
checking for SPICE_CONTROLLER... yes
checking for SPICE_PROTOCOL... yes

I assume it's a wrong configure option, could this please be checked.

Jernej Jakob (jjakob)
description: updated
Revision history for this message
Jernej Jakob (jjakob) wrote :

So I tried to build virt-viewer from source. However, the source package in raspbian archives required newer spice-client-glib/gtk than that available in the archives:

Requested 'spice-client-gtk-3.0 >= 0.33' but version of spice-client-gtk-3.0 is 0.32
Requested 'spice-client-glib-2.0 >= 0.33' but version of spice-client-glib-2.0 is 0.32

The source package of spice-gtk in raspbian is version 0.32, not 0.33, so I tried to build from git ( https://anonscm.debian.org/git/collab-maint/spice-gtk.git ) which had 0.33.
This, however, brought me to the real issue:
(full log in attachment)

In file included from /usr/include/glib-2.0/gobject/gobject.h:24:0,
                 from /usr/include/glib-2.0/gobject/gbinding.h:29,
                 from /usr/include/glib-2.0/glib-object.h:23,
                 from spice-client.h:23,
                 from spice-file-transfer-task-priv.h:25,
                 from spice-file-transfer-task.c:20:
spice-file-transfer-task.c: In function ‘spice_file_transfer_task_get_property’:
/usr/include/glib-2.0/gobject/gtype.h:2207:6: error: cast increases required alignment of target type [-Werror=cast-align]
     ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt))
      ^

So this seems like a real bug in spice-gtk 0.34 or glib-2.0, or I am compiling the wrong code not patched for armhf. Either way, more research is required.

Revision history for this message
Jernej Jakob (jjakob) wrote :

Attached is a patch for building virt-viewer on armhf with spice-gtk enabled.
Applies to both source obtained via apt-get source or from https://salsa.debian.org/libvirt-team/virt-viewer.git. Tested on virt-viewer 5.0-1 and 6.0-2.
Apply the patch, commit and build using "dpkg-buildpackage -rfakeroot -us -uc --build=binary".
Before building virt-viewer you need to build spice-gtk and spice-protocol from git as virt-viewer requires libspice-client-glib-2.0-8 (>= 0.33) but the distribution version is 0.32.

Revision history for this message
Jernej Jakob (jjakob) wrote :

Patch for building the dependency, spice-gtk from https://anonscm.debian.org/git/collab-maint/spice-gtk.git. This disables werror to fix the cast errors and disables building html docs to fix a file not found error during dh_install. Tested on spice-gtk 0.34-1.
Apply the patch, commit, (optionally run "debchange -l +gitxyz") and build with "dpkg-buildpackage -rfakeroot -us -uc".
You need to build and install libspice-protocol-dev from https://anonscm.debian.org/git/collab-maint/spice-protocol.git before building spice-gtk.

Revision history for this message
Jernej Jakob (jjakob) wrote :
Revision history for this message
Arvid Stanson (astanson) wrote :

can someone please fix this in the base raspbian? I doubt people who are new to linux will have any knowledge or even know where to begin on rebuilding packages.

Revision history for this message
Jernej Jakob (jjakob) wrote :

Is it still not fixed? I gave up on fixing it that time after building everything and installing it, there was a lot of graphics glitches, missing graphics etc. that would require debugging the graphics subsystem and fixing bugs, which I have zero experience in. I was testing with the raspbian hardware accelerated graphics (itself experimental at the time) as the sw accelerated was unusably slow. I suspect it has something to do with the combination of the two. Since some time has passed and things may be different now, it would be good to recompile it and check if anything's improved. Unfortunately I don't have the time to do that right now.

Revision history for this message
peter green (plugwash) wrote :

I'm not sure where your builds are picking up the -Werror from, that doesn't seem to be a problem in any of our builds. The problem in spice-gtk is a missing build-dependency, i'll get that dealt with so raspbian stretch's spice-gtk package is back in sync with Debian stretch's one.

Revision history for this message
Arvid Stanson (astanson) wrote :

I was able to hackishly get it working using Debian Sid packages to fill in the gaps. There's no audio and no ability to map USB devices but it works.

Revision history for this message
Jernej Jakob (jjakob) wrote :

@peter: I was building everything from debian sources from anonscm. I assume it was something with the particular versions that may be fixed in the newer ones.

The graphics corruption was connecting to a W7 guest w/ QXL graphics and the HW accelerated driver in raspbian. The SW acceleration worked but was unusably slow and laggy.

If a working build gets released, I'll test it in my particular setup to see if it's still glitchy.

Revision history for this message
Arvid Stanson (astanson) wrote :

@jjakob

here is a video of a working spice client on the raspi, using debian sid debs. https://youtu.be/IAFetwFJrtU

as you can see no glitches or artifacts, if you install pulse, you get audio and usb redirection.

Revision history for this message
peter green (plugwash) wrote :

BTW raspbian buster contains a virt-viewer that appears to be built against SPICE-GTK.

Revision history for this message
peter green (plugwash) wrote :

anonscm is gone, replaced by salsa, but in any case what is on there is of limited relevance to fixing stuff in an existing stable (and soon to become oldstable) release.

Revision history for this message
peter green (plugwash) wrote :

spice-gtk is now up to date in raspbian stretch, I have just scheduled a rebuild of virt-viewer, lets see if it picks spice up without further changes or not (it did on Debian armhf, so i'm hopeful).

Revision history for this message
peter green (plugwash) wrote :

the rebuild of virt-viewer has successfully built with SPICE_GTK, it should be in the next update run.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.