Bug 88729 - remote-viewer: Unlock cellphone screen made remote-viewer stuck
Summary: remote-viewer: Unlock cellphone screen made remote-viewer stuck
Status: RESOLVED NOTOURBUG
Alias: None
Product: Spice
Classification: Unclassified
Component: spice-gtk (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Spice Bug List
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-23 06:15 UTC by Dean
Modified: 2015-01-26 10:08 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Dean 2015-01-23 06:15:07 UTC
I encounter a wierd problem when testing my cell-phone via usb-redirect.

Test environment:
Client OS: win7-32bit
Client: remote-viewer
VM OS:  win7-32bit

Tool-chain:
zadig-2.1 (use libusbk)
usbredir-0.7
spice-gtk-0.27 (use gtk-2.0)
virt-viewer-0.6 (use gtk-2.0)

Test device:
IPhone 5s
Google Nexus 3

Problem:
It seems that almost all USB device can be redirected successfully included cellphone. However, when my IPhone
appeared in the VM OS, I can double click the phone icon, see its storage card. Then, I clicked 'Trust' button on my phone. Then, the whole window of remote-viewer is stuck, and cannot be closed normally( one way to close it is kill the process from task manager).
The same problem can be reproduced on Android phone, take my Nexus 3 as an example. The phone screen is locked with pattern lock before redirect, and unlock it after redirect. Then, remote-viewer is stuck.

Accidentally, I found a way to fix the bug. I add a printf in the beginning of usbredir_handle_msg() function, as below:
static void usbredir_handle_msg(SpiceChannel *c, SpiceMsgIn *in)
{
    SpiceUsbredirChannel *channel = SPICE_USBREDIR_CHANNEL(c);
    SpiceUsbredirChannelPrivate *priv = channel->priv;
    device_error_data data;
    int r, size;
    uint8_t *buf;

    g_return_if_fail(priv->host != NULL);

    /* No recursion allowed! */
    g_return_if_fail(priv->read_buf == NULL);

    buf = spice_msg_in_raw(in, &size);
    priv->read_buf = buf;
    priv->read_buf_size = size;

    printf("msg\n");

    r = usbredirhost_read_guest_data(priv->host);

I don't know why it works. And I try to use sleep(0) to instead, it doesn't work. Then, use sleep(1), it works, but decreased the performance of handling usb message.
Comment 1 Christophe Fergeau 2015-01-23 09:56:32 UTC
Is it an issue similar to http://lists.freedesktop.org/archives/spice-devel/2014-December/018408.html ? According to http://lists.freedesktop.org/archives/spice-devel/2014-December/018430.html this is a libusb bug which is being fixed upstream.
Comment 2 Dean 2015-01-26 01:08:40 UTC
(In reply to Christophe Fergeau from comment #1)
> Is it an issue similar to
> http://lists.freedesktop.org/archives/spice-devel/2014-December/018408.html
> ? According to
> http://lists.freedesktop.org/archives/spice-devel/2014-December/018430.html
> this is a libusb bug which is being fixed upstream.

Yes, they are same. Thanks a lot!
Comment 3 Christophe Fergeau 2015-01-26 10:08:59 UTC
Ok, closing this bug then, thanks for the followup!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.