[Spice-devel] [spice-gtk PATCH v2] spice-channel: check message queue length

Victor Toso lists at victortoso.com
Sun Oct 18 23:30:39 PDT 2015


Hey,

On Fri, Oct 16, 2015 at 04:02:11PM +0200, Fabiano FidĂȘncio wrote:
> I had a private conversation with Hans (which he agreed to share in
> this email) and here is his suggestion:
>
> 15:51 <hansg> Hi, ah yes that one, I had it on my radar at one point...
> 15:51 <hansg> Overall I think the idea is good, but the dropping of
> usbredir data may only be done for isoc packets, not for any other
>               packets, and data must be dropped a whole packet at a time
> 15:52 <hansg> So you likely will need to have some code in
> usbredirparser or usbredirhost to take care of this for you
> 15:53 <hansg> Also with video data (what this is about) you really do
> not want to drop every other packet, as then you will just end up
>               generating only unusable frames.
> 15:54 <hansg> What you want to do is buffer upto a threshold and then
> stop accepting packets until the queue has been drained to a
>               second much lower threshold
> 15:55 <hansg> Thinking more about this, I think that what you need to
> do is add a new callback which usbredirhost can call which is
>               called "is_space_available" or some such, and have that
> return a boolean
> 15:55 <hansg> Then in usbredirhost when receiving an isoc packet from
> an usb device call this callback (if defined) and if it returns
>               falls drop the packet
> 15:56 <hansg> Then in spice-gtk defined the callback and have it
> return true until the queue grows to above a certain threshold
> 15:56 <hansg> Once the queue is above the threshold have the callback
> return falls till the queue is drained till the
> 15:56 <hansg> second much lower threshold
> 15:57 <hansg> Does that make sense ?
> 15:58 <fidencio> yes, it does.
> 15:58 <fidencio> do you mind if I c&p this conversation to that thread?
> 15:58 <hansg> No I do not mind, please do copy and paste it, thanks
> 15:58 <fidencio> thanks a lot!

Thanks for the feedback! It does make sense.
I'll work on the proper fix then!

Cheers,
  toso


More information about the Spice-devel mailing list