<div>Hi,Kai,</div>
<div>   Yep,all the sin of Android is its framework: Java UI layer. But since there are the ARM optimization for dalvik VM, as well as the opengl ES/alsalib APIs for Java in Android, it&#39;s worthy trying to achieve a completely Java porting ONLY IF your have enough time/energy/bugget of this...</div>

<div>   Rgrds. <br><br></div>
<div class="gmail_quote">2011/4/25 Mosebach Kai <span dir="ltr">&lt;<a href="mailto:kai.mosebach@bsse.ethz.ch">kai.mosebach@bsse.ethz.ch</a>&gt;</span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Too bad, that’s exactly what I was thinking of though (totally native, leaving out JNI hybrid) =&gt; for use in an applet for instance…<br>
<br>But thanks for the insight!<br><br>From: Shuxiang Lim &lt;<a href="mailto:shohyanglim@gmail.com">shohyanglim@gmail.com</a>&lt;mailto:<a href="mailto:shohyanglim@gmail.com">shohyanglim@gmail.com</a>&gt;&gt;<br>Date: Mon, 25 Apr 2011 22:49:23 +0800<br>
To: Kai Mosebach &lt;<a href="mailto:kai.mosebach@bsse.ethz.ch">kai.mosebach@bsse.ethz.ch</a>&lt;mailto:<a href="mailto:kai.mosebach@bsse.ethz.ch">kai.mosebach@bsse.ethz.ch</a>&gt;&gt;<br>Subject: Re: [Spice-devel] Release the androidSpice-0.1.3 experimental.<br>

<div class="im"><br>Hi,Kai,<br>  Sorry  but I&#39;ve not got your meaning, you mean,&quot;How to rewrite all of spice-client in Java&quot;?(rather than my current &quot;Hybrid&quot; work?)<br>  If yes, it&#39;s possible and not very hard for the proficient Java guys to implement the spice protocol in Java and leave the image/audio computing works( such as the work of pixman,celt,etc..) remained for C in lib*.so for JNI use by Java. It should not be FULLY rewritten &#39;cause I don&#39;t trust the maths computing ability of Java.<br>
  Regards.<br><br></div>2011/4/25 Mosebach Kai &lt;<a href="mailto:kai.mosebach@bsse.ethz.ch">kai.mosebach@bsse.ethz.ch</a>&lt;mailto:<a href="mailto:kai.mosebach@bsse.ethz.ch">kai.mosebach@bsse.ethz.ch</a>&gt;&gt;<br>
<div class="im">Hi Shuxian,<br><br>How probable / easy would it be to generate a (native) Java port out of<br>this assuming that we leave Sound Support out for now?<br>And (beside me owning an Galaxy Tab w/ Android &lt;2.3) wouldn&#39;t it be much<br>
easier (and maybe better) to just leave out Android &lt;2.3?<br><br>Cheers and Thanks for the great Work!<br><br>Kai<br><br></div>
<div class="im">On 4/25/11 3:08 PM, &quot;Shuxiang Lim&quot; &lt;<a href="mailto:shohyanglim@gmail.com">shohyanglim@gmail.com</a>&lt;mailto:<a href="mailto:shohyanglim@gmail.com">shohyanglim@gmail.com</a>&gt;&gt; wrote:<br>
<br>&gt;After some tracing work: I found that,when no input occurs in the<br>&gt;client,the output flow from server to client may be jammed by the slow<br>&gt;network but will never be choked.But when there&#39;s input, the client<br>
&gt;will always fall soon in the endless calling for coroutine_yield() and<br>&gt;coroutine_swap() in coroutine_gthread.c (for threads prior<br>&gt;swapping???why should this?) and usually cause the &quot;yield to<br>&gt;itself&quot;--&gt;abort() --&gt;segfault. Thus,client will have no mood to<br>
&gt;receive data from server at all,and the output will be choked(input<br>&gt;still OK).<br>&gt;  So,why does such dead-lock-liked thing happens only on android,how<br>&gt;can I fix this,or how can I disable such Swapping? Any ideas?<br>
&gt;Rgrds.<br>&gt;<br>&gt;<br></div>
<div>
<div></div>
<div class="h5">&gt;On 4/25/11, Shuxiang Lim &lt;<a href="mailto:shohyanglim@gmail.com">shohyanglim@gmail.com</a>&lt;mailto:<a href="mailto:shohyanglim@gmail.com">shohyanglim@gmail.com</a>&gt;&gt; wrote:<br>&gt;&gt; Hi,all!<br>
&gt;&gt;    I&#39;m happy to release the experimental androidSpice under<br>&gt;&gt;LGPL,welcome to<br>&gt;&gt; improve!<br>&gt;&gt;    The source and wiki now dwell in google code site here:<br>&gt;&gt; <a href="http://code.google.com/p/spice-client-android/" target="_blank">http://code.google.com/p/spice-client-android/</a><br>
&gt;&gt;    All introductions of porting can be found or redirected in the wiki<br>&gt;&gt; page.<br>&gt;&gt;<br>&gt;&gt;    The structure of androidSpice:<br>&gt;&gt; 1.Data layer,extracted from spice-gtk-0.5, the main logic and data<br>
&gt;&gt; transportation/proccessing of spice protocol,along with all its<br>&gt;&gt; dependencies,built statically into libspicec.so<br>&gt;&gt; 2.Data layer will add two new threads in android-worker.c for the I/O<br>&gt;&gt;with<br>
&gt;&gt; Java UI layer via UNIX-sockets(see the PROBLEMS below)<br>&gt;&gt; 3.UI layer,rewritten in Java. Output the Images and capture user-input<br>&gt;&gt; events and communicate with libspicec.so.<br>&gt;&gt;<br>&gt;&gt; PROBLEMS:<br>
&gt;&gt;<br>&gt;&gt; &quot;The damned greatest obstacle I&#39;ve faced in the porting lies in the<br>&gt;&gt; structure of Android itself:It has no(at least for version&lt;2.3 ) exposed<br>&gt;&gt; audio/image output and input API for C(only Java!)! So I have to<br>
&gt;&gt;transport<br>&gt;&gt; all the fixed data got from spice-server to Java layer by adding two new<br>&gt;&gt; threads to handle the I/O communication with Java UI via two<br>&gt;&gt; UNIX-sockets,that&#39;s the leg-drawing of speed. Besides, quic.c in client<br>
&gt;&gt;is<br>&gt;&gt; buggy of SIGBUS or SIGSEGV on android(anyone can fix it?thx!),I have no<br>&gt;&gt; better way but to force use of JPEG compression in server and the client<br>&gt;&gt; will send jpeg data directly to Java UI for output, it&#39;s queer and<br>
&gt;&gt;should<br>&gt;&gt; be<br>&gt;&gt; condemned(&#39;cause Spice&#39;s value is in the image processing ability)&quot;<br>&gt;&gt;<br>&gt;&gt; So now It just WORKS,but works badly, the first untolerable bug is this<br>
&gt;&gt;<br>&gt;&gt; Bug 1:If press fast on the device the spice-server as well as the<br>&gt;&gt; android-spice-client will be choked and no image updates will be sent<br>&gt;&gt;out<br>&gt;&gt; from server.<br>&gt;&gt; I&#39;m still working on this bug,I need help!<br>
&gt;&gt;<br>&gt;&gt; Best regards,<br>&gt;&gt;     --林<br>&gt;&gt;<br>&gt;_______________________________________________<br>&gt;Spice-devel mailing list<br></div></div>&gt;<a href="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.org</a>&lt;mailto:<a href="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.org</a>&gt;<br>

<div>
<div></div>
<div class="h5">&gt;<a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br><br><br></div></div></blockquote></div><br>