<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div><blockquote class=""><div class="">On 3 Oct 2017, at 15:49, Frediano Ziglio <<a href="mailto:fziglio@redhat.com" class="" target="_blank" data-mce-href="mailto:fziglio@redhat.com">fziglio@redhat.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="" class="" data-mce-style=""><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><blockquote class=""><br class="Apple-interchange-newline">On 2 Oct 2017, at 15:43, Frediano Ziglio <<a href="mailto:fziglio@redhat.com" class="" target="_blank" data-mce-href="mailto:fziglio@redhat.com">fziglio@redhat.com</a>> wrote:<br class=""><br class="">Related problem with audio.<br class=""><br class="">Look at that video<br class=""><a href="https://www.youtube.com/watch?v=bn5iczqLBmk" class="" target="_blank" data-mce-href="https://www.youtube.com/watch?v=bn5iczqLBmk">https://www.youtube.com/watch?v=bn5iczqLBmk</a><br class="">basically for a short while while playing a video with audio network is<br class="">disconnected.<br class="">This create a delay (see the delay when moving the mouse, I had 2 cursor so<br class="">show<br class="">the delay).<br class="">The server cursor follow with a huge delay which disappears when audio is<br class="">disabled.<br class="">This is caused by some reasons:<br class="">- communication is using tcp so packets are retransmitted, not discarded;<br class="">- audio packets are never discarded;<br class=""></blockquote><br class="">That part seems the easiest to address, no?<br class=""><br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">The current design is "we don't care about the delay".</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">If we don't agree on the design change the current behaviour is fine.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div></div></blockquote><div><br class=""></div><div>Mmmmh, sorry, without facial expressions, it’s hard for me to tell if you are</div><div>serious or sarcastic here. I thought I understood you wanted to address the</div><div>latency problem. Doesn’t that imply a change in design?</div></div></blockquote><div>Well, I'm not the king of the castle. Considering that there are plenty of code to<br></div><div>optimize the "movie night" use case and that people in the team in months never<br></div><div>suggested to remove that code I can't see a strong design change. Not that the</div><div>current code is easy to understand and change.<br></div><div><br></div><div>Personally from this patch and my videos (playing games) you can easily<br></div><div>guess my opinion. I would personally merge this patch and work on reducing<br></div><div>the latency on the client to a minimum.<br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div><blockquote class=""><div class=""><div style="" class="" data-mce-style=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><blockquote class="">- video is synchronized on audio.<br class=""></blockquote><br class="">In case we decide to drop audio packets and re-sync, we also need an I-frame.<br class=""><br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">I don't see why. We are not dropping video frames or any video information.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div></div></blockquote><div><br class=""></div><div>Maybe I got confused by your proposal. Are you suggesting we investigate how</div><div>to reduce the delay? Or just sharing observations about where the delay comes from?</div></div></blockquote><div>I would say both.<br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div><blockquote class=""><div class=""><div style="" class="" data-mce-style=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><blockquote class="">You can understand that the delay can became so high that is hard to<br class="">control the VM.<br class=""></blockquote><br class="">Yes ;-)<br class=""><blockquote class=""><br class="">Usually for communications (like mobile phones or similar) when a network<br class="">problem happens we ears noises or silences, just packets are discarded<br class="">(or corrupted).<br class=""></blockquote><br class="">I think that dropping audio packets makes sense. But then, should we send<br class="">audio and video over UDP instead of TCP?<br class=""><br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">TCP will catch up. No reasons for UDP. Yes, UDP would do the drop on its</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">own avoiding retransmissions but you have to change all the entire protocol,</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">design and implementation (not saying is not worth investigating).</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div></div></blockquote><div><br class=""></div><div>OK. I was only observing that TCP only makes sense if we prefer packets not</div><div>to be dropped. By having TCP retried (and associated delays) only to drop the</div><div>packets in the end makes little sense to me.</div></div></blockquote><div>In this case would be audio packets... messages if you prefer. There must be some<br></div><div>reasons why YouTube, Facebook and other streaming websites uses tcp.<br></div><div>Replacing tcp with udp means you have to deal with a lot of problems.<br></div><div>If you want a reliable connection then you'll end up reimplementing tcp.<br></div><div>If you accepts a not reliable connection it means you have to deal with errors, changing<br></div><div>protocol, compression, inserting redundancy (so spending more bandwidth) and<br></div><div>data synchronization points.<br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div><div><br class=""></div><div>So maybe I got confused and you were not suggesting we drop packets. Then</div><div>what were you proposing? Or were you not proposing anything and just asking</div><div>around to get ideas?</div></div></blockquote><div>Was not referring at network packets. Audio is transmitted in chunks compressed<br></div><div>and sent inside spice messages. There messages are queued and synchronization is<br></div><div>based on them. I was suggesting to discard them if the queue reach some threshold.<br></div><div><br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div><blockquote class=""><div class=""><div style="" class="" data-mce-style=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><br class=""><blockquote class="">I think this should be the behaviour instead of introduce long buffering<br class="">and delays.<br class=""></blockquote><br class="">Agreed, though that depends on the delay. Some apps like BlueJeans deal with<br class="">relatively short interruption by pausing and then playing catch-up (i.e.<br class="">playback is<br class="">faster than real-time until it catches actual time)<br class=""><br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">Yes, you are right, trying to catch up (video but also audio) is an option</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">(limiting however the delay).</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div></div></blockquote><div><br class=""></div><div>Yes. The 500ms below were that limit in my mind.</div></div></blockquote><div>Ok, so 500ms as an upper limit, not a lower one (like happens during normal<br></div><div>streaming buffering).<br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div><div><br class=""></div><blockquote class=""><div class=""><div style="" class="" data-mce-style=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><blockquote class="">Basically means that in the client we should limit the<br class="">queue to 1/2 audio packets and a new packet will replace the queued one.<br class=""></blockquote><br class="">I think that the number of audio packets should still be larger than 1 or 2.<br class="">The lower that number, the higher the risk of hearing noticeable clicks.<br class="">I’d say we should probably allow for ~500ms of buffered audio.<br class=""><br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">This plus the video sync means that you click a button (or whatever action)</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">and you'll see the results after 1/2 seconds. Can be acceptable for a office</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">usage, surely not for animations, games or any possible realtime simulation</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">would be impossible.</span></div></div></blockquote><div><br class=""></div><div>I was not suggesting that we accept a 500ms delay, but rather that this</div><div>be the maximum acceptable delay before we take harder measures,</div><div>like a restart. I think 0.5s is acceptable if it only happens a couple of times</div><div>a day when you lost Wi Fi.</div></div></blockquote><div>I won't personally live with that for long. I would try to catch up.<br></div><div><br></div><div>Some notes about this patch that are not easy to see.<br></div><div>The removed code basically introduces a minimum 400ms delay on multimedia<br></div><div>(audio/video) data. Note that part of graphics is video and part graphic commands<br></div><div>which potentially create different artifacts in the client.<br></div><div>But the removal of this code cause some changes on streaming reports used for<br></div><div>video bandwidth adjustment. The reason is that the num_drops and last_frame_delay<br></div><div>depends on the difference between message multimedia time and the client concept<br></div><div>of the multimedia time. So potentially we'll have a smaller delay (last_frame_delay)<br></div><div>and more "dropped" frames. I quoted "dropped" as the computation of this value<br></div><div>is more dependent on the network delay (network latency and time spent sending<br></div><div>the video/audio messages). Is true that for mjpeg the frame is dropped (not<br></div><div>displayed). On this not displaying it's quite odd. We have some video information<br></div><div>but if it arrives too late is dropped but basically we are dropping the last frame<br></div><div>without knowing if we'll have other data to display soon.<br></div><div>Also if network conditions changed and the latency is bigger this can cause<br></div><div>lot of frames to be dropped. To reduce CPU usage would be better to queue<br></div><div>compressed frames and drop old ones instead of dropping new ones.<br></div><div>About the client concept of multimedia time. The server sends some messages<br></div><div>to tell its time (with a -400ms skew) and client try to use this however with<br></div><div>audio every seconds the client set the time based on the audio time (which<br></div><div>has not the skew). So this patch avoids the client code to have 2 different<br></div><div>concepts of time (skewed or not based on audio) which seems a good reason<br></div><div>to have this patch.<br></div><div>Back to the delay, frames dropped and stream reports not sure how the<br></div><div>bandwidth adjustment is affected (I'm actually trying this patch with the<br></div><div>streaming agent which does not do any adjustment). On the other hand<br></div><div>if audio is on the behaviour should be more similar.<br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div><div><br class=""></div><blockquote class=""><div class=""><div style="" class="" data-mce-style=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">I think 50ms is a good target.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">Unless of course we agree to drop the audio/video sync.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div></div></blockquote><div><br class=""></div><div><br class=""></div><div>Thanks</div><div>Christophe</div><blockquote class=""><div class=""><div style="" class="" data-mce-style=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><br class="">Christophe<br class=""><br class=""><blockquote class=""><br class=""></blockquote></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">Frediano</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="" data-mce-style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><blockquote class=""><br class=""><br class=""><blockquote class=""><br class="">Do not offset the time attempting to fix client latency.<br class="">Client should handle it by itself.<br class=""><br class="">This patch is not designed to be merged but more for discussion.<br class=""><br class="">This remove entirely the delay introduced by the server.<br class="">This avoids surely possible time drifts in the client.<br class="">The server just sends it's concept of time without trying to force any<br class="">delay. I think only one end should handle this delay in an attempt to<br class="">synchronize audio and video instead that doing it in both ends.<br class=""><br class="">I'm currently trying it and the responsiveness is much better.<br class=""><br class="">One think I noted is however what happens if I block the connection.<br class="">Think about a momentary disconnection like when you disconnect the a<br class="">cable between the client and the server or when you drop every packets<br class="">between them with a firewall for a short while (this can happens in<br class="">many cases like a restart of a network device, a small fault of one or<br class="">simply you loose signal to your wifi network). The audio restart when<br class="">the connection is fixed (TCP take care of it) but everything then is<br class="">delayed. Looks like instead of catching up the delay is maintained.<br class="">Actually stopping the audio/video remove the delay.<br class=""><br class="">Signed-off-by: Frediano Ziglio <<a href="mailto:fziglio@redhat.com" class="" target="_blank" data-mce-href="mailto:fziglio@redhat.com">fziglio@redhat.com</a>><br class="">---<br class="">server/main-dispatcher.c | 28 ----------------------------<br class="">server/main-dispatcher.h |  1 -<br class="">server/reds-private.h    |  2 --<br class="">server/reds.c            | 25 +++----------------------<br class="">server/reds.h            |  1 -<br class="">server/sound.c           | 26 --------------------------<br class="">server/sound.h           |  2 --<br class="">server/stream.c          |  7 -------<br class="">8 files changed, 3 insertions(+), 89 deletions(-)<br class=""><br class="">diff --git a/server/main-dispatcher.c b/server/main-dispatcher.c<br class="">index 43f8b79a7..7ecb53f4b 100644<br class="">--- a/server/main-dispatcher.c<br class="">+++ b/server/main-dispatcher.c<br class="">@@ -146,7 +146,6 @@ main_dispatcher_init(MainDispatcher *self)<br class="">enum {<br class="">   MAIN_DISPATCHER_CHANNEL_EVENT = 0,<br class="">   MAIN_DISPATCHER_MIGRATE_SEAMLESS_DST_COMPLETE,<br class="">-    MAIN_DISPATCHER_SET_MM_TIME_LATENCY,<br class="">   MAIN_DISPATCHER_CLIENT_DISCONNECT,<br class=""><br class="">   MAIN_DISPATCHER_NUM_MESSAGES<br class="">@@ -214,15 +213,6 @@ static void<br class="">main_dispatcher_handle_migrate_complete(void<br class="">*opaque,<br class="">   g_object_unref(mig_complete->client);<br class="">}<br class=""><br class="">-static void main_dispatcher_handle_mm_time_latency(void *opaque,<br class="">-                                                   void *payload)<br class="">-{<br class="">-    MainDispatcher *self = opaque;<br class="">-    MainDispatcherMmTimeLatencyMessage *msg = payload;<br class="">-    reds_set_client_mm_time_latency(self->priv->reds, msg->client,<br class="">msg->latency);<br class="">-    g_object_unref(msg->client);<br class="">-}<br class="">-<br class="">static void main_dispatcher_handle_client_disconnect(void *opaque,<br class="">                                                    void *payload)<br class="">{<br class="">@@ -249,21 +239,6 @@ void<br class="">main_dispatcher_seamless_migrate_dst_complete(MainDispatcher *self,<br class="">                           &msg);<br class="">}<br class=""><br class="">-void main_dispatcher_set_mm_time_latency(MainDispatcher *self, RedClient<br class="">*client, uint32_t latency)<br class="">-{<br class="">-    MainDispatcherMmTimeLatencyMessage msg;<br class="">-<br class="">-    if (pthread_self() == dispatcher_get_thread_id(DISPATCHER(self))) {<br class="">-        reds_set_client_mm_time_latency(self->priv->reds, client,<br class="">latency);<br class="">-        return;<br class="">-    }<br class="">-<br class="">-    msg.client = g_object_ref(client);<br class="">-    msg.latency = latency;<br class="">-    dispatcher_send_message(DISPATCHER(self),<br class="">MAIN_DISPATCHER_SET_MM_TIME_LATENCY,<br class="">-                            &msg);<br class="">-}<br class="">-<br class="">void main_dispatcher_client_disconnect(MainDispatcher *self, RedClient<br class="">*client)<br class="">{<br class="">   MainDispatcherClientDisconnectMessage msg;<br class="">@@ -318,9 +293,6 @@ void main_dispatcher_constructed(GObject *object)<br class="">   dispatcher_register_handler(DISPATCHER(self),<br class="">   MAIN_DISPATCHER_MIGRATE_SEAMLESS_DST_COMPLETE,<br class="">                               main_dispatcher_handle_migrate_complete,<br class="">                               sizeof(MainDispatcherMigrateSeamlessDstCompleteMessage),<br class="">                               false);<br class="">-    dispatcher_register_handler(DISPATCHER(self),<br class="">MAIN_DISPATCHER_SET_MM_TIME_LATENCY,<br class="">-                                main_dispatcher_handle_mm_time_latency,<br class="">-<br class="">sizeof(MainDispatcherMmTimeLatencyMessage),<br class="">false);<br class="">   dispatcher_register_handler(DISPATCHER(self),<br class="">   MAIN_DISPATCHER_CLIENT_DISCONNECT,<br class="">                               main_dispatcher_handle_client_disconnect,<br class="">                               sizeof(MainDispatcherClientDisconnectMessage),<br class="">                               false);<br class="">diff --git a/server/main-dispatcher.h b/server/main-dispatcher.h<br class="">index 088a5c216..c49d40677 100644<br class="">--- a/server/main-dispatcher.h<br class="">+++ b/server/main-dispatcher.h<br class="">@@ -51,7 +51,6 @@ GType main_dispatcher_get_type(void) G_GNUC_CONST;<br class=""><br class="">void main_dispatcher_channel_event(MainDispatcher *self, int event,<br class="">SpiceChannelEventInfo *info);<br class="">void main_dispatcher_seamless_migrate_dst_complete(MainDispatcher *self,<br class="">RedClient *client);<br class="">-void main_dispatcher_set_mm_time_latency(MainDispatcher *self, RedClient<br class="">*client, uint32_t latency);<br class="">/*<br class="">* Disconnecting the client is always executed asynchronously,<br class="">* in order to protect from expired references in the routines<br class="">diff --git a/server/reds-private.h b/server/reds-private.h<br class="">index 259496c64..056264c22 100644<br class="">--- a/server/reds-private.h<br class="">+++ b/server/reds-private.h<br class="">@@ -29,7 +29,6 @@<br class="">#include "red-record-qxl.h"<br class=""><br class="">#define MIGRATE_TIMEOUT (MSEC_PER_SEC * 10)<br class="">-#define MM_TIME_DELTA 400 /*ms*/<br class=""><br class="">typedef struct TicketAuthentication {<br class="">   char password[SPICE_MAX_PASSWORD_LENGTH];<br class="">@@ -123,7 +122,6 @@ struct RedsState {<br class="">   SpiceBuffer client_monitors_config;<br class=""><br class="">   int mm_time_enabled;<br class="">-    uint32_t mm_time_latency;<br class=""><br class="">   SpiceCharDeviceInstance *vdagent;<br class="">   SpiceMigrateInstance *migration_interface;<br class="">diff --git a/server/reds.c b/server/reds.c<br class="">index 97f9219fe..633fdcba4 100644<br class="">--- a/server/reds.c<br class="">+++ b/server/reds.c<br class="">@@ -1838,7 +1838,7 @@ static void reds_handle_main_link(RedsState *reds,<br class="">RedLinkInfo *link)<br class="">   if (!mig_target) {<br class="">       main_channel_client_push_init(mcc,<br class="">       g_list_length(reds->qxl_instances),<br class="">           reds->mouse_mode, reds->is_client_mouse_allowed,<br class="">-            reds_get_mm_time() - MM_TIME_DELTA,<br class="">+            reds_get_mm_time(),<br class="">           reds_qxl_ram_size(reds));<br class="">       if (reds->config->spice_name)<br class="">           main_channel_client_push_name(mcc, reds->config->spice_name);<br class="">@@ -1971,7 +1971,7 @@ void<br class="">reds_on_client_semi_seamless_migrate_complete(RedsState *reds, RedClient<br class="">*c<br class="">   main_channel_client_push_init(mcc, g_list_length(reds->qxl_instances),<br class="">                                 reds->mouse_mode,<br class="">                                 reds->is_client_mouse_allowed,<br class="">-                                  reds_get_mm_time() - MM_TIME_DELTA,<br class="">+                                  reds_get_mm_time(),<br class="">                                 reds_qxl_ram_size(reds));<br class="">   reds_link_mig_target_channels(reds, client);<br class="">   main_channel_client_migrate_dst_complete(mcc);<br class="">@@ -2670,25 +2670,7 @@ static void reds_send_mm_time(RedsState *reds)<br class="">       return;<br class="">   }<br class="">   spice_debug("trace");<br class="">-    main_channel_push_multi_media_time(reds->main_channel,<br class="">-                                       reds_get_mm_time() -<br class="">reds->mm_time_latency);<br class="">-}<br class="">-<br class="">-void reds_set_client_mm_time_latency(RedsState *reds, RedClient *client,<br class="">uint32_t latency)<br class="">-{<br class="">-    // TODO: multi-client support for mm_time<br class="">-    if (reds->mm_time_enabled) {<br class="">-        // TODO: consider network latency<br class="">-        if (latency > reds->mm_time_latency) {<br class="">-            reds->mm_time_latency = latency;<br class="">-            reds_send_mm_time(reds);<br class="">-        } else {<br class="">-            spice_debug("new latency %u is smaller than existing %u",<br class="">-                        latency, reds->mm_time_latency);<br class="">-        }<br class="">-    } else {<br class="">-        snd_set_playback_latency(client, latency);<br class="">-    }<br class="">+    main_channel_push_multi_media_time(reds->main_channel,<br class="">reds_get_mm_time());<br class="">}<br class=""><br class="">static int reds_init_net(RedsState *reds)<br class="">@@ -3083,7 +3065,6 @@ uint32_t reds_get_mm_time(void)<br class="">void reds_enable_mm_time(RedsState *reds)<br class="">{<br class="">   reds->mm_time_enabled = TRUE;<br class="">-    reds->mm_time_latency = MM_TIME_DELTA;<br class="">   reds_send_mm_time(reds);<br class="">}<br class=""><br class="">diff --git a/server/reds.h b/server/reds.h<br class="">index 264ef205c..9b6c1e6ae 100644<br class="">--- a/server/reds.h<br class="">+++ b/server/reds.h<br class="">@@ -94,7 +94,6 @@ void<br class="">reds_on_client_semi_seamless_migrate_complete(RedsState *reds, RedClient<br class="">*c<br class="">void reds_on_client_seamless_migrate_complete(RedsState *reds, RedClient<br class="">*client);<br class="">void reds_on_main_channel_migrate(RedsState *reds, MainChannelClient<br class="">*mcc);<br class=""><br class="">-void reds_set_client_mm_time_latency(RedsState *reds, RedClient *client,<br class="">uint32_t latency);<br class="">uint32_t reds_get_streaming_video(const RedsState *reds);<br class="">GArray* reds_get_video_codecs(const RedsState *reds);<br class="">spice_wan_compression_t reds_get_jpeg_state(const RedsState *reds);<br class="">diff --git a/server/sound.c b/server/sound.c<br class="">index 9073626cd..996bb5208 100644<br class="">--- a/server/sound.c<br class="">+++ b/server/sound.c<br class="">@@ -972,32 +972,6 @@ SPICE_GNUC_VISIBLE void<br class="">spice_server_playback_put_samples(SpicePlaybackInstance<br class="">   snd_send(SND_CHANNEL_CLIENT(playback_client));<br class="">}<br class=""><br class="">-void snd_set_playback_latency(RedClient *client, uint32_t latency)<br class="">-{<br class="">-    GList *l;<br class="">-<br class="">-    for (l = snd_channels; l != NULL; l = l->next) {<br class="">-        SndChannel *now = l->data;<br class="">-        SndChannelClient *scc = snd_channel_get_client(now);<br class="">-        uint32_t type;<br class="">-        g_object_get(RED_CHANNEL(now), "channel-type", &type, NULL);<br class="">-        if (type == SPICE_CHANNEL_PLAYBACK && scc &&<br class="">-            red_channel_client_get_client(RED_CHANNEL_CLIENT(scc)) ==<br class="">client) {<br class="">-<br class="">-            if<br class="">(red_channel_client_test_remote_cap(RED_CHANNEL_CLIENT(scc),<br class="">-                SPICE_PLAYBACK_CAP_LATENCY)) {<br class="">-                PlaybackChannelClient* playback =<br class="">(PlaybackChannelClient*)scc;<br class="">-<br class="">-                playback->latency = latency;<br class="">-                snd_set_command(scc, SND_PLAYBACK_LATENCY_MASK);<br class="">-                snd_send(scc);<br class="">-            } else {<br class="">-                spice_debug("client doesn't not support<br class="">SPICE_PLAYBACK_CAP_LATENCY");<br class="">-            }<br class="">-        }<br class="">-    }<br class="">-}<br class="">-<br class="">static int snd_desired_audio_mode(bool playback_compression, int<br class="">frequency,<br class="">                                 bool client_can_celt, bool<br class="">                                 client_can_opus)<br class="">{<br class="">diff --git a/server/sound.h b/server/sound.h<br class="">index 2f0a2b93d..75d6c78cd 100644<br class="">--- a/server/sound.h<br class="">+++ b/server/sound.h<br class="">@@ -30,6 +30,4 @@ void snd_detach_record(SpiceRecordInstance *sin);<br class=""><br class="">void snd_set_playback_compression(bool on);<br class=""><br class="">-void snd_set_playback_latency(struct RedClient *client, uint32_t<br class="">latency);<br class="">-<br class="">#endif /* SOUND_H_ */<br class="">diff --git a/server/stream.c b/server/stream.c<br class="">index 71755ea1f..ca0b49170 100644<br class="">--- a/server/stream.c<br class="">+++ b/server/stream.c<br class="">@@ -650,9 +650,6 @@ static void update_client_playback_delay(void *opaque,<br class="">uint32_t delay_ms)<br class="">{<br class="">   StreamAgent *agent = opaque;<br class="">   DisplayChannelClient *dcc = agent->dcc;<br class="">-    RedChannel *channel =<br class="">red_channel_client_get_channel(RED_CHANNEL_CLIENT(dcc));<br class="">-    RedClient *client =<br class="">red_channel_client_get_client(RED_CHANNEL_CLIENT(dcc));<br class="">-    RedsState *reds = red_channel_get_server(channel);<br class=""><br class="">   dcc_update_streams_max_latency(dcc, agent);<br class=""><br class="">@@ -660,10 +657,6 @@ static void update_client_playback_delay(void<br class="">*opaque,<br class="">uint32_t delay_ms)<br class="">   if (delay_ms > dcc_get_max_stream_latency(dcc)) {<br class="">       dcc_set_max_stream_latency(dcc, delay_ms);<br class="">   }<br class="">-    spice_debug("resetting client latency: %u",<br class="">dcc_get_max_stream_latency(dcc));<br class="">-    main_dispatcher_set_mm_time_latency(reds_get_main_dispatcher(reds),<br class="">-                                        client,<br class="">-<br class="">dcc_get_max_stream_latency(agent->dcc));<br class="">}<br class=""><br class="">static void bitmap_ref(gpointer data)</blockquote></blockquote></blockquote></div></div></blockquote></div></blockquote><div><br></div></div></body></html>